1/** 2 * File navigation.js. 3 * 4 * Handles toggling the navigation menu for small screens and enables TAB key 5 * navigation support for dropdown menus. 6 */ 7(function () { 8 const siteNavigation = document.getElementById('site-navigation'); 9 10 // Return early if the navigation doesn't exist. 11 if (!siteNavigation) { 12 return; 13 } 14 15 const button = siteNavigation.getElementsByTagName('button')[0]; 16 17 // Return early if the button doesn't exist. 18 if ('undefined' === typeof button) { 19 return; 20 } 21 22 const menu = siteNavigation.getElementsByTagName('ul')[0]; 23 24 // Hide menu toggle button if menu is empty and return early. 25 if ('undefined' === typeof menu) { 26 button.style.display = 'none'; 27 return; 28 } 29 30 if (!menu.classList.contains('nav-menu')) { 31 menu.classList.add('nav-menu'); 32 } 33 34 // Toggle the .toggled class and the aria-expanded value each time the button is clicked. 35 button.addEventListener('click', function () { 36 siteNavigation.classList.toggle('toggled'); 37 38 if (button.getAttribute('aria-expanded') === 'true') { 39 button.setAttribute('aria-expanded', 'false'); 40 } else { 41 button.setAttribute('aria-expanded', 'true'); 42 } 43 }); 44 45 // Remove the .toggled class and set aria-expanded to false when the user clicks outside the navigation. 46 document.addEventListener('click', function (event) { 47 const isClickInside = siteNavigation.contains(event.target); 48 49 if (!isClickInside) { 50 siteNavigation.classList.remove('toggled'); 51 button.setAttribute('aria-expanded', 'false'); 52 } 53 }); 54 55 // Get all the link elements within the menu. 56 const links = menu.getElementsByTagName('a'); 57 58 // Get all the link elements with children within the menu. 59 const linksWithChildren = menu.querySelectorAll('.menu-item-has-children > a, .page_item_has_children > a'); 60 61 // Toggle focus each time a menu link is focused or blurred. 62 for (const link of links) { 63 link.addEventListener('focus', toggleFocus, true); 64 link.addEventListener('blur', toggleFocus, true); 65 } 66 67 // Toggle focus each time a menu link with children receive a touch event. 68 for (const link of linksWithChildren) { 69 link.addEventListener('touchstart', toggleFocus, false); 70 } 71 72 /** 73 * Sets or removes .focus class on an element. 74 */ 75function toggleFocus(event) { 76 77 if (event.type === 'focus' || event.type === 'blur') { 78 let self = this; 79 // Move up through the ancestors of the current link until we hit .nav-menu. 80 while (!self.classList.contains('nav-menu')) { 81 // On li elements toggle the class .focus. 82 if ('li' === self.tagName.toLowerCase()) { 83 self.classList.toggle('focus'); 84 } 85 self = self.parentNode; 86 } 87 } 88 89 if (event.type === 'touchstart') { 90 const menuItem = this.parentNode; 91 event.preventDefault(); 92 for (const link of menuItem.parentNode.children) { 93 if (menuItem !== link) { 94 link.classList.remove('focus'); 95 } 96 } 97 menuItem.classList.toggle('focus'); 98 } 99 } 100}()); 101 102 103 104document.addEventListener("DOMContentLoaded", function (event) { 105 var selected = $('.drop-dl .current-lang img').attr('src'); 106 $('.lang-chose img').attr('src', selected); 107 108 $('.lang-chose').click(function (event) { 109 $('.drop-dl ul').slideToggle(500); 110 event.preventDefault(); 111 return false; 112 }); 113 114 $(document).bind('click', function (e) { 115 var $clicked = $(e.target); 116 if (!$clicked.parents().hasClass("drop-dl")) 117 $(".drop-dl ul").hide(); 118 }); 119}); 120 121$(document).ready(function () { 122 123 var teamGrid = $('.js-team-grid').isotope({ 124 itemSelector: '.js-team-grid-item', 125 layoutMode: 'packery', 126 packery: { 127 gutter: '.gutter-sizer', 128 } 129 130 }); 131 132 133 $('.js-close-details').on('click', function (e) { 134 e.preventDefault(); 135 var details = $(this).parent(); 136 $('.js-person') 137 .removeClass('active') 138 .end() 139 .toggleClass('active'); 140 details; 141 if (details.hasClass('active')) { 142 details 143 .removeClass('active') 144 .hide(); 145 } else { 146 details
147 .siblings('.person-details.active') 148 .removeClass('active') 149 .hide() 150 .end() 151 .addClass('active') 152 .fadeIn(); 153 } 154 teamGrid.isotope('layout'); 155 }); 156 157 $('.js-person').on('click', function (e) { 158 e.preventDefault(); 159 var details = $(this).next(); 160 161 $(this) 162 .siblings('.js-person') 163 .removeClass('active') 164 .end() 165 .toggleClass('active'); 166 details; 167 if (details.hasClass('active')) { 168 details 169 .removeClass('active') 170 .hide(); 171 $('.js-open-details').text('Learn More...').removeClass('red'); 172 173 } else { 174 details 175 .siblings('.person-details.active') 176 .removeClass('active') 177 .hide() 178 .end() 179 .addClass('active') 180 .fadeIn(); 181 $('.js-open-details').text('Learn More...').removeClass('red'); 182 $(this).find('.js-open-details').text('Close').addClass('red'); 183 184 } 185 teamGrid.isotope('layout'); 186 }); 187 188 189 $('.nav-tgl').click(function (event) { 190 $('.nav-tgl,.header-menu').toggleClass('active'); 191 $('body').toggleClass('lock'); 192 }); 193 194 // $('.header-menu .menu-item-has-children').after().click(function (event) { 195 196 // if ($(this).hasClass('open')) { 197 // $(this).removeClass('open').find('.sub-menu').slideUp(); 198 // } else { 199 // event.preventDefault(); 200 // $(this).addClass('open').find('.sub-menu').slideDown(); 201 // } 202 203 // }); 204 if ($(window).width() <= 1180) { 205 $('.header-menu .menu-item-has-children').click(function (event) { 206 207 if ($(this).hasClass('open')) { 208 $(this).removeClass('open').find('.sub-menu').slideUp(); 209 } else { 210 $(this).addClass('open').find('.sub-menu').slideDown(); 211 } 212 213 }); 214 } 215 216 $('.search .search-toggle').click(function (event) { 217 event.preventDefault(); 218 if ($(this).parent().hasClass('open')) { 219 $(this).parent().removeClass('open').find('.search-form').slideUp(); 220 } else { 221 $(this).parent().addClass('open').find('.search-form').slideDown(); 222 } 223 if ($('.user').hasClass('open')) { 224 $('.user').removeClass('open').find('.search-form').slideUp(); 225 } 226 }); 227 228 $('.user .user-toggle').click(function (event) { 229 event.preventDefault(); 230 if ($(this).parent().hasClass('open')) { 231 $(this).parent().removeClass('open').find('.user-form').slideUp(); 232 } else { 233 $(this).parent().addClass('open').find('.user-form').slideDown(); 234 } 235 if ($('.search').hasClass('open')) { 236 $('.search').removeClass('open').find('.search-form').slideUp(); 237 } 238 }); 239 240 241 //AJAX loadmore 242 243 244 $('#loadmore').click(function (e) { 245 e.preventDefault(); 246 247 // Don't execute on search page 248 if ($('.search-results-container').length > 0 || window.location.search.indexOf('s=') !== -1) { 249 return; 250 } 251 252 // Don't execute on WooCommerce shop pages 253 if ($('body').hasClass('woocommerce') || 254 $('body').hasClass('woocommerce-shop') || 255 $('body').hasClass('woocommerce-page') || 256 $('.woocommerce').length > 0 || 257 window.location.pathname.indexOf('/shop/') !== -1 || 258 window.location.pathname.indexOf('/product/') !== -1 || 259 window.location.pathname.indexOf('/cart/') !== -1 || 260 window.location.pathname.indexOf('/checkout/') !== -1 || 261 window.location.pathname.indexOf('/my-account/') !== -1) { 262 return; 263 } 264 265 var loaddata = { 266 'action': 'loadmore', 267 'id': $('.publications #loadmore').attr('data-id'), 268 'nonce': $('.publications #loadmore').attr('data-nonce'), 269 'show': $('.publications #loadmore').attr('data-show'), 270 }; 271 272 let show = $('.publications #loadmore').attr('data-show'); 273 let count = $('.publications #loadmore').attr('data-counter'); 274 $.ajax({ 275 url: my_ajax_object.ajax_url, 276 data: loaddata, 277 type: 'POST', 278 success: function (data) { 279 if (parseInt(show) < parseInt(count)) { 280 $('.publications #loadmore').attr('data-show', () => { 281 return parseInt(show) + 6; 282 }) 283 } else { 284 $('.publications #loadmore').hide(); 285 } 286 $('.publications-all').html(data); 287 } 288 }); 289 }); 290 291 $(document).ready(function () { 292 293 // Don't execute on search page 294 if ($('.search-results-container').length > 0 || window.location.search.indexOf('s=') !== -1) { 295 return; 296 } 297 298 if ($('.publications-all')) { 299 let show = 0; 300 if ($(window).width() < 767) { 301 show = 0; 302 } else { 303 show = 3; 304 } 305 306 var loaddata = { 307 'action': 'loadmore', 308 'id': $('.publications #loadmore').attr('data-id'), 309 'nonce': $('.publications #loadmore').attr('data-nonce'), 310 'show': show, 311 }; 312 313 setTimeout(function () { 314 $.ajax({ 315 url: my_ajax_object.ajax_url, 316 data: loaddata, 317 type: 'POST', 318 success: function (data) { 319 $('.publications-all').html(data); 320 } 321 }); 322 }, 1000); 323 324 } 325 }); 326 327 328 329 330 //AJAX loadmore BOOKS 331 var loaddataBooks = { 332 'action': 'loadmore-books', 333 'offset': 2, 334 }; 335 336 $('#loadmore-books').click(function (e) { 337 e.preventDefault(); 338 $(this).hide(); 339 $.ajax({ 340 url: my_ajax_object.ajax_url, 341 data: loaddataBooks, 342 type: 'POST', 343 success: function (data) { 344 $('.books-reviews').append(data); 345 } 346 }); 347 348 }); 349 350 351 352 353 //Accordion 354 $('.accordion-list > li > .answer').hide(); 355 356 $('.accordion-list > li .question').click(function () { 357 358 if ($(this).parent().hasClass("active")) { 359 $(this).parent().removeClass("active").find(".answer").slideUp(); 360 361 } else { 362 $(".accordion-list > li.active .answer").slideUp(); 363 $(".accordion-list > li.active").removeClass("active"); 364 $(this).parent().addClass("active").find(".answer").slideDown(); 365 } 366 return false;
367 }); 368 369 370 //POPUP 371 $('.popup-init').click(function (e) { 372 e.preventDefault(); 373 let $thisID = $(this).attr('href') 374 $($thisID).addClass('open'); 375 }); 376 377 $('.popup-close').click(function () { 378 $('.popup').removeClass('open'); 379 $('.speaker-popup').removeClass('open'); 380 }); 381 382 383 //Isotop Filter 384 $('.select-years-filter').change(function () { 385 let valThis = $(this).val(); 386 387 let $next = $('.isotop-filter ' + valThis); 388 if ($next.hasClass('hide-on-mobile-filter')) { 389 $next.removeClass('hide-on-mobile-filter') 390 $('.isotop-filter .interns-all').not($next).each(function () { 391 if (!$(this).hasClass('hide-on-mobile-filter')) { 392 $(this).addClass('hide-on-mobile-filter') 393 } 394 }); 395 } 396 397 }); 398 399 400 //Ajax filter 401 var dateBriefs = { 402 'action': 'filter-date', 403 'date': '', 404 }; 405 $('.accordion-inner ').click(function (e) { 406 $(this).toggleClass('open'); 407 if ($(this).next('.answer-inner').hasClass('open')) { 408 $(this).next('.answer-inner').slideUp().removeClass('open'); 409 } else { 410 $(this).next('.answer-inner').slideDown().addClass('open'); 411 } 412 }); 413 $('.briefs-filter-button').click(function (e) { 414 e.preventDefault(); 415 416 let dataFilter = $(this).attr('data-filter-date'); 417 let getParam = "?briyear=" + dataFilter; 418 window.history.pushState('', '', getParam); 419 420 if ($(window).width() < 770) { 421 $(this).toggleClass('open'); 422 423 if ($(this).next('.briefs-filter-accordion').hasClass('open')) { 424 $(this).next('.briefs-filter-accordion').slideUp().removeClass('open'); 425 } else { 426 $(this).next('.briefs-filter-accordion').slideDown().addClass('open'); 427 } 428 429 } else { 430 431 if ($(this).hasClass('open')) { 432 $(this).removeClass('open'); 433 } else { 434 $(this).addClass('open'); 435 $(this).prevAll('.briefs-filter-button').removeClass('open'); 436 $(this).nextAll('.briefs-filter-button').removeClass('open'); 437 } 438 439 let thisData = $(this).data('filter-date'); 440 dateBriefs['date'] = thisData; 441 $.ajax({ 442 url: my_ajax_object.ajax_url, 443 data: dateBriefs, 444 type: 'POST', 445 success: function (data) { 446 447 $('.brief-filter-ajax').html(data); 448 } 449 }); 450 } 451 452 }); 453 454 function briefGetAjax() { 455 456 let url = new URL(window.location.href); 457 let searchParams = new URLSearchParams(url.search.substring(1)); 458 let briyear = searchParams.get("briyear"); 459 460 if (briyear !== null) { 461 dateBriefs['date'] = briyear; 462 $.ajax({ 463 url: my_ajax_object.ajax_url, 464 data: dateBriefs, 465 type: 'POST', 466 success: function (data) { 467 468 $('.brief-filter-ajax').html(data); 469 } 470 }); 471 } 472 473 let button = $(`button[data-filter-date="${briyear}"]`); 474 475 button.prevAll('.briefs-filter-button').removeClass('open'); 476 button.nextAll('.briefs-filter-button').removeClass('open'); 477 button.addClass('open'); 478 } 479 480 481 //Ajax filter Case Law Corner 482 var dateCaseLaw = { 483 'action': 'filter-date-case-law', 484 'date': '', 485 }; 486 $('.accordion-inner-case-law ').click(function (e) { 487 $(this).toggleClass('open'); 488 if ($(this).next('.answer-inner-case-law').hasClass('open')) { 489 $(this).next('.answer-inner-case-law').slideUp().removeClass('open'); 490 } else { 491 $(this).next('.answer-inner-case-law').slideDown().addClass('open'); 492 } 493 }); 494 $('.case-law-corner-filter-button').click(function (e) { 495 e.preventDefault(); 496 497 let dataFilter = $(this).attr('data-filter-date'); 498 let getParam = "?caselaw=" + dataFilter; 499 window.history.pushState('', '', getParam); 500 501 if ($(window).width() < 770) { 502 $(this).toggleClass('open'); 503 504 if ($(this).next('.case-law-corner-filter-accordion').hasClass('open')) { 505 $(this).next('.case-law-corner-filter-accordion').slide
505Up().removeClass('open'); 506 } else { 507 $(this).next('.case-law-corner-filter-accordion').slideDown().addClass('open'); 508 } 509 510 } else { 511 512 if ($(this).hasClass('open')) { 513 $(this).removeClass('open'); 514 } else { 515 $(this).addClass('open'); 516 $(this).prevAll('.case-law-corner-filter-button').removeClass('open'); 517 $(this).nextAll('.case-law-corner-filter-button').removeClass('open'); 518 } 519 520 let thisData = $(this).data('filter-date'); 521 dateCaseLaw['date'] = thisData; 522 $.ajax({ 523 url: my_ajax_object.ajax_url, 524 data: dateCaseLaw, 525 type: 'POST', 526 success: function (data) { 527 528 $('.case-law-corner-filter-ajax').html(data); 529 } 530 }); 531 } 532 533 }); 534 535 function ÑaseLawGetAjax() { 536 537 let url = new URL(window.location.href); 538 let searchParams = new URLSearchParams(url.search.substring(1)); 539 let caselaw = searchParams.get("caselaw"); 540 541 if (caselaw !== null) { 542 dateCaseLaw['date'] = caselaw; 543 $.ajax({ 544 url: my_ajax_object.ajax_url, 545 data: dateCaseLaw, 546 type: 'POST', 547 success: function (data) { 548 549 $('.case-law-corner-filter-ajax').html(data); 550 } 551 }); 552 } 553 554 let button = $(`button[data-filter-date="${caselaw}"]`); 555 556 button.prevAll('.case-law-corner-filter-button').removeClass('open'); 557 button.nextAll('.case-law-corner-filter-button').removeClass('open'); 558 button.addClass('open'); 559 } 560 561 562 //Ajax filter Newsletters 563 var dateNewsletters = { 564 'action': 'filter-date-newsletters', 565 'date': '', 566 'number': 'all', 567 }; 568 569 $('.newsletters-filter-button').click(function (e) { 570 e.preventDefault(); 571 572 let dataFilter = $(this).attr('data-filter-date'); 573 let getParam = "?newsletter=" + dataFilter; 574 window.history.pushState('', '', getParam); 575 576 if ($(window).width() < 770) { 577 578 } else { 579 580 if ($(this).hasClass('open')) { 581 $(this).removeClass('open'); 582 } else { 583 $(this).addClass('open'); 584 $(this).prevAll('.newsletters-filter-button').removeClass('open'); 585 $(this).nextAll('.newsletters-filter-button').removeClass('open'); 586 } 587 588 let thisData = $(this).data('filter-date'); 589 dateNewsletters['date'] = thisData; 590 $.ajax({ 591 url: my_ajax_object.ajax_url, 592 data: dateNewsletters, 593 type: 'POST', 594 success: function (data) { 595 596 $('.newsletters-filter-ajax-desctop').html(data); 597 } 598 }); 599 } 600 601 }); 602 603 function newslatterGetAjax() { 604 605 let url = new URL(window.location.href); 606 let searchParams = new URLSearchParams(url.search.substring(1)); 607 let newslatter = searchParams.get("newsletter"); 608 609 if (newslatter !== null) { 610 dateNewsletters['date'] = newslatter; 611 $.ajax({ 612 url: my_ajax_object.ajax_url, 613 data: dateNewsletters, 614 type: 'POST', 615 success: function (data) { 616 617 $('.newsletters-filter-ajax-desctop').html(data); 618 } 619 }); 620 } 621 622 let button = $(`button[data-filter-date="${newslatter}"]`); 623 624 button.prevAll('.newsletters-filter-button').removeClass('open'); 625 button.nextAll('.newsletters-filter-button').removeClass('open'); 626 button.addClass('open'); 627 } 628 629 $('#newsletters-filter-select').on('change', function (e) { 630 e.preventDefault(); 631 dateNewsletters['number'] = 5; 632 $('.newsletters-filter-button').addClass('active-date') 633 let thisDate = $(this).val(); 634 dateNewsletters['date'] = thisDate; 635 636 $.ajax({ 637 url: my_ajax_object.ajax_url, 638 data: dateNewsletters, 639 type: 'POST', 640 success: function (data) { 641 642 $('.newsletters-filter-ajax-mobile').html(data); 643 } 644 }); 645 646 647 }); 648 let $currentYear = new Date().getFullYear(); 649 650 651 652 //Load more Newsletters 653 var loaddataNewsletters = {
654 'action': 'loadmore-newsletters', 655 'offset': 5, 656 'date': $currentYear, 657 'number': 5, 658 }; 659 660 $(document).on('click', '#loadmore-newsletters', function (e) { 661 e.preventDefault(); 662 if ($(window).width() < 767) { 663 if ($('#newsletters-filter-select').length) { 664 loaddataNewsletters.date = $('#newsletters-filter-select').val(); 665 666 } 667 668 } 669 670 $(this).parent().hide(); 671 672 $.ajax({ 673 url: my_ajax_object.ajax_url, 674 data: loaddataNewsletters, 675 type: 'POST', 676 success: function (data) { 677 678 $('.newsletters-all').append(data); 679 } 680 }); 681 682 }); 683 684 function addQueryParameter(key, value) { 685 const url = new URL(window.location.href); 686 url.searchParams.set(key, value); 687 window.history.pushState({}, '', url.toString()); 688 }; 689 690 691 //Ajax filter Events 692 var dateEvents = { 693 'action': 'filter-date-events', 694 'date': '', 695 'types': '', 696 }; 697 698 function eventsGetAjax() { 699 700 let url = new URL(window.location.href); 701 let searchParams = new URLSearchParams(url.search); 702 703 let year = null; 704 let type = null; 705 706 if (searchParams) { 707 year = searchParams.get("event_year"); 708 type = searchParams.get("type_event"); 709 } 710 711 if ($('.events-archive-ajax').length !== 0) { 712 if (year !== null || type !== null) { 713 year = year !== null ? year : new Date().getFullYear(); 714 type = type !== null ? type : ''; 715 716 dateEvents['date'] = year; 717 dateEvents['types'] = type; 718 719 $.ajax({ 720 url: my_ajax_object.ajax_url, 721 data: dateEvents, 722 type: 'POST', 723 success: function (data) { 724 $('.events-archive-ajax').html(data); 725 } 726 }); 727 728 let yearButton = $(`.events-archive-button[data-filter-date="${year}"]`); 729 let typeButton = $(`.filter-button[data-filter-tag="${type}"]`); 730 731 $('.events-archive-button').removeClass('active-date'); 732 yearButton.addClass('active-date'); 733 734 $('.filter-button').removeClass('is-active'); 735 typeButton.addClass('is-active'); 736 737 // sessionStorage.clear(); 738 } 739 740 741 } 742 } 743 744 745 $('.events-archive-button').click(function (e) { 746 e.preventDefault(); 747 if ($(window).width() < 770) { 748 749 } else { 750 $('.events-archive-button.active-date').removeClass('active-date'); 751 $('.events-archive-ajax').addClass('loading'); 752 $(this).addClass('active-date'); 753 let thisDate = $(this).data('filter-date'); 754 $('#events-archive-filter').val(thisDate); 755 dateEvents['date'] = thisDate; 756 757 let $tag = $('.events-types-filter .filter-button.is-active').attr('data-filter-tag'); 758 dateEvents['types'] = $tag; 759 760 sessionStorage.setItem('event_year', thisDate); 761 addQueryParameter('event_year', thisDate); 762 763 $.ajax({ 764 url: my_ajax_object.ajax_url, 765 data: dateEvents, 766 type: 'POST', 767 success: function (data) { 768 769 $('.events-archive-ajax').removeClass('loading'); 770 $('.events-archive-ajax').html(data); 771 } 772 }); 773 } 774 775 }); 776 777 $('#events-archive-filter').on('change', function (e) { 778 e.preventDefault(); 779 780 $('.events-archive-ajax').addClass('loading'); 781 let thisDate = $(this).val(); 782 dateEvents['date'] = thisDate; 783 $('.events-archive-button.active-date').removeClass('active-date'); 784 $(`.events-archive-button[data-filter-date=${thisDate}]`).addClass('active-date'); 785 786 // addQueryParameter('year', thisDate); 787 sessionStorage.setItem('year', thisDate); 788 789 let $tag = $('.events-types-filter .filter-button.is-active').attr('data-filter-tag'); 790 dateEvents['types'] = $tag; 791 792 $.ajax({ 793 url: my_ajax_object.ajax_url, 794 data: dateEvents, 795 type: 'POST', 796 success: function (data) { 797 798 $('.events-archive-ajax').html(data); 799 $('.events-archive-ajax').removeClass('loading'); 800 } 801 }); 802 803 804 }); 805 806 807 $('.events-types-filter').on('click', '.filter-button', function (e) { 808 e.preventDefault(); 809 $('.events-types-filter .filter-button').removeClass('is-active'); 810 $('.events-archive-ajax').addClass('loading'); 811 812 $(this).addClass('is-active'); 813 let $tag = $(this).attr('data-filter-tag'); 814 dateEvents['types'] = $tag; 815 816 addQueryParameter('type_event', $tag); 817 sessionStorage.setItem('type_event', $tag); 818 819 let thisDate = $('.events-archive-button.active-date').attr('data-filter-date'); 820 dateEvents['date'] = thisDate; 821 822 $.ajax({ 823 url: my_ajax_object.ajax_url, 824 data: dateEvents, 825 type: 'POST', 826 success: function (data) { 827 828 $('.events-archive-ajax').html(data); 829 $('.events-archive-ajax').removeClass('loading'); 830 } 831 }); 832 833 834 }); 835 836 837 //Load more Events 838 var loaddataEvent = { 839 'action': 'loadmore-event', 840 'offset': 6, 841 'date': 2022, 842 }; 843 844 $(document).on('click', '#loadmore-events', function (e) { 845 e.preventDefault(); 846 $('#loadmore-events').text('Loading...'); 847 $('.events-archive-ajax').addClass('loading'); 848 849 if ($(window).width() < 767) { 850 if ($('#events-archive-filter').length) { 851 loaddataEvent.date = $('#events-archive-filter').val(); 852 853 } 854 855 } else { 856 857 if ($('.active-date').length) { 858 loaddataEvent.date = $('.active-date').data('filter-date'); 859 } 860 } 861 862 $.ajax({ 863 url: my_ajax_object.ajax_url, 864 data: loaddataEvent, 865 type: 'POST', 866 success: function (data) { 867 868 $('#loadmore-events').parent().hide(); 869 $('.events-archive-ajax').removeClass('loading'); 870 $('#loadmore-events').text('View more'); 871 $('.events-archive-all').append(data); 872 } 873 }); 874 875 }); 876 877 878 //Slider Events All 879 880 881 //Articles Slider 882 883 jQuery(document).ready(function () { 884 jQuery('.events-all-slider').each(function () { 885 let $prev = jQuery(this).parents('.events-all').find('.prev'); 886 let $next = jQuery(this).parents('.events-all').find('.next'); 887 888 889 if ($prev.length && $next.length) { 890 jQuery(this).slick({ 891 dots: false, 892 arrows: true, 893 autoplay: false, 894 autoplaySpeed: 2000,
895 infinite: true, 896 prevArrow: $prev, 897 nextArrow: $next, 898 speed: 500, 899 slidesToShow: 3, 900 slidesToScroll: 1, 901 responsive: [{ 902 breakpoint: 1024, 903 settings: { 904 slidesToShow: 2, 905 slidesToScroll: 1, 906 } 907 }, 908 { 909 breakpoint: 769, 910 settings: { 911 variableWidth: true, 912 slidesToShow: 1, 913 slidesToScroll: 1, 914 } 915 }, 916 ] 917 }); 918 } 919 }); 920 921 jQuery('.case-law-featured-slider').each(function () { 922 let $prev = jQuery(this).parents('.case-law-featured').find('.prev'); 923 let $next = jQuery(this).parents('.case-law-featured').find('.next'); 924 925 926 if ($prev.length && $next.length) { 927 jQuery(this).slick({ 928 dots: false, 929 arrows: true, 930 autoplay: false, 931 autoplaySpeed: 2000, 932 infinite: true, 933 prevArrow: $prev, 934 nextArrow: $next, 935 speed: 500, 936 slidesToShow: 3, 937 slidesToScroll: 1, 938 responsive: [{ 939 breakpoint: 1024, 940 settings: { 941 slidesToShow: 2, 942 slidesToScroll: 1, 943 } 944 }, 945 { 946 breakpoint: 769, 947 settings: { 948 variableWidth: true, 949 slidesToShow: 1, 950 slidesToScroll: 1, 951 } 952 }, 953 ] 954 }); 955 } 956 }); 957 958 jQuery('.case-law-last-slider').each(function () { 959 let $prev = jQuery(this).parents('.case-law-featured').find('.prev'); 960 let $next = jQuery(this).parents('.case-law-featured').find('.next'); 961 962 963 if ($prev.length && $next.length) { 964 jQuery(this).slick({ 965 dots: false, 966 arrows: true, 967 autoplay: false, 968 autoplaySpeed: 2000, 969 infinite: true, 970 prevArrow: $prev, 971 nextArrow: $next, 972 speed: 500, 973 slidesToShow: 2, 974 slidesToScroll: 1, 975 responsive: [{ 976 breakpoint: 1024, 977 settings: { 978 slidesToShow: 2, 979 slidesToScroll: 1, 980 } 981 }, 982 { 983 breakpoint: 769, 984 settings: { 985 variableWidth: true, 986 slidesToShow: 1, 987 slidesToScroll: 1, 988 } 989 }, 990 ] 991 }); 992 } 993 }); 994 995 }); 996 997 998 //Clinick Events Slider 999 jQuery('.clinic-events-slider').each(function (item) { 1000 jQuery(this).slick({ 1001 dots: false, 1002 arrows: true, 1003 autoplay: false, 1004 autoplaySpeed: 2000, 1005 infinite: true, 1006 prevArrow: jQuery(this).parents('.clinic-events').find('.prev'), 1007 nextArrow: jQuery(this).parents('.clinic-events').find('.next'), 1008 speed: 500, 1009 slidesToShow: 2, 1010 slidesToScroll: 1, 1011 adaptiveHeight: true, 1012 responsive: [{ 1013 breakpoint: 1024, 1014 settings: { 1015 slidesToShow: 2, 1016 slidesToScroll: 1, 1017 } 1018 }, 1019 { 1020 breakpoint: 769, 1021 settings: "unslick" 1022 }, 1023 ] 1024 }); 1025 }) 1026 1027 1028 1029 1030 1031 1032 //Recognition Slider 1033 if ($(window).width() < 576) { 1034 if (jQuery(window).width() < 576) {
1035 jQuery('.recognition-slider').slick({ 1036 dots: false, 1037 arrows: true, 1038 prevArrow: $('.prev-button'), 1039 nextArrow: $('.next-button'), 1040 autoplay: false, 1041 autoplaySpeed: 2000, 1042 infinite: true, 1043 speed: 500, 1044 responsive: [ 1045 1046 { 1047 breakpoint: 577, 1048 settings: { 1049 variableWidth: true, 1050 slidesToShow: 2, 1051 slidesToScroll: 1, 1052 1053 } 1054 }, 1055 ] 1056 1057 }); 1058 1059 } 1060 } 1061 jQuery(window).on('resize', function () { 1062 if (jQuery(window).width() < 576) { 1063 jQuery('.recognition-slider').slick({ 1064 dots: false, 1065 arrows: true, 1066 prevArrow: $('.prev-button'), 1067 nextArrow: $('.next-button'), 1068 autoplay: false, 1069 autoplaySpeed: 2000, 1070 infinite: true, 1071 speed: 500, 1072 responsive: [ 1073 1074 { 1075 breakpoint: 577, 1076 settings: { 1077 variableWidth: true, 1078 slidesToShow: 2, 1079 slidesToScroll: 1, 1080 1081 } 1082 }, 1083 ] 1084 1085 }); 1086 1087 } else { 1088 jQuery('.recognition-slider').slick('unslick'); 1089 1090 } 1091 }); 1092 1093 1094 //Gallery Slider 1095 jQuery('.gallery-slider ').slick({ 1096 dots: true, 1097 arrows: false, 1098 autoplay: false, 1099 autoplaySpeed: 2000, 1100 infinite: true, 1101 1102 speed: 500, 1103 slidesToShow: 1, 1104 slidesToScroll: 1, 1105 1106 }); 1107 1108 1109 1110 1111 // safe last open Ajax 1112 $(document).ready(function () { 1113 1114 if ($('.briefs')) { 1115 briefGetAjax(); 1116 } 1117 if ($('.case-law-corner')) { 1118 ÑaseLawGetAjax(); 1119 } 1120 if ($('.newsletters')) { 1121 newslatterGetAjax(); 1122 } 1123 1124 if ($('.events-archive-posts')) { 1125 eventsGetAjax(); 1126 } 1127 }); 1128 1129 function addSearchAnimation() { 1130 // Removed - form now submits naturally without JavaScript interception 1131 // This allows instant redirect to search page instead of AJAX loading 1132 } 1133 1134 function calcScroll() { 1135 let div = document.createElement('div'); 1136 1137 div.style.width = '50px'; 1138 div.style.height = '50px'; 1139 div.style.overflowY = 'scroll'; 1140 div.style.visibility = 'hidden'; 1141 1142 document.body.appendChild(div); 1143 let scrollWidth = div.offsetWidth - div.clientWidth; 1144 div.remove(); 1145 1146 return scrollWidth; 1147 } 1148 1149 function togglePopup(list, card) { 1150 const scroll = calcScroll(); 1151 let scrollDistance = 0; 1152 1153 jQuery(list).on('click', '.button-cite', function (event) { 1154 event.preventDefault(); 1155 scrollDistance = window.scrollY; 1156 jQuery(this).parents(card).find('.pop-up').fadeIn(); 1157 jQuery('body').addClass('lock'); 1158 jQuery('body').css('marginRight', `${scroll}px`); 1159 1160 jQuery('body').css("top", scrollDistance * -1); 1161 }); 1162 1163 1164 jQuery(list).on('click', '.pop-up-close', function (event) { 1165 event.preventDefault(); 1166 1167 jQuery(this).parents('.pop-up').fadeOut(); 1168 jQuery('body').removeClass('lock'); 1169 jQuery('body').css('marginRight', '0px'); 1170 jQuery('body').css("top", ""); 1171 jQuery(window).scrollTop(scrollDistance); 1172 }); 1173 1174 jQuery(list).on('click', '.pop-up', function () { 1175 jQuery(this).fadeOut(); 1176 jQuery('body').removeClass('lock'); 1177 jQuery('body').css('marginRight', '0px'); 1178 jQuery('body').css("top", ""); 1179 jQuery(window).scrollTop(scrollDistance); 1180 }); 1181 1182 jQuery(list).on('click', '.pop-up-content', function (event) { 1183 event.stopPropagation(); 1184 }); 1185 } 1186 1187 function toggleFilterItems() { 1188 jQuery('.filter-dropdown__toggle').on('click', function (event) { 1189 event.preventDefault();
1190 let $this = jQuery(this); 1191 1192 $this.toggleClass('hide'); 1193 $this.parents('.filter-dropdown').next().slideToggle(); 1194 }); 1195 } 1196 1197 function toggleMobileFilters() { 1198 let scrollDistance = 0; 1199 1200 function openFilter() { 1201 scrollDistance = window.pageYOffset; 1202 jQuery('body').css("top", scrollDistance * -1); 1203 jQuery('.main-filters').fadeIn(); 1204 jQuery('body').addClass('lock'); 1205 jQuery('.filter-overlay').addClass('active'); 1206 } 1207 1208 function closeFilter() { 1209 jQuery('.main-filters').fadeOut(); 1210 jQuery('body').removeClass('lock'); 1211 jQuery('.filter-overlay').removeClass('active'); 1212 jQuery('body').css("top", ""); 1213 jQuery(window).scrollTop(scrollDistance); 1214 } 1215 1216 jQuery('.open-filters').on('click', openFilter); 1217 jQuery('.filters-close').on('click', closeFilter); 1218 jQuery('#apply-filters').on('click', closeFilter); 1219 1220 } 1221 1222 1223 function scrollToTop(element) { 1224 const adminBar = jQuery('#wpadminbar'); 1225 const adminBarHeight = adminBar.length > 0 ? adminBar.outerHeight() : 0; 1226 1227 jQuery('html, body').animate({ 1228 scrollTop: jQuery(element).offset().top - adminBarHeight 1229 }, 'slow'); 1230 } 1231 1232 1233 function addAttributeToNav() { 1234 const mainNavItems = document.querySelectorAll('#menu-header-menu > .menu-item > a'); 1235 mainNavItems.forEach(nav => { 1236 let href = nav.getAttribute('href'); 1237 if (!href) { 1238 nav.setAttribute('href', 'javascript:void(0);'); 1239 } 1240 }); 1241 } 1242 1243 function addReadMore(trigger, maxChar) { 1244 const readMoreTxt = " ... Read More"; 1245 const readLessTxt = " Read Less"; 1246 1247 //Traverse all selectors with this class and manupulate HTML part to show Read More 1248 $(trigger).each(function () { 1249 if ($(this).find(".firstSec").length) 1250 return; 1251 1252 var allstr = $(this).text(); 1253 if (allstr.length > maxChar) { 1254 var firstSet = allstr.substring(0, maxChar); 1255 var secdHalf = allstr.substring(maxChar, allstr.length); 1256 var strtoadd = firstSet + "<span class='SecSec'>" + secdHalf + "</span><span class='readMore' title='Click to Show More'>" + readMoreTxt + "</span><span class='readLess' title='Click to Show Less'>" + readLessTxt + "</span>"; 1257 $(this).html(strtoadd); 1258 } 1259 1260 }); 1261 //Read More and Read Less Click Event binding 1262 $(document).on("click", ".readMore,.readLess", function () { 1263 $(this).closest(trigger).toggleClass("showlesscontent showmorecontent"); 1264 }); 1265 } 1266 1267 function customReadMore(trigger, button, content) { 1268 jQuery(trigger).on('click', button, function () { 1269 1270 if (jQuery(this).hasClass('read-less')) { 1271 jQuery(this).removeClass('read-less').siblings(content).slideUp(); 1272 jQuery(this).text('Read more'); 1273 1274 } else { 1275 jQuery(content).slideUp(); 1276 jQuery('.read-less').removeClass('read-less').text('Read more'); 1277 jQuery(this).addClass('read-less').siblings(content).slideDown(); 1278 jQuery(this).text('Read less'); 1279 } 1280 return false; 1281 }); 1282 } 1283 1284 1285 1286 1287 function initPublicationsFilters() { 1288 1289 function fetchPublicationsSearch() { 1290 1291 jQuery.ajax({ 1292 url: my_ajax_object.ajax_url, 1293 type: 'post', 1294 data: { 1295 action: 'publications_data_fetch', 1296 keyword: jQuery('#publications-search input[type="search"]').val() 1297 }, 1298 success: function (data) { 1299 jQuery('#publicationsResults').html(data); 1300 } 1301 }); 1302 } 1303 1304 function filterPublications() { 1305 let postsPerPage = +jQuery('.publications-list').attr('data-show'); 1306 let s = jQuery('#publications-search').find('input[type="search"]').val(); 1307 let page = +jQuery(this).attr('data-page') || 1; 1308 let categories = []; 1309 let types = []; 1310 let authors = []; 1311 let dates = []; 1312 let acceptances = []; 1313 1314 1315 1316 jQuery('#categoriesFilter input:checked').each(function () { 1317 categories.push(jQuery(this).val()); 1318 }); 1319 jQuery('#typesFilter input:checked').each(function () { 1320 types.push(jQuery(this).val()); 1321 }); 1322 jQuery('#authorsFilter input:checked').each(function () { 1323 authors.push(jQuery(this).val()); 1324 }); 1325 jQuery('#datesFilter input:checked').each(function () { 1326 dates.push(jQuery(this).val()); 1327 }); 1328 jQuery('#acceptanceFilter input:checked').each(function () { 1329 acceptances.push(jQuery(this).val()); 1330 }); 1331 1332 if (s) { 1333 let getParam = "?t=" + s; 1334 window.history.pushState('', '', getParam); 1335 } else { 1336 window.history.pushState('', '', '?'); 1337 } 1338 1339 jQuery('.publications-list').addClass('loading'); 1340 jQuery('.filters').addClass('loading'); 1341 jQuery('.filters input').attr('disabled', true); 1342 jQuery('.fiter-header button').prop('disabled', true); 1343 1344 let data = { 1345 action: 'filter_publications', 1346 nonce: my_ajax_object.nonce, 1347 page: page, 1348 posts_per_page: postsPerPage, 1349 s: s, 1350 categories: categories, 1351 types: types, 1352 authors: authors, 1353 dates: dates, 1354 acceptances: acceptances, 1355 }; 1356 1357 1358 jQuery.post(my_ajax_object.ajax_url, data, function (response) { 1359 jQuery('.publications-list').html(response.content); 1360 jQuery('.publications-results__count span').html(response.found_results); 1361 jQuery('.publications-list').removeClass('loading'); 1362 jQuery('.filters').removeClass('loading'); 1363 jQuery('.filters input').removeAttr('disabled'); 1364 jQuery('.fiter-header button').prop('disabled', false); 1365 getAllFilters(); 1366 }); 1367 } 1368 1369 function getAllFilters() { 1370 const activeFilters = jQuery('.active-filters'); 1371 1372 let categories = []; 1373 let types = []; 1374 let authors = []; 1375 let dates = []; 1376 let allFilters = []; 1377 let acceptances = []; 1378 1379 1380 jQuery('#categoriesFilter input:checked').each(function () { 1381 categories.push(jQuery(this).data('value')); 1382 }); 1383 jQuery('#typesFilter input:checked').each(function () { 1384 types.push(jQuery(this).data('value')); 1385 }); 1386 jQuery('#authorsFilter input:checked').each(function () { 1387 authors.push(jQuery(this).data('value')); 1388 }); 1389 jQuery('#datesFilter input:checked').each(function () { 1390 dates.push(jQuery(this).data('value')); 1391 }); 1392 jQuery('#acceptanceFilter input:checked').each(function () { 1393 acceptances.push(jQuery(this).data('value')); 1394 }); 1395 1396 allFilters = [...categories, ...types, ...authors, ...dates]; 1397 1398 const allFiltersItems = allFilters.map(item => { 1399 return ` 1400 <div class="active-filter-item">
1401 <span>${item}</span> 1402 <button class="active-filter-item-close" type="button"></button> 1403 </div>`; 1404 }); 1405 1406 activeFilters.html(allFiltersItems); 1407 } 1408 1409 function getUrlParams() { 1410 const section = document.querySelector('.publications-archive'); 1411 1412 if (!section) { 1413 return; 1414 } 1415 const searchInput = section.querySelector('#s'); 1416 1417 let searchParams = new URL(document.location).searchParams; 1418 let searchValue = searchParams.get('t'); 1419 1420 if (searchValue !== null) { 1421 if (searchInput) { 1422 searchInput.value = searchValue; 1423 } 1424 1425 section.scrollIntoView({ 1426 behavior: 'smooth' 1427 }); 1428 1429 filterPublications(); 1430 } 1431 }; 1432 1433 jQuery('.active-filters').on('click', '.active-filter-item-close', function (e) { 1434 e.preventDefault(); 1435 1436 const value = jQuery(this).parent().find('span').text(); 1437 1438 jQuery(this).parent().remove(); 1439 jQuery('.publications-filters').find(`input:checkbox[data-value='${value}']`).prop('checked', false); 1440 filterPublications(); 1441 }); 1442 1443 jQuery('.publications-results').on('click', '.navigation-menu a:not(.disabled)', function (e) { 1444 e.preventDefault(); 1445 const elementToScroll = jQuery('.publications-results-wrapper'); 1446 scrollToTop(elementToScroll); 1447 1448 jQuery('.publications-list').addClass('loading'); 1449 jQuery('.filters').addClass('loading'); 1450 jQuery('.filters input').attr('disabled', true); 1451 jQuery('.fiter-header button').prop('disabled', true); 1452 1453 let page = +jQuery(this).attr('data-page'); 1454 let postsPerPage = +jQuery('.publications-list').attr('data-show'); 1455 let s = jQuery('#publications-search').find('input[type="search"]').val(); 1456 let categories = []; 1457 let types = []; 1458 let authors = []; 1459 let dates = []; 1460 let acceptances = []; 1461 1462 jQuery('#categoriesFilter input:checked').each(function () { 1463 categories.push(jQuery(this).val()); 1464 }); 1465 jQuery('#typesFilter input:checked').each(function () { 1466 types.push(jQuery(this).val()); 1467 }); 1468 jQuery('#authorsFilter input:checked').each(function () { 1469 authors.push(jQuery(this).val()); 1470 }); 1471 jQuery('#datesFilter input:checked').each(function () { 1472 dates.push(jQuery(this).val()); 1473 }); 1474 jQuery('#acceptanceFilter input:checked').each(function () { 1475 acceptances.push(jQuery(this).val()); 1476 }); 1477 1478 1479 if (s) { 1480 let getParam = "?t=" + s; 1481 window.history.pushState('', '', getParam); 1482 } else { 1483 window.history.pushState('', '', '?'); 1484 } 1485 1486 let data = { 1487 action: 'filter_publications', 1488 nonce: my_ajax_object.nonce, 1489 page: page, 1490 posts_per_page: postsPerPage, 1491 s: s, 1492 categories: categories, 1493 types: types, 1494 authors: authors, 1495 dates: dates, 1496 acceptances: acceptances, 1497 }; 1498 1499 jQuery.post(my_ajax_object.ajax_url, data, function (response) { 1500 jQuery('.publications-list').html(response.content); 1501 jQuery('.publications-results__count span').html(response.found_results); 1502 jQuery('.publications-list').removeClass('loading'); 1503 jQuery('.filters').removeClass('loading'); 1504 jQuery('.filters input').removeAttr('disabled'); 1505 jQuery('.fiter-header button').prop('disabled', false); 1506 getAllFilters(); 1507 }); 1508 }); 1509 1510 jQuery('#publications-search').on('submit', function (e) { 1511 e.preventDefault(); 1512 filterPublications(); 1513 }); 1514 1515 jQuery('#publications-search input[type="search"]').on('search', function (e) { 1516 e.preventDefault(); 1517 filterPublications(); 1518 jQuery('#publicationsResults').html(''); 1519 1520 }); 1521 1522 jQuery('.filters').on('change', '.check-box-label input', function () { 1523 1524 if (jQuery(window).width() > 992) { 1525 filterPublications(); 1526 } 1527 }); 1528 1529 jQuery('#clear-filters').click(function () { 1530 jQuery('.filters input:checkbox').prop('checked', false); 1531 filterPublications(); 1532 }); 1533 1534 jQuery('#apply-filters').click(function () { 1535 filterPublications(); 1536 }); 1537 1538 jQuery('#publications-search input[type="search"]').on('keyup', function (event) { 1539 if (event.keyCode === 13 || event.keyCode === 27) { 1540 jQuery('#publicationsResults').html(''); 1541 } else { 1542 fetchPublicationsSearch(); 1543 } 1544 1545 }); 1546 1547 jQuery('#publicationsResults').on('click', 'li', function () { 1548 let value = jQuery(this).text(); 1549 jQuery('#publications-search input[type="search"]').val(value); 1550 jQuery('#publicationsResults').html(''); 1551 1552 filterPublications(); 1553 }); 1554 1555 jQuery('body').on('click', function () { 1556 jQuery('#publicationsResults').html(''); 1557 }); 1558 1559 getUrlParams(); 1560 } 1561 1562 1563 toggleFilterItems() 1564 toggleMobileFilters(); 1565 1566 addAttributeToNav(); 1567 addSearchAnimation(); 1568 1569 initPublicationsFilters(); 1570 togglePopup('.case-law-list', '.case-law-card'); 1571 togglePopup('.publications-list', '.publication-item');
1572 addReadMore('.publication-card-description', 280); 1573 1574 customReadMore('.publications-archive', '.publication-read-more', '.publication-item-content'); 1575 customReadMore('.form', '.read-more-btn', '.content__gdprLegal'); 1576 1577 AOS.init({ 1578 duration: 1000, // values from 0 to 3000, with step 50ms 1579 easing: 'ease' 1580 }); 1581});
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.