1//use: $('#ele').on('slideDown',function(){}); 2(function ($) { 3 $.each(['show', 'hide', 'slideDown'], function (i, ev) { 4 var el = $.fn[ev]; 5 $.fn[ev] = function () { 6 this.trigger(ev); 7 return el.apply(this, arguments); 8 }; 9 }); 10})(jQuery); 11 12$(function () { 13 var locale = document.documentElement.getAttribute('lang'); 14 moment.locale(locale); 15 16 $(document).lightGallery({ 17 selector: 'a[href$=".jpg"]:not([target="_blank"]), a[href$=".png"]:not([target="_blank"]), a[href$=".gif"]:not([target="_blank"]), a[href$=".webp"]:not([target="_blank"])', 18 download: false, 19 loop: false, 20 dynamic: false, 21 thumbnail: false 22 }); 23 24 initStickyHeader(); 25 searchbox(); 26 navigation(); 27 cookieNotification(); 28 embeddedVideos(); 29 filtersNavigation(); 30 initFiltergroups(); 31 32 initGridgallery(); 33 initGallery(); 34 initMediacarousel(); 35 36 formDatePicker(); 37 formFileInput(); 38 formFloatingLabels(); 39 formTextarea(); 40 initDropdown(); 41 initShare(); 42 responsiveTables(); 43 44 initToc(); 45 initAccordion(); 46 initTabs(); 47 initLazyLoad(); 48 initYTEmbeds(); 49 initModals(); 50 51 //googleMapLocations(); 52 53 $('.js-scrollto').on('click', function (e) { 54 scrollToPosition($(this).offset().top, 'slow'); 55 }); 56}); 57 58$(document).on('click', '#to-top', function (e) { 59 e.preventDefault(); 60 window.scrollToPosition(0, 0); 61}); 62 63function scrollToPosition(top, options) { 64 $('html,body').animate({scrollTop: top}, options); 65} 66 67function initStickyHeader() { 68 const update = (scrolled) => document.body.classList.toggle('has-sticky-header', scrolled); 69 70 if ('IntersectionObserver' in window) { 71 const notificationBar = document.getElementById('notificationbar'); 72 let topDistance = 0; 73 74 if (notificationBar) { 75 topDistance += notificationBar.offsetHeight; 76 } 77 78 const sentinel = document.createElement('div'); 79 sentinel.style.position = 'absolute'; 80 sentinel.style.top = topDistance + 'px'; 81 sentinel.style.height = '1px'; 82 sentinel.style.width = '1px'; 83 document.body.prepend(sentinel); 84 85 const obs = new IntersectionObserver((entries) => { 86 update(!entries[0].isIntersecting); 87 }); 88 obs.observe(sentinel); 89 90 requestAnimationFrame(() => update(window.scrollY > 10)); 91 } else { 92 const onScroll = () => update(window.scrollY > 10); 93 onScroll(); 94 window.addEventListener('scroll', onScroll, {passive: true}); 95 } 96} 97 98function initAccordion() { 99 if ($('.accordion') && $('.accordion-section').length > 0) { 100 var buttons = $('.accordion-button'); 101 if (window.location.hash) { 102 var id = window.location.hash.substr(1); 103 if ($('#' + id).length > 0) { 104 var section = $('#' + id).parent('.accordion-section'); 105 var button = section.find('[aria-controls="' + id + '"]'); 106 var content = section.find('#' + id); 107 content.removeAttr('hidden'); 108 button.attr('aria-expanded', true); 109 } 110 } 111 112 buttons.on('click', function (event) { 113 let button = $(this); 114 let content = $('#' + button.attr('aria-controls')); 115 116 if (content.attr('hidden')) { 117 content.removeAttr('hidden'); 118 button.attr('aria-expanded', true); 119 } else { 120 content.attr('hidden', ''); 121 button.attr('aria-expanded', false); 122 } 123 }); 124 } 125} 126 127 128function initToc() { 129 var scrollPosition = 0; 130 131 $('.toc-mobilenavbutton').on('click', function () { 132 if ($('body').hasClass('has-open-toc')) { 133 $('body').removeClass('has-open-toc'); 134 $('html').css('scroll-behavior', 'auto'); 135 $('html, body').stop().animate({scrollTop: scrollPosition}, 0); 136 $('html').css('scroll-behavior', ''); 137 } else { 138 scrollPosition = $(document).scrollTop(); 139 $('body').addClass('has-open-toc'); 140 $('html, body').stop().animate({scrollTop: scrollPosition}, 0); 141 } 142 }); 143 144 $('.toc [href^="#"]').on('click', function (e) { 145 e.preventDefault(); 146 if ($('body').hasClass('has-open-toc')) { 147 $('.toc-mobilenavbutton').first().trigger('click'); 148 } 149 150 let me = this; 151 setTimeout(function () { 152 let targetId = $(me).attr('href'); 153 154 if (window.location.hash !== targetId) { 155 history.pushState(null, '', targetId); 156 } 157 158 let offset = $(targetId).offset(); 159 let scrollto = offset.top - ($('.site-header').outerHeight() + 15); // minus fixed header height 160 161 $('html, body').animate({scrollTop: scrollto}, 0); 162 }, 1); 163 }); 164 165 $('.toc-progress').each(function () { 166 let progress = $(this); 167 let progressValue = $(this).find('.toc-progressvalue'); 168 let progressIndicator = $(this).find('.toc-progressindicator'); 169 let container = $(this).parents('.toc-progress-container'); 170 171 $(window).on('scroll', function () { 172 let containerHeight = container.outerHeight() - $(window).height(); 173 let windowScroll = (document.body.scrollTop || document.documentElement.scrollTop) - container.offset().top; 174 let scrolledPercentage = '100%'; 175 176 if (containerHeight > 0) { 177 progress.show(); 178 scrolledPercentage = (windowScroll / containerHeight) * 100; 179 scrolledPercentage = (scrolledPercentage < 0) ? 0 : scrolledPercentage; 180 scrolledPercentage = (scrolledPercentage > 100) ? 100 : scrolledPercentage; 181 scrolledPercentage = Math.round(scrolledPercentage) + '%'; 182 } else { 183 progress.hide(); 184 } 185 186 progressValue.html(scrolledPercentage); 187 progressValue.css('margin-left', scrolledPercentage); 188 progressIndicator.css('width', scrolledPercentage); 189 }).trigger('scroll'); 190 191 }); 192 193 $('.toc-toggle').on('click', function () { 194 var status = $(this).attr('aria-expanded'); 195 var tocToggles = $(this).parent('.toc-item').find('.toc-toggle'); 196 197 if (status === 'true') { 198 tocToggles.attr('aria-expanded', false); 199 } else { 200 $(this).attr('aria-expanded', true); 201 } 202 203 $('.toc-item.is-open').removeClass('is-open'); 204 $('.toc-toggle[aria-expanded="true"]').parent('.toc-item').addClass('is-open'); 205 }); 206 207 $('.toc-closeall').on('click', function () { 208 $('.toc-toggle').attr('aria-expanded', false); 209 $('.toc-item.is-open').removeClass('is-open'); 210 }); 211 $('.toc-openall').on('click', function () { 212 $('.toc-toggle').attr('aria-expanded', true); 213 $('.toc-item').addClass('is-open'); 214 }); 215} 216 217 218function initTabs() { 219 220 if ($('.tabsnav') && $('.tabs-pane').length > 0) { 221 var buttons = $('.tabsnav-link'); 222 var panes = $('.tabs-pane'); 223 224 if (window.location.hash) { 225 tabsChange(buttons, panes); 226 } 227 228 $(window).on('hashchange', function () { 229 tabsChange(buttons, panes); 230 }); 231 232 buttons.on('click', function (ev) { 233 ev.preventDefault(); 234 var button = $(this); 235 var hash = button.attr('href'); 236 var tab = $(hash); 237 238 if (tab.attr('hidden')) { 239 panes.attr('hidden', ''); 240 buttons.attr('aria-expanded', false); 241 tab.removeAttr('hidden'); 242 button.attr('aria-expanded', true); 243 history.pushState(null, null, hash); 244 } 245 }); 246 } 247} 248 249function tabsChange(buttons, panes) { 250 var id = window.location.hash.substr(1); 251 if ($('#' + id).length > 0) { 252 var tab = $('#' + id); 253 var button = $('.tabsnav-link[href="#' + id + '"]'); 254 255 if (tab) { 256 panes.attr('hidden', ''); 257 tab.removeAttr('hidden'); 258 } 259 if (button) { 260 buttons.attr('aria-expanded', false); 261 button.attr('aria-expanded', true); 262 } 263 } 264} 265
266function initMediacarousel() { 267 if ($('.js-mediacarousel').length > 0) { 268 if ($('.js-mediacarousel .mediacarousel-item').length == 1) { 269 $('.mediacarousel-pagination').hide(); 270 } 271 var settings = { 272 loop: true, 273 pagination: { 274 el: '.mediacarousel-bullets', 275 type: 'bullets', 276 clickable: true 277 }, 278 speed: 700, 279 autoHeight: false, 280 breakpoints: { 281 767: { 282 //autoHeight: true 283 } 284 } 285 }; 286 287 var mediacarouselSwiper = new Swiper('.js-mediacarousel', settings); 288 } 289} 290 291function initGallery() { 292 if ($('.js-gallery').length > 0) { 293 $('.js-gallery').lightGallery({ 294 selector: '.gallery-link', 295 download: false, 296 youtubePlayerParams: { 297 modestbranding: 1, 298 showinfo: 0, 299 rel: 0, 300 controls: 1 301 }, 302 vimeoPlayerParams: { 303 byline: 0, 304 portrait: 0, 305 color: '231E59' 306 } 307 }); 308 309 if ($('.js-gallery .gallery-item').length == 1) { 310 $('.gallery-pagination').hide(); 311 } 312 var settings = { 313 pagination: { 314 el: '.gallery-fraction', 315 type: 'fraction' 316 }, 317 effect: 'slide', 318 speed: 700, 319 autoHeight: true, 320 navigation: { 321 nextEl: '.gallery-button-next', 322 prevEl: '.gallery-button-prev' 323 }, 324 breakpoints: { 325 767: { 326 //autoHeight: true 327 } 328 } 329 }; 330 331 var gallerySwiper = new Swiper('.js-gallery', settings); 332 } 333} 334 335function initGridgallery() { 336 $('.gridgallery').lightGallery({ 337 thumbnail: true, 338 download: false, 339 selector: '.gridgallery-link' 340 }); 341 342 $('[data-rel="lg"]').on('click', function (e) { 343 e.preventDefault(); 344 $('.gridgallery-link').first().trigger('click'); 345 }); 346} 347 348 349function searchbox() { 350 if ($('.searchbox').length > 0) { 351 $('.js-toggle-searchbox').on('click', function (e) { 352 353 var target = $('#' + $(this).attr('aria-controls')); 354 $(this).attr('aria-expanded', ($(this).attr('aria-expanded') == 'true') ? false : true); 355 356 if (target.hasClass('is-hidden')) { 357 target.removeClass('is-hidden'); 358 target.find('input').eq(0).focus(); 359 $('body').addClass('has-open-searchbox'); 360 } else { 361 target.addClass('is-hidden'); 362 $('body').removeClass('has-open-searchbox'); 363 } 364 }); 365 366 $(document).on('click', function (e) { 367 var target = $(e.target); 368 if (!target.hasClass('searchbox') && !target.hasClass('js-toggle-searchbox') && !(target.parents('.searchbox').length > 0) && !(target.parents('.js-toggle-searchbox').length > 0)) { 369 $('.searchbox').addClass('is-hidden'); 370 $('.js-toggle-searchbox').attr('aria-expanded', false); 371 $('body').removeClass('has-open-searchbox'); 372 } 373 }); 374 375 $('.searchbox').on('click', function (e) { 376 e.stopPropagation(); 377 }); 378 } 379} 380 381function initShare() { 382 $('.js-share-popup').on("click", function (e) { 383 $(this).sharePopup(e); 384 }); 385 386 $('.share-button[aria-haspopup="true"]').on('click', function (e) { 387 e.stopPropagation(); 388 $(this).attr('aria-expanded', ($(this).attr('aria-expanded') == 'true') ? 'false' : 'true'); 389 }); 390 391 $(document).on('click', function (e) { 392 $('.share-button').attr('aria-expanded', false); 393 }); 394 395 $('.share-dropdown .share-button:last-child').on('focusout', function (e) { 396 $('.share-button').attr('aria-expanded', false); 397 }); 398} 399 400function initLazyLoad() { 401 $('img.lazyload').lazyload(); 402} 403 404//responsive yt vids 405function initYTEmbeds() { 406 if ($('.yt-vid').length) { 407 $(window).resize(function () { 408 $('.yt-vid').each(function () { 409 $(this).height(parseInt($(this).width() * 315 / 560)); 410 }); 411 }).trigger('resize'); 412 } 413} 414 415function initModals() { 416 $('a[data-micromodal-trigger]').on('click', function (ev) { 417 ev.preventDefault(); 418 }); 419 420 MicroModal.init({ 421 'onShow': function (modal) { 422 var modal = $(modal); 423 424 if (modal.hasClass('micromodal-video') && window.hasOwnProperty('plyrs')) { 425 $(window.plyrs).each(function () { 426 var plyr = this; 427 var plyrContainer = $(plyr.elements.container); 428 if (plyrContainer.parents(modal).length > 0) { 429 plyr.play(); 430 } 431 }); 432 } 433 }, 434 'onClose': function (modal) { 435 var modal = $(modal); 436 437 if (modal.hasClass('micromodal-video') && window.hasOwnProperty('plyrs')) { 438 $(window.plyrs).each(function () { 439 var plyr = this; 440 var plyrContainer = $(plyr.elements.container); 441 if (plyrContainer.parents(modal).length > 0) { 442 plyr.pause(); 443 } 444 }); 445 } 446 } 447 }); 448 449 if ($('[data-micromodal-show-ms]').length > 0) { 450 $('[data-micromodal-show-ms]').each(function () { 451 var milliseconds = parseInt(this.getAttribute('data-micromodal-show-ms')); 452 var interval = parseInt(this.getAttribute('data-micromodal-interval')); 453 var id = this.id; 454 var cookie = Cookies.get(id); 455 if (!cookie) { 456 setTimeout(function () { 457 MicroModal.show(id); 458 Cookies.set(id, 'opened', {expires: interval / 24}); 459 }, milliseconds); 460 } 461 }); 462 } 463} 464 465 466function initFiltergroups() { 467 if ($('.filtergroup').length > 0) { 468 let screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 469 470 if (screenWidth < 960) { 471 $('.filtergroup').addClass('is-open'); 472 $('.filtergroup-button').attr('aria-expanded', true); 473 } 474 475 $(document).on('click', '.filtergroup-button', function (e) { 476 477 if ($('body.has-open-filters').length == 0) { 478 $('.filtergroup-button[aria-expanded="true"]').attr('aria-expanded', false).parents('.filtergroup').removeClass('is-open'); 479 } 480 481 if ($(this).attr('aria-expanded') == 'true') { 482 $(this).attr('aria-expanded', false); 483 $(this).parents('.filtergroup').removeClass('is-open'); 484 } else { 485 $(this).attr('aria-expanded', true); 486 $(this).parents('.filtergroup').addClass('is-open'); 487 } 488 }); 489 490 if (screenWidth >= 960) { 491 $(document).on('click', function (e) { 492 var target = $(e.target); 493 if (!target.hasClass('.filtergroup') && !(target.parents('.filtergroup').length > 0)) { 494 $('.filtergroup-button').attr('aria-expanded', false); 495 $('.filtergroup').removeClass('is-open'); 496 } 497 }); 498 } 499 500 $(document).on('click', '.filtergroup', function (e) { 501 e.stopPropagation(); 502 }); 503 $('.filtergroup').each(function () { 504 var filtergroup = $(this); 505 filtergroup.find('a, button').last().on('focusout', function () { 506 //filtergroup.find('.filtergroup-button').attr('aria-expanded', false); 507 }); 508 }); 509 } 510} 511 512function initDropdown() { 513 if ($('.dropdown').length > 0) { 514 $('.dropdown-button').on('click', function (e) { 515 $('.dropdown-button[aria-expanded="true"]').attr('aria-expanded', false); 516 $(this).attr('aria-expanded', ($(this).attr('aria-expanded') == 'true') ? false : true); 517 }); 518 $(document).on('click', function (e) { 519 var target = $(e.target); 520 if (!target.hasClass('.dropdown') && !(target.parents('.dropdown').length > 0)) { 521 $('.dropdown-button').attr('aria-expanded', false); 522 } 523 }); 524 $('.dropdown').on('click', function (e) { 525 e.stopPropagation(); 526 }); 527 $('.dropdown').each(function () { 528 var dropdown = $(this); 529 dropdown.find('a, button').last().on('focusout', function () { 530 //dropdown.find('.dropdown-button').attr('aria-expanded', false); 531 }); 532 }); 533 } 534} 535 536function scrollToAnchor(selector, amount) { 537 if (!amount) { 538 amount = $('.site-header').outerHeight() + 15; 539 } 540 var aTag = $(selector); 541 $('html,body').animate({scrollTop: (aTag.offset().top - amount)}, 'slow'); 542} 543 544function embeddedVideos() { 545 $("p > iframe[src*='//player.vimeo.com'], p > iframe[src*='//www.youtube.com']").each(function () { 546 if ($(this).parent().is('p')) { 547 $(this).unwrap('p'); 548 } 549 $(this).wrap('<div class="responsive-video"></div>'); 550 }); 551} 552 553function formDatePicker() { 554 $('.js-pikaday-date').pikaday({ 555 format: 'DD-MM-YYYY', 556 firstDay: 1, 557 yearRange: 100, 558 i18n: { 559 months: moment.localeData()._months, 560 weekdays: moment.localeData()._weekdays, 561 weekdaysShort: moment.localeData()._weekdaysShort 562 } 563 }); 564} 565 566function formFloatingLabels() { 567 var elements = $('.form-row-floating-label').find('input, textarea, select'); 568 if (elements.length > 0) { 569 elements.each(function () { 570 var element = $(this); 571 element.on('input change focusout', function () { 572 if ($(this).val().length > 0) { 573 $(this).parents('.form-row-floating-label').addClass('has-label-top'); 574 } else if (!$(this).is(':focus')) { 575 $(this).parents('.form-row-floating-label').removeClass('has-label-top'); 576 } 577 }); 578 579 element.on('focus', function () { 580 $(this).parents('.form-row-floating-label').addClass('has-label-top'); 581 }); 582 583 }).trigger('input'); 584 } 585} 586 587function responsiveTables() { 588 $('.table, table[border]').wrap('<div class="table-responsive"></div>'); 589} 590 591 592function navigation() { 593 let scrollPosition = 0; 594 595 $('.js-toggle-sitenav').on('click', function () { 596 if ($('body').hasClass('has-open-sitenav')) { 597 $('body').removeClass('has-open-sitenav'); 598 $(this).attr('aria-expanded', false); 599 $('html, body').stop().animate({scrollTop: scrollPosition}, 0); 600 } else { 601 scrollPosition = $(document).scrollTop(); 602 $('body').addClass('has-open-sitenav'); 603 $(this).attr('aria-expanded', true); 604 $('html, body').stop().animate({scrollTop: scrollPosition}, 0); 605 } 606 }); 607 608 $('.sitenav').on('click', function (e) { 609 if (e.target.classList.contains('sitenav')) { 610 $('.js-toggle-sitenav').first().trigger('click'); 611 } 612 }); 613 614 615 $('.subnav').each(function () { 616 if ($(this).offset().left + $(this).actual('outerWidth') >= window.innerWidth) { 617 $(this).parents('.mainnav-item').find('> .subnav').addClass('subnav-left'); 618 } 619 }); 620 621 $('.topsubnav').each(function () { 622 if ($(this).offset().left + $(this).actual('outerWidth') >= window.innerWidth) { 623 $(this).parents('.topnav-item').find('> .topsubnav').addClass('topsubnav-left'); 624 } 625 }); 626 627 var keyPressed = false;
628 629 var showSubmenu = function (dropdown) { 630 dropdown.attr('aria-hidden', 'false'); 631 }; 632 633 var hideSubmenu = function (dropdown) { 634 dropdown.attr('aria-hidden', 'true'); 635 }; 636 637 $('.mainnav a, .mainnav button, .topnav a, .topnav button').on('focus', function (e) { 638 hideSubmenu($(this).closest('ul').find('[aria-haspopup]').next()); 639 }); 640 641 $('.mainnav [aria-haspopup], .topnav [aria-haspopup]').on('focus', function (e) { 642 keyPressed = false; 643 }); 644 645 $('.mainnav [aria-haspopup], .topnav [aria-haspopup]').on('keypress', function (e) { 646 if (e.which == 13 || e.keyCode == 13) { 647 showSubmenu($(this).nextAll('[aria-label="subnavigation"]')); 648 if (!keyPressed) { 649 keyPressed = true; 650 return false; 651 } 652 } 653 }); 654 655 $('.mainnav [aria-haspopup], .topnav [aria-haspopup]').parents('li').on('mouseleave', function () { 656 if ($('body.has-open-navigation').length < 1) { 657 hideSubmenu($(this).find('> [aria-label="subnavigation"]')); 658 } 659 }); 660 661 $('.mainnav [aria-haspopup], .topnav [aria-haspopup]').parents('li').on('mouseover', function () { 662 if ($('body.has-open-navigation').length < 1) { 663 showSubmenu($(this).find('> [aria-label="subnavigation"]')); 664 } 665 }); 666 667 var toggleSubnav = function (subnav) { 668 var parent = subnav.parents('li').first(); 669 670 if ($('.topnav-item.is-opened')) { 671 $('.topnav-item.is-opened').attr('aria-hidden', 'true'); 672 $('.topnav-item.is-opened').removeClass('is-opened'); 673 } 674 675 if (subnav.attr('aria-hidden') == 'true') { 676 subnav.attr('aria-hidden', 'false'); 677 parent.addClass('is-opened'); 678 } else { 679 subnav.attr('aria-hidden', 'true'); 680 parent.removeClass('is-opened'); 681 682 subnav.find('[aria-label="subnavigation"][aria-hidden="false"]').each(function () { 683 toggleSubnav($(this)); 684 }); 685 } 686 } 687 688 $('.subnav-toggle, .topsubnav-toggle, .togglenav-toggle, .topnav-link[aria-haspopup]').on('click', function () { 689 toggleSubnav($(this).nextAll('[aria-label="subnavigation"]')); 690 }); 691 692 $('.mainnav [aria-haspopup], .topnav [aria-haspopup]').nextAll('[aria-label="subnavigation"]').find('li:last > a').on('focusout', function (e) { 693 hideSubmenu($('.mainnav [aria-haspopup], .topnav [aria-haspopup]').nextAll('[aria-label="subnavigation"]')); 694 }); 695} 696 697function filtersNavigation() { 698 var scrollTopPosition = 0; 699 $(document).on('click', '.js-filters-toggle', function () { 700 if ($('body').hasClass('has-open-filters')) { 701 $('body').removeClass('has-open-filters'); 702 $('html, body').stop().animate({scrollTop: scrollTopPosition}, 0); 703 } else { 704 scrollTopPosition = $(document).scrollTop(); 705 $('body').addClass('has-open-filters'); 706 } 707 }); 708} 709 710function formFileInput() { 711 var elements = $('.file-input'); 712 if (elements.length > 0) { 713 elements.each(function () { 714 var element = $(this); 715 var input = $(this).find('[type="file"]'), path = '', filename = ''; 716 input.on('change', function () { 717 path = $(this).val(); 718 if (path) { 719 var startIndex = (path.indexOf('\\') >= 0 ? path.lastIndexOf('\\') : path.lastIndexOf('/')); 720 var filename = path.substring(startIndex); 721 if (filename.indexOf('\\') === 0 || filename.indexOf('/') === 0) { 722 filename = filename.substring(1); 723 } 724 } 725 726 element.find('.file-input-path [type="text"]').val(filename); 727 }); 728 }); 729 } 730} 731 732function formTextarea() { 733 var elements = $('.textarea-input'); 734 if (elements.length > 0) { 735 elements.each(function () { 736 var element = $(this); 737 element.on('keydown keyup keypress focus focusout', function () { 738 this.style.height = '1px'; 739 this.style.height = 24 + this.scrollHeight + 'px'; 740 }); 741 }).trigger('keydown'); 742 } 743} 744 745function cookieNotification() { 746 var cookieModal = $('#cookie_modal'); 747 748 if (cookieModal.length) { 749 $('.js-accept-maximum-cookie').on('click', function (event) { 750 event.preventDefault(); 751 var activeConsents = JSON.parse(window.cookieAcceptMaximum); 752 activeConsents.show = false;
753 Cookies.set('active_consents', JSON.stringify(activeConsents), {expires: 30}); 754 cookieModal.hide(); 755 location.reload(); 756 }); 757 758 $('.js-accept-minimal-cookie').on('click', function (event) { 759 event.preventDefault(); 760 var activeConsents = JSON.parse(window.cookieAcceptMinimal); 761 activeConsents.show = false; 762 Cookies.set('active_consents', JSON.stringify(activeConsents), {expires: 30}); 763 cookieModal.hide(); 764 location.reload(); 765 }); 766 } 767} 768 769 770function googleMapLocations() { 771 if (window.hasOwnProperty('mapLocationsJson') && document.getElementById('map-locations') !== null) { 772 loadLocationsGoogleMapsScript(); 773 } 774} 775 776function loadLocationsGoogleMapsScript() { 777 var script = document.createElement('script'); 778 script.type = 'text/javascript'; 779 script.src = 'https://maps.googleapis.com/maps/api/js?key=&language=' + document.documentElement.lang + '&v=3&' + 'callback=initializeLocationsGoogleMaps'; 780 document.body.appendChild(script); 781} 782 783function initializeLocationsGoogleMaps() { 784 785 var googleMap = new google.maps.Map(document.getElementById('map-locations'), { 786 mapTypeId: google.maps.MapTypeId.ROADMAP, 787 disableAutoPan: false, 788 navigationControl: true, 789 mapTypeControl: false, 790 mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, 791 disableDefaultUI: true, 792 gestureHandling: 'cooperative', 793 styles: [ 794 { 795 "featureType": "administrative", 796 "elementType": "all", 797 "stylers": [ 798 { 799 "saturation": "-100" 800 } 801 ] 802 }, 803 { 804 "featureType": "administrative.province", 805 "elementType": "all", 806 "stylers": [ 807 { 808 "visibility": "off" 809 } 810 ] 811 }, 812 { 813 "featureType": "landscape", 814 "elementType": "all", 815 "stylers": [ 816 { 817 "saturation": -100 818 }, 819 { 820 "lightness": 65 821 }, 822 { 823 "visibility": "on" 824 } 825 ] 826 }, 827 { 828 "featureType": "poi", 829 "elementType": "all", 830 "stylers": [ 831 { 832 "saturation": -100 833 }, 834 { 835 "lightness": "50" 836 }, 837 { 838 "visibility": "simplified" 839 } 840 ] 841 }, 842 { 843 "featureType": "road", 844 "elementType": "all", 845 "stylers": [ 846 { 847 "saturation": "-100" 848 } 849 ] 850 }, 851 { 852 "featureType": "road.highway", 853 "elementType": "all", 854 "stylers": [ 855 { 856 "visibility": "simplified" 857 } 858 ] 859 }, 860 { 861 "featureType": "road.arterial", 862 "elementType": "all", 863 "stylers": [ 864 { 865 "lightness": "30" 866 } 867 ] 868 }, 869 { 870 "featureType": "road.local", 871 "elementType": "all", 872 "stylers": [ 873 { 874 "lightness": "40" 875 } 876 ] 877 }, 878 { 879 "featureType": "transit", 880 "elementType": "all", 881 "stylers": [ 882 { 883 "saturation": -100 884 }, 885 { 886 "visibility": "simplified" 887 } 888 ] 889 }, 890 { 891 "featureType": "water", 892 "elementType": "geometry", 893 "stylers": [ 894 { 895 "hue": "#ffff00" 896 }, 897 { 898 "lightness": -25 899 }, 900 { 901 "saturation": -97 902 } 903 ] 904 }, 905 { 906 "featureType": "water", 907 "elementType": "labels", 908 "stylers": [ 909 { 910 "lightness": -25 911 }, 912 { 913 "saturation": -100 914 } 915 ] 916 } 917 ] 918 }); 919 var bounds = new google.maps.LatLngBounds(); 920 var geocoder = new google.maps.Geocoder(); 921 var infowindow = new google.maps.InfoWindow(); 922 var pinIcon = new google.maps.MarkerImage(); 923 924 for (i = 0; i < window.mapLocationsJson.length; i++) { 925 926 var location = window.mapLocationsJson[i]; 927 var latlng = new google.maps.LatLng(location.latitude, location.longitude); 928 pinIcon.url = location.marker; 929 var mapMarker = new google.maps.Marker({ 930 position: latlng, 931 map: googleMap, 932 icon: pinIcon 933 }); 934 bounds.extend(mapMarker.position); 935 googleMap.fitBounds(bounds); 936 googleMap.panToBounds(bounds); 937 google.maps.event.addListener(mapMarker, 'click', (function (mapMarker, location) { 938 return function () { 939 infowindow.setContent(location.description); 940 infowindow.open(googleMap, mapMarker); 941 } 942 })(mapMarker, location)); 943 } 944 945 var listener = google.maps.event.addListener(googleMap, "idle", function () { 946 if (googleMap.getZoom() > 14) 947 googleMap.setZoom(14); 948 google.maps.event.removeListener(listener); 949 }); 950} 951 952var waitForFinalEvent = (function () { 953 var timers = {}; 954 return function (callback, ms, uniqueId) { 955 if (!uniqueId) { 956 uniqueId = "Don't call this twice without a uniqueId"; 957 } 958 if (timers[uniqueId]) { 959 clearTimeout(timers[uniqueId]); 960 } 961 timers[uniqueId] = setTimeout(callback, ms); 962 }; 963})(); 964 965; 966(function ($) { 967 /** 968 * jQuery function to prevent default anchor event and take the href 969 * and the title to make a share popup 970 * 971 * @param {[object]} e [Mouse event] 972 * @param {[integer]} intWidth [Popup width defalut 500] 973 * @param {[integer]} intHeight [Popup height defalut 400] 974 * @param {[boolean]} blnResize [Is popup resizeabel default true] 975 */ 976 $.fn.sharePopup = function (e, intWidth, intHeight, blnResize) { 977 978 // Prevent default anchor event 979 e.preventDefault(); 980 981 // Set values for window 982 intWidth = intWidth || '500'; 983 intHeight = intHeight || '400'; 984 strResize = (blnResize ? 'yes' : 'no'); 985 986 // Set title and open popup with focus on it
987 var strTitle = ((typeof this.attr('title') !== 'undefined') ? this.attr('title') : 'Social Share'), 988 strParam = 'width=' + intWidth + ',height=' + intHeight + ',resizable=' + strResize, 989 objWindow = window.open(this.attr('href'), strTitle, strParam).focus(); 990 } 991}(jQuery)); 992 993/*! Copyright 2012, Ben Lin (http://dreamerslab.com/) 994 * Licensed under the MIT License (LICENSE.txt). 995 * 996 * Version: 1.0.19 997 * 998 * Requires: jQuery >= 1.2.3 999 */ 1000(function (a) { 1001 if (typeof define === "function" && define.amd) { 1002 define(["jquery"], a); 1003 } else { 1004 a(jQuery); 1005 } 1006}(function (a) { 1007 a.fn.addBack = a.fn.addBack || a.fn.andSelf; 1008 a.fn.extend({ 1009 actual: function (b, l) { 1010 if (!this[b]) { 1011 throw'$.actual => The jQuery method "' + b + '" you called does not exist'; 1012 } 1013 var f = {absolute: false, clone: false, includeMargin: false, display: "block"}; 1014 var i = a.extend(f, l); 1015 var e = this.eq(0); 1016 var h, j; 1017 if (i.clone === true) { 1018 h = function () { 1019 var m = "position: absolute !important; top: -1000 !important; "; 1020 e = e.clone().attr("style", m).appendTo("body"); 1021 }; 1022 j = function () { 1023 e.remove(); 1024 }; 1025 } else { 1026 var g = []; 1027 var d = ""; 1028 var c; 1029 h = function () { 1030 c = e.parents().addBack().filter(":hidden"); 1031 d += "visibility: hidden !important; display: " + i.display + " !important; "; 1032 if (i.absolute === true) { 1033 d += "position: absolute !important; "; 1034 } 1035 c.each(function () { 1036 var m = a(this); 1037 var n = m.attr("style"); 1038 g.push(n); 1039 m.attr("style", n ? n + ";" + d : d); 1040 }); 1041 }; 1042 j = function () { 1043 c.each(function (m) { 1044 var o = a(this); 1045 var n = g[m]; 1046 if (n === undefined) { 1047 o.removeAttr("style"); 1048 } else { 1049 o.attr("style", n); 1050 } 1051 }); 1052 }; 1053 } 1054 h(); 1055 var k = /(outer)/.test(b) ? e[b](i.includeMargin) : e[b](); 1056 j(); 1057 return k; 1058 } 1059 }); 1060}));
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.