PageSourceSearch

https://bellevueia.gov/_assets_/js/scripts.js

js bellevueia.gov collected 2026-10-04 17:37:14 UTC 22,615 bytes, 646 lines download raw bytes

1/*-----------------------------------------------------------------------------------
2
3	Theme Name: Small City
4	Author Design: Samir Alley @samiralley
5	Author URI: http://www.revize.com/
6	Date: March 19, 2016
7	
8-----------------------------------------------------------------------------------*/
9
10/*-----------------------------------------------
11
12#Contact form at bottom of page page http://www.sanwebe.com/2011/12/making-simple-jquery-ajax-contact-form
13    
14------------------------------------------------*/
15$(document).ready(function () {
16  // Docs at http://simpleweatherjs.com
17  $.simpleWeather({
18    woeid: "12589531", // http://woeid.rosselliot.co.nz/lookup/athens%20county%20%20oh
19    unit: "f",
20    success: function (weather) {
21      var html = '<span class="forecast">' + weather.temp + " &deg; " + weather.forecast[0].text + "</span>";
22      html += '<i class="icon-' + weather.code + '"></i>';
23
24      $("#weather").html(html);
25    },
26    error: function (error) {
27      $("#weather").html("<p>" + error.message + "</p>");
28    },
29  });
30
31  //#######################################
32  // Report Issue Form
33  $(".report-pagejudge-yes").on("click", function (e) {
34    e.preventDefault();
35    $(".pagejudge").slideToggle("fast", function () {
36      $(".pagejudge").html('<strong><i class="fa fa-check"></i> Thank you for the feedback!</strong>');
37      $(".pagejudge").slideToggle("fast").addClass("alert alert-success");
38      $("html, body").animate({ scrollTop: $(document).height() }, "slow");
39    });
40  });
41
42  $(".report-pagejudge-no").on("click", function (e) {
43    e.preventDefault();
44    $(".pagejudge").slideToggle();
45    $(".report-issue-form").delay("400").slideToggle();
46    $("html, body").animate({ scrollTop: $(document).height() }, "slow");
47  });
48
49  $("#submit_btn").click(function () {
50    var proceed = true;
51    //simple validation at client's end
52    //loop through each field and we simply change border color to red for invalid fields
53    $("#contact_form input[required=true], #contact_form textarea[required=true]").each(function () {
54      $(this).css("border-color", "");
55      if (!$.trim($(this).val())) {
56        //if this field is empty
57        $(this).css("border-color", "red"); //change border color to red
58        proceed = false; //set do not proceed flag
59      }
60      //check invalid email
61      var email_reg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
62      if ($(this).attr("type") == "email" && !email_reg.test($.trim($(this).val()))) {
63        $(this).css("border-color", "red"); //change border color to red
64        proceed = false; //set do not proceed flag
65      }
66    });
67
68    if (proceed) {
69      //everything looks good! proceed...
70      //get input field values data to be sent to server
71      post_data = {
72        user_name: $("input[name=name]").val(),
73        user_email: $("input[name=email]").val(),
74        /*                 'phone_number'  : $('input[name=phone]').val(), */
75        /*                 'subject'       : $('select[name=subject]').val(), */
76        location: $("input[name=location]").val(),
77        msg: $("textarea[name=comments]").val(),
78      };
79
80      //Ajax post data to server
81      $.post(
82        "_assets_/php/contact.php",
83        post_data,
84        function (response) {
85          if (response.type == "error") {
86            //load json data from server and output message
87            output = '<div class="alert alert-info">' + response.text + "</div>";
88          } else {
89            output = '<div class="alert alert-success">' + response.text + "</div>";
90            //reset values in all input fields
91            $("#contact_form  input[required=true], #contact_form textarea[required=true]").val("");
92            $("#contact_form #contact_body").slideUp(); //hide form after success
93          }
94          $("#contact_form #contact_results").hide().html(output).slideDown();
95        },
96        "json"
97      );
98    }
99  });
100
101  //reset previously set border colors and hide all message on .keyup()
102  $("#contact_form  input[required=true], #contact_form textarea[required=true]").keyup(function () {
103    $(this).css("border-color", "");
104    $("#result").slideUp();
105  });
106});
107
108(function ($) {
109  "use strict";
110
111  var $window = $(window),
112    $body = $("body");
113
114  /*!
115   * IE10 viewport hack for Surface/desktop Windows 8 bug
116   * Copyright 2014-2015 Twitter, Inc.
117   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
118   */
119
120  // See the Getting Started docs for more information:
121  // http://getbootstrap.com/getting-started/#support-ie10-width
122  if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
123    var msViewportStyle = document.createElement("style");
124    msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}"));
125    document.querySelector("head").appendChild(msViewportStyle);
126  }
127
128  $window.ready(function () {
129    if (RZ.login) {
130      $body.addClass("user-logged-in");
131    } else {
132      $body.addClass("user-not-logged-in");
133    }
134
135    var $logo = $(".logo"),
136      $nav = $("#nav"),
137      $footer = $("#footer"),
138      $header = $("header"),
139      headpad = parseInt($header.css("paddingTop").replace("px", "")),
140      footerpad = 50;
141
142    function checkHeight() {
143      var windowHeight = $window.height();
144      var combinedHeight = $logo.outerHeight(true) + $nav.height() + $footer.height() + headpad + footerpad;
145      if (windowHeight < combinedHeight) {
146        $body.addClass("short-screen").css("min-height", combinedHeight + "px");
147      } else {
148        $body.removeClass("short-screen").css("min-height", 0);
149      }
150    }
151
152    checkHeight();
153    $window.resize(checkHeight);
154
155    $('[data-toggle="tooltip"]').tooltip();
156
157    $("#toggle-edit-btns").on("click", function () {
158      $(".edit-panel").toggleClass("open");
159    });
160
161    // Search Toggle
162    $("#search-toggle").on("click", function () {
163      $("#search").stop().slideToggle(200);
164      $(this).toggleClass("fa-search fa-close");
165    });
166
167    // Navigation Toggle
168    $("#nav-toggle").on("click", function (e) {
169      $("#nav").stop().slideToggle();
170      $("#nav-toggle i").toggleClass("fa-bars fa-close");
171    });
172
173    // Menu Arrows
174    $("#nav > li:has(ul)").addClass("first-parent").find("a:first").append('<i role="button" tabindex="0" aria-expanded="false" class="fa fa-angle-right down-arrow">');
175
176    // Menu Toggles
177    $("#nav > li:has(ul)").find("a:first").append('<i class="fa fa-angle-down toggle">');
178    $("#nav li li:has(ul)").find("a:first").append('<i class="fa fa-angle-down toggle2">');
179
180    function addNavClass() {
181      if ($window.width() < 992) {
182        $("#nav>li>ul").addClass("first-level");
183        $("#nav li ul ul").addClass("second-level");
184      } else {
185        $("#nav >li>ul").removeClass("first-level").css("display", "");
186        $("#nav  li ul ul").removeClass("second-level").css("display", "");
187      }
188    }
189
190    addNavClass();
191    $window.resize(addNavClass);
192
193    // Select all down-arrow elements
194    const downArrows = document.querySelectorAll(".down-arrow");
195    downArrows.forEach((arrow, index) => {
196      const parentLi = arrow.closest("li"); // Parent LI
197      const dropdown = parentLi.querySelector(".menuUL"); // Associated dropdown for parentLi
198      const navLink = parentLi.querySelector(".menuA"); // Anchor tag inside parentLi
199
200      if (dropdown) {
201        // Extract the unique number from the class that starts with 'ul-'
202        const ulClass = Array.from(dropdown.classList).find((cls) => cls.startsWith("ul-"));
203        if (ulClass) {
204          const uniqueNumber = ulClass.split("-")[1];
205          const dropdownId = "dropdown-" + uniqueNumber;
206          dropdown.id = dropdownId;
207          arrow.setAttribute("aria-controls", dropdownId);
208        }
209      }
210
211      if (navLink) {
212        const linkText = navLink.textContent.trim();
213        arrow.setAttribute("aria-label", "Show dropdown for " + linkText);
214        const uniqueId = "nav-link-" + linkText[0] + "-" + index;
215        navLink.id = uniqueId;
216        dropdown.setAttribute("aria-label", linkText);
217      }
218
219      arrow.addEventListener("keydown", function (e) {
220        // Check if the pressed key is Enter (13) or Spacebar (32)
221        if (e.key === "Enter" || e.key === " ") {
222          e.preventDefault(); // Prevent default action (scrolling for Spacebar or navigation for Enter)
223          e.stopPropagation();
224          toggleDropdown(this);
225        }
226      });
227
228      arrow.addEventListener("click", function (e) {
229        e.preventDefault(); // Prevent default action (navigation)
230        e.stopPropagation();
231        toggleDropdown(this);
232      });
233    });
234
235    function toggleDropdown(arrow) {
236      const parentLi = arrow.closest("li");
237      const dropdown = parentLi.querySelector(".menuUL");
238
239      // Determine if the current dropdown is already visible
240      const isCurrentlyVisible = dropdown && dropdown.classList.contains("menuVisible");
241
242      // Find all dropdown menus
243      const allDropdowns = document.querySelectorAll(".menuUL");
244
245      // Hide all dropdown menus except the current one if it's visible
246      allDropdowns.forEach((d) => {
247        if (d !== dropdown) {
248          d.classList.add("menuHidden");
249          d.classList.remove("menuVisible");
250        }
251      });
252
253      // Toggle the current dropdown visibility
254      if (dropdown) {
255        dropdown.classList.toggle("menuHidden", isCurrentlyVisible);
256        dropdown.classList.toggle("menuVisible", !isCurrentlyVisible);
257
258        // Update ARIA attribute
259        arrow.setAttribute("aria-expanded", !isCurrentlyVisible);
260      }
261    }
262
263    // Select the three .col-md-4 elements
264    var colElements = $(".blocks .row > .col-md-4");
265
266    // Wrap them with a <ul>
267    colElements.wrapAll('<ul class="quick-links-list" aria-label="Quick Links"></ul>');
268
269    // Convert each .col-md-4 div to an li
270    colElements.each(function () {
271      var $this = $(this);
272      // Change the outer div to li
273      $this.replaceWith(function () {
274        return $("<li />", {
275          class: $this.attr("class"),
276          html: $this.html(),
277        });
278      });
279    });
280
281    // ADA, close menu on escape key (mobile nav)
282    $(document).on("keydown", "#nav", function (e) {
283      if (e.keyCode === 27 && $("#nav").is(":visible") && $(window).width() < 992) {
284        $("#nav").slideUp().removeClass("menuVisible").addClass("menuHidden");
285        $("#nav-toggle i").removeClass("fa-close").addClass("fa-bars");
286        $("#nav-toggle").focus();
287      }
288    });
289
290    // ADA, close menu on escape key (desktop nav)
291    $(document).on("keydown", "ul.menuUL.level1", function (e) {
292      if (e.keyCode === 27 && $("ul.menuUL.level1").is(":visible") && $(window).width() > 992) {
293        $("ul.menuUL.level1").slideUp().removeClass("menuVisible").addClass("menuHidden");
294        $(this).focus();
295      }
296    });
297
298    // ADA, close menu on escape key (desktop nav)
299    $(document).on("keydown", "ul.menuUL.level1 li:last-child a", function (e) {
300      if (e.key === "Tab" && !e.shiftKey && $("ul.menuUL.level1").is(":visible") && $(window).width() > 992) {
301        $("ul.menuUL.level1").slideUp().removeClass("menuVisible").addClass("menuHidden");
302        $(this).focus();
303      }
304    });
305
306    $(".toggle").click(function (e) {
307      e.preventDefault();
308      if ($(this).parent().next(".first-level").is(":visible")) {
309        $(this).parent().next(".first-level").slideUp();
310        $(this).parent().removeClass("active-toggle");
311      } else {
312        $(".first-level").slideUp("slow");
313        $(this).parent().next(".first-level").slideToggle();
314        $(this).parent().addClass("active-toggle");
315      }
316    });
317
318    $(".toggle2").click(function (e) {
319      e.preventDefault();
320      if ($(this).parent().next(".second-level").is(":visible")) {
321        $(this).parent().next(".second-level").slideUp();
322        $(this).parent().removeClass("active-toggle");
323      } else {
324        $(".second-level").slideUp("slow");
325        $(this).parent().next(".second-level").slideToggle();
326        $(this).parent().addClass("active-toggle");
327      }
328    });
329
330    // Flyout
331    var flyout = $("#flyout"),
332      flyoutwrap = $("#flyout-wrap");
333
334    if ($("#flyout li, .content-block").length === 0) {
335      $body.addClass("noleftnav");
336      $(".user-not-logged-in .content .col-md-3").hide();
337      $(".user-not-logged-in .content .col-md-9").removeClass("col-md-9").addClass("col-md-12");
338    }
339
340    if ($("#flyout li").length === 0) {
341      $(".user-not-logged-in #flyout-wrap").hide();
342    }
343
344    if (flyout.text().length) {
345      flyoutwrap.prepend('<div tabindex="0" id="flyout-toggle"><i class="fa fa-bars"></i> Sub Menu</div>');
346    }
347
348    $("#flyout-toggle").on("click", function () {
349      flyout.stop().slideToggle();
350      $(this).toggleClass("active");
351      $("#flyout-toggle i").toggleClass("fa-bars fa-close");
352    });
353
354    $("#flyout-toggle").on("keydown", function (e) {
355      if (e.keyCode === 13) {
356        flyout.slideToggle();
357        $(this).toggleClass("active");
358      }
359    });
360
361    $("#flyout").on("keydown", function (e) {
362      if (e.keyCode === 27 && $(window).width() < 992) {
363        flyout.slideUp();
364        $("#flyout-toggle").removeClass("active");
365        $("#flyout-toggle i").toggleClass("fa-bars fa-close");
366      }
367    });
368
369    $("#flyout li:last-child").on("keydown", function (e) {
370      if (e.keyCode === 9 && !e.shiftKey && $(window).width() < 992) {
371        flyout.slideUp();
372        $("#flyout-toggle").removeClass("active");
373        $("#flyout-toggle i").toggleClass("fa-bars fa-close");
374      }
375    });
376
377    $("#flyout li:has(ul)")
378      .find("a:first")
379      .each(function () {
380        const linkText = $(this).text().trim(); // Get the text of the <a> element
381        $(this).append('<i role="button" tabindex="0" aria-label="Dropdown for ' + linkText + '" aria-expanded="false" class="fa fa-angle-down toggle-children"></i>');
382      });
383    $("#flyout ul").addClass("flyout-children");
384
385    var flyoutChildren = $(".flyout-children");
386
387    $(".toggle-children").on("click keydown", function (e) {
388      if (e.type === "click" || e.key === "Enter" || e.key === " ") {
389        e.preventDefault();
390        if ($(this).parent().next(flyoutChildren).is(":visible")) {
391          $(this).parent().next(flyoutChildren).slideUp();
392        } else {
393          $(flyoutChildren).slideUp("slow");
394          $(this).parent().next(flyoutChildren).slideToggle();
395        }
396      }
397    });
398
399    // Tabs
400    $("#tabs li a").click(function (e) {
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    });
409
410    // bxSlider
411    if (typeof $.fn.bxSlider !== "undefined") {
412      $(".bxslider").bxSlider({
413        mode: "fade",
414        auto: $(".bxslider").children().length < 2 ? false : true,
415        pager: false,
416        controls: false,
417        speed: 1000,
418      });
419    }
420
421    // Sticky
422    if (typeof $.fn.sticky !== "undefined") {
423      $("#sticky").sticky({
424        topSpacing: 30,
425      });
426    }
427
428    // Animations http://www.oxygenna.com/tutorials/scroll-animations-using-waypoints-js-animate-css
429    function onScrollInit(items, trigger) {
430      items.each(function () {
431        var osElement = $(this),
432          osAnimationClass = osElement.data("os-animation"),
433          osAnimationDelay = osElement.data("os-animation-delay");
434
435        osElement.css({
436          "-moz-animation-delay": osAnimationDelay,
437          "animation-delay": osAnimationDelay,
438          "-webkit-animation-delay": osAnimationDelay,
439        });
440
441        var osTrigger = trigger ? trigger : osElement;
442
443        if (typeof $.fn.waypoint !== "undefined") {
444          osTrigger.waypoint(
445            function () {
446              osElement.addClass("animated").addClass(osAnimationClass);
447            },
448            {
449              triggerOnce: true,
450              offset: "100%",
451            }
452          );
453        }
454      });
455    }
456    onScrollInit($(".os-animation"));
457
458    //#Smooth Scrolling
459    $("a[href*=#]:not([href=#])").click(function () {
460      if (location.pathname.replace(/^\//, "") === this.pathname.replace(/^\//, "") && location.hostname === this.hostname) {
461        var target = $(this.hash);
462        target = target.length ? target : $("[name=" + this.hash.slice(1) + "]");
463        if (target.length) {
464          $("html,body").animate(
465            {
466              scrollTop: target.offset().top,
467            },
468            1000
469          );
470          return false;
471        }
472      }
473    });
474
475    /*global jQuery */
476    /*!
477     * FlexVerticalCenter.js 1.0
478     *
479     * Copyright 2011, Paul Sprangers http://paulsprangers.com
480     * Released under the WTFPL license
481     * http://sam.zoy.org/wtfpl/
482     *
483     * Date: Fri Oct 28 19:12:00 2011 +0100
484     */
485    $.fn.flexVerticalCenter = function (options) {
486      var settings = $.extend(
487        {
488          cssAttribute: "margin-top", // the attribute to apply the calculated value to
489          verticalOffset: 0, // the number of pixels to offset the vertical alignment by
490          parentSelector: null, // a selector representing the parent to vertically center this element within
491          debounceTimeout: 25, // a default debounce timeout in milliseconds
492          deferTilWindowLoad: false, // if true, nothing will take effect until the $(window).load event
493        },
494        options || {}
495      );
496
497      return this.each(function () {
498        var $this = $(this); // store the object
499        var debounce;
500
501        // recalculate the distance to the top of the element to keep it centered
502        var resizer = function () {
503          var parentHeight = settings.parentSelector && $this.parents(settings.parentSelector).length ? $this.parents(settings.parentSelector).first().height() : $this.parent().height();
504
505          $this.css(settings.cssAttribute, (parentHeight - $this.height()) / 2 + parseInt(settings.verticalOffset));
506        };
507
508        // Call on resize. Opera debounces their resize by default.
509        $(window).resize(function () {
510          clearTimeout(debounce);
511          debounce = setTimeout(resizer, settings.debounceTimeout);
512        });
513
514        if (!settings.deferTilWindowLoad) {
515          // call it once, immediately.
516          resizer();
517        }
518
519        // Call again to set after window (frames, images, etc) loads.
520        $(window).load(function () {
521          resizer();
522        });
523      });
524    };
525    $(".v-align").flexVerticalCenter();
526    var mystring = window.location.pathname;
527    if (mystring.indexOf("imagelink-editlist.jsp") != -1) {
528      $(".table").css("margin-left", "300px");
529    }
530  }); // Ready
531
532  // Create the skip link
533  const skipLink = document.createElement("a");
534  skipLink.href = "#main";
535  skipLink.id = "skip";
536  skipLink.textContent = "Skip to main content";
537  skipLink.style.position = "absolute"; // Position it off-screen initially
538  skipLink.style.top = "-25px";
539  skipLink.style.left = "-205px";
540  skipLink.style.backgroundColor = "#000";
541  skipLink.style.color = "#fff";
542  skipLink.style.padding = "20px";
543  skipLink.style.zIndex = "1000";
544  skipLink.style.textDecoration = "none";
545
546  // Add focus styles to make it visible when focused
547  skipLink.addEventListener("focus", function () {
548    skipLink.style.top = "5px";
549    skipLink.style.left = "205px";
550  });
551
552  skipLink.addEventListener("blur", function () {
553    skipLink.style.top = "-25px";
554    skipLink.style.left = "-205px";
555  });
556
557  skipLink.addEventListener("click", function (e) {
558    console.log("clik");
559    e.preventDefault();
560    const mainContent = document.getElementById("main");
561    if (mainContent) {
562      console.log(mainContent);
563      const focusableElements = mainContent.querySelectorAll('a, button, input, textarea, select, [tabindex]:not
563([tabindex="-1"]):not(#flyout-toggle)');
564      console.log(focusableElements);
565      if (focusableElements.length > 0) {
566        // Focus the first focusable element
567        console.log("focus", focusableElements[0]);
568        focusableElements[0].focus();
569      } else {
570        // If no focusable elements, focus the main element itself
571        mainContent.setAttribute("tabindex", "-1");
572        mainContent.focus();
573      }
574    }
575  });
576
577  // Append the skip link as the first child of the body
578  document.body.insertBefore(skipLink, document.body.firstChild);
579
580  $(".isotop-element").attr("tabindex", "0");
581  $(document).on("focus", ".isotop-element", function () {
582    console.log("focus");
583    $(".item-overlay").css({
584      opacity: "0",
585      display: "none",
586    });
587    $(".more-icon").css({
588      left: "-50%",
589    });
590
591    $(this).find(".item-overlay").css({
592      opacity: ".8",
593      display: "block",
594    });
595    $(this).find(".more-icon").css({
596      left: "50%",
597      "z-index": "99",
598    });
599  });
600
601  $(document).on("click", ".toggle-children", function (e) {
602    if ($(this).attr("aria-expanded") === "true") {
603      $(".toggle-children").each((index, element) => {
604        $(element).attr("aria-expanded", "false");
605      });
606    } else {
607      $(this).attr("aria-expanded", true);
608    }
609  });
610
611  $(".toggle-children").each((index, elem) => {
612    console.log(elem);
613  });
614
615  function moveSkipLink() {
616    // Wait for UserWay widget to be present in DOM
617    if ($(".uwy").length) {
618      // Move skip link to be first child of body
619      $("body").prepend($("#skip"));
620    } else {
621      // If UserWay isn't loaded yet, try again in 100ms
622      setTimeout(moveSkipLink, 100);
623    }
624  }
625
626  // Start checking once document is ready
627  $(document).ready(function () {
628    moveSkipLink();
629  });
630
631  const observer = new MutationObserver((mutationsList, observer) => {
632    mutationsList.forEach((mutation) => {
633      if (mutation.type === "childList") {
634        const iframe = document.querySelector("#tmg-widget-iframe");
635        if (iframe) {
636          iframe.setAttribute("title", "TextMyGov");
637          observer.disconnect();
638        }
639      }
640    });
641  });
642
643  observer.observe(document.body, { childList: true, subtree: true });
644})(jQuery);
645
646$('.alertbtn a img').html('<span style="background: #f5f5f5;color: #000 !important;border: 0;border-radius: 0;font-size: 11px !important;display: inline-block !important;font-weight: bold !important;text-decoration: none;cursor: pointer;line-height: normal;vertical-align: top;font-family: "Gotham", sans-serif;transition: background .3s;letter-spacing: .08em;text-transform: uppercase;">Edit Alert</span>');

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.