1 2 3 4 5 6/*----------------------------------------------------------------------------------- 7 8 Theme Name: City of Thomas, Michigan Webgen 9 Developers: Alec Armstrong & Derek Ortiz 10 Author HTML, CSS, and JavaScript: Richard Opiniano 11 Author Design: Samir Alley @samiralley 12 Author URI: http://www.revize.com/ 13 Date: 8/24/18 14 15-----------------------------------------------------------------------------------*/ 16 17(function($) { 18 19 20/*----------------------------------------------------------------------------------- 21 22 Theme Name: City of Thomas, Michigan Webgen 23 Developers: Alec Armstrong & Derek Ortiz 24 Author HTML, CSS, and JavaScript: Richard Opiniano 25 Author Design: Samir Alley @samiralley 26 Author URI: http://www.revize.com/ 27 Date: 8/24/18 28 29-----------------------------------------------------------------------------------*/ 30 31(function($) { 32 33 'use strict'; 34 35 var $window = $(window), 36 $body = $('body'); 37 38 $(function(){ 39 if(RZ.pageid === 'index'){ 40 $("#video-bg").YTPlayer(); 41 } 42 }); 43 44 /*! 45 * IE10 viewport hack for Surface/desktop Windows 8 bug 46 * Copyright 2014-2015 Twitter, Inc. 47 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 48 */ 49 50 // See the Getting Started docs for more information: 51 // http://getbootstrap.com/getting-started/#support-ie10-width 52 if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 53 var msViewportStyle = document.createElement('style'); 54 msViewportStyle.appendChild( 55 document.createTextNode( 56 '@-ms-viewport{width:auto!important}' 57 ) 58 ); document.querySelector('head').appendChild(msViewportStyle); 59 } 60 61 /*! 62 * JavaScript Cookie v2.2.0 63 * https://github.com/js-cookie/js-cookie 64 * 65 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 66 * Released under the MIT license 67 */ 68 !function(e){var n;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var t=window.Cookies,o=window.Cookies=e();o.noConflict=function(){return window.Cookies=t,o}}}(function(){function f(){for(var e=0,n={};e<arguments.length;e++){var t=arguments[e];for(var o in t)n[o]=t[o]}return n}function a(e){return e.replace(/(%[0-9A-Z]{2}
68)+/g,decodeURIComponent)}return function e(u){function c(){}function t(e,n,t){if("undefined"!=typeof document){"number"==typeof(t=f({path:"/"},c.defaults,t)).expires&&(t.expires=new Date(1*new Date+864e5*t.expires)),t.expires=t.expires?t.expires.toUTCString():"";try{var o=JSON.stringify(n);/^[\{\[]/.test(o)&&(n=o)}catch(e){}n=u.write?u.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var r="";for(var i in t)t[i]&&(r+="; "+i,!0!==t[i]&&(r+="="+t[i].split(";")[0]));return document.cookie=e+"="+n+r}}function n(e,n){if("undefined"!=typeof document){for(var t={},o=document.cookie?document.cookie.split("; "):[],r=0;r<o.length;r++){var i=o[r].split("="),c=i.slice(1).join("=");n||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var f=a(i[0]);if(c=(u.read||u)(c,f)||a(c),n)try{c=JSON.parse(c)}catch(e){}if(t[f]=c,e===f)break}catch(e){}}return e?t[e]:t}}return c.set=t,c.get=function(e){return n(e,!1)},c.getJSON=function(e){return n(e,!0)},c.remove=function(e,n){t(e,"",f(n,{expires:-1}))},c.defaults={},c.withConverter=e,c}(function(){})}); 69 70 /* 71 * E-Notify Auto submit 72 */ 73 $.urlParam=function(n){var e=new RegExp("[?&]"+n+"=([^]*)").exec(window.location.href);return null==e?null:e[1]||0}; 74 var $enotify = $('iframe[src*="/revize/plugins/notify/notify.jsp"]'); 75 if( $enotify.length > 0 ){ 76 var emailStr = $.urlParam("email"); 77 if( emailStr != null ){ 78 $enotify.attr("src", $enotify.attr("src") + "&email=" + emailStr); 79 } 80 } 81 82 // For large calendar 83 $('#freeform iframe[src="calendar_app/index.html#css=css/calendar_colors.css"]').attr({'id': 'calendar', 'title': 'calendar'}); 84 85 $('#skip').on('click', function(e) { 86 e.preventDefault(); 87 $('#main').focus(); 88 }); 89 90 // ADA MENU 91 if (Cookies.get("highcontrast") == "on") { 92 $("html").addClass("highcontrast"); 93 $(".highcontrast #flyout li:has(ul)>a").css({ color: "#fff" }); 94 $("#highcontrast").text("High Contrast Off"); 95 } 96 if (Cookies.get("yellowlinks") == "on") { 97 $("html").addClass("yellowlinks"); 98 $("#yellowlinks").text("Yellow Links Off"); 99 } 100 if (Cookies.get("greyscale") == "on") { 101 $("html").addClass("greyscale"); 102 $("#greyscale").text("Grey Scale Off"); 103 } 104 if (Cookies.get("underline-links") == "on") { 105 $("html").addClass("underline-links"); 106 $("#underline-links").text("Underline Links Off"); 107 } 108 $(".accessible-btn a").on("click keydown", function(e) { 109 if (e.keyCode === 13 || e.type === 'click') { 110 e.preventDefault(); 111 $(this).parent().parent().toggleClass("visible"); 112 } 113 }); 114 $("#highcontrast").on("click keydown", function(e) { 115 if (e.keyCode === 13 || e.type === 'click') { 116 e.preventDefault(); 117 if (Cookies.get("highcontrast")) { 118 Cookies.remove("highcontrast"); 119 } else { 120 Cookies.set("highcontrast", "on", { expires: 7 }); 121 } 122 if (Cookies.get("highcontrast") == "on") { 123 $("html").addClass("highcontrast"); 124 $('#calendar').contents().find('html').addClass('highcontrast'); 125 $(this).text("High Contrast Off"); 126 } else { 127 $("html").removeClass("highcontrast"); 128 $('#calendar').contents().find('html').removeClass('highcontrast'); 129 $(this).text("High Contrast"); 130 } 131 } 132 }); 133 $("#yellowlinks").on("click keydown", function(e) { 134 if (e.keyCode === 13 || e.type === 'click') { 135 e.preventDefault(); 136 if (Cookies.get("yellowlinks")) { 137 Cookies.remove("yellowlinks"); 138 } else { 139 Cookies.set("yellowlinks", "on", { expires: 7 }); 140 } 141 if (Cookies.get("yellowlinks") == "on") { 142 $("html").addClass("yellowlinks"); 143 $('#calendar').contents().find('html').addClass('yellowlinks'); 144 $(this).text("Yellow Links Off"); 145 } else { 146 $("html").removeClass("yellowlinks"); 147 $('#calendar').contents().find('html').removeClass('yellowlinks'); 148 $(this).text("Yellow Links"); 149 } 150 } 151 }); 152 $("#greyscale").on("click keydown", function(e) { 153 if (e.keyCode === 13 || e.type === 'click') { 154 e.preventDefault(); 155 if (Cookies.get("greyscale")) { 156 Cookies.remove("greyscale"); 157 } else { 158 Cookies.set("greyscale", "on", { expires: 7 }); 159 } 160 if (Cookies.get("greyscale") == "on") { 161 $("html").addClass("greyscale"); 162 $('#calendar').contents().find('html').addClass('greyscale'); 163 $(this).text("Greyscale Off"); 164 } else { 165 $("html").removeClass("greyscale"); 166 $('#calendar').contents().find('html').removeClass('greyscale'); 167 $(this).text("Grey Scale"); 168 } 169 } 170 }); 171 $("#underline-links").on("click keydown", function(e) { 172 if (e.keyCode === 13 || e.type === 'click') { 173 e.preventDefault(); 174 if (Cookies.get("underline-links")) { 175 Cookies.remove("underline-links"); 176 } else { 177 Cookies.set("underline-links", "on", { expires: 7 }); 178 } 179 if (Cookies.get("underline-links") == "on") { 180 $("html").addClass("underline-links"); 181 $('#calendar').contents().find('html').addClass('underlink-links'); 182 $(this).text("Underline Links Off"); 183 } else { 184 $("html").removeClass("underline-links"); 185 $('#calendar').contents().find('html').removeClass('underlink-links'); 186 $(this).text("Underline Links"); 187 } 188 } 189 }); 190 // ADA MENU END 191 192 // Keyboard Navigation: Nav, flyout
193 var isClick = false; 194 $("#nav li a, #flyout li a, a, button, .toggle, .toggle2").on('focusin', function(e) { 195 console.log(isClick); 196 if( isClick === false ) { 197 $(".focused").removeClass("focused"); 198 $(e.currentTarget).parents("#nav li, #flyout li").addClass("focused"); 199 $(".opened:not(.focused) ul:visible,.opened2:not(.focused) ul:visible").slideUp().parent().removeClass("opened opened2"); 200 } else { 201 $(".focused").removeClass("focused"); 202 isClick = false; 203 } 204 }); 205 206 // prevent focused class changes on click - This way arrows wont pop when clicking nav links 207 $("#nav a,#flyout a").on('mousedown',function(){ 208 isClick = true; 209 }); 210 211 // RZ Class 212 if(typeof RZ !== "undefined"){ 213 if(RZ.login){ 214 $body.addClass("user-logged-in"); 215 }else { 216 $body.addClass("user-not-logged-in"); 217 } 218 } 219 220 221 222 $('#cookieConsent').remove(); 223 224 // Search Toggle 225 $('#search-toggle').on('click keydown',function(e){ 226 if (e.keyCode === 13 || e.type === 'click') { 227 $('#search').stop().slideToggle(200); 228 $(this).toggleClass('fa-search fa-times'); 229 } 230 }); 231 232 // Navigation Toggle 233 $("#nav-toggle").on("click keydown", function(e){ 234 if (e.keyCode === 13 || e.type === 'click') { 235 $("#nav").stop().slideToggle(); 236 $(this).toggleClass("fa-bars fa-times"); 237 } 238 }); 239 240 // Menu Toggles 241 $("#nav >li>ul,#flyout >li>ul").addClass('first-level'); 242 $("#nav li ul ul").addClass('second-level'); 243 $("#nav >li:has(ul)").find("a:first").append('<i class="fa fa-angle-down toggle" tabindex="0">'); 244 $("#nav li li:has(ul)").find("a:first").append('<i class="fa fa-angle-down toggle2" tabindex="0">'); 245 $("#flyout >li:has(ul)").find("a:first").append('<i class="fa fa-angle-down toggle" tabindex="0">'); 246 247 function mainSizer(){ 248 var mainHeight = $('#freeform main').outerHeight(); 249 var combinedHeight = $('header').outerHeight() + $('#slider').outerHeight() + $('footer').outerHeight(); 250 var windowHeight = $(window).height(); 251 252 if(mainHeight + combinedHeight < windowHeight){ 253 $('#freeform main').css('min-height',(windowHeight - combinedHeight) + 'px'); 254 } 255 } 256 257 function addNavClass() { 258 mainSizer(); 259 if ($window.width() < 992) { 260 $("body").addClass('mobile'); 261 $("body").removeClass('desktop'); 262 263 } else{ 264 $("body").addClass('mobile'); 265 $("body").removeClass('desktop'); 266 $('#nav ul').css('display','none'); 267 } 268 } 269 addNavClass(); 270 $window.resize(addNavClass); 271 272 $(".toggle").on("click keydown",function(e) { 273 if (e.keyCode === 13 || e.type === 'click') { 274 e.preventDefault(); 275 var $parent = $(this).parent(); 276 var $parentLi = $parent.parent(); 277 $parentLi.toggleClass('opened'); 278 if($parent.addClass('active').next('.first-level').is(":visible")){ 279 $parent.next('.first-level').slideUp(); 280 } else { 281 $(".first-level").slideUp("slow"); 282 $parent.removeClass('active').next('.first-level').slideToggle(); 283 } 284 } 285 }); 286 287 $(".toggle2").on("click keydown",function(e) { 288 if (e.keyCode === 13 || e.type === 'click') { 289 e.preventDefault(); 290 var $parent = $(this).parent(); 291 var $parentLi = $parent.parent(); 292 $parentLi.toggleClass('opened2'); 293 if($parent.next('.second-level').is(":visible")){ 294 $parent.next('.second-level').slideUp(); 295 } else { 296 $(".second-level").slideUp("slow"); 297 $parent.next('.second-level').slideToggle(); 298 } 299 } 300 }); 301 302 //colapse nav if left 303 $(".desktop *").focus(function(e){ 304 var $opened = $(".opened"); 305 var $opened2 = $(".opened2"); 306 if( $opened.length > 0 || $opened2.length > 0 ) { 307 if( $(".opened :focus").length < 1 ){ 308 $opened.children("ul").slideUp(); 309 $opened.removeClass("opened"); 310 $(".opened2").removeClass("opened2"); 311 } 312 if( $(".opened2 :focus").length < 1 ){ 313 $opened2.children("ul").slideUp(); 314 $opened2.removeClass("opened2"); 315 } 316 } 317 }); 318 319 // Flyout 320 var flyout = $('#flyout'), 321 flyoutwrap = $('#flyout-wrap'); 322 323 if (flyout.text().length){ 324 flyoutwrap.prepend('<div id="flyout-toggle" class="hidden-lg hidden-md"><i class="fa fa-bars"></i> Sub Menu</div>'); 325 } 326 327 $("#flyout-toggle").on("click keydown", function(e){
328 if (e.keyCode === 13 || e.type === 'click') { 329 flyout.slideToggle(); 330 $(this).toggleClass("active"); 331 } 332 }); 333 334 // start calendar resize handler 335 function resizeIframe(height) { 336 var iFrameID = document.getElementById('calendar'); 337 var calendarHTML = $('#calendar').contents().find('html'); 338 calendarHTML.attr('lang', 'en'); 339 if(iFrameID) { 340 // here you can set the height, I delete it first, then I set it again 341 iFrameID.height = ""; 342 iFrameID.height = height; 343 } 344 console.log("height to: " + height); 345 if (Cookies.get("highcontrast") == "on") { 346 calendarHTML.addClass('highcontrast'); 347 } 348 if (Cookies.get("yellowlinks") == "on") { 349 calendarHTML.addClass('yellowlinks'); 350 } 351 if (Cookies.get("greyscale") == "on") { 352 calendarHTML.addClass("greyscale"); 353 } 354 if (Cookies.get("underline-links") == "on") { 355 calendarHTML.addClass("underline-links"); 356 } 357 $('#calendar').contents().find('#headerMonth').attr({'title': 'Month', 'aria-label': 'Month'}); 358 $('#calendar').contents().find('#headerYear').attr({'title': 'Year', 'aria-label': 'Year'}); 359 $('#calendar').contents().find('select[name="calendarName"]').attr({'title': 'Calendar Name', 'aria-label': 'Calendar Name'}); 360 } 361 var eventMethod = window.addEventListener 362 ? "addEventListener" 363 : "attachEvent"; 364 var eventHandler = window[eventMethod]; 365 var messageEvent = eventMethod === "attachEvent" 366 ? "onmessage" 367 : "message"; 368 eventHandler(messageEvent, function (e) { 369 370 if( e.data && e.data[0] === "setCalHeight" ) 371 { 372 if(typeof resizeIframe === 'function'){ 373 resizeIframe(e.data[1]); 374 } 375 376 } 377 378 }); 379 // end calendar resize handler 380 381 // bxSlider 382 if(typeof $.fn.bxSlider !== "undefined"){ 383 $('.bxslider').bxSlider({ 384 mode:'fade', 385 auto:($('.bxslider').children().length < 2) ? false : true, 386 pager: false 387 }); 388 } 389 390 // Owl Slider 391 if(typeof $.fn.owlCarousel !== "undefined"){ 392 var quickLinkCount = $('.quick-link').length; 393 $("#quick-links-carousel").owlCarousel({ 394 responsive: { 395 1367: { 396 items: (quickLinkCount >= 6 ? 6 : quickLinkCount), 397 autoplay: (quickLinkCount > 6 ? true : false) 398 }, 399 1199: { 400 items: (quickLinkCount >= 5 ? 5 : quickLinkCount), 401 autoplay: (quickLinkCount > 5 ? true : false) 402 }, 403 991: { 404 items: (quickLinkCount >= 4 ? 4 : quickLinkCount), 405 autoplay: (quickLinkCount > 4 ? true : false) 406 }, 407 767: { 408 items: (quickLinkCount >= 3 ? 3 : quickLinkCount), 409 autoplay: (quickLinkCount > 3 ? true : false) 410 }, 411 479: { 412 items: (quickLinkCount >= 2 ? 2 : quickLinkCount), 413 autoplay: (quickLinkCount > 2 ? true : false) 414 }, 415 0: { 416 items: 1, 417 autoplay: (quickLinkCount > 1 ? true : false) 418 } 419 }, 420 autoplayTimeout:3000, 421 autoplayHoverPause:true 422 }); 423 } 424 425 $(function(){// Ready 426 var colors = ['#EC7132','#0EB3D2','#A5C43C','#2A88E6','#6172E5','#4BBFDA']; 427 var max = 6; 428 var cIndex = 0; 429 $('.ql-icon').each(function(i,el){ 430 cIndex = cIndex === max ? 0 : cIndex; 431 $(this).css('background', colors[cIndex]); 432 cIndex++; 433 }); 434 }); 435 436 $window.ready(function(){ 437 438 $('#translation-links span').on('keydown click', function(e){ 439 if (e.keyCode === 13 || e.type === 'click') { 440 $('#translation-links ul').stop().fadeToggle(); 441 } 442 }); 443 444 $('#translation-links ul').on('mouseleave',function(){ 445 $(this).fadeOut(); 446 }); 447 448 var translateURL = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; 449 450 // Translate Script 451 $.getScript(translateURL); 452 console.log(translateURL); 453 $('#translation-links a').click(function() { 454 var lang = $(this).data('lang'); 455 console.log(lang); 456 var $frame = $('.goog-te-menu-frame:first'); 457 if (!$frame.size()) { 458 return false; 459 } 460 $frame.contents().find('.goog-te-menu2-item span.text:contains(' + lang + ')').get(0).click(); 461 return false; 462 }); 463 464 $('header .social-media-links').clone().insertAfter('#logo-footer'); 465 466 // matchHeight 467 if(typeof $.fn.matchHeight !== "undefined"){ 468 $('.equal').matchHeight({ 469 //defaults 470 byRow: true, 471 property: 'height', // height or min-height 472 target: null, 473 remove: false 474 }); 475 } 476 477 //#Smooth Scrolling 478 $('a[href*=#]').not('[href=#]').not('[href*="#collapse"]').click(function() { 479 if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) { 480 var target = $(this.hash); 481 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 482 if (target.length) { 483 $('html,body').animate({ 484 scrollTop: target.offset().top 485 }, 1000); 486 return false; 487 } 488 } 489 }); 490 491 /*global jQuery */ 492 /*! 493 * FlexVerticalCenter.js 1.0 494 * 495 * Copyright 2011, Paul Sprangers http://paulsprangers.com 496 * Released under the WTFPL license 497 * http://sam.zoy.org/wtfpl/ 498 * 499 * Date: Fri Oct 28 19:12:00 2011 +0100 500 */ 501 $.fn.flexVerticalCenter = function( options ) { 502 var settings = $.extend({ 503 cssAttribute: 'margin-top', // the attribute to apply the calculated value to 504 verticalOffset: 0, // the number of pixels to offset the vertical alignment by 505 parentSelector: null, // a selector representing the parent to vertically center this element within 506 debounceTimeout: 25, // a default debounce timeout in milliseconds 507 deferTilWindowLoad: false // if true, nothing will take effect until the $(window).load event 508 }, options || {}); 509 510 return this.each(function(){ 511 var $this = $(this); // store the object 512 var debounce; 513 514 // recalculate the distance to the top of the element to keep it centered 515 var resizer = function () { 516 517 var parentHeight = (settings.parentSelector && $this.parents(settings.parentSelector).length) ? 518 $this.parents(settings.parentSelector).first().height() : $this.parent().height(); 519 520 $this.css( 521 settings.cssAttribute, ( ( ( parentHeight - $this.height() ) / 2 ) + parseInt(settings.verticalOffset) ) 522 ); 523 }; 524 525 // Call on resize. Opera debounces their resize by default. 526 $(window).resize(function () { 527 clearTimeout(debounce); 528 debounce = setTimeout(resizer, settings.debounceTimeout); 529 }); 530 531 if (!settings.deferTilWindowLoad) { 532 // call it once, immediately. 533 resizer(); 534 } 535 536 // Call again to set after window (frames, images, etc) loads. 537 $(window).load(function () { 538 resizer(); 539 }); 540 541 }); 542 543 }; 544 $('.v-align').flexVerticalCenter(); 545 546 }); // Ready 547 548})(jQuery); 549 550 551})(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.