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