PageSourceSearch

https://redondo.org/_assets_/js/scripts.js?v=20260924014148

js redondo.org collected 2026-09-24 17:42:12 UTC 39,127 bytes, 1,163 lines download raw bytes

1/*-----------------------------------------------------------------------------------
2
3	Theme Name: Redondo Beach, CA
4	Front-end developer: Abir Hossain
5	Author Design: Samir Alley
6	Author URI: http://www.revize.com/
7	Date: 4/12/2023
8
9-----------------------------------------------------------------------------------*/
10function RZRenderMini(elementList) {
11  $("#homepage .mini-calendar").css("display", "block");
12
13  function hasEventClick() {
14    $("#homepage .fc-day-top.day-has-event a").on("click", function () {
15      $("#homepage .fc-left .fc-button-group+.fc-button-group").css("opacity", "1");
16      $("#homepage .fc-left .fc-button-group+.fc-button-group button").css("cursor", "pointer");
17      $("#homepage .fc-left .fc-button-group+.fc-button-group button").css("pointer-events", "all");
18      $("#homepage .fc-left .fc-prev-button").css("opacity", "0").css("pointer-events", "none");
19      $("#homepage .fc-left .fc-next-button").css("opacity", "0").css("pointer-events", "none");
20    });
21  }
22
23  function eachEvent() {
24    $("a.fc-day-grid-event").each(function () {
25      var eventIndex = $(this).parent(".fc-event-container").index();
26      $(this).parent().parent(":first-child").parent().siblings().find("td").eq(eventIndex).addClass("day-has-event");
27    });
28
29    hasEventClick();
30  }
31
32  eachEvent();
33  hasEventClick();
34
35  $("#homepage .fc-left .fc-button-group > .fc-dayGridMonth-button")
36    .add("#homepage .fc-left .fc-button-group > .fc-prev-button")
37    .add("#homepage .fc-left .fc-button-group > .fc-next-button")
38    .add("#homepage .fc-left .fc-button-group > .fc-today-button")
39    .on("click", function () {
40      eachEvent();
41    });
42
43  $("#homepage .fc-left .fc-button-group+.fc-button-group .fc-dayGridMonth-button").on("click", function () {
44    $("#homepage .fc-left .fc-button-group+.fc-button-group").css("opacity", "0");
45    $("#homepage .fc-left .fc-button-group+.fc-button-group button").css("pointer-events", "none");
46    $("#homepage .fc-left .fc-prev-button").css("opacity", "1").css("pointer-events", "all");
47    $("#homepage .fc-left .fc-next-button").css("opacity", "1").css("pointer-events", "all");
48    hasEventClick();
49  });
50
51  $("#homepage .fc-left .fc-button-group+.fc-button-group .fc-today-button").on("click", function () {
52    $("#homepage .fc-left .fc-button-group+.fc-button-group").css("opacity", "1");
53  });
54
55  // border hide on hover
56  $(document).ready(function () {
57    let aiChatClicked = false;
58
59    $("#ai-chat-button").on("click", () => {
60      aiChatClicked = true;
61    });
62
63    if ($(window).width() > 991) {
64      setTimeout(() => {
65        if (!aiChatClicked) {
66          $("#ai-chat-button").addClass("close-ai-bot").removeClass("open-ai-bot");
67          $("#botIframe").addClass("show-ai-chat").removeClass("hide-ai-chat");
68        }
69      }, 10000);
70    }
71
72    $(".calendar-left").addClass("equal");
73
74    $(".cal-event").addClass("equal");
75    $("time").addClass("equal");
76  });
77}
78
79(function ($) {
80  "use strict";
81
82  var $window = $(window),
83    $body = $("body");
84
85  /*!
86   * IE10 viewport hack for Surface/desktop Windows 8 bug
87   * Copyright 2014-2015 Twitter, Inc.
88   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
89   */
90
91  // See the Getting Started docs for more information:
92  // http://getbootstrap.com/getting-started/#support-ie10-width
93  if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
94    var msViewportStyle = document.createElement("style");
95    msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}"));
96    document.querySelector("head").appendChild(msViewportStyle);
97  }
98
99  // RZ Class
100  if (typeof RZ !== "undefined") {
101    if (RZ.login) {
102      $body.addClass("user-logged-in");
103    } else {
104      $body.addClass("user-not-logged-in");
105    }
106  }
107
108  // prevent focused class changes on click - This way arrows wont pop when clicking nav links
109  $("#nav a,#flyout a").on("mousedown", function () {
110    isClick = true;
111  });
112
113  // Search Toggle
114  $("#search-toggle").on("click", function (e) {
115    $("#search").stop().slideToggle(200);
116    $(this).toggleClass("fa-search fa-close");
117  });
118
119  // Navigation Toggle
120  $("#nav-toggle").on("click", function () {
121    $("#nav").stop().slideToggle();
122    $(this).toggleClass("fa-bars fa-close");
123  });
124
125  // Menu Arrows and Toggles
126  $("#nav >li>ul,#flyout >li>ul").addClass("first-level");
127  $("#nav  li ul ul").addClass("second-level");
128  $("#nav>li:has(ul)").each(function () {
129    $(
130      '<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>'
131    ).insertAfter($(this).find("a:first"));
132    $(this)
133      .find("ul:first")
134      .attr("aria-labelledby", "dropdown-toggle-" + $(this).index());
135  });
136  $("#nav li ul>li:has(ul)").each(function (index) {
137    $('<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(
138      $(this).find("a:first")
139    );
140    $(this)
141      .find("ul:first")
142      .attr("aria-labelledby", "sub-dropdown-toggle-" + index);
143  });
144  $("#flyout >li:has(ul)").each(function () {
145    $(
146      '<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>'
147    ).insertAfter($(this).find("a:first"));
148    $(this)
149      .find("ul:first")
150      .attr("aria-labelledby", "flyout-dropdown-toggle-" + $(this).index());
151  });
152
153  // Keyboard Navigation: Nav, flyout
154  var isClick = false;
155  $("#nav li a, #flyout  li a, a, button, .toggle, .toggle2").on("focusin", function (e) {
156    if (isClick === false) {
157      $(".focused").removeClass("focused");
158      $(e.currentTarget).parents("#nav li, #flyout li").addClass("focused");
159      $("#flyout .opened:not(.focused) ul:visible,#flyout .opened2:not(.focused) ul:visible").slideUp().parent().removeClass("opened opened2");
160      $("#nav .opened:not(.focused) .mega-wrapper:visible,#nav .opened2:not(.focused) .mega-wrapper:visible").slideUp().parent().removeClass("opened opened2");
161    } else {
162      $(".focused").removeClass("focused");
163      isClick = false;
164    }
165  });
166
167  // flyout toggle
168  $("#flyout .toggle").on("click keydown", function (e) {
169    if (e.keyCode === 13 || e.type === "click") {
170      e.preventDefault();
171      var $parent = $(this).parent();
172      var $parentLi = $parent.parent();
173      $parent.toggleClass("opened");
174      if ($parent.addClass("active") && $(this).next(".first-level").is(":visible")) {
175        $(this).next(".first-level").slideUp();
176        $parent.removeClass("active");
177        $(this).attr({ "aria-expanded": "false" });
178      } else {
179        $(this).attr({ "aria-expanded": "true" });
180        $(".first-level").slideUp("slow");
181        $parent.addClass("active");
182        $(this).next(".first-level").slideToggle();
183      }
184    }
185  });
186
187  $(window).on("load resize", function () {
188    if ($window.width() < 992) {
189    }
190  });
191
192  if ($window.width() < 992) {
193    // Insert needed for mobile
194    // nav toggle for mobile
195    $("#nav .toggle").on("click keydown", function (e) {
196      if (e.keyCode === 13 || e.type === "click") {
197        e.preventDefault();
198        var $parent = $(this).parent();
199        var $parentLi = $parent.parent();
200        $parent.toggleClass("opened");
201        if ($parent.addClass("active") && $(this).next(".first-level").is(":visible")) {
202          $(this).next(".first-level").slideUp();
203          $parent.removeClass("active");
204          $(this).attr({ "aria-expanded": "false" });
205        } else {
206          $(this).attr({ "aria-expanded": "true" });
207          $(".first-level").slideUp("slow");
208          $parent.addClass("active");
209          $(this).next(".first-level").slideToggle();
210        }
211      }
212    });
213
214    $("#nav>li.mega-wrapper>ul").each(function () {
215      $(this).unwrap("div.mega-wrapper");
216    });
217  } else {
218    // Insert needed for desktop
219    $("#nav ul, #flyout ul").css("display", "");
220
221    $("#nav>li>ul").each(function () {
222      $(this).wrap("<div class='mega-wrapper'></div>");
223    });
224
225    // nav toggle for desktop
226    $("#nav .toggle").on("click keydown", function (e) {
227      if (e.keyCode === 13 || e.type === "click") {
228        e.preventDefault();
229        var $parent = $(this).parent();
230        var $parentLi = $parent.parent();
231        $parent.toggleClass("opened");
232        if ($parent.addClass("active") && $(this).next(".mega-wrapper").is(":visible")) {
233          $(this).next(".mega-wrapper").slideUp();
234          $parent.removeClass("active");
235          $(this).attr({ "aria-expanded": "false" });
236        } else {
237          $(this).attr({ "aria-expanded": "true" });
238          $(".mega-wrapper").slideUp("slow");
239          $parent.addClass("active");
240          $(this).next(".mega-wrapper").slideToggle();
241        }
242      }
243    });
244
245    setTimeout(() => {
246      $("#nav >.mega-wrapper >ul").show();
247    }, 1000);
248  }
249
250  $(".toggle2").on("click keydown", function (e) {
251    if (e.keyCode === 13 || e.type === "click") {
252      e.preventDefault();
253      var $parent = $(this).parent();
254      var $parentLi = $parent.parent();
255      $parent.toggleClass("opened2");
256      if ($parent.addClass("active") && $(this).next(".second-level").is(":visible")) {
257        $(this).next(".second-level").slideUp();
258        $parent.removeClass("active");
259        $(this).attr({ "aria-expanded": "false" });
260      } else {
261        $(this).attr({ "aria-expanded": "true" });
262        $(".second-level").slideUp("slow");
263        $parent.addClass("active");
264        $(this).next(".second-level").slideToggle();
265      }
266    }
267  });
268
269  // close nav if left
270  $(".desktop *").focus(function (e) {
271    var $opened = $(".opened");
272    var $opened2 = $(".opened2");
273    if ($opened.length > 0 || $opened2.length > 0) {
274      if ($(".opened :focus").length < 1) {
275        $opened.children("ul").slideUp();
276        $opened.removeClass("opened");
277        $(".opened2").removeClass("opened2");
278      }
279      if ($(".opened2 :focus").length < 1) {
280        $opened2.children("ul").slideUp();
281        $opened2.removeClass("opened2");
282      }
283    }
284  });
285
286  // Flyout
287  var flyout = $("#flyout"),
288    flyoutwrap = $("#flyout-wrap");
289
290  if (flyout.text().length) {
291    flyoutwrap.prepend('<div tabindex="0" role="button" id="flyout-toggle" class="d-lg-none"><i class="fa fa-bars"></i> Sub Menu</div>');
292  }
293
294  $("#flyout-toggle").on("click", function () {
295    flyout.slideToggle();
296    $(this).toggleClass("active");
297  });
298
299  $("#flyout-toggle").on("keydown", function (e) {
300    if (e.keyCode === 13) {
301      flyout.slideToggle();
302      $(this).toggleClass("active");
303    }
304  });
305
306  $("#flyout").on("keydown", function (e) {
307    if (e.keyCode === 27 && $(window).width() < 992) {
308      flyout.slideUp();
309      $("#flyout-toggle").removeClass("active");
310      $("#flyout-toggle").trigger("focus");
311    }
312  });
313
314  $("#flyout li:last-child").on("keydown", function (e) {
315    if (e.keyCode === 9 && !e.shiftKey && $(window).width() < 992) {
316      flyout.slideUp();
317      $("#flyout-toggle").removeClass("active");
318    }
319  });
320
321  /*
322   * E-Notify Auto submit
323   */
324  $.urlParam = function (n) {
325    var e = new RegExp("[?&]" + n + "=([^]*)").exec(window.location.href);
326    return null == e ? null : e[1] || 0;
327  };
328  var $enotify = $('iframe[src*="/revize/plugins/notify/notify.jsp"]');
329  if ($enotify.length > 0) {
330    var emailStr = $.urlParam("email");
331    if (emailStr != null) {
332      $enotify.attr("src", $enotify.attr("src") + "&email=" + emailStr);
333    }
334  }
335
336  // Make sure all calendars have unique ids
337  $('iframe[name="calendar"]').each(function (index, calendar) {
338    calendar.id = "calendar-" + index;
339  });
340
341  // Start Frame Resizer
342  function resizeIframe(height, frameElement) {
343    if (frameElement) {
344      frameElement.height = "";
345      frameElement.height = height;
346    }
347  }
348
349  var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
350  var eventHandler = window[eventMethod];
351  var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message";
352  eventHandler(messageEvent, function (e) {
353    if (Array.isArray(e.data)) {
354      if (e.data[0] === "setCalHeight" || e.data[0] === "setNotifyHeight") {
355        var frames = document.querySelectorAll("iframe");
356        for (var i = 0; i < frames.length; i++) {
357          if (frames[i].contentWindow === e.source) {
358            resizeIframe(e.data[1], frames[i]);
359          }
360        }
361      }
362    }
363  });
364  // End Frame Resizer
365
366  // Alert Close Caching
367  if ($("div.alert").length) {
368    var hide = window.sessionStorage && parseInt(window.sessionStorage.getItem("alertClosed")) > 1;
369    if (!hide || $(".user-logged-in").length != 0) {
370      $("div.alert").addClass("show");
371    }
372    $("div.alert button.close").on("click", function (e) {
373      if (window.sessionStorage) {
374        window.sessionStorage.setItem("alertClosed", parseInt(window.sessionStorage.getItem("alertClosed") || 0) + 1);
375      }
376    });
377  }
378
379  var $translateButton = $('.translate-button');
380
381$translateButton.on('click', function () {
382    $(this).next('ul').stop().fadeToggle();
383    $(this).toggleClass('toggled');
384    $(this).attr('aria-expanded', $(this).attr('aria-expanded') !== 'true');
385});
386
387$('.translation-links ul').on('mouseleave', function () {
388    $(this).fadeOut();
389    $translateButton.attr('aria-expanded', false);
390    $('.translate-button').removeClass('toggled');
391});
392
393// Load Google Translate
394var translateURL = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit";
395$.getScript(translateURL);
396
397// Fix selector هنا 👇
398$('.translation-links a').attr('href', 'javascript:void(0)');
399
400$('.translation-links a').on('click', function () {
401    var lang = $(this).data('lang');
402
403    setTimeout(function () {
404        var $frame = $('iframe.skiptranslate');
405
406        if (!$frame.length) return;
407
408        if (lang === 'English') {
409            $frame.contents().find('span.text:contains("English")')
410                .closest('a')[0].click();
411            return;
412        }
413
414        var el = $frame.contents().find('span.text:contains("' + lang + '")')
415            .closest('a')[0];
416
417        if (el) {
418            el.click();
419        } else {
420            // fallback
421            $frame.contents().find('span.text:contains("English")')
422                .closest('a')[0].click();
423        }
424    }, 1000); // important delay
425});
426
427  // Tiny Slider
428  if (typeof tns !== "undefined") {
429    $(".tiny-slider").each(function (i, el) {
430      tns({
431        autoplay: true,
432        autoplayTimeout: 8000,
433        container: el,
434        items: 1,
435        lazyload: true,
436        lazyloadSelector: ".tns-lazy-img", // accompanied with data src or data-style
437        mode: "gallery",
438        preventScrollOnTouch: "force",
439        nav: false,
440        controlsText: ['<img src="_assets_/images/angle-left.png" alt="">', '<img src="_assets_/images/angle-right.png" alt="">'],
441        autoplayButtonOutput: false,
442      });
443    });
444
445    $("#quick-links .tiny-carousel").each(function (i, el) {
446      var qlinkCount = $("#quick-links .tiny-item").length;
447      var $el = $(el);
448      var tinyItemCount = $el.children().length;
449      var tinyItemData = $el.data("tinyItems") ? $el.data("tinyItems") : 6;
450      tns({
451        container: el,
452        items: Math.min(tinyItemCount, tinyItemData),
453        lazyload: true,
454        lazyloadSelector: ".tns-lazy-img", // accompanied with data src or data-style
455        preventScrollOnTouch: "force",
456        nav: false,
457        loop: true,
458        speed: 600,
459        controlsText: ['<img src="_assets_/images/angle-left.png" alt="">', '<img src="_assets_/images/angle-right.png" alt="">'],
460        autoplayButtonOutput: false,
461        responsive: {
462          1460: {
463            items: qlinkCount >= 5 ? 5 : qlinkCount,
464          },
465          992: {
466            items: qlinkCount >= 4 ? 4 : qlinkCount,
467          },
468          768: {
469            items: qlinkCount >= 3 ? 3 : qlinkCount,
470          },
471          540: {
472            items: qlinkCount >= 2 ? 2 : qlinkCount,
473          },
474          0: {
475            items: 1,
476          },
477        },
478        gutter: 30,
479      });
480    });
481
482    $("#news .news-carousel").each(function (i, el) {
483      var newsCount = $("#news .tiny-item").length;
484      var $el = $(el);
485      var tinyItemCount = $el.children().length;
486      var tinyItemData = $el.data("tinyItems") ? $el.data("tinyItems") : 6;
487      tns({
488        container: el,
489        items: Math.min(tinyItemCount, tinyItemData),
490        lazyload: true,
491        lazyloadSelector: ".tns-lazy-img", // accompanied with data src or data-style
492        preventScrollOnTouch: "force",
493        nav: false,
494        loop: false,
495        speed: 600,
496        onInit: function () {
497          $(".news-box-content").addClass("equal");
498        },
499        controlsText: ['<img src="_assets_/images/angle-left.png" alt="">', '<img src="_assets_/images/angle-right.png" alt="">'],
500        autoplayButtonOutput: false,
501        responsive: {
502          1200: {
503            gutter: 30,
504          },
505
506          992: {
507            items: newsCount >= 3 ? 3 : newsCount,
508          },
509          767: {
510            items: newsCount >= 2 ? 2 : newsCount,
511          },
512          0: {
513            items: 1,
514          },
515        },
516        gutter: 15,
517      });
518    });
519  }
520
521  // Responsive Tables
522  $(".post table:not(.layout-table):not(.not-responsive)").wrap('<div class="table-responsive"></div>');
523  $(".layout-table").attr("role", "presentation");
524
525  if ($("#freeform #news").length > 0) {
526    $("#freeform #main").addClass("has-news");
527  }
528
529  if (RZ.pageid == "links-182") {
530    $("body").addClass("public_works");
531  }
532
533  $window.ready(function () {
534    // if($(window).width() > 992){
535    // 	$('#nav').mouseover(function(){
536    // 		$('header').css('position','absolute')
537    // 	}).mouseleave(function(){
538    // 		$('header').css('position','fixed')
539    // 	})
540    // }
541
542    if ($("#quick-links .tiny-item").length == 0) {
543      $("#quick-links").hide();
544    }
545
546    $(".rz-business-block").attr("id", "rz-business-directory");
547
548    function CloneTab() {
549      $("#tabs-button").clone().appendTo(".calendar-header");
550      $(".calendar-header #tabs-button").show();
551    }
552
553    var interval = setInterval(() => {
554      if ($(".calendar-header").children().length > 0) {
555        clearInterval(interval);
556      } else {
557        CloneTab();
558      }
559    }, 100);
560
561    if ($(".pull-left").width() == 0) {
562      $(".pull-left").hide();
563    }
564
565    $(window).on("load resize scroll", function (e) {
566      if ($(window).width() > 992) {
567        if (document.documentElement.scrollTop > 10) {
568          $("header").css("background", "rgb(7 57 77)");
569        } else {
570          $("header").css("background", "rgba(0,0,0,.3)");
571        }
572      }
573    });
574
575    $(".mega-content-header").each(function () {
576      var megaHeaderIndex = $(this).parent().index();
577      console.log(megaHeaderIndex);
578      $(this).text($("#nav>li>.mega-wrapper").eq(megaHeaderIndex).children("a,span").text() + " menu");
579    });
580
581    $(".mega-content").each(function () {
582      var megaContentIndex = $(this).index();
583      console.log(megaContentIndex);
584      $(this).clone();
585      $("#nav>li>.mega-wrapper").eq(megaContentIndex).children("ul").prepend($(this).clone());
586    });
587
588    setTimeout(() => {
589      function windowResizer() {
590        $("#nav >li").each(function () {
591          var megaMneuIndex = $(this).index();
592          var megaImageHeight = $(this).children(".mega-wrapper").innerHeight();
593          var megaImage = $(".mega-content .mega-content-banner", this);
594
595          megaImage.css("height", megaImageHeight);
596        });
597      }
598      windowResizer();
599      $window.resize(windowResizer);
600    }, 1000);
601
602    // nav mega menu
603    $("#nav").addClass("mega");
604
605    // closes the alert banner on click
606    $("#alert-close").click(function (e) {
607      e.preventDefault();
608      $("#alert").stop().slideUp();
609    });
610
611    $(".social-link li").on("mouseover click", function (e) {
612      var socialIndex = $(this).index();
613      console.log(socialIndex);
614      $(".social-link-body ul").hide();
615      $(".social-link-body ul").eq(socialIndex).show();
616    });
617
618    $(".social-link-body ul").mouseleave(function (e) {
619      var socialIndex = $(this).index();
620      $(".social-link-body ul").eq(socialIndex).hide();
621    });
622
623    window.addEventListener("mouseup", function (event) {
624      var pol = document.getElementById("social");
625      if (event.target != pol && event.target.parentNode != pol) {
626        $(".social-link-body ul").hide();
627      }
628    });
629
630    // matchHeight
631    if (typeof $.fn.matchHeight !== "undefined") {
632      $(".equal").matchHeight({
633        //defaults
634        byRow: true,
635        property: "height", // height or min-height
636        target: null,
637        remove: false,
638      });
639    }
640
641    //#Smooth Scrolling
642    $('a[href*="#"]')
643      .not('[href="#"]')
644      .not('[href*="#collapse"]')
645      .not(".faq-header")
646      .click(function (event) {
647        if (location.pathname.replace(/^\//, "") === this.pathname.replace(/^\//, "") && location.hostname === this.hostname) {
648          var target = $(this.hash);
649          target = target.length ? target : $("[name=" + this.hash.slice(1) + "]");
650          if (target.length) {
651            event.preventDefault();
652            $("html,body").animate(
653              {
654                scrollTop: target.offset().top - 300,
655              },
656              1000,
657              function () {
658                var $target = $(target);
659                $target.focus();
660              }
661            );
662          }
663        }
664      });
665
666    // scroll top by click
667
668    $(document).ready(function () {
669      $("#skip").click(function () {
670        $("html, body").animate({ scrollTop: $("#main").offset().top - 300 }, 1000);
671        return false;
672      });
673    });
674
675    // Curated search
676    $("#search .search-form button").on("click", function () {
677      return false;
678    });
679
680    // Search Tabs
681    // $(".search-nav li").on('click',function() {
682    // 	var tab = $(this).data('tab');
683    // 	$('.search-nav li').removeClass('active');
684    // 	$(this).addClass('active');
685
686    // 	$('#search-2 .g-search-wrap,#search-3 .g-search-wrap').html('');
687    // 	$('#search-results .tab-pane').removeClass('active');
688    // 	$(tab).addClass('active');
689    // 	$('#search-2.active .g-search-wrap').html('<iframe src="_assets_/plugins/search-box.html?q='+$('#search-input').val()+' site:https://www.redondo.org/ filetype:doc OR filetype:pdf OR filetype:docx"></iframe>');
690    // 	$('#search-3.active .g-search-wrap').html('<iframe src="_assets_/plugins/search-box.html?q='+$('#search-input').val()+' site:https://www.redondo.org/"></iframe>');
691
692    // 	$('.g-search-wrap iframe').on("load", function() {
693    // 		$(this).contents().find("body").css({
694    // 			transition: 'all 300ms',
695    // 			margin: "8px 0 0",
696    // 		});
697
698    // 		$(this).contents().find(".gsc-control-cse").css({
699    // 			transition: 'all 300ms',
700    // 			padding: "1em 0",
701    // 		});
702
703    // 		$(this).contents().find(".gsc-search-box").css({
704    // 			transition: 'all 300ms',
705    // 			opacity: 0,
706    // 		});
707    // 	});
708    // });
709
710    $("#search-input").focusin(function () {
711      $('.search-nav li[data-tab="#search-1"]').click();
712    });
713
714    $("#close-curated").on("click", function () {
715      $("#search-results").fadeOut();
716      $("#slider").removeClass("results-open");
717      $("#search-input").val("");
718      $(".search-placeholder").css("display", "block");
719    });
720
721    $(function () {
722      function getCleanString(str) {
723        if (str.length) {
724          return str
725            .replace(/&lt;/g, "<")
726            .replace(/&gt;/g, ">")
727            .replace(/&amp;/g, "&")
728            .replace(/&quot;/g, '"')
729            .replace(/&#39;/g, "'");
730        } else {
731          return "";
732        }
733      }
734
735      var searchStr = "";
736      var throttle = null;
737      var timer;
738      var $input = $("#search-input");
739      var termsArr = [];
740      //on keyup, start the countdown
741      $input.on("keyup", function () {
742        clearTimeout(timer);
743        timer = setTimeout(liveSearch, 600);
744        searchStr = $(this).val().toLowerCase();
745      });
746      $input.on("keydown", function () {
747        termsArr = [];
748        clearTimeout(timer);
749      });
750
751      function liveSearch() {
752        if (searchStr.length >= 3) {
753          $("#search-results").fadeIn();
754          $("#slider").addClass("results-open");
755          termsArr = searchStr.split(" ");
756          //$('#curated').fadeOut();
757          $("#curated").html("");
758          $.each(searchJson, function (i, el) {
759            var showRecord = true;
760            $.each(termsArr, function (k, str) {
761              if (el.terms.indexOf(str) < 0) showRecord = false;
762            });
763            if (showRecord) {
764              var tags = "";
765              if (el.tags !== "") {
766                tags = el.tags
767                  .split(",")
768                  .map(function (val) {
769                    return "<span>" + val + "</span>";
770                  })
771                  .join("");
772              }
773
774              $("#curated").append(
775                '<div class="curated-item clearfix">' +
776                  '<div class="pull-right">' +
777                  (el.url === "#" ? "<h4>" + el.subheader + "</h4>" : '<a class="search-dept-url" href="' + el.deptUrl + '" target="' + el.deptTarget + '"><h4>' + el.subheader + "</h4></a>") +
778                  (el.phone === "" ? "" : '<a class="search-icon" href="tel:' + el.phone + '"><i class="fa fa-phone"></i></a>') +
779                  (el.email === "" ? "" : '<a class="search-icon" href="mailto:' + el.email + '"><i class="fa fa-envelope"></i></a>') +
780                  (el.address === "" ? "" : '<a class="search-icon" href="https://maps.google.com/?q=' + el.address + '" target="_blank"><i class="fa fa-map-marker"></i></a>') +
781                  "</div>" +
782                  '<h3 class="pull-left"><a href="' +
783                  el.url +
784                  '" target="' +
785                  el.target +
786                  '" class="clearfix">' +
787                  el.header +
788                  '</a><small style="display:block">' +
789                  el.description +
790                  "</small></h3>" +
791                  '<div class="curated-tags">' +
792                  tags +
793                  "</div>" +
794                  "</div>"
795              );
796            }
797          });
798          if (!$(".curated-item").length) {
799            $("#curated").append('<div class="curated-item"><h3>
799No keywords found. Use a different keyword or click on the All of Redondo Beach tab</h3></div>');
800          }
801          $(".g-search-wrap.first").html('<h2>Forms</h2><iframe src="_assets_/plugins/search-box.html?q=' + $("#search-input").val() + ' site:https://www.redondo.org/ filetype:doc OR filetype:pdf OR filetype:docx"></iframe>');
802          $(".g-search-wrap.second").html('<h2>All of Redondo Beach</h2><iframe src="_assets_/plugins/search-box.html?q=' + $("#search-input").val() + ' site:https://www.redondo.org/"></iframe>');
803        } else {
804          $("#search-results").fadeOut();
805          $("#slider").removeClass("results-open");
806        }
807      }
808    });
809
810    // ADA - Links with target blank will have sr div announcing this is the case
811    $("a").each(function (index) {
812      if ($(this).attr("target") === "_blank" || $(this).attr("target") === "_new") {
813        $(this).append('<div class="sr-only">Opens in new window</div>');
814      }
815    });
816
817    // ADA, close menu on escape key (mobile nav)
818    $(document).on("keydown", "#nav", function (e) {
819      if (e.keyCode === 27 && $("#nav").is(":visible") && $(window).width() < 992) {
820        $("#nav").slideUp();
821        $("#nav-toggle").removeClass("fa-close").addClass("fa-bars");
822        $("#nav-toggle").focus();
823      }
824    });
825
826    // ADA, close menu on escape key (desktop nav)
827    $(document).on("keydown", "ul.menuUL.level1", function (e) {
828      if (e.keyCode === 27 && $(".mega-wrapper").is(":visible") && $(window).width() > 992) {
829        $(".mega-wrapper").slideUp();
830        $(this).focus();
831      }
832    });
833
834    // Close UL when tab through the list
835    $("#nav li:last-child").on("keydown", function (e) {
836      var parentUL = $(this).parent();
837      if (e.keyCode === 9 && !e.shiftKey && $(window).width() < 992) {
838        parentUL.slideUp();
839      }
840    });
841
842    // ADA, Refocus last clicked calendar event
843
844    function initializeModalFocus() {
845      let $lastFocused = null;
846      const $modal = $("#event-modal");
847
848      function setupEventHandlers() {
849        // Track last focused event
850        $(document).on("click keydown", ".cal-event", function (e) {
851          if (e.type === "click" || (e.type === "keydown" && e.which === 13)) {
852            $lastFocused = $(this);
853            if (e.type === "keydown") $(this).trigger("click");
854          }
855        });
856
857        // Handle modal closing
858        const closeModal = () => {
859          $modal.hide();
860          $modal.removeClass("show");
861          $modal.css("display", "none");
862
863          setTimeout(() => {
864            if ($lastFocused?.length) {
865              $lastFocused.focus();
866            }
867          }, 100);
868        };
869
870        // Close modal via button or escape key
871        $(document).on("click", "#modal-close-button, .modal-footer .btn-secondary", closeModal);
872
873        // Handle escape key
874        $(document).on("keydown", function (e) {
875          // Get computed style directly
876          const modalElement = document.getElementById("event-modal");
877          const computedStyle = window.getComputedStyle(modalElement);
878          const isModalVisible = computedStyle.display !== "none";
879
880          if (e.key === "Escape" && isModalVisible) {
881            e.preventDefault();
882            closeModal();
883          }
884        });
885      }
886
887      setupEventHandlers();
888    }
889
890    initializeModalFocus();
891
892    function observeOwlItemsForActiveClass() {
893      function updateTabindex() {
894        $(".tns-item").each(function () {
895          if ($(this).hasClass("tns-slide-active")) {
896            $(this).find("a").attr("tabindex", "0");
897          } else {
898            $(this).find("a").attr("tabindex", "-1");
899          }
900        });
901      }
902
903      // MutationObserver callback to detect class changes
904      const observer = new MutationObserver(function (mutations) {
905        mutations.forEach(function (mutation) {
906          if (mutation.attributeName === "class") {
907            updateTabindex();
908          }
909        });
910      });
911
912      // Observe each .owl-item element for changes in class attribute
913      $(".tns-item").each(function () {
914        observer.observe(this, { attributes: true });
915      });
916
917      // Initial tabindex setup in case some items are already active
918      updateTabindex();
919    }
920
921    // Call the function to initialize the observer
922    observeOwlItemsForActiveClass();
923
924    // ADA, Update modal title/subtitle to be default not empty
925
926    function updateModalTitle() {
927      const observer = new MutationObserver((mutationsList, observer) => {
928        mutationsList.forEach((mutation) => {
929          if (mutation.type === "childList") {
930            const modalTitle = document.getElementById("modal-event-title");
931            const modalSubtitle = document.getElementById("modal-event-subtitle");
932
933            if (modalTitle && modalTitle.textContent.trim() === "") {
934              modalTitle.textContent = "Modal Title";
935            }
936
937            if (modalSubtitle && modalSubtitle.textContent.trim() === "") {
938              modalSubtitle.textContent = "Modal Subtitle";
939            }
940
941            if (modalTitle && modalSubtitle) {
942              observer.disconnect();
943            }
944          }
945        });
946      });
947
948      observer.observe(document.body, { childList: true, subtree: true });
949    }
950
951    updateModalTitle();
952
953    // ADA, Fix Google Translate Inputs
954    function fixGoogleTranslateInputs() {
955      const inputs = [
956        { id: "goog-gt-votingInputSrcLang", label: "Source Language Input" },
957        { id: "goog-gt-votingInputTrgLang", label: "Target Language Input" },
958        { id: "goog-gt-votingInputSrcText", label: "Source Text Input" },
959        { id: "goog-gt-votingInputTrgText", label: "Target Text Input" },
960        { id: "goog-gt-votingInputVote", label: "Vote Input" },
961      ];
962
963      let allLabelsSet = true;
964      inputs.forEach((item) => {
965        const input = document.getElementById(item.id);
966        if (input) {
967          input.setAttribute("aria-label", item.label);
968        } else {
969          allLabelsSet = false;
970        }
971      });
972
973      if (allLabelsSet) {
974        googleObserver.disconnect();
975      }
976    }
977
978    const googleObserver = new MutationObserver((mutationsList, observer) => {
979      for (let mutation of mutationsList) {
980        if (mutation.type === "childList") {
981          fixGoogleTranslateInputs();
982        }
983      }
984    });
985
986    googleObserver.observe(document.body, { childList: true, subtree: true });
987
988    fixGoogleTranslateInputs();
989
990    // ADA, Move skip link ahead of Userway
991    function moveSkipLink() {
992      if ($(".uwy").length) {
993        $("body").prepend($("#skip"));
994      } else {
995        setTimeout(moveSkipLink, 100);
996      }
997    }
998
999    moveSkipLink();
1000
1001    // ADA, Skip link focus first visible focusable element in slug section
1002    $("#skip").on("click", function (e) {
1003      e.preventDefault();
1004      var targetId = $(this).attr("href").split("#").pop();
1005      console.log(targetId);
1006      var targetElement = document.getElementById(targetId);
1007
1008      if (targetElement) {
1009        var $target = $(targetElement);
1010
1011        // Find first focusable element in target section that is visible
1012        var $firstFocusable = $target
1013          .find("a[href], button, input, select, textarea, [tabindex]")
1014          .filter(function () {
1015            return $(this).is(":visible") && $(this).attr("tabindex") !== "-1";
1016          })
1017          .first();
1018
1019        if ($firstFocusable.length) {
1020          $firstFocusable.focus();
1021        } else {
1022          $target.attr("tabindex", "-1").focus();
1023        }
1024      } else {
1025        console.error("Target element not found for ID:", targetId);
1026      }
1027    });
1028
1029    // ADA, Docs toggle has proper aria-roles, outline, and focusability
1030    $(".docs-toggle").attr("tabindex", "0");
1031    $(".docs-toggle").each(function (e) {
1032      var list = $(this).siblings(".inner-cat-wrap").first();
1033      var isExpanded = list.css("display") === "block";
1034      $(this).attr("role", "button");
1035      $(this).attr("aria-expanded", isExpanded);
1036      var controlsId = "inner-cat-wrap-" + e;
1037      $(this).attr("aria-controls", controlsId);
1038      list.attr("id", controlsId);
1039    });
1040
1041    $(".docs-toggle").on("click keydown", function (e) {
1042      if (e.type === "click" || e.key === "Enter" || e.key === " ") {
1043        var currentOpen = $(this).attr("aria-expanded");
1044        $(".docs-toggle").each(function (e) {
1045          $(this).attr("aria-expanded", "false");
1046        });
1047      }
1048
1049      if (e.key === "Enter" || e.key === " ") {
1050        $(this).trigger("click");
1051        $(this).trigger("focus");
1052        $(this).attr("aria-expanded", currentOpen === "true" ? "false" : "true");
1053      } else if (e.type === "click") {
1054        $(this).trigger("focus");
1055        $(this).attr("aria-expanded", currentOpen === "true" ? "false" : "true");
1056      }
1057    });
1058
1059    $(".isotop-element").attr("tabindex", "0");
1060    $(".isotop-element").on("focusin", function () {
1061      $(this).find(".item-overlay").css({ display: "block", opacity: "1" });
1062      $(this).find(".item-overlay .more-icon").css("left", "50%");
1063    });
1064
1065    $(".isotop-element").on("focusout", function (e) {
1066      // Only hide if focus moved OUTSIDE of this isotop-element
1067      if (!$(this).has(e.relatedTarget).length) {
1068        $(this).find(".item-overlay").css({ display: "none", opacity: "0" });
1069        $(this).find(".item-overlay .more-icon").css("left", "-100%");
1070      }
1071    });
1072
1073    // Use event delegation for dynamically cloned tabs
1074    $(document).on("click", "#tabs-button .tab", function (e) {
1075      var $this = $(this);
1076      var $tabsButton = $this.closest("#tabs-button"); // find local group
1077      var $allTabs = $tabsButton.find(".tab");
1078      var tabsIndex = $this.index();
1079
1080      // Visual state
1081      $allTabs.removeClass("active").attr({
1082        "aria-selected": "false",
1083        tabindex: "-1",
1084      });
1085
1086      $this
1087        .addClass("active")
1088        .attr({
1089          "aria-selected": "true",
1090          tabindex: "0",
1091        })
1092        .focus();
1093
1094      // Update content visibility
1095      $(".tab-calendar, .tab-event").removeClass("active").hide();
1096      $(".tab-calendar").eq(tabsIndex).addClass("active").show();
1097      $(".tab-event").eq(tabsIndex).addClass("active").show();
1098    });
1099
1100    // Keyboard navigation (event delegation)
1101    $(document).on("keydown", "#tabs-button .tab", function (e) {
1102      const $this = $(this);
1103      const $tabsButton = $this.closest("#tabs-button");
1104      const $tabs = $tabsButton.find(".tab");
1105      const currentIndex = $tabs.index($this);
1106
1107      if (currentIndex === -1) return;
1108
1109      let newIndex = currentIndex;
1110
1111      switch (e.key) {
1112        case "ArrowLeft":
1113          newIndex = currentIndex === 0 ? $tabs.length - 1 : currentIndex - 1;
1114          break;
1115        case "ArrowRight":
1116          newIndex = currentIndex === $tabs.length - 1 ? 0 : currentIndex + 1;
1117          break;
1118        case "Home":
1119          newIndex = 0;
1120          break;
1121        case "End":
1122          newIndex = $tabs.length - 1;
1123          break;
1124        default:
1125          return;
1126      }
1127
1128      e.preventDefault();
1129
1130      // Trigger click + focus manually
1131      const $targetTab = $tabs.eq(newIndex);
1132      $targetTab.trigger("click"); // ensure content updates
1133      $targetTab.focus(); // ensure focus moves visually
1134    });
1135
1136    $("#ai-chat-button").attr("aria-label", "Chat with AI assistant");
1137    $(".close-ai-bot-moblie").attr("aria-label", "Close chat window");
1138
1139    $(".tns-controls, .tns-controls button").removeAttr("tabindex").removeAttr("aria-label");
1140    $(".tns-controls button[data-controls='prev']").attr("aria-label", "Previous Slide");
1141    $(".tns-controls button[data-controls='next']").attr("aria-label", "Next Slide");
1142  }); // Ready
1143})(jQuery);
1144
1145if ($("#blog-posts").length) {
1146  if (location.href.indexOf("revize.com/revize") < 0) {
1147    var bDate = "";
1148    var tDate = new Date();
1149    $(".blog-item").each(function (i, el) {
1150      bDate = new Date($(el).data("date"));
1151      if (bDate <= tDate) {
1152        $(el).show();
1153      }
1154    });
1155  } else {
1156    $(".blog-item").show();
1157  }
1158}
1159
1160if ($("#custom-news-list").length) {
1161  $('#freeform #custom-news-list').detach().appendTo('#freeform article#entry');
1162}
1163

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.