1/*----------------------------------------------------------------------------------- 2 3 Theme Name: Leesburg, FL 4 Front-end developer: Raju Paul 5 Author Design: Jade Wang 6 Author URI: http://www.revize.com/ 7 Date: 07/31/2023 8 9-----------------------------------------------------------------------------------*/ 10 11(function ($) { 12 "use strict"; 13 14 var $window = $(window), 15 $body = $("body"); 16 17 /*! 18 * IE10 viewport hack for Surface/desktop Windows 8 bug 19 * Copyright 2014-2015 Twitter, Inc. 20 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 21 */ 22 23 // See the Getting Started docs for more information: 24 // http://getbootstrap.com/getting-started/#support-ie10-width 25 if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 26 var msViewportStyle = document.createElement("style"); 27 msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")); 28 document.querySelector("head").appendChild(msViewportStyle); 29 } 30 31 // RZ Class 32 if (typeof RZ !== "undefined") { 33 if (RZ.login) { 34 $body.addClass("user-logged-in"); 35 } else { 36 $body.addClass("user-not-logged-in"); 37 } 38 } 39 40 // Clone icons to each navigation link/span 41 $("#navicons li").each(function () { 42 var navIconIndex = $(this).index(); 43 $(this).find("img").prependTo($("#nav>li").eq(navIconIndex).children("a,span")); 44 }); 45 46 // Create live region for nav announcements on page load 47 $(document).ready(function () { 48 if (!$("#nav-announcement").length) { 49 $("body").append('<div id="nav-announcement" aria-live="polite" class="sr-only"></div>'); 50 } 51 }); 52 53 // Set aria-label for dynamically loaded accessibility widget label 54 function setAccessibilityWidgetLabel() { 55 var $label = $("#panel-font-size-normal-long label"); 56 if ($label.length) { 57 $label.attr("aria-label", "Accessibility Widget"); 58 return true; 59 } 60 return false; 61 } 62 63 // Try immediately in case it's already present 64 if (!setAccessibilityWidgetLabel()) { 65 // Observe DOM changes to set the label when it appears 66 const accWidgetObserver = new MutationObserver(function () { 67 if (setAccessibilityWidgetLabel()) { 68 accWidgetObserver.disconnect(); 69 } 70 }); 71 accWidgetObserver.observe(document.body, { childList: true, subtree: true }); 72 } 73 74 // Keyboard Navigation: Nav, flyout 75 var isClick = false; 76 $("#nav li a, #flyout li a, a, button, .toggle, .toggle2").on("focusin", function (e) { 77 if (isClick === false) { 78 $(".focused").removeClass("focused"); 79 $(e.currentTarget).parents("#nav li, #flyout li").addClass("focused"); 80 81 // Add a slight delay before closing menus to allow for announcement 82 if ($(".opened:not(.focused) ul:visible:not(.level2),.opened2:not(.focused) ul:visible").length) { 83 // First announce the collapse 84 $("#nav-announcement").text("Menu collapsed"); 85 86 setTimeout(function () { 87 $(".opened:not(.focused) ul:visible:not(.level2),.opened2:not(.focused) ul:visible") 88 .slideUp() 89 .parent() 90 .removeClass("opened opened2") 91 .find(".toggle, .toggle2") 92 .attr({ 93 "aria-expanded": "false", 94 "aria-label": function () { 95 return "Show Dropdown for " + $(this).prev("a").text(); 96 }, 97 }); 98 99 // Clear the announcement after the action is complete 100 setTimeout(function () { 101 $("#nav-announcement").text(""); 102 }, 100); 103 }, 50); 104 } 105 } else { 106 $(".focused").removeClass("focused"); 107 isClick = false; 108 } 109 }); 110 111 // prevent focused class changes on click - This way arrows wont pop when clicking nav links 112 $("#nav a,#flyout a").on("mousedown", function () { 113 isClick = true; 114 }); 115 116 // Search Toggle 117 $("#search-toggle").on("click", function (e) { 118 $("#search").stop().slideToggle(200); 119 $(this).toggleClass("fa-search fa-close"); 120 $("#search-input").trigger("focus"); 121 }); 122 123 $("#search-input").on("keydown", function (e) { 124 if (e.key === "Escape" && $(window).width() < 992) { 125 $("#search").stop().slideToggle(200); 126 $("#search-toggle").toggleClass("fa-search fa-close"); 127 $("#search-toggle").trigger("focus"); 128 } 129 }); 130 131 // Navigation Toggle 132 $("#nav-toggle").on("click", function () { 133 $("#nav").stop().slideToggle(); 134 $(this).toggleClass("fa-bars fa-close"); 135 }); 136 137 // Menu Arrows and Toggles 138 $("#nav >li>ul,#flyout >li>ul").addClass("first-level"); 139 $("#nav li ul ul").addClass("second-level"); 140 $("#nav>li:has(ul)").each(function () { 141 $( 142 '<a href="#" class="fa fa-angle-down toggle d-lg-none" tabindex="0" aria-haspopup="true" aria-expanded="false" id="dropdown-toggle-' + $(this).index() + '" aria-label="Show Dropdown for ' + $(this).find("a:first").text() + '"></a>' 143 ).insertAfter($(this).find("a:first")); 144 $(this) 145 .find("ul:first") 146 .attr("aria-labelledby", "dropdown-toggle-" + $(this).index()); 147 }); 148 $("#nav li ul>li:has(ul)").each(function (index) { 149 $('<a href="#" class="fa fa-angle-down toggle2 d-lg-none" tabindex="0" aria-haspopup="true" aria-expanded="false" id="sub-dropdown-toggle-' + index + '" aria-label="Show Dropdown for ' + $(this).find("a:first").text() + '"></a>').insertAfter( 150 $(this).find("a:first") 151 ); 152 $(this) 153 .find("ul:first") 154 .attr("aria-labelledby", "sub-dropdown-toggle-" + index); 155 }); 156 $("#flyout >li:has(ul)").each(function () { 157 $( 158 '<a href="#" class="fa fa-angle-down toggle d-lg-none" tabindex="0" aria-haspopup="true" aria-expanded="false" id="flyout-dropdown-toggle-' + $(this).index() + '" aria-label="Show Flyout for ' + $(this).find("a:first").text() + '"></a>' 159 ).insertAfter($(this).find("a:first")); 160 $(this) 161 .find("ul:first") 162 .attr("aria-labelledby", "flyout-dropdown-toggle-" + $(this).index()); 163 }); 164 165 function addNavClass() { 166 if ($window.width() < 992) { 167 // Insert needed for mobile 168 } else { 169 // Insert needed for desktop 170 $("#nav ul, #flyout ul").css("display", ""); 171 } 172 } 173 addNavClass(); 174 $window.resize(addNavClass); 175 176 $(".toggle").on("click keydown", function (e) { 177 if (e.keyCode === 13 || e.type === "click") { 178 e.preventDefault(); 179 var $parent = $(this).parent(); 180 var $parentLi = $parent.parent(); 181 $parent.toggleClass("opened"); 182 if ($parent.addClass("active") && $(this).next(".first-level").is(":visible")) { 183 $(this).next(".first-level").slideUp(); 184 $parent.removeClass("active"); 185 $(this).attr("aria-expanded", "false"); 186 $parent.find(".menuUL").attr("aria-expanded", "false"); 187 } else { 188 $(this).attr("aria-expanded", "true"); 189 $(".first-level").slideUp("slow"); 190 $parent.addClass("active"); 191 $parent.find(".menuUL").attr("aria-expanded", "true"); 192 $(this).next(".first-level").slideToggle(); 193 } 194 } 195 }); 196 197 $(".toggle2").on("click keydown", function (e) { 198 if (e.keyCode === 13 || e.type === "click") { 199 e.preventDefault(); 200 var $parent = $(this).parent(); 201 var $parentLi = $parent.parent(); 202 $parent.toggleClass("opened2"); 203 if ($parent.addClass("active") && $(this).next(".second-level").is(":visible")) { 204 $(this).next(".second-level").slideUp(); 205 $parent.removeClass("active"); 206 $(this).attr({ "aria-expanded": "false" }); 207 $(this).next(".menuUL").attr({ "aria-expanded": "false" }); 208 } else { 209 $(this).attr({ "aria-expanded": "true" }); 210 $(this).next(".menuUL").attr({ "aria-expanded": "true" }); 211 $(".second-level").slideUp("slow"); 212 $parent.addClass("active"); 213 $(this).next(".second-level").slideToggle(); 214 } 215 } 216 }); 217 218 // close nav if left 219 $(".desktop *").focus(function (e) { 220 var $opened = $(".opened"); 221 var $opened2 = $(".opened2"); 222 if ($opened.length > 0 || $opened2.length > 0) { 223 if ($(".opened :focus").length < 1) { 224 $opened.children("ul").slideUp(); 225 $opened.removeClass("opened"); 226 $(".opened2").removeClass("opened2"); 227 $("ul.menuUL").attr({ "aria-expanded": "false" }); 228 } 229 if ($(".opened2 :focus").length < 1) { 230 $opened2.children("ul").slideUp(); 231 $opened2.removeClass("opened2"); 232 $("ul.menuUL").attr({ "aria-expanded": "false" }); 233 } 234 } 235 }); 236 237 $(".menuA.level0").focus(function () { 238 $(".menuUL").each(function () { 239 $(this).attr("aria-expanded", "false"); 240 }); 241 $(".toggle").each(function () { 242 $(this).attr("aria-expanded", "false"); 243 }); 244 }); 245 246 // Flyout 247 var flyout = $("#flyout"), 248 flyoutwrap = $("#flyout-wrap"); 249 250 if (flyout.text().length) { 251 flyoutwrap.prepend('<div tabindex="0" id="flyout-toggle" class="d-lg-none"><i class="fa fa-bars"></i> Sub Menu</div>'); 252 } 253 254 $("#flyout-toggle").on("click keydown", function (e) { 255 if (e.keyCode === 13 || e.type === "click") { 256 e.preventDefault(); 257 flyout.slideToggle(); 258 $(this).toggleClass("active"); 259 } 260 }); 261 262 $("#flyout").on("keydown", function (e) { 263 if (e.keyCode === 27 && $(window).width() < 992) { 264 flyout.slideUp(); 265 $("#flyout-toggle").removeClass("active"); 266 } 267 }); 268 269 $("#flyout li:last-child").on("keydown", function (e) { 270 if (e.keyCode === 9 && !e.shiftKey && $(window).width() < 992) { 271 flyout.slideUp(); 272 $("#flyout-toggle").removeClass("active"); 273 } 274 }); 275 276 function updateModalTitle() { 277 const observer = new MutationObserver((mutationsList, observer) => { 278 mutationsList.forEach((mutation) => { 279 if (mutation.type === "childList") { 280 const modalTitle = document.getElementById("modal-event-title"); 281 const modalSubtitle = document.getElementById("modal-event-subtitle"); 282 283 if (modalTitle && modalTitle.textContent.trim() === "") { 284 modalTitle.textContent = "Modal Title"; 285 } 286 287 if (modalSubtitle && modalSubtitle.textContent.trim() === "") { 288 modalSubtitle.textContent = "Modal Subtitle"; 289 } 290 291 if (modalTitle && modalSubtitle) { 292 observer.disconnect(); 293 } 294 } 295 }); 296 }); 297 298 observer.observe(document.body, { childList: true, subtree: true }); 299 } 300 301 updateModalTitle(); 302 303 function fillSide() { 304 var whiteSpace = parseFloat($(".container").css("margin-right")) + 15; 305 $(".fillLeft").css("margin-left", -whiteSpace); 306 $(".fillLeft.withPadding").css("padding-left", whiteSpace); 307 $(".fillRight").css("margin-right", -whiteSpace); 308 $(".fillRight.withPadding").css("padding-right", whiteSpace); 309 } 310 fillSide(); 311 $window.resize(fillSide); 312 313 /* 314 * E-Notify Auto submit 315 */ 316 $.urlParam = function (n) { 317 var e = new RegExp("[?&]" + n + "=([^]*)").exec(window.location.href); 318 return null == e ? null : e[1] || 0; 319 }; 320 var $enotify = $('iframe[src*="/revize/plugins/notify/notify.jsp"]'); 321 if ($enotify.length > 0) { 322 var emailStr = $.urlParam("email"); 323 if (emailStr != null) { 324 $enotify.attr("src", $enotify.attr("src") + "&email=" + emailStr); 325 } 326 } 327 328 // Make sure all calendars have unique ids 329 $('iframe[name="calendar"]').each(function (index, calendar) { 330 calendar.id = "calendar-" + index; 331 }); 332 333 // Start Frame Resizer 334 function resizeIframe(height, frameElement) { 335 if (frameElement) { 336 frameElement.height = ""; 337 frameElement.height = height; 338 } 339 } 340 341 var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; 342 var eventHandler = window[eventMethod]; 343 var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message"; 344 eventHandler(messageEvent, function (e) { 345 if (Array.isArray(e.data)) {
346 if (e.data[0] === "setCalHeight" || e.data[0] === "setNotifyHeight") { 347 var frames = document.querySelectorAll("iframe"); 348 for (var i = 0; i < frames.length; i++) { 349 if (frames[i].contentWindow === e.source) { 350 resizeIframe(e.data[1], frames[i]); 351 } 352 } 353 } 354 } 355 }); 356 // End Frame Resizer 357 358 // Alert Close Caching 359 if ($("div.alert").length) { 360 var hide = window.sessionStorage && parseInt(window.sessionStorage.getItem("alertClosed")) > 1; 361 if (!hide || $(".user-logged-in").length != 0) { 362 $("div.alert").addClass("show"); 363 } 364 $("div.alert button.close").on("click", function (e) { 365 if (window.sessionStorage) { 366 window.sessionStorage.setItem("alertClosed", parseInt(window.sessionStorage.getItem("alertClosed") || 0) + 1); 367 } 368 }); 369 } 370 371 // revizeWeather 372 if (typeof $.fn.revizeWeather !== "undefined") { 373 $.fn.revizeWeather({ 374 zip: "34748", 375 city_name: "", 376 unit: "f", 377 success: function (weather) { 378 var html = 379 '<i class="' + 380 weather.icon + 381 '"></i><div class="weather-box"><div class="week-day">' + 382 new Date().toLocaleDateString("en-us", { weekday: "long" }) + 383 '</div><span class="forecast">' + 384 weather.temp + 385 '°</span> <span class="forecast-text">' + 386 weather.forecast + 387 "</span></div>"; 388 $("#weather").html(html); 389 }, 390 error: function (error) { 391 // better to just hide the secion if there is an error 392 $(".weather").hide(); 393 console.log(error); 394 }, 395 }); 396 } 397 398 // Tabs 399 $("#tabs li a").on("click keypress", function (e) { 400 if (e.keyCode === 13 || e.type === "click") { 401 $("#tabs li, #tabs-content .current").removeClass("current").removeClass("fadeInLeft"); 402 $(this).parent().addClass("current"); 403 404 var currentTab = $(this).attr("href"); 405 406 e.preventDefault(); 407 $(currentTab).addClass("current animated fadeInLeft"); 408 $(currentTab).find("h2").focus(); 409 } 410 }); 411 412 $("#tabs-button .tab").click(function (e) { 413 var tabsIndex = $(this).index(); 414 console.log(tabsIndex); 415 $("#tabs-button .tab").removeClass("active"); 416 $(this).addClass("active"); 417 $(".tab-calendar").removeClass("active"); 418 $(".tab-calendar").hide(); 419 $(".tab-calendar").eq(tabsIndex).addClass("active"); 420 $(".tab-calendar").eq(tabsIndex).show(); 421 422 $(".tab-event").removeClass("active"); 423 $(".tab-event").hide(); 424 $(".tab-event").eq(tabsIndex).addClass("active"); 425 $(".tab-event").eq(tabsIndex).show(); 426 }); 427 428 var $translateButton = $("#translate-button"); 429 $translateButton.on("keydown click", function (e) { 430 if (e.keyCode === 13 || e.type === "click") { 431 $("#translation-links ul").stop().fadeToggle(); 432 $translateButton.attr("aria-expanded", !("true" === $translateButton.attr("aria-expanded"))); 433 } 434 }); 435 436 $("#translation-links ul").on("mouseleave", function () { 437 $(this).fadeOut(); 438 $translateButton.attr("aria-expanded", false); 439 }); 440 441 $("#translation-links ul").on("keydown", function (e) { 442 if (e.keyCode === 27) { 443 $(this).fadeOut(); 444 $translateButton.attr("aria-expanded", false); 445 $translateButton.focus(); 446 } 447 }); 448 449 function removeCookieString(value, domain) { 450 domain = domain ? "domain=" + domain + "; " : ""; 451 return value + "; expires=Thu, 01 Jan 1970 00:00:01 GMT; " + domain + "path=/"; 452 } 453 454 function unsetGoogtransCookie() { 455 for (var domains = window.location.hostname.split("."); domains.length >= 2; domains.shift()) { 456 var cookieString = removeCookieString("googtrans=unset", domains.join(".")); 457 document.cookie = cookieString; 458 if (domains.length === 2) { 459 cookieString = removeCookieString("googtrans=unset", "." + domains.join(".")); 460 document.cookie = cookieString; 461 } 462 } 463 document.cookie = removeCookieString("googtrans=unset"); 464 } 465 466 if ( 467 document.cookie.split(";").some(function (item) { 468 return item.trim().startsWith("googtrans=/auto/en"); 469 }) 470 ) { 471 unsetGoogtransCookie(); 472 } 473 474 // Translate Script 475 var translateURL = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; 476 $.getScript(translateURL); 477 $("#translation-links a").click(function () { 478 var lang = $(this).data("lang"); 479 var $frame = $("iframe.skiptranslate"); 480 if (lang === "English") { 481 $frame.contents().find('span.text:contains("English")').parent().parent().get(0).click(); 482 return; 483 } 484 if (!$frame.length) { 485 return false;
486 } 487 var $el = $frame 488 .contents() 489 .find("span.text:contains(" + lang + ")") 490 .parent() 491 .parent() 492 .get(0) 493 .click(); 494 console.log($el); 495 if (!$el) { 496 $frame.contents().find('span.text:contains("English")').parent().parent().get(0); 497 } 498 499 $el.click(); 500 return false; 501 }); 502 503 // hide hero slider control when video will be play 504 var interval = setInterval(hideControl, 1000); 505 function hideControl() { 506 var videoId = document.getElementById("wrapper_sliderVideo"); 507 if (videoId) { 508 if (videoId.style.opacity == "1") { 509 clearInterval(interval); 510 $("#slider .tns-controls button").hide(); 511 } else { 512 $("#slider .tns-controls button").show(); 513 } 514 } 515 } 516 517 //popular links show hide mobile 518 519 $(".plus-button").on("click", function () { 520 $(".popular-links").toggle(); 521 }); 522 523 // Tiny Slider 524 if (typeof tns !== "undefined") { 525 $(".tiny-slider").each(function (i, el) { 526 var slider = tns({ 527 autoplay: true, 528 autoplayTimeout: 8000, 529 container: el, 530 items: 1, 531 lazyload: true, 532 lazyloadSelector: ".tns-lazy-img", // accompanied with data src or data-style 533 mode: "gallery", 534 preventScrollOnTouch: "force", 535 nav: false, 536 controlsText: ['<img src="_assets_/images/left-arrow.png" alt="Previous Arrow">', '<img src="_assets_/images/right-arrow.png" alt="Next Arrow">'], 537 autoplayButtonOutput: false, 538 }); 539 540 $( 541 '<button aria-label="Pause Slider" id="slider-pause" type="button" data-controls="pause" tabindex="-1" aria-controls="tns1"><i class="fa fa-pause" style="font-size:25px;position:relative;top:3px;left:1px;color:#122c49;"></i></button>' 542 ).appendTo($(".tns-controls")); 543 544 $("#slider-pause").click(function () { 545 if ($(this).children().attr("class") == "fa fa-pause") { 546 slider.pause(); 547 $(this).children().attr("class", "fa fa-play"); 548 } else { 549 slider.play(); 550 $(this).children().attr("class", "fa fa-pause"); 551 } 552 }); 553 }); 554 555 $("#qlinks .tiny-carousel").each(function (i, el) { 556 var qlinkCount = $("#qlinks .qlink-box").length; 557 var $el = $(el); 558 var tinyItemCount = $el.children().length; 559 var tinyItemData = $el.data("tinyItems") ? $el.data("tinyItems") : 5; 560 tns({ 561 container: el, 562 items: Math.min(tinyItemCount, tinyItemData), 563 lazyload: true, 564 lazyloadSelector: ".tns-lazy-img", // accompanied with data src or data-style 565 preventScrollOnTouch: "force", 566 nav: false, 567 touch: false, 568 controlsText: ['<img src="_assets_/images/left-arrow.png" alt="Previous Arrow">', '<img src="_assets_/images/right-arrow.png" alt="Next Arrow">'], 569 autoplayButtonOutput: false, 570 loop: true, 571 touch: false, 572 autoplayButtonOutput: false, 573 responsive: { 574 1200: { 575 items: qlinkCount >= 5 ? 5 : qlinkCount, 576 }, 577 992: { 578 items: qlinkCount >= 4 ? 4 : qlinkCount, 579 }, 580 600: { 581 items: qlinkCount >= 2 ? 2 : qlinkCount, 582 }, 583 480: { 584 items: qlinkCount >= 1 ? 1 : qlinkCount, 585 }, 586 0: { 587 items: 1, 588 }, 589 }, 590 //gutter : 44 591 }); 592 }); 593 594 $("#news .tiny-carousel").each(function (i, el) { 595 var newscount = $("#news .news-box").length; 596 var $el = $(el); 597 var tinyItemCount = $el.children().length; 598 var tinyItemData = $el.data("tinyItems") ? $el.data("tinyItems") : 4; 599 tns({ 600 container: el, 601 items: Math.min(tinyItemCount, tinyItemData), 602 lazyload: true, 603 lazyloadSelector: ".tns-lazy-img", // accompanied with data src or data-style 604 preventScrollOnTouch: "force", 605 nav: false, 606 touch: false, 607 controlsText: ['<img src="_assets_/images/left-arrow.png" alt="Previous Arrow">', '<img src="_assets_/images/right-arrow.png" alt="Next Arrow">'], 608 autoplayButtonOutput: false, 609 loop: true, 610 touch: false, 611 autoplayButtonOutput: false, 612 responsive: { 613 992: { 614 items: newscount >= 4 ? 4 : newscount, 615 }, 616 600: { 617 items: newscount >= 2 ? 2 : newscount, 618 }, 619 480: { 620 items: newscount >= 2 ? 2 : newscount, 621 }, 622 0: { 623 items: 1, 624 }, 625 }, 626 gutter: 25, 627 }); 628 }); 629 } 630 631 // $( document ).ready(function() { 632 // $('#fb-ic').hover( 633 // function() { 634 // $('.fb-list-items').fadeIn(); 635 // }, function() { 636 // $('.fb-list-items').fadeOut(); 637 // } 638 // ); 639 // }); 640 641 $(".social-media-link ").hover(function () { 642 var tabID = $(this).attr("data-tab"); 643 644 $(".social-media-link").removeClass("active"); 645 $(this).addClass("active"); 646 647 $("#tab-" + tabID) 648 .addClass("active") 649 .siblings() 650 .removeClass("active"); 651 }); 652 653 $window.ready(function () { 654 $("#breadcrumbs ul li:last-child").attr("aria-current", "page"); 655 656 function waitForElm(selector) { 657 return new Promise((resolve) => { 658 if (document.querySelector(selector)) { 659 return resolve(document.querySelector(selector)); 660 } 661 662 const observer = new MutationObserver((mutations) => { 663 if (document.querySelector(selector)) { 664 observer.disconnect(); 665 resolve(document.querySelector(selector)); 666 } 667 }); 668 669 observer.observe(document.body, { 670 childList: true, 671 subtree: true, 672 }); 673 }); 674 } 675 676 waitForElm("#ics-export").then((elm) => { 677 $("#ics-export").text("Add To My Calendar"); 678 $("#ics-export").attr("aria-label", "Download Calendar File"); 679 }); 680 681 $("div#mini-events").click(function () { 682 $("#ics-export").text("Add To My Calendar"); 683 $("#ics-export").attr("aria-label", "Download Calendar File"); 684 }); 685 686 $("#document-center .file-group li a").each(function () { 687 var itemText = $(this).text(); 688 $(this).attr("aria-label", itemText + " PDF"); 689 }); 690 691 // closes the alert banner on click 692 $(".alert-dark-close").click(function (e) { 693 e.preventDefault(); 694 $(this).parent().stop().slideUp(); 695 }); 696 697 $(".alert-light-close").click(function (e) { 698 e.preventDefault(); 699 $(this).parent().stop().slideUp(); 700 var headerM = $("header").css("margin-top"); 701 $("header").css("margin-top", headerM - 42); 702 }); 703 704 //Add mega menu 705 $("#nav").addClass("mega"); 706 707 //slider margin-top 708 var headerHeight = $("header").height(); 709 $("#slider-caption").css("margin-top", headerHeight); 710 711 //Alert 712 // $("header").css("margin-top", $(".alert-group").height()); 713 // $(".alert-dark-close").click(function (e) { 714 // e.preventDefault(); 715 // $(this).parent().stop().slideUp(); 716 // if ($(".alert-light-close, .alert-dark-close").is(":visible")) { 717 // var headerM = parseInt($("header").css("margin-top")); 718 // $("header").css("margin-top", headerM - 42 + "px"); 719 // } else { 720 // $("header").css("margin-top", "0"); 721 // } 722 // setTimeout(function () { 723 // var alertCount = $(".alert-group div:visible").length / 2; 724 // console.log(alertCount); 725 // var alertHeight = alertCount * 42 + "px"; 726 // $("#slider").attr("style", "margin-top:" + alertHeight); 727 // }, 450); 728 // }); 729 // $(".alert-light-close").click(function (e) { 730 // e.preventDefault(); 731 // $(this).parent().stop().slideUp(); 732 // if ($(".alert-light-close, .alert-dark-close").is(":visible")) { 733 // var headerM = parseInt($("header").css("margin-top")); 734 // $("header").css("margin-top", headerM - 42 + "px"); 735 // } else { 736 // $("header").css("margin-top", "0"); 737 // } 738 // setTimeout(function () { 739 // var alertCount = $(".alert-group div:visible").length / 2; 740 // var alertHeight = alertCount * 42 + "px"; 741 // $("#slider").attr("style", "margin-top:" + alertHeight); 742 // }, 450); 743 // }); 744 745 // var alertCount = $(".alert-group div").length / 2; 746 // var alertHeight = alertCount * 42 + "px"; 747 // $("#slider").attr("style", "margin-top:" + alertHeight); 748 749 //Fixed header 750 $(window).scroll(function () { 751 if ($(this).scrollTop() > 50) { 752 $("header").addClass("scrolled"); 753 } else { 754 $("header").removeClass("scrolled"); 755 } 756 }); 757 758 // matchHeight 759 if (typeof $.fn.matchHeight !== "undefined") { 760 $(".equal").matchHeight({ 761 //defaults 762 byRow: true, 763 property: "height", // height or min-height 764 target: null, 765 remove: false, 766 }); 767 768 $("#homepage .news-title").matchHeight(); 769 } 770 771 // Video for slider 772 if ($("body").attr("id") == "homepage") { 773 $("#sliderVideo").YTPlayer(); 774 } 775 776 // Animations http://www.oxygenna.com/tutorials/scroll-animations-using-waypoints-js-animate-css 777 function onScrollInit(items, trigger) { 778 items.each(function () { 779 var osElement = $(this), 780 osAnimationClass = osElement.data("os-animation"), 781 osAnimationDelay = osElement.data("os-animation-delay"); 782 783 osElement.css({ 784 "-moz-animation-delay": osAnimationDelay, 785 "animation-delay": osAnimationDelay, 786 "-webkit-animation-delay": osAnimationDelay, 787 }); 788 789 var osTrigger = trigger ? trigger : osElement; 790 791 if (typeof $.fn.waypoint !== "undefined") {
792 osTrigger.waypoint( 793 function () { 794 osElement.addClass("animated").addClass(osAnimationClass); 795 }, 796 { 797 triggerOnce: true, 798 offset: "100%", 799 } 800 ); 801 } 802 }); 803 } 804 onScrollInit($(".os-animation")); 805 806 //#Smooth Scrolling 807 $('a[href*="#"]') 808 .not('[href="#"]') 809 .not('[href*="#collapse"]') 810 .click(function (event) { 811 if (location.pathname.replace(/^\//, "") === this.pathname.replace(/^\//, "") && location.hostname === this.hostname) { 812 var target = $(this.hash); 813 target = target.length ? target : $("[name=" + this.hash.slice(1) + "]"); 814 if (target.length) { 815 event.preventDefault(); 816 $("html,body").animate( 817 { 818 scrollTop: target.offset().top, 819 }, 820 1000, 821 function () { 822 var $target = $(target); 823 $target.focus(); 824 if ($target.is(":focus")) { 825 return false; 826 } else { 827 $target.attr("tabindex", "-1"); 828 $target.focus(); 829 $target.removeAttr("tabindex"); 830 } 831 } 832 ); 833 } 834 } 835 }); 836 837 /*global jQuery */ 838 /*! 839 * FlexVerticalCenter.js 1.0 840 * 841 * Copyright 2011, Paul Sprangers http://paulsprangers.com 842 * Released under the WTFPL license 843 * http://sam.zoy.org/wtfpl/ 844 * 845 * Date: Fri Oct 28 19:12:00 2011 +0100 846 */ 847 $.fn.flexVerticalCenter = function (options) { 848 var settings = $.extend( 849 { 850 cssAttribute: "margin-top", // the attribute to apply the calculated value to 851 verticalOffset: 0, // the number of pixels to offset the vertical alignment by 852 parentSelector: null, // a selector representing the parent to vertically center this element within 853 debounceTimeout: 25, // a default debounce timeout in milliseconds 854 deferTilWindowLoad: false, // if true, nothing will take effect until the $(window).load event 855 }, 856 options || {} 857 ); 858 859 return this.each(function () { 860 var $this = $(this); // store the object 861 var debounce; 862 863 // recalculate the distance to the top of the element to keep it centered 864 var resizer = function () { 865 var parentHeight = settings.parentSelector && $this.parents(settings.parentSelector).length ? $this.parents(settings.parentSelector).first().height() : $this.parent().height(); 866 867 $this.css(settings.cssAttribute, (parentHeight - $this.height()) / 2 + parseInt(settings.verticalOffset)); 868 }; 869 870 // Call on resize. Opera debounces their resize by default. 871 $(window).resize(function () { 872 clearTimeout(debounce); 873 debounce = setTimeout(resizer, settings.debounceTimeout); 874 }); 875 876 if (!settings.deferTilWindowLoad) { 877 // call it once, immediately. 878 resizer(); 879 } 880 881 // Call again to set after window (frames, images, etc) loads. 882 $(window).on("load", function () { 883 resizer(); 884 }); 885 }); 886 }; 887 $(".v-align").flexVerticalCenter(); 888 889 $(".tns-liveregion").removeAttr("aria-live"); 890 891 function observeOwlItemsForActiveClass() { 892 function updateTabindex() { 893 $(".tns-item").each(function () { 894 if ($(this).hasClass("tns-slide-active")) { 895 $(this).find("a").attr("tabindex", "0"); 896 } else { 897 $(this).find("a").attr("tabindex", "-1"); 898 } 899 }); 900 } 901 902 // MutationObserver callback to detect class changes 903 const observer = new MutationObserver(function (mutations) { 904 mutations.forEach(function (mutation) { 905 if (mutation.attributeName === "class") { 906 updateTabindex(); 907 } 908 }); 909 }); 910 911 // Observe each .owl-item element for changes in class attribute 912 $(".tns-item").each(function () { 913 observer.observe(this, { attributes: true }); 914 }); 915 916 // Initial tabindex setup in case some items are already active 917 updateTabindex(); 918 } 919 920 // Call the function to initialize the observer 921 observeOwlItemsForActiveClass(); 922 923 //Allows user to open as well as enter, close button, or esc., to open and close modal. 924 function observeMiniEvents() { 925 // Create a MutationObserver to detect DOM changes 926 const observer = new MutationObserver((mutationsList, observer) => { 927 mutationsList.forEach((mutation) => {
928 mutation.addedNodes.forEach((node) => { 929 if (node.nodeType === 1) { 930 // Ensure it's an element node 931 const $node = $(node); 932 933 if ($node.is("#mini-events") || $node.find("#mini-events").length) { 934 console.log("#mini-events is loaded into the DOM"); 935 936 fixTabCalendar(); 937 938 // Disconnect the observer after finding the element 939 observer.disconnect(); 940 } 941 } 942 }); 943 }); 944 }); 945 946 const config = { childList: true, subtree: true }; 947 observer.observe(document.body, config); 948 949 const checkMiniEventsInterval = setInterval(function () { 950 if ($("#mini-events").length) { 951 console.log("#mini-events found by polling"); 952 953 // Run fixTabCalendar if #mini-events is found 954 fixTabCalendar(); 955 956 // Clear the interval to stop checking 957 clearInterval(checkMiniEventsInterval); 958 } 959 }, 500); // Check every 500ms 960 } 961 962 function fixTabCalendar() { 963 var $lastFocused = null; 964 965 // Use event delegation to capture clicks and keydown on dynamically loaded `.cal-event` elements 966 $(document).on("click", ".cal-event", function () { 967 $lastFocused = $(this); // Store the last focused element 968 }); 969 970 $(document).on("keydown", ".cal-event", function (e) { 971 if (e.which === 13) { 972 // Enter key 973 $lastFocused = $(this); // Store the last focused element 974 $(this).trigger("click"); // Trigger the click action 975 } 976 }); 977 978 // Event listener for modal close 979 $(document).on("click", "#modal-close-button, .modal-footer button.btn.btn-secondary", function () { 980 $("#event-modal").hide(); // Hide the modal 981 982 // Restore focus to the last focused element 983 if ($lastFocused && $lastFocused.length) { 984 $lastFocused.focus(); 985 } 986 }); 987 988 // Handle escape key to close modal 989 $(document).on("keydown", function (e) { 990 if (e.which === 27 && $("#event-modal").is(":visible")) { 991 // Escape key and modal is visible 992 $("#event-modal").hide(); // Hide modal 993 994 // Restore focus to the last focused element 995 if ($lastFocused && $lastFocused.length) { 996 $lastFocused.focus(); 997 } 998 } 999 }); 1000 } 1001 1002 // Call the observer function to start listening for #mini-events 1003 observeMiniEvents(); 1004 1005 $(".tab").attr("tabindex", "0"); 1006 $(".social-media-link").attr("tabindex", "0"); 1007 1008 $(".tab").on("keydown", function (e) { 1009 if (e.keyCode === 13) { 1010 $(this).click(); 1011 } 1012 }); 1013 1014 function observeSocialMediaLinks() { 1015 const $socialMediaLinks = $(".social-media-link"); 1016 1017 $socialMediaLinks.on("click keydown", function (e) { 1018 if (e.which === 13 || e.type === "click" || e.which === 32) { 1019 if (e.which === 32) { 1020 e.preventDefault(); 1021 } 1022 $socialMediaLinks.removeClass("active"); 1023 const dataTab = $(this).data("tab"); 1024 $(this).addClass("active"); 1025 for (let i = 1; i <= 4; i++) { 1026 $("#tab-" + i).removeClass("active"); 1027 } 1028 $("#tab-" + dataTab).addClass("active"); 1029 } 1030 }); 1031 } 1032 observeSocialMediaLinks(); 1033 1034 if ($("#contact-header").text().trim() === "") { 1035 $("#contact-header").remove(); 1036 } 1037 1038 // Set tabindex for dynamically loaded #mk-aweb-open-panel 1039 function setMkAwebTabindex() { 1040 var $el = $("#mk-aweb-open-panel"); 1041 if ($el.length) { 1042 $el.attr("tabindex", "0"); 1043 return true; 1044 } 1045 return false; 1046 } 1047 1048 function setMkButtonTabindex() { 1049 var $el = $("#wcag-skip-to button"); 1050 if ($el.length) { 1051 $el.attr("tabindex", "0"); 1052 return true; 1053 } 1054 return false; 1055 } 1056 1057 if (!setMkAwebTabindex()) { 1058 const mkAwebObserver = new MutationObserver(function () { 1059 if (setMkAwebTabindex()) { 1060 mkAwebObserver.disconnect(); 1061 } 1062 }); 1063 mkAwebObserver.observe(document.body, { childList: true, subtree: true }); 1064 } 1065 1066 if (!setMkButtonTabindex()) { 1067 const mkAwebButtonObserver = new MutationObserver(function () { 1068 if (setMkButtonTabindex()) { 1069 mkAwebButtonObserver.disconnect(); 1070 } 1071 }); 1072 1073 mkAwebButtonObserver.observe(document.body, { childList: true, subtree: true }); 1074 } 1075 1076 $("#formwizziwmorf input").attr("aria-label", "Submit Form"); 1077 $("#g-recaptcha-response").attr("aria-label", "Captcha"); 1078 $(".tns-controls").removeAttr("aria-label"); 1079 $(".tns-controls button:first-child").attr("aria-label", "Previous Button"); 1080 $(".tns-controls button:last-child").attr("aria-label", "Next Button"); 1081 $(".menuLI.level0 .menuUL").attr("aria-expanded", "false"); 1082 1083 // Create and append the span for screen reader instructions 1084 $(".tns-controls").each(function (index) { 1085 const uniqueId = "carousel-desc-" + (index + 1); 1086 1087 $(this) 1088 .attr({ 1089 "aria-labelledby": uniqueId, 1090 "aria-roledescription": "Carousel", 1091 }) 1092 .prepend( 1093 $("<span>", { 1094 id: uniqueId, 1095 class: "sr-only", 1096 text: "Carousel Controls - Use left and right arrow keys to navigate", 1097 }) 1098 ); 1099 }); 1100 $(".faq-header").attr("tabindex", "0"); 1101 $(".faq-header").on("keydown", function (e) { 1102 if (e.which === 13) { 1103 $(this).click(); 1104 } 1105 }); 1106 1107 $(".docs-toggle").on("keydown", function (e) { 1108 if (e.which === 13) { 1109 $(this).click(); 1110 } 1111 }); 1112 1113 $("h1#page-title").each(function () { 1114 var text = $(this).text(); 1115 var attributes = {}; 1116 1117 // Copy all attributes from the h1 to the new h2 1118 $.each(this.attributes, function () { 1119 attributes[this.name] = this.value; 1120 }); 1121 1122 // Create the new h2 element with the same attributes and text 1123 var $h2 = $("<h3>", attributes).text(text); 1124
1125 // Replace the h1 with the new h2 1126 $(this).replaceWith($h2); 1127 }); 1128 1129 $("#calendar-filters").attr("tabindex", "0"); 1130 $("#calendar-filters a").attr("tabindex", "-1"); 1131 1132 $("#calendar-filters").on("keydown", function (e) { 1133 const focusableElements = $(this).find("a, button, input, select, textarea, [tabindex]:not([tabindex='-1'])"); 1134 const currentElement = document.activeElement; 1135 const currentIndex = focusableElements.index(currentElement); 1136 1137 switch (e.which) { 1138 case 37: // left arrow 1139 e.preventDefault(); 1140 focusableElements.attr("aria-selected", "false"); 1141 if (currentIndex > 0) { 1142 focusableElements.eq(currentIndex - 1).focus(); 1143 focusableElements.eq(currentIndex - 1).attr("aria-selected", "true"); 1144 } 1145 break; 1146 1147 case 39: // right arrow 1148 e.preventDefault(); 1149 focusableElements.attr("aria-selected", "false"); 1150 if (currentIndex < focusableElements.length - 1) { 1151 focusableElements.eq(currentIndex + 1).focus(); 1152 focusableElements.eq(currentIndex + 1).attr("aria-selected", "true"); 1153 } 1154 break; 1155 1156 case 13: // enter 1157 e.preventDefault(); 1158 $(currentElement).click(); 1159 break; 1160 } 1161 }); 1162 1163 $("#tabs-button").attr("tabindex", "0"); 1164 $("#tabs-button button").attr("tabindex", "-1"); 1165 1166 $("#tabs-button").on("keydown", function (e) { 1167 const focusableElements = $(this).find("a, button, input, select, textarea, [tabindex]:not([tabindex='-1'])"); 1168 const currentElement = document.activeElement; 1169 const currentIndex = focusableElements.index(currentElement); 1170 1171 switch (e.which) { 1172 case 37: // left arrow 1173 e.preventDefault(); 1174 if (currentIndex > 0) { 1175 focusableElements.eq(currentIndex - 1).focus(); 1176 focusableElements.eq(currentIndex - 1).click(); 1177 } 1178 break; 1179 1180 case 39: // right arrow 1181 e.preventDefault(); 1182 if (currentIndex < focusableElements.length - 1) { 1183 focusableElements.eq(currentIndex + 1).focus(); 1184 focusableElements.eq(currentIndex + 1).click(); 1185 } 1186 break; 1187 1188 case 13: // enter 1189 e.preventDefault(); 1190 focusableElements.attr("aria-selected", "false"); 1191 if (currentIndex > 0) { 1192 focusableElements.eq(currentIndex).attr("aria-selected", "true"); 1193 } 1194 $(currentElement).click(); 1195 break; 1196 } 1197 }); 1198 1199 function initDocumentCenterSearch() { 1200 $("#doc-search-announcement").remove(); 1201 1202 $("body").append('<div id="doc-search-container" class="sr-only" aria-live="assertive" aria-atomic="true"><div id="doc-search-announcement">
1202Initial text</div></div>'); 1203 1204 $(".rz-doc-search-submit").on("click", function (e) { 1205 e.preventDefault(); 1206 const searchTerm = $("#file-search").val().toLowerCase(); 1207 let visibleResults = 0; 1208 $("#document-center .file-group").hide(); 1209 1210 $("#document-center .file-group li").each(function () { 1211 const text = $(this).find("a").text().toLowerCase(); 1212 if (text.includes(searchTerm)) { 1213 $(this).show(); 1214 $(this).closest(".file-group").show(); 1215 visibleResults++; 1216 } else { 1217 $(this).hide(); 1218 } 1219 }); 1220 1221 const announcement = visibleResults === 0 ? "No results found for " + searchTerm : "Found " + visibleResults + " " + visibleResults === 1 ? "result" : "results" + " for " + searchTerm; 1222 $("#doc-search-announcement").empty().text(announcement); 1223 return false; 1224 }); 1225 1226 $(".rz-doc-search-reset").on("click", function () { 1227 $("#file-search").val(""); 1228 $("#document-center .file-group li").show(); 1229 $("#document-center .file-group").show(); 1230 1231 const announcement = "Search reset, showing all documents"; 1232 $("#doc-search-announcement").empty().text(announcement); 1233 }); 1234 } 1235 1236 $(".docs-toggle").each(function () { 1237 $(this).attr({ 1238 "aria-expanded": "false", 1239 role: "button", 1240 }); 1241 1242 $(this).on("click keydown", function (e) { 1243 if (e.type === "click" || (e.type === "keydown" && e.which === 13)) { 1244 const isExpanded = $(this).attr("aria-expanded") === "true"; 1245 1246 $(this).attr("aria-expanded", !isExpanded); 1247 1248 const announcement = !isExpanded ? "Expanded" : "Collapsed"; 1249 1250 if (!$("#toggle-announcement").length) { 1251 $("body").append('<div id="toggle-announcement" class="sr-only" aria-live="assertive" aria-atomic="true"></div>'); 1252 } 1253 $("#toggle-announcement").text(announcement); 1254 } 1255 }); 1256 }); 1257 1258 $(".faqs-heading").each(function () { 1259 $(this).attr({ 1260 "aria-expanded": "false", 1261 role: "button", 1262 }); 1263 1264 $(this).on("click keydown", function (e) { 1265 if (e.type === "click" || (e.type === "keydown" && e.which === 13)) { 1266 const isExpanded = $(this).attr("aria-expanded") === "true"; 1267 1268 $(this).attr("aria-expanded", isExpanded); 1269 } 1270 }); 1271 }); 1272 1273 initDocumentCenterSearch(); 1274 1275 function fixGoogleTranslateInputs() { 1276 const inputs = [ 1277 { id: "goog-gt-votingInputSrcLang", label: "Source Language Input" }, 1278 { id: "goog-gt-votingInputTrgLang", label: "Target Language Input" }, 1279 { id: "goog-gt-votingInputSrcText", label: "Source Text Input" }, 1280 { id: "goog-gt-votingInputTrgText", label: "Target Text Input" }, 1281 { id: "goog-gt-votingInputVote", label: "Vote Input" }, 1282 ]; 1283 1284 let allLabelsSet = true; 1285 inputs.forEach((item) => { 1286 const input = document.getElementById(item.id); 1287 if (input) { 1288 input.setAttribute("aria-label", item.label); 1289 } else { 1290 allLabelsSet = false; 1291 } 1292 }); 1293 1294 if (allLabelsSet) { 1295 googleObserver.disconnect(); 1296 } 1297 } 1298 1299 const googleObserver = new MutationObserver((mutationsList, observer) => { 1300 for (let mutation of mutationsList) { 1301 if (mutation.type === "childList") { 1302 fixGoogleTranslateInputs(); 1303 } 1304 } 1305 }); 1306 1307 googleObserver.observe(document.body, { childList: true, subtree: true }); 1308 1309 fixGoogleTranslateInputs(); 1310 1311 $(".tns-controls").removeAttr("tabindex aria-label"); 1312 $(".tns-controls button").removeAttr("tabindex"); 1313 $(".tns-controls button[data-controls='prev']").attr("aria-label", "Go to previous slide"); 1314 $(".tns-controls button[data-controls='next']").attr("aria-label", "Go to next slide"); 1315 1316 // ADA - Links with target blank will have sr div announcing this is the case 1317 $("a").each(function (index) { 1318 if ($(this).attr("target") === "_blank" || $(this).attr("target") === "_new") { 1319 $(this).append('<div class="sr-only">Opens in new window</div>'); 1320 } 1321 }); 1322 1323 // ADA, close menu on escape key (mobile nav) 1324 $(document).on("keydown", "#nav", function (e) { 1325 if (e.keyCode === 27 && $("#nav").is(":visible") && $(window).width() < 992) { 1326 $("#nav").slideUp(); 1327 $("#nav-toggle").removeClass("fa-close").addClass("fa-bars"); 1328 $("#nav-toggle").focus(); 1329 } 1330 }); 1331 1332 // ADA, close menu on escape key (desktop nav) 1333 $(document).on("keydown", "ul.menuUL.level1", function (e) { 1334 if (e.keyCode === 27 && $("ul.menuUL.level1").is(":visible") && $(window).width() > 992) {
1335 $("ul.menuUL.level1").slideUp(); 1336 $(this).focus(); 1337 } 1338 }); 1339 1340 // Close UL when tab through the list 1341 $("#nav li:last-child").on("keydown", function (e) { 1342 var parentUL = $(this).parent(); 1343 if (e.keyCode === 9 && !e.shiftKey && $(window).width() < 992) { 1344 parentUL.slideUp(); 1345 } 1346 }); 1347 }); // Ready 1348})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.