1if (navigator.userAgent.indexOf("Mac") > 0) { 2 $("body").addClass("mac-os"); 3} 4 5// carousel normalisation 6 7function carouselNormalization() { 8 var items = $("#campagnesCarousel .carousel-inner .item"), //grab all slides 9 heights = [], //create empty array to store height values 10 tallest; //create variable to make note of the tallest slide 11 12 if (items.length) { 13 function normalizeHeights() { 14 items.each(function () { 15 //add heights to array 16 17 heights.push($(this).height()); 18 }); 19 20 // 30 = padding-bottom de item 21 22 tallest = Math.max.apply(null, heights) + 0; //cache largest value 23 24 items.each(function () { 25 $(this).css("min-height", tallest + "px"); 26 }); 27 28 var tallestItem = tallest + 6; 29 30 $(".dce-recommend").css("height", tallestItem + "px"); 31 } 32 33 normalizeHeights(); 34 35 $(window).on("resize orientationchange", function () { 36 ((tallest = 0), (heights.length = 0)); //reset vars 37 38 items.each(function () { 39 $(this).css("min-height", "0"); //reset min-height 40 }); 41 42 normalizeHeights(); //run it again 43 }); 44 } 45} 46 47function social_header() { 48 $(".tx-pb-social .btn-filter").remove(); 49 50 var socialCount = 0; 51 52 if ($(".pb-list-item-instagram").length > 0) { 53 $(".tx-pb-social").prepend('<div class="btn-filter"><a id="filter-instagram" class="btn btn-filter-newsroom" data-filter=".pb-list-item-instagram" ><i class="fa fa-instagram" aria-hidden="true"></i> <span class="hidden-xs">Instagram</span></a></div>'); 54 55 socialCount++; 56 } 57 58 if ($(".pb-list-item-flickr").length > 0) { 59 $(".tx-pb-social").prepend('<div class="btn-filter"><a id="filter-flickr" class="btn btn-filter-newsroom" data-filter=".pb-list-item-flickr" ><i class="fa fa-flickr" aria-hidden="true"></i> <span class="hidden-xs">Flickr</span></a></div>'); 60 61 socialCount++; 62 } 63 64 if ($(".pb-list-item-twitter").length > 0) { 65 $(".tx-pb-social").prepend('<div class="btn-filter"><a id="filter-twitter" class="btn btn-filter-newsroom" data-filter=".pb-list-item-twitter" ><i class="fa fa-twitter" aria-hidden="true"></i> <span class="hidden-xs">Twitter</span></a></div>'); 66 67 socialCount++; 68 } 69 70 if ($(".pb-list-item-facebook").length > 0) { 71 $(".tx-pb-social").prepend('<div class="btn-filter"><a id="filter-facebook" class="btn btn-filter-newsroom" data-filter=".pb-list-item-facebook" ><i class="fa fa-facebook-official" aria-hidden="true"></i> <span class="hidden-xs">Facebook</span></a></div>'); 72 73 socialCount++; 74 } 75 76 if ($(".pb-list-item-youtube").length > 0) { 77 $(".tx-pb-social").prepend('<div class="btn-filter"><a id="filter-youtube" class="btn btn-filter-newsroom" data-filter=".pb-list-item-youtube" ><i class="fa fa-youtube-play" aria-hidden="true"></i> <span class="hidden-xs">Youtube</span></a></div>'); 78 79 socialCount++; 80 } 81 82 if (socialCount > 1) { 83 if (document.documentElement.lang == "fr" || document.documentElement.lang == "fr-CH") { 84 $(".tx-pb-social .pb-list").before("<div class='btn-filter btn-no-filter'><a id='filter-none' class='btn btn-filter-newsroom' data-filter='*' >Tout afficher</a></div>"); 85 } else if (document.documentElement.lang == "it" || document.documentElement.lang == "it_IT") { 86 $(".tx-pb-social .pb-list").before("<div class='btn-filter btn-no-filter'><a id='filter-none' class='btn btn-filter-newsroom' data-filter='*' >Mostra tutto</a></div>"); 87 } else { 88 $(".tx-pb-social .pb-list").before("<div class='btn-filter btn-no-filter'><a id='filter-none' class='btn btn-filter-newsroom' data-filter='*' >Alles anzeigen</a></div>"); 89 } 90 } 91 92 if (socialCount < 2) { 93 $(".tx-pb-social .btn-filter").remove(); 94 } 95 96 $(".btn-filter-newsroom").click(function (e) { 97 var filter; 98 99 e.preventDefault(); 100 101 filter = $(this).data("filter"); 102 103 console.log(filter); 104 105 triggerFilter(filter); 106 107 $(".btn-filter-newsroom").removeClass("active"); 108 109 $(this).addClass("active"); 110 }); 111} 112 113// carousel blog normalisation 114 115function carouselBlogNormalization() { 116 var items = $("#blogCarousel .carousel-inner .article-blog"), //grab all slides 117 heights = [], //create empty array to store height values 118 tallest; //create variable to make note of the tallest slide 119 120 if (items.length) { 121 function normalizeHeights() { 122 items.each(function () { 123 //add heights to array 124 125 heights.push($(this).height()); 126 }); 127 128 // 30 = padding-bottom de item 129 130 tallest = Math.max.apply(null, heights) + 0; //cache largest value 131 132 items.each(function () { 133 $(this).css("min-height", tallest + "px"); 134 }); 135 } 136 137 normalizeHeights(); 138 139 $(window).on("resize orientationchange", function () { 140 ((tallest = 0), (heights.length = 0)); //reset vars 141 142 items.each(function () { 143 $(this).css("min-height", "0"); //reset min-height 144 }); 145 146 normalizeHeights(); //run it again 147 }); 148 } 149} 150 151// paramètres URL 152 153function urlParam(name) {
154 var results = new RegExp("[\?&]" + name + "=([^&#]*)").exec(window.location.href); 155 156 if (results) { 157 return results[1] || 0; 158 } else { 159 return false; 160 } 161} 162 163function update_roles(thisVal) { 164 if (typeof window.cantons_rol[thisVal] !== "undefined") { 165 $('#tx_user_role > option[value!=""][selected!="selected"]').wrap("<span>").prop("selected", false); 166 167 $.each(window.cantons_rol[thisVal]["roles"], function (a, role) { 168 $('#tx_user_role span option[value="' + role + '"]').unwrap("span"); 169 }); 170 } 171} 172 173// filter the title ,cantons list depending on the the other list value 174 175function annuaire_filter() { 176 if ($("input#tx_user_section_primaire").length) { 177 update_roles($("#canton_id").val()); 178 } else { 179 $("#tx_user_section_primaire") 180 .change(function () { 181 thisVal = parseInt($("#tx_user_section_primaire > option:selected").val()); 182 183 otherVal = parseInt($("#tx_user_role > option:selected").val()); 184 185 if (isNaN(thisVal)) $("#tx_user_role span option").unwrap("span"); 186 else { 187 update_roles(thisval); 188 189 if (isNaN(otherVal)) { 190 $("#tx_user_role").val(""); 191 } else { 192 $("#tx_user_role").val(otherVal); 193 } 194 } 195 }) 196 .trigger("change"); 197 } 198 199 $("#tx_user_role") 200 .change(function () { 201 thisVal = parseInt($("#tx_user_role > option:selected").val()); 202 203 otherVal = parseInt($("#tx_user_section_primaire > option:selected").val()); 204 205 //console.log(thisVal); 206 207 if (isNaN(thisVal)) $("#tx_user_section_primaire span option").unwrap("span"); 208 else { 209 if (typeof window.roles_cant[thisVal] !== "undefined") { 210 //console.log(window.roles_cant[thisVal]); 211 212 $('#tx_user_section_primaire > option[value!=""][selected!="selected"]').wrap("<span>").prop("selected", false); 213 214 $.each(window.roles_cant[thisVal]["cantons"], function (a, canton) { 215 $('#tx_user_section_primaire span option[value="' + canton + '"]').unwrap("span"); 216 }); 217 } 218 219 if (isNaN(otherVal)) { 220 $("#tx_user_section_primaire").val(""); 221 } else { 222 $("#tx_user_section_primaire").val(otherVal); 223 } 224 } 225 }) 226 .trigger("change"); 227} 228 229function fix_external_links() { 230 const isUrlLink = new RegExp("http"); 231 232 const isInternalLink = new RegExp("/${window.location.host}/"); 233 234 const isMailtoLink = new RegExp("mailto"); 235 236 jQuery.each($("a"), function (i, link) { 237 if (isUrlLink.test(link) && !isInternalLink.test(link) && !isMailtoLink.test(link)) { 238 link.setAttribute("target", "_blank"); 239 240 link.setAttribute("rel", "noopener noreferrer"); 241 } 242 }); 243} 244 245function isScrolledIntoView(elem) { 246 var $elem = $(elem); 247 248 var $window = $(window); 249 250 var docViewTop = $window.scrollTop(); 251 252 var docViewBottom = docViewTop + $window.height(); 253 254 var elemTop = $elem.offset().top; 255 256 var elemBottom = elemTop + $elem.height(); 257 258 return elemBottom <= docViewBottom && elemTop >= docViewTop; 259} 260 261$(document).ready(function () { 262 $(window).scroll(function () { 263 $(".highlight").each(function () { 264 if (isScrolledIntoView($(this))) { 265 $(this).addClass("visible"); 266 } else { 267 $(this).removeClass("visible"); 268 } 269 }); 270 }); 271 272 $(".pb-list-social .pb-list-item").click(function () { 273 if ($(this).attr("data-url")) window.open($(this).attr("data-url")); 274 275 // window.open($(this).attr('data-url'),"my_window", "width=800, height=800"); 276 }); 277 278 /* 279 280 281 282 * NEW DCE 283 284 285 286 */ 287 288 $(".program-accordion.active").click(function () { 289 $(this).siblings(".program-accordion").find(".program-accordion-content").slideUp(); 290 291 $(this).find(".program-accordion-content").stop().slideToggle(); 292 }); 293
294 var flipBoxWidth = $(".wng-new-personne-img-area").width(); 295 296 //$('.wng-new-personne-area .flipper, .wng-new-personne-img-area, .wng-new-personne-flip-area').css('height', flipBoxWidth); 297 298 $(".wng-new-personne-flip-area").perfectScrollbar(); 299 300 /* 301 302 303 304 * Search 305 306 307 308 */ 309 310 $(".search-toggle, #closeSearch").click(function (event) { 311 $(".search-toggle").toggleClass("active"); 312 313 $(".dropdown-search").toggleClass("open"); 314 315 $(".main-submenu").each(function () { 316 $(this).removeClass("open"); 317 }); 318 319 event.preventDefault(); 320 }); 321 322 $(".navbar-toggle").click(function (event) { 323 $(".search-toggle").removeClass("active"); 324 325 setTimeout(function () { 326 $(".dropdown-search").removeClass("open"); 327 }, 1000); 328 329 event.preventDefault(); 330 }); 331 332 /* 333 334 335 336 * Menu 337 338 339 340 */ 341 342 $(".dropdow-separation") 343 .mouseenter(function () { 344 $(this).parent().find(".col-md-offset-1 > li > a").css("color", "rgba(255, 255, 255, 0.3)"); 345 }) 346 347 .mouseleave(function () { 348 $(this).parent().find(".col-md-offset-1 > li > a").css("color", ""); 349 }); 350 351 $(".menu > li > a").click(function () { 352 $(".menu li").each(function (index) { 353 $(this).removeClass("open"); 354 }); 355 356 $(this).parent("li").addClass("open"); 357 358 $(".dropdown-menu .container .row > ul > li").each(function () { 359 $(this).removeClass("light"); 360 }); 361 362 $("body").toggleClass("menu-open"); 363 364 $(".search-toggle").removeClass("active"); 365 366 $(".dropdown-search").removeClass("open"); 367 368 setTimeout(function () { 369 if ($(".menu > li.open").length >= 1) { 370 $("body").addClass("menu-open"); 371 } 372 }, 1000); 373 }); 374 375 $(".dropdown-submenu").click(function (event) { 376 event.stopPropagation(); 377 378 $(".dropdown-menu .container .row > ul > li").each(function () { 379 $(this).addClass("light"); 380 }); 381 382 if ($(this).hasClass("open")) { 383 $(".dropdown-submenu").each(function () { 384 $(this).removeClass("open"); 385 }); 386 } else { 387 $(".dropdown-submenu").each(function () { 388 $(this).removeClass("open"); 389 }); 390 391 $(this).removeClass("light"); 392 393 $(this).addClass("open"); 394 } 395 396 if ($(".dropdown-menu .container .row > ul > li.open").length < 1) { 397 $(".dropdown-menu .container .row > ul > li").each(function () { 398 $(this).removeClass("light"); 399 }); 400 } 401 }); 402 403 $(".dropdown-submenu > a").click(function (event) { 404 event.preventDefault(); 405 }); 406 407 $(".dropdown-menu").on("click.bs.dropdown", function (e) { 408 e.stopPropagation(); 409 }); 410 411 $(".navToggle").click(function () { 412 $(".menu > .open").removeClass("open"); 413 414 $("body").removeClass("menu-open"); 415 416 $(".dropdown-menu li").removeClass("light"); 417 }); 418 419 $("header *").click(function (event) { 420 setTimeout(function () { 421 if ($(".menu > li.open").length < 1) { 422 $("body").removeClass("menu-open"); 423 } 424 }, 1000); 425 }); 426 427 // mobile menu 428 429 $(".navbar-toggle").click(function (e) { 430 $(this).toggleClass("open"); 431 }); 432 433 $(".open .dropdown-toggle").click(function (e) { 434 $(this).parent().removeClass("open"); 435 }); 436 437 $(".navbar-toggle").click(function (e) { 438 var windowWidth = $(window).width(); 439 440 if (windowWidth < 992) { 441 setTimeout(function () { 442 if ($(".menu").hasClass("activated")) { 443 $(".menu li").each(function (index) { 444 $(this).removeClass("closed"); 445 446 $(this).removeClass("light"); 447 448 $(this).removeClass("open"); 449 }); 450 451 $(".menu a").removeAttr("style"); 452 453 $(".menu .dropdown-menu li").each(function (index) { 454 $(this).removeClass("closed"); 455 456 $(this).removeClass("current-submenu"); 457 458 $(this).removeClass("open"); 459 }); 460 461 $(".menu").removeClass("activated"); 462 } 463 }, 100); 464 } 465 }); 466 467 $("header > .container:first-child *").click(function (event) { 468 setTimeout(function () { 469 if ($("#navbar").hasClass("in")) { 470 $("body").removeClass("menu-open"); 471 472 $(".menu li").each(function (index) { 473 $(this).removeClass("closed"); 474 475 $(this).removeClass("open"); 476 477 $(this).removeClass("light"); 478 }); 479 480 $(".menu").removeClass("activated"); 481 482 $(".menu a").removeAttr("style"); 483 484 $(".menu .dropdown-menu li").each(function (index) { 485 $(this).removeClass("closed"); 486 487 $(this).removeClass("current-submenu"); 488 489 $(this).removeClass("open"); 490 }); 491 492 $("#navbar").removeClass("in"); 493 494 $(".navbar-toggle").removeClass("open"); 495 } 496 }, 300); 497 }); 498 499 $(".menu").on("hide.bs.dropdown", function (e) { 500 e.stopPropagation(); 501 502 e.preventDefault(); 503 }); 504
505 $(".dropdown-toggle").click(function (e) { 506 var windowWidth = $(window).width(); 507 508 if (windowWidth < 992) { 509 setTimeout(function () { 510 if ($(".menu").hasClass("activated")) { 511 $(".menu li").each(function (index) { 512 $(this).removeClass("closed"); 513 514 $(this).removeClass("open"); 515 }); 516 517 $(".menu").removeClass("activated"); 518 } else { 519 $(".menu:not(.activated) > li:not(.open)").addClass("closed"); 520 521 $(".menu").addClass("activated"); 522 } 523 }, 100); 524 } 525 }); 526 527 $(".dropdown-submenu a").click(function (e) { 528 var windowWidth = $(window).width(); 529 530 if (windowWidth < 992) { 531 if ($(this).parent().hasClass("current-submenu")) { 532 setTimeout(function () { 533 $(".menu .dropdown-menu li").each(function (index) { 534 $(this).removeClass("closed"); 535 536 $(this).removeClass("current-submenu"); 537 }); 538 539 $(".main-submenu.open > a").removeAttr("style"); 540 }, 100); 541 } else { 542 setTimeout(function () { 543 $(".menu .dropdown-menu .container .row > ul > li").addClass("current-submenu"); 544 545 $(".menu .dropdown-menu .container .row > ul > li:not(.open)").addClass("closed"); 546 547 $(".main-submenu.open > a").css({ 548 height: "0", 549 550 opacity: "0", 551 552 padding: "0", 553 }); 554 }, 100); 555 } 556 } 557 }); 558 559 // scrollbar hidden 560 561 $(".main-submenu a").click(function (e) { 562 var windowWidth = $(window).width(); 563 564 if (windowWidth >= 992) { 565 $(".dce-recommend").perfectScrollbar(); 566 567 $(".dropdown-menu .container").perfectScrollbar(); 568 } 569 }); 570 571 $(window).on("resize orientationchange", function () { 572 var windowWidth = $(window).width(); 573 574 if (windowWidth >= 992) { 575 $(".dce-recommend").perfectScrollbar(); 576 577 $(".dropdown-menu .container").perfectScrollbar(); 578 } 579 }); 580 581 // slider de news - campagnes 582 583 carouselNormalization(); 584 585 // slider de news - blog 586 587 carouselBlogNormalization(); 588 589 /* 590 591 592 593 * slider film roll 594 595 596 597 */ 598 599 var film_roll = new FilmRoll({ 600 container: "#film_roll", 601 602 scroll: false, 603 }); 604 605 /* 606 * sticky header 607 */ 608 609 // var contentImg = $(".content-img"); 610 611 //if element ".content-img" exists 612 613 // if (!contentImg.length) { 614 // contentImg = $("#main-content"); 615 // } 616 617 // if (!$(".content-img").length && !$("#main-content").length) { 618 // var position = 0; 619 // } else { 620 // var position = contentImg.position().top; 621 // } 622 623 var position = 0; 624 625 if ($(document).scrollTop() > position) { 626 $("#nav, .navbar-header").addClass("sticky"); 627 } else { 628 $("#nav, .navbar-header").removeClass("sticky"); 629 } 630 631 $(window).scroll(function () { 632 if ($(document).scrollTop() > position) { 633 $("#nav, .navbar-header").addClass("sticky"); 634 } else { 635 $("#nav, .navbar-header").removeClass("sticky"); 636 } 637 }); 638 639 /* 640 641 642 643 * to top link 644 645 646 647 */ 648 649 $("#back-to-top").click(function () { 650 $("body,html").animate( 651 { 652 scrollTop: 0, 653 }, 654 800, 655 ); 656 657 return false; 658 }); 659 660 /* 661 662 663 664 * Social wall 665 666 667 668 */ 669 670 jQuery(document).ready(function ($) { 671 social_header(); 672 }); 673 674 /* 675 676 677 678 * DCE position 679 680 681 682 */ 683 684 $(".documents-more a").click(function (e) { 685 e.preventDefault(); 686 687 $(this).toggleClass("open"); 688 689 $(this).parent().siblings(".documents-height-hidden").toggleClass("document-visible"); 690 }); 691 692 /* 693 694 695 696 * Google map iframe 697 698 699 700 */ 701 702 $(".bottom-content") 703 .click(function () { 704 $(this).find("iframe").addClass("clicked"); 705 }) 706 707 .mouseleave(function () { 708 $(this).find("iframe").removeClass("clicked"); 709 }); 710 711 /* 712 713 714 715 * Formulaires 716 717 718 719 */ 720 721 /*if ($('.tx-powermail').length > 0) { 722 723 724 725 $('.tx-powermail select').material_select(); 726 727 728 729 }*/ 730 731 $(".powermail_submit").click(function (e) { 732 window.setTimeout(function () { 733 var headerHeight = $("#header").height(); 734 735 if ($(".parsley-error").length > 0) { 736 $("html, body").animate( 737 { 738 scrollTop: $(".parsley-error").first().offset().top - headerHeight - 25, 739 }, 740 500, 741 ); 742 } 743 }, 300); 744 }); 745 746 var headerHeight = $("#header").height(); 747 748 if ($(".powermail_message_error").length > 0) { 749 $("html, body").animate( 750 { 751 scrollTop: $(".powermail_message_error").first().offset().top - headerHeight - 25, 752 }, 753 500, 754 ); 755 } 756 757 if ($(".powermail_create").length > 0) { 758 $("html, body").animate( 759 { 760 scrollTop: $(".powermail_create").first().offset().top - headerHeight - 250, 761 }, 762 500, 763 ); 764 } 765 766 if ($("#subscribe-form").length > 0) { 767 if ($(".alert-success").length > 0) { 768 $("html, body").animate( 769 { 770 scrollTop: $("#subscribe-form").offset().top - headerHeight - 250, 771 }, 772 500, 773 ); 774 } 775 776 if ($(".alert-danger").length > 0) { 777 $("html, body").animate( 778 { 779 scrollTop: $("#subscribe-form").offset().top - headerHeight - 250, 780 }, 781 500, 782 ); 783 } 784 } 785 786 /* 787 788 789 790 * Events height 791 792 793 794 */ 795 796 var engagerValeurs = $("#four-content > .container > .row:last-child > div:last-child").height(); 797 798 //$('#four-content > .container > .row:last-child > div:first-child > div').css('min-height', engagerValeurs-30); 799 800 // $(window).on("resize orientationchange", function () { 801 // engagerValeurs = $("#four-content > .container > .row:last-child > div:last-child").height(); 802 803 // $("#four-content > .container > .row:last-child > div:first-child > div").css("min-height", engagerValeurs - 30); 804 // }); 805 806 // activate the annuaire_filter on page load //line 61 807 808 annuaire_filter(); 809 810 // fix the taget for the external links // line 90 811 812 // fix_external_links(); 813 814 /* 815 816 817 818 * newsletter form 819 820 821 822 */ 823 824 $("#newsletter-subscription").on("submit", function (event) { 825 var emailValue = $("#newsletter-subscription #email").val(); 826 827 if (emailValue) { 828 var formAction = $(this).attr("action"); 829 830 //alert('the action is: ' + formAction + ' email ' + emailValue); 831 832 window.location.href = formAction + "?email=" + emailValue; 833 834 event.preventDefault(); 835 } 836 }); 837 838 var emailFromURL = urlParam("email"); 839 840 if (emailFromURL) { 841 $(".addressix-subscribe input[type=email]").val(emailFromURL); 842 } 843 844 /* 845 846 847 848 * Accordion person 849 850 851 852 */ 853 854 /*if($('#accordion-com .panel-body li').length < 1) { 855 856 857 858 $('#accordion-com').remove(); 859 860 861 862 } 863 864 865 866 if($('#accordion-blog .panel-body li').length < 1) { 867 868 869 870 $('#accordion-blog').remove(); 871 872 873 874 } 875 876 877 878 if($('#accordion-newsletter .panel-body li').length < 1) { 879 880 881 882 $('#accordion-newsletter').remove(); 883 884 885 886 } 887 888 889 890 if(($('#accordion-com .panel-body li').length < 1) && ($('#accordion-blog .panel-body li').length < 1) && ($('#accordion-newsletter .panel-body li').length < 1)) { 891 892 893 894 $('.users-accordion').remove(); 895 896 897 898 }*/ 899 900 if ($("#accordion-news .panel-body ul.article li").length < 1) { 901 $(".users-accordion").remove(); 902 } 903}); 904
905var configObj = configObj || { 906 layout: "masonry", 907 908 itemSelector: ".pb-list-item", 909 910 masonry: { 911 gutter: 10, 912 913 // , isFitWidth : true 914 }, 915}; 916 917function update() { 918 window.setTimeout(function () { 919 $(".pb-list").isotope(configObj); 920 }, 1100); 921 922 return $(".pb-list"); 923} 924 925function scrollTo(destination, time, $win) { 926 var animationTime = time ? time : 1000; 927 928 var win = $win ? $win : $("html,body"); 929 930 win.bind("scroll mousedown DOMMouseScroll mousewheel keyup", function (e) { 931 if (e.which > 0 || e.type === "mousedown" || e.type === "mousewheel") { 932 win.stop(true, false); 933 934 win.unbind("scroll mousedown DOMMouseScroll mousewheel keyup"); 935 } 936 }); 937 938 win.stop().animate( 939 { 940 scrollTop: destination, 941 }, 942 animationTime, 943 "swing", 944 function () { 945 win.unbind("scroll mousedown DOMMouseScroll mousewheel keyup"); 946 947 return true; 948 }, 949 ); 950} 951 952function toggleSelected(obj) { 953 var $selected = $(".selected"); 954 955 if ($(obj).hasClass("selected") !== true) { 956 if ($(".selected")) { 957 $(".selected").removeClass("selected bigSize").addClass("regSize"); 958 } 959 } 960 961 $(obj).addClass("selected").removeClass("regSize").addClass("bigSize"); 962 963 update().isotope("once", "layoutComplete", function () { 964 var top = $(obj).offset().top; 965 966 scrollTo(top); 967 }); 968} 969 970function triggerFilter(filter) { 971 window.setTimeout(function () { 972 $(".pb-list").isotope({ filter: filter }); 973 }, 900); 974} 975 976var initShow = 10; //number of images loaded on init & onclick load more button 977 978var counter = initShow; //counter for load more button 979 980var $container; 981 982var iso; 983 984jQuery(document).ready(function ($) { 985 window.setTimeout(function () { 986 if ($(".pb-list.pb-list-social")[0]) { 987 $container = $(".pb-list-social").isotope(configObj); 988 989 iso = $container.data("isotope"); // get Isotope instance 990 991 loadMore(initShow); 992 } else { 993 if ($(".pb-list")[0]) $(".pb-list").not(".pb-list-social").isotope(configObj); 994 } 995 }, 1100); 996 997 $("#update").click(function () { 998 toggleSelected($(".post-selector").eq(0)); 999 1000 window.setTimeout(function () { 1001 $(".pb-list").isotope(configObj); 1002 }, 1100); 1003 }); 1004 1005 $(".post-selector").click(function (e) { 1006 toggleSelected(this); 1007 }); 1008 1009 $(".btn-filter-newsroom").click(function (e) { 1010 var filter; 1011 1012 e.preventDefault(); 1013 1014 filter = $(this).data("filter"); 1015 1016 console.log(filter); 1017 1018 triggerFilter(filter); 1019 1020 $(".btn-filter-newsroom").removeClass("active"); 1021 1022 $(this).addClass("active"); 1023 }); 1024 1025 /// datepicker localisation 1026 1027 (function (factory) { 1028 if (typeof define === "function" && define.amd) { 1029 // AMD. Register as an anonymous module. 1030 1031 define(["../widgets/datepicker"], factory); 1032 } else { 1033 // Browser globals 1034 1035 factory(jQuery.datepicker); 1036 } 1037 })(function (datepicker) { 1038 datepicker.regional.fr = { 1039 closeText: "Fermer", 1040 1041 prevText: "Précédent", 1042 1043 nextText: "Suivant", 1044 1045 currentText: "Aujourd'hui", 1046 1047 monthNames: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"], 1048 1049 monthNamesShort: ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."], 1050 1051 dayNames: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], 1052 1053 dayNamesShort: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."], 1054 1055 dayNamesMin: ["D", "L", "M", "M", "J", "V", "S"], 1056 1057 weekHeader: "Sem.", 1058 1059 dateFormat: "dd/mm/yy", 1060 1061 firstDay: 1, 1062 1063 isRTL: false, 1064 1065 showMonthAfterYear: false, 1066 1067 yearSuffix: "", 1068 }; 1069 1070 datepicker.regional.de = { 1071 closeText: "SchlieÃen", 1072 1073 prevText: "<Zurück", 1074 1075 nextText: "Vor>", 1076 1077 currentText: "Heute", 1078 1079 monthNames: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "
1079November", "Dezember"], 1080 1081 monthNamesShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], 1082 1083 dayNames: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], 1084 1085 dayNamesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], 1086 1087 dayNamesMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], 1088 1089 weekHeader: "KW", 1090 1091 dateFormat: "dd.mm.yy", 1092 1093 firstDay: 1, 1094 1095 isRTL: false, 1096 1097 showMonthAfterYear: false, 1098 1099 yearSuffix: "", 1100 }; 1101 1102 datepicker.regional.it = { 1103 closeText: "Chiudi", 1104 1105 prevText: "<Prec", 1106 1107 nextText: "Succ>", 1108 1109 currentText: "Oggi", 1110 1111 monthNames: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], 1112 1113 monthNamesShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], 1114 1115 dayNames: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], 1116 1117 dayNamesShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"], 1118 1119 dayNamesMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa"], 1120 1121 weekHeader: "Sm", 1122 1123 dateFormat: "dd.mm.yy", 1124 1125 firstDay: 1, 1126 1127 isRTL: false, 1128 1129 showMonthAfterYear: false, 1130 1131 yearSuffix: "", 1132 }; 1133 1134 if ($("html").attr("lang") == "de") { 1135 datepicker.setDefaults(datepicker.regional.de); 1136 1137 return datepicker.regional.de; 1138 } else if ($("html").attr("lang") == "fr") { 1139 datepicker.setDefaults(datepicker.regional.fr); 1140 1141 return datepicker.regional.fr; 1142 } 1143 }); 1144 1145 /* 1146 1147 1148 1149 * Datepicker 1150 1151 1152 1153 */ 1154 1155 $(".datepicker").datepicker(); 1156 1157 var minDateShow = $("#news-minimumDateShow"); 1158 1159 var minDate = $("#news-minimumDate"); 1160 1161 minDateShow.datepicker({ 1162 altFormat: "mm/dd/yy", 1163 1164 altField: "#news-minimumDate", 1165 }); 1166 1167 if (minDate.val() != "") { 1168 minDateShow.datepicker("setDate", new Date(minDate.val())); 1169 } 1170 1171 var maxDateShow = $("#news-maximumDateShow"); 1172 1173 var maxDate = $("#news-maximumDate"); 1174 1175 maxDateShow.datepicker({ 1176 altFormat: "mm/dd/yy", 1177 1178 altField: "#news-maximumDate", 1179 }); 1180 1181 if (maxDate.val() != "") { 1182 maxDateShow.datepicker("setDate", new Date(maxDate.val())); 1183 } 1184 1185 // var entered = 0; 1186 1187 // $(document).ready(function () { 1188 1189 // if(entered === 0) { 1190 1191 // $('#kesearch_submit').click(); 1192 1193 // entered = 1; 1194 1195 // } 1196 1197 // }); 1198}); 1199 1200$(document) 1201 .ajaxStart(function () { 1202 $(document.body).css({ cursor: "wait" }); 1203 }) 1204 .ajaxStop(function () { 1205 $(document.body).css({ cursor: "default" }); 1206 }); 1207 1208jQuery(document).ready(function ($) { 1209 $(document).on("click", "a.btn-anchor", function (event) { 1210 event.preventDefault(); 1211 1212 $("html, body").animate( 1213 { 1214 scrollTop: $($.attr(this, "href")).offset().top - 121, 1215 }, 1216 500, 1217 ); 1218 }); 1219}); 1220 1221//execute function onload 1222 1223function loadMore(toShow) { 1224 $container.find(".hidden").removeClass("hidden"); 1225 1226 var hiddenElems = iso.filteredItems.slice(toShow, iso.filteredItems.length).map(function (item) { 1227 return item.element; 1228 }); 1229 1230 $(hiddenElems).addClass("hidden"); 1231 1232 $container.isotope("layout"); 1233 1234 //when no more to load, hide show more button 1235 1236 if (hiddenElems.length == 0) { 1237 $("#load_more_posts").hide(); 1238 } else { 1239 $("#load_more_posts").show(); 1240 } 1241} 1242 1243//when load more button clicked 1244 1245function LoadmoreFunction() { 1246 if ($("#filters").data("clicked")) { 1247 //when filter button clicked, set initial value for counter 1248 1249 counter = initShow; 1250 1251 $("#filters").data("clicked", false); 1252 } else { 1253 counter = counter; 1254 } 1255 1256 counter = counter + initShow; 1257 1258 loadMore(counter); 1259} 1260 1261function testDevice() { 1262 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) { 1263 return true; 1264 } else { 1265 return false;
1266 } 1267} 1268 1269jQuery(document).ready(function ($) { 1270 $("table").wrap("<div class='frame-type-table'></div>"); 1271 1272 //$('.frame-type-table').perfectScrollbar(); 1273}); 1274 1275function getCookie(name) { 1276 var dc = document.cookie; 1277 1278 var prefix = name + "="; 1279 1280 var begin = dc.indexOf("; " + prefix); 1281 1282 if (begin == -1) { 1283 begin = dc.indexOf(prefix); 1284 1285 if (begin != 0) return null; 1286 } else { 1287 begin += 2; 1288 1289 var end = document.cookie.indexOf(";", begin); 1290 1291 if (end == -1) { 1292 end = dc.length; 1293 } 1294 } 1295 1296 // because unescape has been deprecated, replaced with decodeURI 1297 1298 //return unescape(dc.substring(begin + prefix.length, end)); 1299 1300 return decodeURI(dc.substring(begin + prefix.length, end)); 1301} 1302 1303// Ajoute un margin si le bandeau tarteaucitron est visible // rsp // 12.11.2020 1304 1305window.addEventListener("load", function () { 1306 //if ($('#tarteaucitronAlertBig').css('display') != 'none'){ 1307 1308 var cookieTarteAuCitron = getCookie("tarteaucitron"); 1309 1310 if (cookieTarteAuCitron.indexOf("wait") > 0) { 1311 $("footer").addClass("footer-with-bottom"); 1312 } else { 1313 $("footer").removeClass("footer-with-bottom"); 1314 } 1315}); 1316 1317// jQuery(document).ready(function($){ 1318 1319// $('#slider-election').carousel({ 1320 1321// interval: 3100, 1322 1323// pause:null 1324 1325// }) 1326 1327// $('#slider-election').carousel('cycle'); 1328 1329// }); 1330 1331jQuery(document).ready(function ($) { 1332 $("#myCarousel").on("touchstart", function (event) { 1333 const xClick = event.originalEvent.touches[0].pageX; 1334 1335 $(this).one("touchmove", function (event) { 1336 const xMove = event.originalEvent.touches[0].pageX; 1337 1338 const sensitivityInPx = 5; 1339 1340 if (Math.floor(xClick - xMove) > sensitivityInPx) { 1341 $(this).carousel("next"); 1342 } else if (Math.floor(xClick - xMove) < -sensitivityInPx) { 1343 $(this).carousel("prev"); 1344 } 1345 }); 1346 1347 $(this).on("touchend", function () { 1348 $(this).off("touchmove"); 1349 }); 1350 }); 1351}); 1352 1353//CUSTOM SELECT 1354function custom_select() { 1355 $(".powermail_select").each(function (i, select) { 1356 if (!$(this).next().hasClass("dropdown")) { 1357 $(this).after('<div class="dropdown ' + ($(this).attr("class") || "") + '" tabindex="0"><span class="current"></span><div class="list"><ul></ul></div></div>'); 1358 var dropdown = $(this).next(); 1359 var options = $(select).find("option"); 1360 var selected = $(this).find("option:selected"); 1361 dropdown.find(".current").html(selected.data("display-text") || selected.text()); 1362 options.each(function (j, o) { 1363 var display = $(o).data("display-text") || ""; 1364 dropdown.find("ul").append('<li class="option ' + ($(o).is(":selected") ? "selected" : "") + '" data-value="' + $(o).val() + '" data-display-text="' + display + '">' + $(o).text() + "</li>"); 1365 }); 1366 } 1367 }); 1368 1369 $(".dropdown.powermail_select").each(function (index) { 1370 $(this).attr("data-nth", index + 1); 1371 }); 1372} 1373 1374//CUSTOM SELECT - Open/close 1375$(document).on("click", ".dropdown", function (event) { 1376 $(".dropdown").not($(this)).removeClass("open"); 1377 $(this).toggleClass("open"); 1378 if ($(this).hasClass("open")) { 1379 $(this).find(".option").attr("tabindex", 0); 1380 $(this).find(".selected").focus(); 1381 } else { 1382 $(this).find(".option").removeAttr("tabindex"); 1383 $(this).focus(); 1384 } 1385}); 1386//CUSTOM SELECT - Close when clicking outside 1387$(document).on({ 1388 touchstart: function (event) { 1389 if ($(event.target).closest(".dropdown").length === 0) { 1390 $(".dropdown").removeClass("open"); 1391 $(".dropdown .option").removeAttr("tabindex"); 1392 } 1393 event.stopPropagation(); 1394 }, 1395}); 1396 1397$(document).click(function (event) { 1398 if ($(event.target).closest(".dropdown").length === 0) { 1399 $(".dropdown").removeClass("open"); 1400 $(".dropdown .option").removeAttr("tabindex"); 1401 } 1402 event.stopPropagation(); 1403}); 1404 1405//CUSTOM SELECT - Option click 1406$(document).on("click", ".dropdown .option", function (event) { 1407 $(this).closest(".list").find(".selected").removeClass("selected"); 1408 $(this).addClass("selected"); 1409 var text = $(this).data("display-text") || $(this).text(); 1410 $(this).closest(".dropdown").find(".current").text(text); 1411 $(this).closest(".dropdown").prev("select").val($(this).data("value")).trigger("change"); 1412}); 1413 1414jQuery(document).ready(function ($) { 1415 if (typeof $("#header #branding a").attr("href") === "undefined") { 1416 $("#header #branding a").attr("href", "/"); 1417 } 1418 1419 //INPUT LABEL ANIMATION 1420 $(".powermail_fieldwrap_type_input input, .powermail_fieldwrap_type_textarea textarea, .wng-plr-news .input-field input, .wng-plr-news .input-field textarea").focus(function () { 1421 $(this).siblings("label").addClass("active"); 1422 }); 1423 1424 $(".powermail_fieldwrap_type_input input, .powermail_fieldwrap_type_textarea textarea, .wng-plr-news .input-field input, .wng-plr-news .input-field textarea").focusout(function () { 1425 if ($(this).val() === "") { 1426 $(this).siblings("label").removeClass("active"); 1427 } else { 1428 $(this).siblings("label").addClass("active"); 1429 } 1430 }); 1431 1432 var classlist = ".powermail_fieldwrap_type_input input, .powermail_fieldwrap_type_textarea textarea, .wng-plr-news .input-field input, .wng-plr-news .input-field textarea"; 1433 1434 // if ($('.powermail_fieldwrap_type_input input, .powermail_fieldwrap_type_textarea textarea, .wng-plr-news .input-field input, .wng-plr-news .input-field textarea').val() === "") { 1435 // $('.powermail_fieldwrap_type_input input, .powermail_fieldwrap_type_textarea textarea, .wng-plr-news .input-field input, .wng-plr-news .input-field textarea').siblings('label').removeClass('active'); 1436 // } else { 1437 // console.log('gugu'); 1438 // $('.powermail_fieldwrap_type_input input, .powermail_fieldwrap_type_textarea textarea, .wng-plr-news .input-field input, .wng-plr-news .input-field textarea').siblings('label').addClass('active'); 1439 // } 1440 1441 $(classlist).each(function () { 1442 if ($(this).val() === "") { 1443 $(this).siblings("label").removeClass("active"); 1444 } else { 1445 $(this).siblings("label").addClass("active"); 1446 } 1447 }); 1448 1449 $('form[name="newEventEmail"]').submit(function (event) { 1450 if ($("#datenschutz").is(":not(:checked)")) { 1451 $("#datenschutz").focus(); 1452 1453 return false;
1454 } else { 1455 return true; 1456 } 1457 }); 1458 1459 custom_select(); 1460});
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.