1 2 3 4 5 6/*----------------------------------------------------------------------------------- 7 8 Theme Name: Homesome 9 Front-end developer: Jamie Phy 10 Author Design: Samir Alley @samiralley 11 Author URI: http://www.revize.com/ 12 Date: 9/3/2020 13 14-----------------------------------------------------------------------------------*/ 15 16(function($) { 17 18 19 var al = document.getElementById("alert_bar"); 20 if (al != null) { 21 var tog = document.getElementById("toggles"); 22 tog.style.top = al.getBoundingClientRect().height + 15 + "px"; 23 window.addEventListener("resize", function() { 24 tog.style.top = al.getBoundingClientRect().height + 15 + "px"; 25 }); 26 } 27 28 (function($) { 29 30 'use strict'; 31 32 var $window = $(window), 33 $body = $('body'); 34 35 /*! 36 * IE10 viewport hack for Surface/desktop Windows 8 bug 37 * Copyright 2014-2015 Twitter, Inc. 38 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 39 */ 40 41 // See the Getting Started docs for more information: 42 // http://getbootstrap.com/getting-started/#support-ie10-width 43 if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 44 var msViewportStyle = document.createElement('style'); 45 msViewportStyle.appendChild( 46 document.createTextNode( 47 '@-ms-viewport{width:auto!important}' 48 ) 49 ); document.querySelector('head').appendChild(msViewportStyle); 50 } 51 52 if(RZ.pageid === "index"){ 53 $("#video-bg").YTPlayer(); 54 } 55 56 $(".cookieConsentOK, #closeCookieConsent").on("click keydown", function() { 57 if (e.keyCode === 13 || e.type === 'click') { 58 $("#cookieConsent").slideUp(); 59 } 60 }); 61 62 $("#cookieConsent").remove(); 63 64 // RZ Class 65 if(typeof RZ !== "undefined"){ 66 if(RZ.login){ 67 $body.addClass("user-logged-in"); 68 } else{ 69 $body.addClass("user-not-logged-in"); 70 } 71 } 72 73 // Font resizer 74 function textResizer() { 75 var $dec, $inc; 76 $inc = $('#increase-font'); 77 $dec = $('#decrease-font'); 78 $inc.on('click', function(e) { 79 return $('body').css({ 80 'font-size': '+=1.5' 81 }); 82 }); 83 $dec.on('click', function(e) { 84 return $('body').css({ 85 'font-size': '-=1.5' 86 }); 87 }); 88 return $('#font-resizer a').on('click', function(e) { 89 return e.preventDefault(); 90 }); 91 92 // Hookup to use Userway's functions instead. 93 }; 94 textResizer(); 95 96 // Clone icons to each navigation link/span 97 $('#navicons li').each(function(){ 98 var navIconIndex = $(this).index(); 99 $(this).find('img').prependTo($('#nav>li').eq(navIconIndex).children('a,span')); 100 }); 101 102 // Keyboard Navigation: Nav, flyout 103 var isClick = false; 104 $("#nav li a").on('focusin', function(e) { 105 if( isClick === false ) { 106 $(".focused").removeClass("focused"); 107 $(e.currentTarget).parents("#nav li").addClass("focused"); 108 } else { 109 $(".focused").parents("#nav li").removeClass("focused"); 110 isClick = false; 111 } 112 }); 113 114 // prevent focused class changes on click - This way arrows wont pop when clicking nav links 115 $("#nav a,#flyout a").on('mousedown',function(){ 116 isClick = true; 117 }); 118 119 // Search Toggle 120 $('#search-toggle').on('click',function(e){ 121 $('#search').stop().slideToggle(200); 122 $(this).toggleClass('fa-search fa-times'); 123 }); 124 125 // Navigation Toggle 126 $("#nav-toggle").on("click", function(){ 127 $("#nav").stop().slideToggle(); 128 $(this).toggleClass("fa-bars fa-times"); 129 }); 130 131 // Menu Arrows and Toggles 132 $("#nav >li>ul,#flyout >li>ul").addClass('first-level'); 133 $("#nav li ul ul").addClass('second-level'); 134 $("#nav>li:has(ul)").each(function(){ 135 $('<a href="#" class="fa fa-angle-down toggle" tabindex="0" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="dropdown-toggle-'+$(this).index()+'" aria-label="Show Dropdown for '+ $(this).find('a:first').text() +'"></a>').insertAfter($(this).find('a:first')); 136 $(this).find('ul:first').attr('aria-labelledby', 'dropdown-toggle-'+$(this).index()); 137 }); 138 $('#nav li ul>li:has(ul)').each(function(index) { 139 $('<a href="#" class="fa fa-angle-down toggle2" tabindex="0" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="sub-dropdown-toggle-'+index+'" aria-label="Show Dropdown for '+ $(this).find('a:first').text() +'"></a>').insertAfter($(this).find('a:first')); 140 $(this).find('ul:first').attr('aria-labelledby', 'sub-dropdown-toggle-'+index); 141 }); 142 $('#flyout >li:has(ul)').each(function() { 143 $('<a href="#" class="fa fa-angle-down toggle" tabindex="0" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="flyout-dropdown-toggle-'+$(this).index()+'" aria-label="Show Flyout for '+ $(this).find('a:first').text() +'"></a>').insertAfter($(this).find('a:first')); 144 $(this).find('ul:first').attr('aria-labelledby', 'flyout-dropdown-toggle-'+$(this).index()); 145 }); 146 147 function addNavClass() { 148 if ($window.width() < 992) { 149 // Insert needed for mobile 150 } else{ 151 // Insert needed for desktop 152 $('#nav ul, #flyout ul').css('display', ''); 153 } 154 } 155 addNavClass(); 156 $window.resize(addNavClass); 157 158 function matchFlyout() { 159 if ($("body").outerWidth() < 992) { $("#flyout-wrap, #entry").css("height",""); return; } 160 var _max = 0; 161 var _temp = 0; 162 $("#flyout-wrap, #entry").each(function() { 163 _temp = $(this).outerHeight(); 164 if ( $(this).css("height","").outerHeight() > _max) { 165 _max = $(this).outerHeight(); 166 } 167 $(this).css("height",_temp); 168 }).css("height",_max); 169 } 170 171 if ($("#flyout").length) { 172 matchFlyout(); 173 $(window).on("resize", matchFlyout); 174 } 175 176 // Flyout Dropdown toggling. 177 function toggleDropdown(el) { 178 $(el).toggleClass('opened').toggleClass('active'); 179 $(el).children("ul").stop(true).slideToggle({step : matchFlyout}); 180 if ($(el).hasClass("active")) { 181 $(el).children("ul").attr({'aria-expanded': 'true'}); 182 } else { 183 $(el).children("ul").attr({'aria-expanded': 'false'}); 184 } 185 } 186 187 // Make a slight delay on hover so you don't flick your cursor and open every single thing. 188 var slideTimeout = {el : null, t : null}; 189 $("#flyout .first-level, #flyout .second-level").parent().on("mouseenter", function(e) { 190 if ($(this).hasClass("active")) { return; } 191 slideTimeout.el = $(this); 192 slideTimeout.t = setTimeout(function() { 193 if ($(slideTimeout.el).hasClass("opened")) { return; } 194 toggleDropdown(slideTimeout.el); 195 },250); // Hover Delay 196 }).on("mouseleave", function() { 197 clearTimeout(slideTimeout.t); 198 }); 199 200 $(".toggle, .toggle2").on("click keydown",function(e) { 201 if (e.keyCode === 13 || e.type === 'click') { 202 e.preventDefault(); 203 toggleDropdown($(this).parent()); 204 } 205 }); 206 207 // close nav if left 208 /*$(".desktop *").focus(function(e){
209 var $opened = $(".opened"); 210 var $opened2 = $(".opened2"); 211 if( $opened.length > 0 || $opened2.length > 0 ) { 212 if( $(".opened :focus").length < 1 ){ 213 $opened.children("ul").slideUp(); 214 $opened.removeClass("opened").removeClass("active"); 215 $(".opened2").removeClass("opened2"); 216 } 217 if( $(".opened2 :focus").length < 1 ){ 218 $opened2.children("ul").slideUp(); 219 $opened2.removeClass("opened2").removeClass("active"); 220 } 221 } 222 });*/ 223 224 // Flyout 225 var flyout = $('#flyout'), 226 flyoutwrap = $('#flyout-wrap'); 227 228 if (flyout.text().length){ 229 flyoutwrap.prepend('<div id="flyout-toggle" class="hidden-lg hidden-md"><i class="fa fa-bars"></i> Sub Menu</div>'); 230 } 231 232 $("#flyout-toggle").on("click", function(){ 233 flyout.slideToggle(); 234 $(this).toggleClass("active"); 235 }); 236 237 238 function fillSide(){ 239 var whiteSpace = parseFloat($('.container').css('margin-right')) + 15; 240 $('.fillLeft').css('margin-left',-whiteSpace); 241 $('.fillLeft.withPadding').css('padding-left',whiteSpace); 242 $('.fillRight').css('margin-right',-whiteSpace); 243 $('.fillRight.withPadding').css('padding-right',whiteSpace); 244 } 245 fillSide(); 246 $window.resize(fillSide); 247 248 /* 249 * E-Notify Auto submit 250 */ 251 $.urlParam=function(n){var e=new RegExp("[?&]"+n+"=([^]*)").exec(window.location.href);return null==e?null:e[1]||0}; 252 var $enotify = $('iframe[src*="/revize/plugins/notify/notify.jsp"]'); 253 if( $enotify.length > 0 ){ 254 var emailStr = $.urlParam("email"); 255 if( emailStr != null ){ 256 $enotify.attr("src", $enotify.attr("src") + "&email=" + emailStr); 257 } 258 } 259 260 // Make sure all calendars have unique ids 261 $('iframe[name="calendar"]').each(function (index, calendar) { 262 calendar.id = 'calendar-' + index; 263 }); 264 265 // Start Frame Resizer 266 function resizeIframe(height, frameElement) { 267 if ( frameElement ) { 268 frameElement.height = ""; 269 frameElement.height = height; 270 } 271 } 272 273 var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; 274 var eventHandler = window[eventMethod]; 275 var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message"; 276 eventHandler(messageEvent, function (e) { 277 if ( Array.isArray(e.data) ) { 278 if( e.data[0] === "setCalHeight" || e.data[0] === "setNotifyHeight") { 279 var frames = document.querySelectorAll('iframe'); 280 for( var i = 0; i < frames.length; i++ ) { 281 if( frames[i].contentWindow === e.source ){ 282 resizeIframe(e.data[1], frames[i]); 283 } 284 } 285 } 286 } 287 }); 288 289 // End Frame Resizer 290 291 // Alert Close Caching 292 if ($("div.alert-dismissible").length) { 293 if (window.sessionStorage) { 294 var hide = parseInt(window.sessionStorage.getItem("alertClosed")) > 1; 295 if (hide && $(".user-logged-in").length == 0) { 296 $("div.alert-dismissible").slideToggle(); 297 } 298 } 299 $("div.alert-dismissible button.alert-dismiss").on('click', function(e) { 300 if (window.sessionStorage) { 301 window.sessionStorage.setItem("alertClosed",parseInt(window.sessionStorage.getItem("alertClosed")||0)+1); 302 } 303 $("div.alert-dismissible").slideUp(); 304 }); 305 } 306 307 //Slider Date 308 if ($("#date_weather").length) { 309 var _date = new Date(); 310 $("#slider_date>time").hide().fadeIn().text(_date.toLocaleDateString('en-US', {weekday: 'long', month: 'short', day: 'numeric'})); 311 312 // revizeWeather 313 if( typeof $.fn.revizeWeather !== "undefined" ){ 314 $.fn.revizeWeather({ 315 zip: '48326', 316 city_name: '', 317 unit: 'f', 318 success: function(weather) { 319 var date = new Date(); 320 date = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear(); 321 var html = '<span class="forecast">'+weather.forecast+' '+weather.temp+'° F</span>'; 322 $("#weather").hide().fadeIn().html(html); 323 }, 324 error: function(error) { 325 // better to just hide the secion if there is an error 326 $('.weather').hide(); 327 console.log(error); 328 } 329 }); 330 } 331 } 332 333 334 // Tabs 335 $('#tabs li a').on('click keypress', function(e) { 336 if (e.keyCode === 13 || e.type === 'click') { 337 $('#tabs li, #tabs-content .current').removeClass('current').removeClass('fadeInLeft'); 338 $(this).parent().addClass('current'); 339 340 var currentTab = $(this).attr('href'); 341 342 e.preventDefault(); 343 $(currentTab).addClass('current animated fadeInLeft'); 344 $(currentTab).find('h2').focus(); 345 } 346 }); 347 348 var $translateButton = $('#translate-button'); 349 $translateButton.on('keydown click', function(e){
350 if (e.keyCode === 13 || e.type === 'click') { 351 $('#translation-links ul').stop().fadeToggle(); 352 $translateButton.attr('aria-expanded', !('true' === $translateButton.attr('aria-expanded'))); 353 } 354 }); 355 356 $('#translation-links ul').on('mouseleave',function(){ 357 $(this).fadeOut(); 358 $translateButton.attr('aria-expanded', false); 359 }); 360 361 var translateURL = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; 362 363 // Translate Script 364 $.getScript(translateURL); 365 $('#translation-links a').click(function() { 366 var lang = $(this).data('lang'); 367 var $frame = $('iframe.skiptranslate'); 368 if (lang === 'English') { 369 $frame.contents().find('span.text:contains("English")').parent().parent().get(0).click(); 370 return; 371 } 372 if (!$frame.length) { 373 return false; 374 } 375 var $el = $frame.contents().find('span.text:contains(' + lang + ')').parent().parent().get(0).click(); 376 console.log($el); 377 if (!$el) { 378 $frame.contents().find('span.text:contains("English")').parent().parent().get(0); 379 } 380 $el.click(); 381 return false; 382 }); 383 // bxSlider 384 if(typeof $.fn.bxSlider !== "undefined"){ 385 $('.bxslider').each(function(i, el){ 386 $(el).bxSlider({ 387 mode: 'fade', 388 auto: ($(el).children().length < 2) ? false : true, 389 pager: true, 390 pause: 8000 391 }); 392 }); 393 } 394 395 // Owl Slider 396 if(typeof $.fn.owlCarousel !== "undefined"){ 397 $("#slider_quicks").owlCarousel({ 398 responsive : { 399 1200 : { items : Math.min($(".quick-item").length, 5) }, 400 990 : { items : Math.min($(".quick-item").length, 4) }, 401 800 : { items : Math.min($(".quick-item").length, 3) }, 402 660 : { items : Math.min($(".quick-item").length, 2) }, 403 0 : { items : Math.min($(".quick-item").length, 1) }, 404 } 405 }); 406 } 407 408 // Events/News Tabs 409 $(".event-tab").click(function() { 410 $(".event-tab, .event-container").removeClass("current"); 411 $(this).addClass("current"); 412 $(".event-container").eq($(this).index()).addClass("current"); 413 }); 414 415 // Responsive Tables 416 $('.post table:not(.layout-table):not(.not-responsive)').wrap('<div class="table-responsive"></div>'); 417 $('.layout-table').attr('role', 'presentation'); 418 419 // Preloader 420 $window.load(function() { 421 422 setTimeout(function(){ 423 $body.addClass('loaded'); 424 $('#loader-wrapper').fadeOut(); 425 }, 600); 426 427 }); 428 429 $window.ready(function(){ 430 431 // matchHeight 432 if(typeof $.fn.matchHeight !== "undefined"){ 433 $('.equal').matchHeight({ 434 //defaults 435 byRow: true, 436 property: 'height', // height or min-height 437 target: null, 438 remove: false 439 }); 440 } 441 442 // Animations http://www.oxygenna.com/tutorials/scroll-animations-using-waypoints-js-animate-css 443 function onScrollInit( items, trigger ) { 444 items.each( function() { 445 var osElement = $(this), 446 osAnimationClass = osElement.data('os-animation'), 447 osAnimationDelay = osElement.data('os-animation-delay'); 448 449 osElement.css({ 450 '-moz-animation-delay': osAnimationDelay, 451 'animation-delay': osAnimationDelay, 452 '-webkit-animation-delay': osAnimationDelay 453 }); 454 455 var osTrigger = ( trigger ) ? trigger : osElement; 456 457 if(typeof $.fn.waypoint !== "undefined"){ 458 osTrigger.waypoint(function() { 459 osElement.addClass('animated').addClass(osAnimationClass); 460 },{ 461 triggerOnce: true, 462 offset: '100%' 463 }); 464 } 465 }); 466 } 467 onScrollInit($('.os-animation')); 468 469 //#Smooth Scrolling 470 $('a[href*="#"]').not('[href="#"]').not('[href*="#collapse"]').click(function(event) { 471 if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) { 472 var target = $(this.hash); 473 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 474 if (target.length) { 475 event.preventDefault(); 476 $('html,body').animate({ 477 scrollTop: target.offset().top 478 }, 1000, function() { 479 var $target = $(target);
480 $target.focus(); 481 if ($target.is(":focus")) { 482 return false; 483 } else { 484 $target.attr('tabindex','-1'); 485 $target.focus(); 486 $target.removeAttr('tabindex'); 487 }; 488 }); 489 } 490 } 491 }); 492 493 /*global jQuery */ 494 /*! 495 * FlexVerticalCenter.js 1.0 496 * 497 * Copyright 2011, Paul Sprangers http://paulsprangers.com 498 * Released under the WTFPL license 499 * http://sam.zoy.org/wtfpl/ 500 * 501 * Date: Fri Oct 28 19:12:00 2011 +0100 502 */ 503 $.fn.flexVerticalCenter = function( options ) { 504 var settings = $.extend({ 505 cssAttribute: 'margin-top', // the attribute to apply the calculated value to 506 verticalOffset: 0, // the number of pixels to offset the vertical alignment by 507 parentSelector: null, // a selector representing the parent to vertically center this element within 508 debounceTimeout: 25, // a default debounce timeout in milliseconds 509 deferTilWindowLoad: false // if true, nothing will take effect until the $(window).load event 510 }, options || {}); 511 512 return this.each(function(){ 513 var $this = $(this); // store the object 514 var debounce; 515 516 // recalculate the distance to the top of the element to keep it centered 517 var resizer = function () { 518 519 var parentHeight = (settings.parentSelector && $this.parents(settings.parentSelector).length) ? 520 $this.parents(settings.parentSelector).first().height() : $this.parent().height(); 521 522 $this.css( 523 settings.cssAttribute, ( ( ( parentHeight - $this.height() ) / 2 ) + parseInt(settings.verticalOffset) ) 524 ); 525 }; 526 527 // Call on resize. Opera debounces their resize by default. 528 $(window).resize(function () { 529 clearTimeout(debounce); 530 debounce = setTimeout(resizer, settings.debounceTimeout); 531 }); 532 533 if (!settings.deferTilWindowLoad) { 534 // call it once, immediately. 535 resizer(); 536 } 537 538 // Call again to set after window (frames, images, etc) loads. 539 $(window).load(function () { 540 resizer(); 541 }); 542 543 }); 544 545 }; 546 $('.v-align').flexVerticalCenter(); 547 548 }); // Ready 549 550 })(jQuery); 551 552 553 })(jQuery); 554
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.