1/*----------------------------------------------------------------------------------- 2 3 Theme Name: City of Streator, IL, Tourism 4 Front-end developer: Hayk Galoyan 5 Author Design: Toshe Vladevski 6 Author URI: https://www.revize.com/ 7 Date: 07/05/2025 8 9-----------------------------------------------------------------------------------*/ 10 11(function($) { 12 13 'use strict'; 14 15 var $window = $(window), 16 $body = $('body'), 17 $html = $('html'), 18 $rzBarWrap = $('#rz-bar-wrap'), 19 $rzBtnsContainer = $('.rz-btns-container'); 20 21 // RZ Class + remove revize bar 22 if(typeof RZ !== "undefined"){ 23 if(RZ.login){ 24 $body.addClass("user-logged-in"); 25 } else{ 26 $body.addClass("user-not-logged-in"); 27 } 28 } 29 30 // needed for revize bar 31 // $('[data-toggle="tooltip"]').tooltip({trigger:"hover"}) 32 33 // Keyboard Navigation: Nav, flyout 34 var isClick = false; 35 $("#nav li a, #flyout li a, a, button, .toggle, .toggle2").on('focusin', function(e) { 36 if( isClick === false ) { 37 $(".focused").removeClass("focused"); 38 $(e.currentTarget).parents("#nav li, #flyout li").addClass("focused"); 39 $(".opened:not(.focused) ul:visible,.opened2:not(.focused) ul:visible").slideUp().parent().removeClass("active opened opened2").find('.toggle, .toggle2').attr('aria-expanded', 'false') 40 } else { 41 $(".focused").removeClass("focused"); 42 isClick = false; 43 } 44 }); 45 46 // for revize buttons container 47 $rzBtnsContainer.each(function(){ 48 var $container = $(this); 49 if($container.html().trim()!=""){ 50 $container.closest(".has-edit-buttons").addClass('yes-has-edit-buttons'); 51 } 52 }); 53 $(".has-edit-buttons").not(".yes-has-edit-buttons").removeClass("has-edit-buttons"); 54 55 // responsive views from revize bar 56 var urlParams = new URLSearchParams(window.location.search); //get all parameters 57 var hidebar = urlParams.get('hidebar'); //extract the hidebar parameter - this will return NULL if hidebar isn't a parameter 58 59 if(hidebar) { //check if hidebar parameter is set to anything 60 $body.removeClass("user-logged-in").addClass("hide-edit-btns"); 61 } 62 63 // prevent focused class changes on click - This way arrows wont pop when clicking nav links 64 $("#nav a,#flyout a").on('mousedown',function(){ 65 isClick = true; 66 }); 67 68 // toggle panels 69 const navToggle = $("#nav-toggle"); 70 const infoToggle = $("#info-toggle"); 71 const headerNav = $(".site-header nav"); 72 const headerBox = $("#header-box"); 73 74 function togglePanel(panel, otherPanel, trigger, activeClass, iconClassDefault, iconClassActive) { 75 panel.stop(true, true).slideToggle().css('display', 'flex'); 76 otherPanel.hide(); 77 trigger.toggleClass(activeClass); 78 79 var iconClass = trigger.hasClass(activeClass) ? iconClassActive : iconClassDefault; 80 trigger.removeClass(iconClassDefault + ' ' + iconClassActive).addClass(iconClass); 81 } 82 83 // Nav toggle 84 navToggle.on("click", function() { 85 togglePanel(headerNav, headerBox, $(this), "active", "fa-bars", "fa-times"); 86 infoToggle.removeClass("active fa-times").addClass("fa-info"); 87 }); 88 89 // Info toggle 90 infoToggle.on("click", function() { 91 togglePanel(headerBox, headerNav, $(this), "active", "fa-info", "fa-times"); 92 navToggle.removeClass("active fa-times").addClass("fa-bars"); 93 }); 94 95 // Menu Arrows and Toggles 96 $("#nav >li>ul,#flyout >li>ul").addClass('first-level'); 97 $("#nav li ul ul").addClass('second-level'); 98 $("#nav>li:has(ul)").each(function(){ 99 $('<a href="#" class="fa fa-angle-down toggle" tabindex="0" aria-haspopup="true" aria-expanded="false" id="dropdown-toggle-'+$(this).index()+'" aria-label="Show Dropdown for '+ $(this).find('a:first').text() +'"></a>').insertAfter($(this).find('a:first')); 100 $(this).find('ul:first').attr('aria-labelledby', 'dropdown-toggle-'+$(this).index()); 101 }); 102 $('#nav li ul>li:has(ul)').each(function(index) { 103 $('<a href="#" class="fa fa-angle-down toggle2" 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($(this).find('a:first')); 104 $(this).find('ul:first').attr('aria-labelledby', 'sub-dropdown-toggle-'+index); 105 }); 106 $('#flyout >li:has(ul)').each(function() { 107 $('<a href="#" class="fa fa-angle-down toggle" 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>').insertAfter($(this).find('a:first')); 108 $(this).find('ul:first').attr('aria-labelledby', 'flyout-dropdown-toggle-'+$(this).index()); 109 }); 110 111 function addNavClass() { 112 if ($window.width() < 992) { 113 // Insert needed for mobile 114 } else{ 115 // Insert needed for desktop 116 $('#nav ul, #flyout ul').css('display', ''); 117 } 118 } 119 addNavClass(); 120 $window.resize(addNavClass); 121 122 $(".toggle").on("click keydown",function(e) { 123 if (e.keyCode === 13 || e.type === 'click') { 124 e.preventDefault(); 125 var $parent = $(this).parent(); 126 127 if($(this).next('.first-level').is(":visible")){ 128 $(this).next('.first-level').slideUp(); 129 $parent.removeClass('active opened'); 130 $(this).attr('aria-expanded', 'false'); 131 } else { 132 $(".first-level").slideUp("slow"); 133 $('#nav > li').removeClass('active opened'); 134 $('#nav .toggle').attr('aria-expanded', 'false'); 135 $('#flyout > li').removeClass('active opened'); 136 $('#flyout .toggle').attr('aria-expanded', 'false'); 137 $parent.addClass('active opened'); 138 $(this).attr('aria-expanded', 'true'); 139 $(this).next('.first-level').slideToggle(); 140 } 141 } 142 }); 143 $(".toggle2").on("click keydown",function(e) { 144 if (e.keyCode === 13 || e.type === 'click') { 145 e.preventDefault(); 146 var $parent = $(this).parent(); 147 148 if($(this).next('.second-level').is(":visible")){ 149 $(this).next('.second-level').slideUp(); 150 $parent.removeClass('active opened2'); 151 $(this).attr('aria-expanded', 'false'); 152 } else { 153 $(".second-level").slideUp("slow"); 154 $('.first-level li').removeClass('active opened2'); 155 $('.first-level .toggle2').attr('aria-expanded', 'false'); 156 $parent.addClass('active opened2'); 157 $(this).attr('aria-expanded', 'true'); 158 $(this).next('.second-level').slideToggle(); 159 } 160 } 161 }); 162 163 // close nav if left 164 $(".desktop *").focus(function(e){ 165 var $opened = $(".opened"); 166 var $opened2 = $(".opened2"); 167 if( $opened.length > 0 || $opened2.length > 0 ) { 168 if( $(".opened :focus").length < 1 ){ 169 $opened.children("ul").slideUp(); 170 $opened.removeClass("opened"); 171 $(".opened2").removeClass("opened2"); 172 } 173 if( $(".opened2 :focus").length < 1 ){ 174 $opened2.children("ul").slideUp(); 175 $opened2.removeClass("opened2"); 176 } 177 } 178 }); 179 180 /* 181 * E-Notify Auto submit 182 */ 183 $.urlParam=function(n){var e=new RegExp("[?&]"+n+"=([^]*)").exec(window.location.href);return null==e?null:e[1]||0}; 184 var $enotify = $('iframe[src*="/revize/plugins/notify/notify.jsp"]'); 185 if( $enotify.length > 0 ){ 186 var emailStr = $.urlParam("email"); 187 if( emailStr != null ){ 188 $enotify.attr("src", $enotify.attr("src") + "&email=" + emailStr); 189 } 190 } 191 192 // Make sure all calendars have unique ids 193 $('iframe[name="calendar"]').each(function (index, calendar) { 194 calendar.id = 'calendar-' + index; 195 }); 196 197 // Start Frame Resizer 198 function resizeIframe(height, frameElement) { 199 if ( frameElement ) { 200 frameElement.height = ""; 201 frameElement.height = height; 202 } 203 } 204 205 var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; 206 var eventHandler = window[eventMethod]; 207 var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message"; 208 eventHandler(messageEvent, function (e) { 209 if ( Array.isArray(e.data) ) {
210 if( e.data[0] === "setCalHeight" || e.data[0] === "setNotifyHeight") { 211 var frames = document.querySelectorAll('iframe'); 212 for( var i = 0; i < frames.length; i++ ) { 213 if( frames[i].contentWindow === e.source ){ 214 resizeIframe(e.data[1], frames[i]); 215 } 216 } 217 } 218 } 219 }); 220 // End Frame Resizer 221 222 // Alert Close Caching 223 if ($("div.alert").length) { 224 var hide = window.sessionStorage && parseInt(window.sessionStorage.getItem("alertClosed")) > 1; 225 if (!hide || $(".user-logged-in").length != 0) { 226 $("div.alert").addClass('show'); 227 } 228 $("div.alert .close-alert").on('click', function(e) { 229 if (window.sessionStorage) { 230 window.sessionStorage.setItem("alertClosed",parseInt(window.sessionStorage.getItem("alertClosed")||0)+1); 231 } 232 }); 233 } 234 235 // revizeWeather 236 if( typeof $.fn.revizeWeather !== "undefined" ){ 237 $.fn.revizeWeather({ 238 zip: '61364', 239 city_name: '', 240 unit: 'f', 241 success: function(weather) { 242 var html = '<i class="'+weather.icon+'"></i> <span class="forecast">'+weather.temp+'° F</span> <span class="forecast-text">'+weather.forecast+'</span>'; 243 $("#weather").html(html); 244 }, 245 error: function(error) { 246 // better to just hide the secion if there is an error 247 $('.weather').hide(); 248 console.log(error); 249 } 250 }); 251 } 252 253 // Tabs 254 $('#tabs li a').on('click keypress', function(e) { 255 if (e.keyCode === 13 || e.type === 'click') { 256 $('#tabs li, #tabs-content .current').removeClass('current').removeClass('fadeInLeft'); 257 $(this).parent().addClass('current'); 258 259 var currentTab = $(this).attr('href'); 260 261 e.preventDefault(); 262 $(currentTab).addClass('current animated fadeInLeft'); 263 $(currentTab).find('h2').focus(); 264 } 265 }); 266 267 // translate 268 var $translateButton = $('#translate-button'); 269 var $translateReset = $('#translate-reset'); 270 271 $translateButton.on('click', function(e){ 272 if (e.keyCode === 13 || e.type === 'click') { 273 $('#translation-links ul').stop().fadeToggle(); 274 $translateButton.attr('aria-expanded', !('true' === $translateButton.attr('aria-expanded'))); 275 } 276 }); 277 278 $('#translation-links ul').on('mouseleave focusout', function (event) { 279 if (!$(this).has(event.relatedTarget).length && this !== event.relatedTarget) { 280 $(this).fadeOut(); 281 $translateButton.attr('aria-expanded', false); 282 283 if ($translateReset.is(':visible')) { 284 $translateReset.focus(); 285 } 286 } 287 }); 288 289 function removeCookieString(value, domain) { 290 domain = domain ? 'domain='+domain+'; ' : ''; 291 return value+'; expires=Thu, 01 Jan 1970 00:00:01 GMT; '+domain+'path=/'; 292 } 293 294 function unsetGoogtransCookie() { 295 for (var domains = window.location.hostname.split('.'); domains.length >= 2; domains.shift()) { 296 var cookieString = removeCookieString('googtrans=unset', domains.join('.')); 297 document.cookie=cookieString; 298 if (domains.length === 2) { 299 cookieString = removeCookieString('googtrans=unset', '.'+domains.join('.')); 300 document.cookie=cookieString; 301 } 302 } 303 document.cookie=removeCookieString('googtrans=unset'); 304 } 305 306 if (document.cookie.split(';').some(function(item) { return item.trim().startsWith('googtrans=/auto/en'); })) { 307 unsetGoogtransCookie(); 308 } 309 310 // Translate Script 311 var translateURL = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; 312 $.getScript(translateURL); 313 $('#translation-links a').click(function() { 314 var lang = $(this).data('lang'); 315 var $frame = $('iframe.skiptranslate'); 316 if (!$frame.length) { 317 return false; 318 } 319 var $el = $frame.contents().find('span.text:contains(' + lang + ')').parent().parent().get(0); 320 321 if (!$el) { 322 $frame.contents().find('span.text:contains("English")').parent().parent().get(0); 323 } 324 $el.click(); 325 return false; 326 }); 327 328 $translateReset.on('keydown click', function(e){ 329 if (e.keyCode === 13 || e.type === 'click') { 330 $('iframe.skiptranslate').contents().find('span.text:contains("English")').parent().parent().get(0).click(); 331 } 332 }); 333 334 $(document).on('click', function(e) { 335 if (!$(e.target).closest('#translation-links').length) { 336 $('#translation-links ul').fadeOut(); 337 $translateButton.attr('aria-expanded', false); 338 } 339 }); 340 341 // Tiny Slider 342 if (typeof tns !== "undefined") { 343 $('.tiny-slider').each(function(i, el) { 344 tns({ 345 autoplay: true, 346 autoplayTimeout: 8000, 347 container: el, 348 items: 1, 349 mouseDrag: true, 350 lazyload: true, 351 lazyloadSelector: '.tns-lazy-img', 352 mode: "gallery", 353 autoplayButtonOutput: false, 354 prevButton: '#slider-prev', 355 nextButton: '#slider-next', 356 }); 357 }); 358 359 $('#slider-prev, #slider-next').attr('tabindex', 0); 360 361 // 362 var quickLinksCarousel = $('#quick-links-carousel'); 363 if (quickLinksCarousel.length > 0) { 364 tns({ 365 container: '#quick-links-carousel', 366 loop: false, 367 controlsText: [ 368 '<img src="_assets_/images/slider-prev.png" alt="Previous slide">', 369 '<img src="_assets_/images/slider-next.png" alt="Next slide">', 370 ], 371 gutter: 20, 372 speed: 600,
373 nav: false, 374 responsive: { 375 0: { items: 1 }, 376 480: { items: 2 }, 377 768: { items: 3 }, 378 992: { items: 4 }, 379 1200: { items: 5 }, 380 } 381 }); 382 } 383 $('#quick-links-in').css('opacity', '1'); 384 385 // news slider 386 $('.news-slider').each(function(i, el) { 387 tns({ 388 container: el, 389 loop: false, 390 speed: 600, 391 nav: false, 392 lazyload: true, 393 lazyloadSelector: '.h-news-banner', 394 prevButton: '#news-prev', 395 nextButton: '#news-next', 396 responsive: { 397 //0: { items: 1 }, 398 480: { items: 1 }, 399 768: { items: 2 }, 400 992: { items: 3 }, 401 } 402 }); 403 }); 404 405 } 406 407 // Responsive Tables 408 $('.post table:not(.layout-table):not(.not-responsive)').wrap('<div class="table-responsive"></div>'); 409 $('.layout-table').attr('role', 'presentation'); 410 411 // Preloader 412 $window.on('load', function() { 413 414 setTimeout(function(){ 415 $body.addClass('loaded'); 416 $('#loader-wrapper').fadeOut(); 417 }, 600); 418 419 }); 420 421 $window.ready(function(){ 422 423 //#Smooth Scrolling 424 $('a[href*="#"]').not('[href="#"]').not('[href*="#collapse"]').not('.faq-header').click(function(event) { 425 if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) { 426 var target = $(this.hash); 427 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 428 if (target.length) { 429 event.preventDefault(); 430 $('html,body').animate({ 431 scrollTop: target.offset().top 432 }, 1000, function() { 433 var $target = $(target); 434 $target.focus(); 435 if ($target.is(":focus")) { 436 return false; 437 } else { 438 $target.attr('tabindex','-1'); 439 $target.focus(); 440 $target.removeAttr('tabindex'); 441 }; 442 }); 443 } 444 } 445 }); 446 447 $('#skip').on('click', function(event) { 448 event.preventDefault(); 449 450 var target = $(this).attr('href'); 451 var $target = $(target); 452 453 if ($target.length) { 454 var headerHeight = 92; 455 var targetOffset = $target.offset().top - headerHeight; 456 457 $('html, body').stop().animate({ scrollTop: targetOffset }, 1000, function() { 458 $target.attr('tabindex', '-1'); 459 $target[0].focus({ preventScroll: true }); 460 }); 461 } 462 }); 463 464 }); // Ready 465 466 // 467 const siteHeader = $('.site-header'); 468 469 function scrollFunc() { 470 const isScrolled = $window.scrollTop() > 0; 471 siteHeader.toggleClass('scrolled', isScrolled); 472 } 473 474 // Scroll functionality for a lengthy menu 475 const firstLevel = $('#nav .first-level'); 476 477 if (!firstLevel.find('.nav-in').length) { 478 firstLevel.wrapInner('<li class="nav-in-wrap"><ul class="nav-in"></ul></li>'); 479 } 480 481 // Mega menu dividers 482 $('<li class="first-divider nav-divider"></li><li class="second-divider nav-divider"></li><li class="third-divider nav-divider"></li>').prependTo('.site-header .nav-in'); 483 484 const headerLi = $('#nav > li'); 485 const matchMediaQuery = window.matchMedia("(min-width: 992px)"); 486 487 function manageHeader(mediaQuery) { 488 if (mediaQuery.matches) { 489 490 scrollFunc(); 491 $window.scroll(scrollFunc); 492 493 headerLi.hover( 494 function() { 495 const navIn = $(this).find('.nav-in'); 496 const gap = 20; 497 const maxHeight = $window.height() - siteHeader.outerHeight() - gap; 498 499 if (navIn.outerHeight() > maxHeight) { 500 firstLevel.css({ 501 height: maxHeight, 502 'overflow-y': 'auto', 503 'overscroll-behavior': 'contain' 504 }); 505 } 506 }, 507 function() { 508 firstLevel.css({ 509 height: 'auto', 510 'overflow-y': 'visible' 511 }); 512 } 513 ); 514 } else { 515 $window.off('scroll', scrollFunc); 516 517 headerLi.off('mouseenter mouseleave'); 518 firstLevel.css('height', 'auto'); 519 } 520 } 521 522 manageHeader(matchMediaQuery); 523 matchMediaQuery.addListener(manageHeader); 524 525 // Hero video 526 if(typeof $.fn.YTPlayer !== "undefined"){ 527 var sliderVideo = $("#sliderVideo"); 528 if (sliderVideo.length) sliderVideo.YTPlayer(); 529 } 530 531 // 532 function equalHeights(el) { 533 el.css('height', 'auto'); 534 535 var maxHeight = 0; 536 el.each(function() { 537 var height = $(this).outerHeight(); 538 maxHeight = Math.max(height, maxHeight); 539 }); 540 541 el.css('height', maxHeight); 542 } 543 544 $window.on('load resize', function() { 545 equalHeights($('.h-news-info')); 546 equalHeights($('.h-news-title')); 547 equalHeights($('.highlights-item-info')); 548 equalHeights($('.highlights-item-title')); 549 }); 550 551 /* communities ( start ) */ 552 const $tabs = $('.communities-tablist [role="tab"]'); 553 const $panels = $('.communities-panels [role="tabpanel"]'); 554 const $mainPanel = $('.communities-main-panel'); 555 const $backButton = $('.back-button'); 556 557 $tabs.on('click', function () { 558 const $clickedTab = $(this); 559 const panelId = $clickedTab.attr('aria-controls'); 560 const $targetPanel = $('#' + panelId); 561 562 $tabs.removeClass('active').attr({'aria-selected': 'false', 'tabindex': '-1'}); 563 $clickedTab.addClass('active').attr({'aria-selected': 'true', 'tabindex': '0'}); 564 565 $panels.removeClass('active').attr('hidden', true); 566 $targetPanel.removeAttr('hidden')[0].offsetWidth; 567 $targetPanel.addClass('active'); 568 569 // Hide main panel, show back button 570 $mainPanel.hide(); 571 $backButton.removeAttr('hidden'); 572 573 if ($window.width() < 992) { 574 $('html, body').animate({ 575 scrollTop: $('#communities-data').offset().top 576 }, 1000); 577 } 578 }); 579 580 $backButton.on('click', function () { 581 $panels.removeClass('active').attr('hidden', true); 582 $tabs.removeClass('active').attr({'aria-selected': 'false', 'tabindex': '-1'}); 583 584 // Show main panel, hide back button 585 $mainPanel.show(); 586 $backButton.attr('hidden', true); 587 588 if ($window.width() < 992) { 589 $('html, body').animate({ 590 scrollTop: $('#communities-data').offset().top 591 }, 0); 592 } 593 }); 594 595 // Keyboard navigation 596 $tabs.on('keydown', function (e) { 597 const index = $tabs.index(this); 598 let newIndex = null; 599 600 if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') { 601 newIndex = (index - 1 + $tabs.length) % $tabs.length; 602 } else if (e.key === 'ArrowRight' || e.key === 'ArrowDown') { 603 newIndex = (index + 1) % $tabs.length; 604 } else if (e.key === 'Enter' || e.key === ' ') { 605 e.preventDefault(); 606 const panelId = $(this).attr('aria-controls'); 607 $('#' + panelId).focus(); 608 return; 609 } 610 611 if (newIndex !== null) { 612 $tabs.eq(newIndex).focus().click(); 613 e.preventDefault(); 614 } 615 }); 616 617 const $clonedButtons = $('.communities-tablist button').clone().each(function() { 618 $(this).removeAttr('style'); 619 }); 620 621 $('<div class="main-panel-btns"></div>').append($clonedButtons).appendTo($mainPanel); 622 623 $('.main-panel-btns').on('click', 'button', function() { 624 const btnId = $(this).attr('id'); 625 $(`.communities-tablist #${btnId}`).trigger('click'); 626 }); 627 628 $('.main-panel-btns').on('mouseenter', 'button', function() { 629 const btnId = $(this).attr('id'); 630 $(`.communities-tablist #${btnId}`).addClass('hover-active'); 631 }).on('mouseleave', 'button', function() { 632 const btnId = $(this).attr('id'); 633 $(`.communities-tablist #${btnId}`).removeClass('hover-active'); 634 }); 635 636 // create/add headers 637 $tabs.each(function() { 638 const panelId = $(this).attr('aria-controls'); 639 const label = $(this).find('span').text(); 640 641 const $header = $('<h2>', { 642 class: 'communities-panel-header', 643 text: label 644 }); 645 646 $(`#${panelId}`).prepend($header); 647 }); 648 /* communities ( end ) */ 649 650 // max 3 letters 651 $('.aside-hours strong').each(function() { 652 var day = $(this).text(); 653 if (day.length > 3) $(this).text(day.substring(0, 3)); 654 }); 655 656 // userway btn 657 $('#app-userway-btn').on('click', function () { 658 if (window.UserWay && typeof window.UserWay.widgetToggle === 'function') { 659 window.UserWay.widgetToggle(); 660 return; 661 } 662 }); 663 664 // ADA 665 var labels = { 666 'goog-gt-votingInputSrcLang': 'Source Language:', 667 'goog-gt-votingInputTrgLang': 'Target Language:', 668 'goog-gt-votingInputSrcText': 'Source Text:', 669 'goog-gt-votingInputTrgText': 'Translated Text:', 670 'goog-gt-votingInputVote': 'Vote:' 671 }; 672 673 function addLabels() { 674 $.each(labels, function(id, text) { 675 var input = $('#' + id); 676 if (input.length && !input.prev('label').length) { 677 var label = $('<label>').attr('for', id).text(text); 678 input.before(label); 679 } 680 }); 681 } 682 683 var observer = new MutationObserver(function(mutations) { 684 mutations.forEach(function(mutation) { 685 if (mutation.addedNodes.length) { 686 addLabels(); 687 } 688 }); 689 }); 690 691 var config = { childList: true, subtree: true }; 692 693 observer.observe(document.body, config); 694 695 addLabels(); 696 697 // ADA 698 $('#rz-bar-wrap a img').each(function() { 699 var src = $(this).attr('src'); 700 var fileName = src.split('/').pop().split('.')[0]; 701 var altText = fileName.replace(/[_-]/g, ' ') + ' icon'; 702 $(this).attr('alt', altText); 703 }); 704 705 // 706 $('.aside-box').each(function () { 707 var box = $(this); 708 var header = box.find('.aside-box-header').first().text().trim(); 709 710 var contentCheck = box.clone(); 711 contentCheck.find('.left-top, .aside-box-header, img').remove(); 712 713 var content = contentCheck.text().trim(); 714 715 if (header || content) { 716 box.show(); 717 } 718 }); 719 720 if ($.trim($('#flyout').html()) !== '') { 721 $('#flyout-wrap').show(); 722 } 723 724 // 725 var fileSearch = $('#file-search'); 726 var resetButton = $('#post .rz-doc-search-reset'); 727 728 fileSearch.on('keypress', function() { 729 resetButton.css('display', 'inline-block'); 730 }); 731 732})(jQuery); 733 734// 735var pointerEvents = $('body').hasClass('user-logged-in') ? 'auto' : 'none'; 736$('.rz-btns-container').parent().css('pointer-events', pointerEvents);
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.