1(function ($) { 2 function forceRightPosition() { 3 $(".dropdown-menu").each(function () { 4 var windowWidth = $(window).width(); 5 var elementRight = $(this).offset().left + $(this).outerWidth(); 6 if (elementRight > windowWidth) { 7 $(this).addClass("overflowing"); 8 } else { 9 $(this).removeClass("overflowing"); 10 } 11 }); 12 } 13 14 function orderByMonth() { 15 $(".event-list-item").each(function () { 16 var month = $(this).attr("data-month"); 17 var year = $(this).attr("data-year"); 18 19 if ( 20 !$("." + month + "-" + year + "") 21 .first() 22 .hasClass("first") 23 ) { 24 $("." + month + "-" + year + "") 25 .first() 26 .before('<div class="heading-month-container"><div class="heading-month" id="' + month + "-" + year + '"><b>' + month + "</b> " + year + "</div></div>"); 27 $("." + month + "-" + year + "") 28 .first() 29 .addClass("first"); 30 } 31 }); 32 } 33 34 function mostViewedPagesPopUp() { 35 $(document).on("click", ".most-viewed-pages", function (e) { 36 e.preventDefault(); 37 $(".pop-up-container").fadeIn(); 38 $(".pop-up-container").addClass("open"); 39 }); 40 41 $(".pop-up-close").on("click", function () { 42 $(".pop-up-container").fadeOut(); 43 $(".pop-up-container").removeClass("open"); 44 }); 45 46 $(".pop-up-container").on("click", function (e) { 47 var container = $(".pop-up"); 48 // If the target of the click isn't the container 49 if (!container.is(e.target) && container.has(e.target).length === 0) { 50 $(".pop-up-container").fadeOut(); 51 $(".pop-up-container").removeClass("open"); 52 } 53 }); 54 } 55 56 function iasEvent(spinner) { 57 spinner.hide(); 58 59 var pageUrl = spinner.parent().siblings(".page-navigation").find(".next a").attr("href"); 60 var parentId = spinner.parents(".frame").attr("id"); 61 62 $.ajax({ 63 url: pageUrl, 64 type: "GET", 65 dataType: "html", 66 async: false, 67 success: function (data, statut) { 68 if (pageUrl != undefined) { 69 var item = $(data) 70 .find("#" + parentId + "") 71 .find(".event-list-item"); 72 var pagination = $(data) 73 .find("#" + parentId + "") 74 .find(".f3-widget-paginator"); 75 76 item.css("display", "none"); 77 spinner.parent().siblings(".page-navigation").before(item); 78 item.fadeIn(); 79 80 spinner.parent().siblings(".page-navigation").html(pagination); 81 82 var nextPage = spinner.parent().siblings(".page-navigation").find(".next a").attr("href"); 83 84 if (nextPage == undefined) { 85 spinner.hide(); 86 } else { 87 spinner.fadeIn(); 88 } 89 } 90 }, 91 92 error: function (resultat, statut, erreur) {}, 93 94 complete: function (resultat, statut) { 95 orderByMonth(); 96 }, 97 }); 98 } 99 100 $(document).ready(function () { 101 forceRightPosition(); 102 orderByMonth(); 103 mostViewedPagesPopUp(); 104 105 $("#main-nav .menu > li.has-sub > a").on("click", function (e) { 106 e.preventDefault(); 107 }); 108 109 $("#header #ke_search_sword").on("focus", function () { 110 $(this).parents("form").addClass("active"); 111 }); 112 113 $("#header #ke_search_sword").on("blur", function () { 114 setTimeout( 115 function () { 116 $(this).parents("form").removeClass("active"); 117 }.bind($(this)), 118 300 119 ); 120 }); 121 122 $(".ias-event").scroll(function () { 123 if ($(this).scrollTop() + $(this).outerHeight() >= $(this)[0].scrollHeight) { 124 // console.log($(this).scrollTop()); 125 // console.log($(this).innerHeight()); 126 // console.log($(this)[0].scrollHeight); 127 var spinner = $(this).find(".load-more-loader .spinner"); 128 iasEvent(spinner); 129 } 130 }); 131
132 $(".news-slider .row").slick({ 133 infinite: true, 134 slidesToShow: 3, 135 slidesToScroll: 3, 136 responsive: [ 137 { 138 breakpoint: 1200, 139 settings: { 140 slidesToShow: 2, 141 slidesToScroll: 2, 142 }, 143 }, 144 { 145 breakpoint: 992, 146 settings: { 147 slidesToShow: 1, 148 slidesToScroll: 1, 149 }, 150 }, 151 { 152 breakpoint: 768, 153 settings: { 154 slidesToShow: 2, 155 slidesToScroll: 2, 156 arrows: false, 157 }, 158 }, 159 { 160 breakpoint: 577, 161 settings: { 162 slidesToShow: 1, 163 slidesToScroll: 1, 164 arrows: false, 165 }, 166 }, 167 ], 168 }); 169 mobileMenu(); 170 171 $(".anchor-link").click(function (e) { 172 e.preventDefault(); 173 var speed = 750; // Durée de l'animation (en ms) 174 var hrefTarget = $(this).attr("href"); 175 var hrefTarget = hrefTarget.substring(hrefTarget.indexOf("#")); 176 var menuHeight = $("#header").outerHeight(); 177 178 $("html, body").animate( 179 { 180 scrollTop: $(hrefTarget).offset().top - menuHeight, 181 }, 182 speed 183 ); 184 }); 185 }); 186 187 // menu mobile 188 function mobileMenu() { 189 $(".menu-toggle").on("click", function () { 190 $(this).toggleClass("nav-open"); 191 $(".main-nav-wrap").fadeToggle(); 192 if ($(this).hasClass("nav-open")) { 193 $("#header .header-top-area .right-area .btn").clone().appendTo($(".header-bottom-area #main-nav")); 194 $("#header .header-top-area .right-area .social-icons").clone().appendTo($(".header-bottom-area")); 195 } else { 196 $("#header .header-bottom-area .btn").remove(); 197 $("#header .header-bottom-area .social-icons").remove(); 198 $(".main-nav-wrap.mobile-menu .dropdown-menu").slideUp(); 199 $(".main-nav-wrap.mobile-menu #main-nav .menu > li").removeClass("sub-open"); 200 } 201 }); 202 203 $(document).on("click", ".main-nav-wrap.mobile-menu #main-nav .menu > li > a", function (e) { 204 e.preventDefault(); 205 $(this).siblings(".dropdown-menu").slideToggle(); 206 $(this).parent().toggleClass("sub-open"); 207 }); 208 209 if (window.innerWidth > 991) { 210 $(".main-nav-wrap").removeClass("mobile-menu"); 211 } else { 212 $(".main-nav-wrap").addClass("mobile-menu"); 213 } 214 215 $(window).on("resize", function () { 216 if (window.innerWidth > 991) { 217 $(".main-nav-wrap").removeAttr("style"); 218 $(".main-nav-wrap").removeClass("mobile-menu"); 219 $(".menu-toggle").removeClass("nav-open"); 220 $("#header .header-bottom-area .btn").remove(); 221 $("#header .header-bottom-area .social-icons").remove(); 222 } else { 223 $(".main-nav-wrap").addClass("mobile-menu"); 224 } 225 }); 226 } 227 228 $(window).on("resize", function () { 229 forceRightPosition(); 230 }); 231 232 function showAlert() { 233 if ($(".alert").length) { 234 if ($(".alert").attr("data-cookie") !== "") { 235 var setCookie = $(".alert").data("cookie"); 236 237 var rules = { 238 a: /[à áâãäå]+/g, 239 240 ae: /[æ]+/g, 241 242 c: /[ç]+/g, 243 244 e: /[èéêë]+/g, 245 246 i: /[ìÃîï]+/g, 247 248 n: /[ñ]+/g, 249 250 o: /[òóôõö]+/g, 251 252 oe: /[Å]+/g, 253 254 u: /[ùúûü]+/g, 255 256 y: /[ýÿ]+/g, 257 258 _: /[\'\s\\]+/g, 259 }; 260
261 setCookie = setCookie.toString().toLowerCase(); 262 263 for (var r in rules) setCookie = setCookie.replace(rules[r], r); 264 265 //NOTIF QUI NE S'AFFICHE QU'UNE SEULE FOIS 266 267 if (localStorage.getItem(setCookie) != "shown") { 268 setTimeout(function () { 269 $(".alert").css("transform", "translateX(0%)"); 270 271 if ($(window).outerWidth() > 991) { 272 $(".alert").css("right", "0px"); 273 274 $(".alert").css("left", "0px"); 275 } else { 276 $(".alert").css("left", "0px"); 277 278 $(".alert").css("right", "0px"); 279 } 280 281 $(".alert").css("opacity", "1"); 282 }, 300); 283 284 $(".alert-icon-2 i").click(function () { 285 $(".alert").css("transform", "translateX(100%)"); 286 287 $(".alert").css("right", "0px"); 288 289 $(".alert").css("opacity", "0"); 290 291 setTimeout(function () { 292 $(".alert").css("display", "none"); 293 }, 300); 294 295 localStorage.setItem(setCookie, "shown"); 296 }); 297 } else { 298 $(".alert").remove(); 299 } 300 } else { 301 setTimeout(function () { 302 $(".alert").css("transform", "translateX(0%)"); 303 304 if ($(window).outerWidth() > 991) { 305 $(".alert").css("right", "0px"); 306 307 $(".alert").css("left", "0px"); 308 } else { 309 $(".alert").css("left", "0px"); 310 311 $(".alert").css("right", "0px"); 312 } 313 314 $(".alert").css("opacity", "1"); 315 }, 300); 316 317 $(".alert-icon-2 i").click(function () { 318 $(".alert").css("transform", "translateX(100%)"); 319 320 $(".alert").css("right", "0px"); 321 322 $(".alert").css("opacity", "0"); 323 324 setTimeout(function () { 325 $(".alert").css("display", "none"); 326 }, 300); 327 }); 328 } 329 } 330 } 331 332 //WRAP TABLE FOR RESPONSIVE 333 334 function wrapTableResponsive() { 335 $(".ce-bodytext table").wrap('<div class="table-responsive"></div>'); 336 } 337 338 //START - DOCUMENT READY 339 340 $(document).ready(function () { 341 showAlert(); 342 343 wrapTableResponsive(); 344 345 $(".mediaelement-video").parent(".mediaelement").addClass("video-container"); 346 347 //START - HEADER ADD STICKY CLASS 348 349 // if ($(".menu-tiles").length) { 350 // var windowWidth = $(window).width(); 351 352 // if (windowWidth < 992) { 353 // var mainContent = $(".menu-tiles + div").offset().top - 75; 354 // } else { 355 // var mainContent = $(".menu-tiles + div").offset().top + 50; 356 // } 357 358 // $(window).scroll(function () { 359 // var windowTop = $(this).scrollTop(); 360 361 // if (windowTop >= mainContent) { 362 // $("#header").addClass("sticky"); 363 // } else { 364 // $("#header").removeClass("sticky"); 365 // } 366 // }); 367 // } 368 369 // if ($(".menu-container").length) { 370 // var mainContent = $(".menu-container").offset().top; 371 // } 372 373 // if (!$(".sub-menu-content").length) { 374 // var currentSubmenuHeight = 0; 375 376 // //currentSubmenuHeight = $('.current .dropdown-menu').height() + $('#navbar').height(); 377 378 // currentSubmenuHeight = $(".current .dropdown-menu").outerHeight(); 379 // } 380 381 // $("#content.internal-page:not(.no-padding)").css("padding-top", currentSubmenuHeight); 382 383 // $(window).scroll(function () { 384 // var windowWidth = $(window).width(); 385 386 // $(window).on("load resize", function (e) { 387 // windowWidth = $(window).width(); 388 // }); 389 390 // if (windowWidth > 767) { 391 // var windowTop = $(this).scrollTop(); 392 393 // if ($("body").hasClass("homepage")) { 394 // console.log("home"); 395 // if ($(this).scrollTop() > 10) { 396 // $("#header").addClass("fixed"); 397 // $(".menu > li.active").removeClass("open"); 398 // $(".menu > li.current").removeClass("open-current"); 399 // $(".menu > li.active").removeClass("active"); 400 // $(".menu > li.current").addClass("active"); 401
402 // if (!$(".sub-menu-content").length) { 403 // currentSubmenuHeight = $(".current .dropdown-menu").outerHeight() + $("#navbar").outerHeight(); 404 // //$('#content.internal-page:not(.no-padding)').css('padding-top',currentSubmenuHeight); modification par wadii 405 // } 406 // } else { 407 // $("#header").removeClass("fixed"); 408 // $("#header").removeClass("sticky"); 409 // $(".menu > li.active").addClass("open"); 410 // $(".menu > li.current").addClass("open-current"); 411 412 // currentSubmenuHeight = $(".current .dropdown-menu").outerHeight(); 413 // //$('#content.internal-page:not(.no-padding)').css('padding-top',currentSubmenuHeight);modification par wadii 414 // } 415 // } else { 416 // if (windowTop >= mainContent) { 417 // $("#header").addClass("fixed"); 418 // $(".menu > li.active").removeClass("open"); 419 // $(".menu > li.current").removeClass("open-current"); 420 // $(".menu > li.active").removeClass("active"); 421 // $(".menu > li.current").addClass("active"); 422 423 // if (!$(".sub-menu-content").length) { 424 // currentSubmenuHeight = $(".current .dropdown-menu").outerHeight() + $("#navbar").outerHeight(); 425 // //$('#content.internal-page:not(.no-padding)').css('padding-top',currentSubmenuHeight); modification par wadii 426 // } 427 // } else { 428 // $("#header").removeClass("fixed"); 429 // $(".menu > li.active").addClass("open"); 430 // $(".menu > li.current").addClass("open-current"); 431 432 // currentSubmenuHeight = $(".current .dropdown-menu").outerHeight(); 433 // //$('#content.internal-page:not(.no-padding)').css('padding-top',currentSubmenuHeight);modification par wadii 434 // } 435 // } 436 // } 437 // }); 438 439 //END - HEADER ADD STICKY CLASS 440 441 //START - SEARCH POPUP TABS CHANGE ID 442 443 // $(".menu-tiles .search-popup .search-popup-tabs li a").each(function () { 444 // var tabHref = $(this).attr("href") + "Home"; 445 446 // $(this).attr("href", tabHref); 447 // }); 448 449 // $(".menu-tiles .search-popup .tab-content > div").each(function () { 450 // var tabId = $(this).attr("id") + "Home"; 451 // $(this).attr("id", tabId); 452 // }); 453 454 //END - SEARCH POPUP TABS CHANGE ID 455 456 //START - VIRTUAL COUNTER OPEN 457 458 // $(".virtual-counter-btn").click(function () { 459 // $(".virtual-counter-content").toggleClass("open"); 460 461 // $("#header").toggleClass("virtual-open"); 462 463 // return false; 464 // }); 465 466 // $("#close-virtual-counter").click(function () { 467 // $(".virtual-counter-content").removeClass("open"); 468 469 // $("#header").removeClass("virtual-open"); 470 471 // return false; 472 // }); 473 474 //END - VIRTUAL COUNTER OPEN 475 476 //START - MENU DROPDOWN OPEN 477 478 // $(".menu > li:not(.open) > a").click(function () { 479 // $(".menu > li").removeClass("open"); 480 481 // $(".menu > li").removeClass("active"); 482 483 // if ($(this).next(".dropdown-menu").length > 0) { 484 // $(this).parent("li").addClass("active"); 485 486 // $(this).parent("li").addClass("open"); 487 488 // return false; 489 // } 490 // }); 491 492 // $(".menu > li > a").click(function () { 493 // setTimeout(function () { 494 // if ($(".virtual-counter-content").hasClass("open")) { 495 // $(".virtual-counter-content").removeClass("open"); 496 497 // $("#header").removeClass("virtual-open"); 498 // } 499 500 // if ($(".menu > li.current").hasClass("open")) { 501 // $(".menu > li").removeClass("active"); 502 503 // $(".menu > li.current").addClass("active"); 504 // } 505 506 // return false;
507 // }, 100); 508 509 // $(".dropdown-search").removeClass("open"); 510 // }); 511 512 // $(".dropdown-submenu").click(function (event) { 513 // event.stopPropagation(); 514 // }); 515 516 // $(".dropdown-menu").on("click.bs.dropdown", function (e) { 517 // e.stopPropagation(); 518 // }); 519 520 // $(".navToggle").click(function () { 521 // $(".menu > .open").removeClass("active"); 522 523 // $(".menu > .open").removeClass("open"); 524 525 // $(".menu > .current").addClass("active"); 526 527 // //$('.menu > .current').addClass('open'); 528 529 // $(".dropdown-search").removeClass("open"); 530 531 // $("#open-search").parent().removeClass("active"); 532 533 // //$('body').removeClass('menu-open'); 534 535 // //$('.dropdown-menu li').removeClass('light'); 536 // }); 537 538 // $("#open-search").click(function () { 539 // $(".dropdown-search").toggleClass("open"); 540 541 // $(this).parent().toggleClass("active"); 542 543 // return false; 544 // }); 545 546 // $("#navToggle").click(function () { 547 // $(this).toggleClass("open"); 548 549 // $("#navbar").toggleClass("in"); 550 551 // $(".dropdown-search").toggleClass("open"); 552 553 // return false; 554 // }); 555 556 //END - MENU DROPDOWN OPEN 557 558 //START - SEARCH FOCUS DISPLAY POPUP 559 560 // $("form .tx-indexedsearch-searchbox-sword").click(function () { 561 // $(".search-popup").addClass("open"); 562 // }); 563 564 // $(".slider-top-bg, .menu-tiles-container").click(function () { 565 // $(".search-popup").removeClass("open"); 566 // }); 567 568 // $(".tx-indexedsearch-searchbox, .dropdown-search, .dropdown-search.open:before").click(function (e) { 569 // if ($(e.target).closest(".tx-indexedsearch-searchbox-sword, .search-popup").length > 0) { 570 // $(".search-popup").addClass("open"); 571 // } else { 572 // $(".search-popup").removeClass("open"); 573 // } 574 // }); 575 576 //START - SEARCH FOCUS DISPLAY POPUP 577 578 //START - HEADER LANGUAGE MENU 579 580 // if (!$(".language-menu .active").length) { 581 // $(".language-menu li:first-of-type").addClass("active"); 582 // } 583 584 // $(".language-menu li:not(.active)").hide(); 585 586 // $(".language-menu") 587 // .on("mouseenter", function () { 588 // $(".language-menu li").slideDown(function () { 589 // $(".language-menu li").css("display", "block"); 590 // }); 591 // }) 592 // .on("mouseleave", function (event) { 593 // $(".language-menu li:not(.active)").slideUp(function () { 594 // $(".language-menu li:not(.active)").css("display", "none"); 595 // }); 596 // }); 597 598 //START - HEADER LANGUAGE MENU 599 600 //START - TILES EQUAL HEIGHT 601 602 equalheight = function (container) { 603 var currentTallest = 0, 604 currentRowStart = 0, 605 rowDivs = new Array(), 606 $el, 607 topPosition = 0; 608 609 jQuery(container).each(function () { 610 $el = jQuery(this); 611 612 jQuery($el).height("auto"); 613 614 topPostion = $el.position().top; 615 616 if (currentRowStart != topPostion) { 617 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 618 rowDivs[currentDiv].height(currentTallest); 619 } 620 621 rowDivs.length = 0; 622 623 currentRowStart = topPostion; 624 625 currentTallest = $el.height(); 626 627 rowDivs.push($el); 628 } else { 629 rowDivs.push($el); 630 631 currentTallest = currentTallest < $el.height() ? $el.height() : currentTallest; 632 } 633 634 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 635 rowDivs[currentDiv].height(currentTallest); 636 } 637 }); 638 }; 639 640 jQuery(window).load(function () { 641 equalheight(".tiles-container .tiles"); 642 }); 643 644 //END - TILES EQUAL HEIGHT 645 646 /* 647 648 * Jquery Infinite Scroll 649 650 */ 651 652 if ($(".news-list-view.with-pagination").length) { 653 var ias = jQuery.ias({ 654 container: ".news-list-view", 655 item: ".article", 656 pagination: ".page-navigation", 657 next: ".next a", 658 delay: 0, 659 }); 660 661 ias.on("rendered", function (event) { 662 orderByMonth(); 663 }); 664 665 ias.extension( 666 new IASTriggerExtension({ 667 html: '<div class="col-md-12 align-center news-footer"><a class="button">Afficher plus</a></div>', 668 }) 669 ); 670 671 ias.extension( 672 new IASSpinnerExtension({ 673 html: '<div class="col-md-12 ias-spinner" style="text-align: center;"><span class="icon icon-synchronize-3"></span></div>', 674 }) 675 ); 676 } 677 678 /* 679 680 * News - A la Une 681 682 */ 683 684 var newsTopNews = $(".top-news .article-picture img").height(); 685 686 $(".top-news .article-content").css("min-height", newsTopNews); 687 688 var newsTopNewsContent = $(".top-news .article-content").outerHeight(); 689 690 $(".top-news .article-picture iframe").css("min-height", newsTopNewsContent); 691 692 $(window).on("resize orientationchange", function () { 693 newsTopNews = $(".top-news .article-picture img").height(); 694 695 $(".top-news .article-content").css("min-height", newsTopNews); 696 697 var newsTopNewsContent = $(".top-news .article-content").outerHeight(); 698 699 $(".top-news .article-picture iframe").css("min-height", newsTopNewsContent); 700 }); 701 702 /* 703 704 * Font resizer 705 706 */ 707 708 // Sauve dans le cookie la taille courante 709 710 function writeCookie() { 711 document.cookie = "montreux_currentsize=" + sizeCurrent; 712 } 713 714 // Lit la taille dans le cookie 715 716 function readCookie() { 717 var cookEnd, i, j; 718 719 var cookContent = document.cookie; 720 721 var sName = "montreux_currentsize="; 722 723 for (i = 0, c = cookContent.length; i < c; i++) { 724 j = i + sName.length; 725 726 if (cookContent.substring(i, j) == sName) {
727 cookEnd = cookContent.indexOf(";", j); 728 729 if (cookEnd == -1) { 730 cookEnd = cookContent.length; 731 } 732 733 return decodeURIComponent(cookContent.substring(j, cookEnd)); 734 } 735 } 736 737 return null; 738 } 739 740 var sizeMin = 1; 741 742 var sizeMax = 3; 743 744 var sizeCurrent = 1; 745 746 function initResizer() { 747 // Lecture du cookie 748 749 var cookie = readCookie(); 750 751 // Si pas de cookie, on le crée. 752 753 // Si existe, on update sizeCurrent 754 755 if (cookie == "undefined" || cookie == null) { 756 writeCookie(); 757 758 cookie = sizeCurrent; 759 } else { 760 sizeCurrent = cookie; 761 } 762 763 if (sizeCurrent > sizeMax) { 764 sizeCurrent = sizeMax; 765 } else if (sizeCurrent < sizeMin) { 766 sizeCurrent = sizeMin; 767 } 768 769 jQuery("body").addClass("fontResizer-size-" + sizeCurrent); 770 771 // Clique sur le bouton d'augmentation 772 773 jQuery("a.fontSizePlus").click(function (e) { 774 e.preventDefault(); 775 776 // Vérifie la limite de taille 777 778 if (sizeCurrent < sizeMax) { 779 // On enlève la class 780 781 jQuery("body").removeClass("fontResizer-size-" + sizeCurrent); 782 783 // On incrémente 784 785 sizeCurrent++; 786 787 // On remet la nouvelle 788 789 jQuery("body").addClass("fontResizer-size-" + sizeCurrent); 790 791 // Update du cookie 792 793 writeCookie(); 794 } 795 796 //cancel a click event 797 798 return false; 799 }); 800 801 // Clique sur le bouton de réduction 802 803 jQuery("a.fontSizeMinus").click(function (e) { 804 e.preventDefault(); 805 806 // Vérifie la limite de taille 807 808 if (sizeCurrent > sizeMin) { 809 // On enlève la class 810 811 jQuery("body").removeClass("fontResizer-size-" + sizeCurrent); 812 813 // On incrémente 814 815 sizeCurrent--; 816 817 // On remet la nouvelle 818 819 jQuery("body").addClass("fontResizer-size-" + sizeCurrent); 820 821 // Update du cookie 822 823 writeCookie(); 824 } 825 826 //cancel a click event 827 828 return false; 829 }); 830 } 831 832 initResizer(); 833 834 /* 835 836 * perfectScrollbar 837 838 */ 839 840 // $("#header .virtual-counter-content .row").perfectScrollbar(); 841 842 /*$('#header .menu-container #navbar nav').perfectScrollbar();*/ 843 844 /* 845 846 * Accordion link smooth scroll 847 848 */ 849 850 $(function () { 851 var hash = document.location.hash; 852 853 if (hash) { 854 var headerHeight = $("#header").height(); 855 856 if ($(hash).parents(".panel-collapse").length) { 857 setTimeout(function () { 858 $(hash).parents(".panel-collapse").siblings(".panel-heading").children("a").click(); 859 860 $(hash).find("a").click(); 861 862 $(hash).parent("a").click(); 863 864 setTimeout(function () { 865 $("html, body").animate( 866 { 867 scrollTop: $(hash).offset().top - headerHeight - 25, 868 }, 869 "slow" 870 ); 871 }, 800); 872 }, 300); 873 } else { 874 $(hash).find("a").click(); 875 876 $(hash).parent("a").click(); 877 878 $("html, body").animate( 879 { 880 scrollTop: $(hash).offset().top - headerHeight - 25, 881 }, 882 "slow" 883 ); 884 } 885 } 886 }); 887 888 /* 889 890 * mobile menu 891 892 */ 893 894 // var scrollDisplayTiles = 100; 895 896 // var windowWidth = $(window).width(); 897 // var windowHeight = $(window).height(); 898 899 // if (windowWidth < 992 || windowHeight < 680) { 900 // if (windowWidth < 767) { 901 // scrollDisplayTiles = 15; 902 // } 903 904 // if ($(document).scrollTop() > scrollDisplayTiles) { 905 // $("#content .menu-tiles").removeClass("little-tiles"); 906 // } else { 907 // $("#content .menu-tiles").addClass("little-tiles"); 908 // } 909 910 // $(window).scroll(function () { 911 // if ($(document).scrollTop() > scrollDisplayTiles) { 912 // $("#content .menu-tiles").removeClass("little-tiles"); 913 // } else { 914 // $("#content .menu-tiles").addClass("little-tiles"); 915 // } 916 // }); 917 // } 918 919 // $(window).on("load resize", function (e) { 920 // var windowWidth = $(window).width(); 921 // var windowHeight = $(window).height(); 922 923 // if (windowWidth < 992 || windowHeight < 680) { 924 // if (windowWidth < 767) { 925 // scrollDisplayTiles = 15; 926 // } 927 928 // if ($(document).scrollTop() > scrollDisplayTiles) { 929 // $("#content .menu-tiles").removeClass("little-tiles"); 930 // } else { 931 // $("#content .menu-tiles").addClass("little-tiles"); 932 // } 933 934 // $(window).scroll(function () { 935 // if ($(document).scrollTop() > scrollDisplayTiles) { 936 // $("#content .menu-tiles").removeClass("little-tiles"); 937 // } else { 938 // $("#content .menu-tiles").addClass("little-tiles"); 939 // } 940 // }); 941 // } 942 // }); 943
944 // $("#subnavToggle").click(function () { 945 // $(".sub-menu-content").toggleClass("open"); 946 947 // return false; 948 // }); 949 950 // $(".dropdown-toggle").click(function (e) { 951 // setTimeout(function () { 952 // if ($(".menu").hasClass("activated")) { 953 // $(".menu li").each(function (index) { 954 // $(this).removeClass("closed"); 955 956 // $(this).removeClass("inside"); 957 // }); 958 959 // //$('.dropdown-search').addClass('open'); 960 961 // $(".menu").removeClass("activated"); 962 // } else { 963 // $(".menu:not(.activated) > li.open").addClass("inside"); 964 965 // $(".menu:not(.activated) > li:not(.open)").addClass("closed"); 966 967 // $(".menu").addClass("activated"); 968 // } 969 // }, 100); 970 // }); 971 972 // $("#navToggle").click(function (e) { 973 // if ($(".menu").hasClass("activated")) { 974 // $(".dropdown-search").removeClass("open"); 975 // } 976 977 // setTimeout(function () { 978 // $(".menu").removeClass("activated"); 979 980 // $(".menu li").each(function (index) { 981 // $(this).removeClass("closed"); 982 983 // $(this).removeClass("active"); 984 985 // $(this).removeClass("open"); 986 987 // $(this).removeClass("inside"); 988 // }); 989 // }, 100); 990 // }); 991 992 /* Apply fancybox to multiple items */ 993 994 $("a.gallery-link").fancybox({ 995 transitionIn: "none", 996 997 transitionOut: "none", 998 999 titlePosition: "over", 1000 }); 1001 }); 1002 1003 //END - DOCUMENT READY 1004 1005 //START - WINDOW RESIZE 1006 1007 $(window).resize(function () { 1008 showAlert(); 1009 1010 //START - TILES EQUAL HEIGHT ON RESIZE 1011 1012 if ($(".tiles-container .tiles").length) { 1013 equalheight(".tiles-container .tiles"); 1014 } 1015 1016 //END - TILES EQUAL HEIGHT ON RESIZE 1017 1018 //START - HEADER ADD STICKY CLASS ON RESIZE 1019 1020 // var windowWidth = $(window).width(); 1021 1022 // if ($(".menu-tiles").length) { 1023 // if (windowWidth < 992) { 1024 // var mainContent = $(".menu-tiles + div").offset().top - 75; 1025 // } else { 1026 // var mainContent = $(".menu-tiles + div").offset().top + 50; 1027 // } 1028 1029 // $(window).scroll(function () { 1030 // var windowTop = $(this).scrollTop(); 1031 1032 // if (windowTop >= mainContent) { 1033 // $("#header").addClass("sticky"); 1034 // } else { 1035 // $("#header").removeClass("sticky"); 1036 // } 1037 // }); 1038 // } 1039 1040 //END - HEADER ADD STICKY CLASS ON RESIZE 1041 }); 1042 1043 //END - WINDOW RESIZE 1044 1045 $(window).on("load", function () { 1046 showAlert(); 1047 }); 1048})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.