1(function($) 2{ 3 "use strict"; 4 5 $(document).ready(function() 6 { 7 var aviabodyclasses = AviaBrowserDetection('html'); 8 9 $.avia_utilities = $.avia_utilities || {}; 10 if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement) 11 { 12 $.avia_utilities.isMobile = true; 13 } 14 else 15 { 16 $.avia_utilities.isMobile = false; 17 } 18 19 //activates the hamburger mobile menu 20 avia_hamburger_menu(); 21 22 //show scroll top but1ton 23 avia_scroll_top_fade(); 24 25 //calculate width of content 26 aviaCalcContentWidth(); 27 28 //creates search tooltip 29 new $.AviaTooltip({"class": 'avia-search-tooltip',data: 'avia-search-tooltip', event:'click', position:'bottom', scope: "body", attach:'element', within_screen: true}); 30 31 //creates relate posts tooltip 32 new $.AviaTooltip({"class": 'avia-related-tooltip', data: 'avia-related-tooltip', scope: ".related_posts, .av-share-box", attach:'element', delay:0}); 33 34 //creates ajax search 35 new $.AviaAjaxSearch({scope:'#header, .avia_search_element'}); 36 37 // actiavte portfolio sorting 38 if($.fn.avia_iso_sort) 39 $('.grid-sort-container').avia_iso_sort(); 40 41 // Checks height of content and sidebar and applies shadow class to the higher one 42 AviaSidebarShaowHelper(); 43 44 $.avia_utilities.avia_ajax_call(); 45 46 47 }); 48 49 $.avia_utilities = $.avia_utilities || {}; 50 51 $.avia_utilities.avia_ajax_call = function(container) 52 { 53 if(typeof container == 'undefined'){ container = 'body';}; 54 55 56 $('a.avianolink').on('click', function(e){ e.preventDefault(); }); 57 $('a.aviablank').attr('target', '_blank'); 58 59 //activates the prettyphoto lightbox 60 if($.fn.avia_activate_lightbox){ 61 $(container).avia_activate_lightbox(); 62 } 63 64 //scrollspy for main menu. must be located before smoothscrolling 65 if($.fn.avia_scrollspy) 66 { 67 if(container == 'body') 68 { 69 $('body').avia_scrollspy({target:'.main_menu .menu li > a'}); 70 } 71 else 72 { 73 $('body').avia_scrollspy('refresh'); 74 } 75 } 76 77 78 79 //smooth scrooling 80 if($.fn.avia_smoothscroll) 81 $('a[href*="#"]', container).avia_smoothscroll(container); 82 83 avia_small_fixes(container); 84 85 avia_hover_effect(container); 86 87 avia_iframe_fix(container); 88 89 //activate html5 video player 90 if($.fn.avia_html5_activation && $.fn.mediaelementplayer) 91 $(".avia_video, .avia_audio", container).avia_html5_activation({ratio:'16:9'}); 92 93 }; 94 95 // ------------------------------------------------------------------------------------------- 96 // Error log helper 97 // ------------------------------------------------------------------------------------------- 98 99 $.avia_utilities.log = function(text, type, extra) 100 { 101 if(typeof console == 'undefined'){return;} if(typeof type == 'undefined'){type = "log";} type = "AVIA-" + type.toUpperCase(); 102 console.log("["+type+"] "+text); if(typeof extra != 'undefined') console.log(extra); 103 }; 104 105 106 107 // ------------------------------------------------------------------------------------------- 108 // keep track of the browser and content width 109 // ------------------------------------------------------------------------------------------- 110 111 112 113 function aviaCalcContentWidth() 114 { 115 116 var win = $(window), 117 width_select= $('html').is('.html_header_sidebar') ? "#main" : "#header", 118 outer = $(width_select), 119 outerParent = outer.parents('div:eq(0)'), 120 the_main = $(width_select + ' .container:first'), 121 css_block = "", 122 calc_dimensions = function() 123 { 124 var css = "", 125 w_12 = Math.round( the_main.width() ), 126 w_outer = Math.round( outer.width() ), 127 w_inner = Math.round( outerParent.width() ); 128 129 //css rules for mega menu 130 css += " #header .three.units{width:" + ( w_12 * 0.25)+ "px;}"; 131 css += " #header .six.units{width:" + ( w_12 * 0.50)+ "px;}"; 132 css += " #header .nine.units{width:" + ( w_12 * 0.75)+ "px;}"; 133 css += " #header .twelve.units{width:" +( w_12 ) + "px;}"; 134 135 //css rules for tab sections 136 css += " .av-framed-box .av-layout-tab-inner .container{width:" +( w_inner )+ "px;}"; 137 css += " .html_header_sidebar .av-layout-tab-inner .container{width:" +( w_outer )+ "px;}"; 138 css += " .boxed .av-layout-tab-inner .container{width:" +( w_outer )+ "px;}"; 139
140 //css rules for submenu container 141 css += " .av-framed-box#top .av-submenu-container{width:" +( w_inner )+ "px;}"; 142 143 //ie8 needs different insert method 144 try{ 145 css_block.text(css); 146 } 147 catch(err){ 148 css_block.remove(); 149 css_block = $("<style type='text/css' id='av-browser-width-calc'>"+css+"</style>").appendTo('head:first'); 150 } 151 152 }; 153 154 155 156 if($('.avia_mega_div').length > 0 || $('.av-layout-tab-inner').length > 0 || $('.av-submenu-container').length > 0) 157 { 158 css_block = $("<style type='text/css' id='av-browser-width-calc'></style>").appendTo('head:first'); 159 win.on( 'debouncedresize', calc_dimensions); 160 calc_dimensions(); 161 } 162 } 163 164 165 // ------------------------------------------------------------------------------------------- 166 // Tiny helper for sidebar shadow 167 // ------------------------------------------------------------------------------------------- 168 169 function AviaSidebarShaowHelper(){ 170 171 var $sidebar_container = $('.sidebar_shadow#top #main .sidebar'); 172 var $content_container = $('.sidebar_shadow .content'); 173 174 if ($sidebar_container.height() >= $content_container.height()) { 175 $sidebar_container.addClass('av-enable-shadow'); 176 } 177 else{ 178 $content_container.addClass('av-enable-shadow'); 179 } 180 181 } 182 183 184 // ------------------------------------------------------------------------------------------- 185 // modified SCROLLSPY by bootstrap 186 // ------------------------------------------------------------------------------------------- 187 188 189 function AviaScrollSpy(element, options) 190 { 191 var self = this; 192 193 var process = $.proxy(self.process, self) 194 , refresh = $.proxy(self.refresh, self) 195 , $element = $(element).is('body') ? $(window) : $(element) 196 , href; 197 self.$body = $('body'); 198 self.$win = $(window); 199 self.options = $.extend({}, $.fn.avia_scrollspy.defaults, options); 200 self.selector = (self.options.target 201 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 202 || ''); 203 204 self.activation_true = false; 205 206 if(self.$body.find(self.selector + "[href*='#']").length) 207 {
208 self.$scrollElement = $element.on('scroll.scroll-spy.data-api', process); 209 self.$win.on('av-height-change', refresh); 210 self.$body.on('av_resize_finished', refresh); 211 self.activation_true = true; 212 self.checkFirst(); 213 214 setTimeout(function() 215 { 216 self.refresh(); 217 self.process(); 218 219 },100); 220 } 221 222 } 223 224 AviaScrollSpy.prototype = { 225 226 constructor: AviaScrollSpy 227 , checkFirst: function () { 228 229 var current = window.location.href.split('#')[0], 230 matching_link = this.$body.find(this.selector + "[href='"+current+"']").attr('href',current+'#top'); 231 } 232 , refresh: function () { 233 234 if(!this.activation_true) return; 235 236 var self = this 237 , $targets; 238 239 this.offsets = $([]); 240 this.targets = $([]); 241 242 $targets = this.$body 243 .find(this.selector) 244 .map(function () { 245 var $el = $(this) 246 , href = $el.data('target') || $el.attr('href') 247 , hash = this.hash 248 , hash = hash.replace(/\//g, "") 249 , $href = /^#\w/.test(hash) && $(hash); 250 251 return ( $href 252 && $href.length 253 && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null; 254 }) 255 .sort(function (a, b) { return a[0] - b[0]; }) 256 .each(function () { 257 self.offsets.push(this[0]); 258 self.targets.push(this[1]); 259 }); 260 261 } 262 263 , process: function () { 264 265 if(!this.offsets) return; 266 if(isNaN(this.options.offset)) this.options.offset = 0; 267 268 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 269 , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight 270 , maxScroll = scrollHeight - this.$scrollElement.height() 271 , offsets = this.offsets 272 , targets = this.targets 273 , activeTarget = this.activeTarget 274 , i; 275 276 if (scrollTop >= maxScroll) { 277 return activeTarget != (i = targets.last()[0]) 278 && this.activate ( i ); 279 } 280 281 for (i = offsets.length; i--;) { 282 activeTarget != targets[i] 283 && scrollTop >= offsets[i] 284 && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) 285 && this.activate( targets[i] ); 286 } 287 } 288 289 , activate: function (target) { 290 var active 291 , selector; 292 293 this.activeTarget = target; 294 295 $(this.selector) 296 .parent('.' + this.options.applyClass) 297 .removeClass(this.options.applyClass); 298 299 selector = this.selector 300 + '[data-target="' + target + '"],' 301 + this.selector + '[href="' + target + '"]'; 302 303 304 305 active = $(selector) 306 .parent('li') 307 .addClass(this.options.applyClass); 308 309 if (active.parent('.sub-menu').length) { 310 active = active.closest('li.dropdown_ul_available').addClass(this.options.applyClass); 311 } 312 313 active.trigger('activate'); 314 } 315 316 }; 317 318 319 /* AviaScrollSpy PLUGIN DEFINITION 320 * =========================== */ 321 322 $.fn.avia_scrollspy = function (option) { 323 return this.each(function () { 324 var $this = $(this) 325 , data = $this.data('scrollspy') 326 , options = typeof option == 'object' && option; 327 if (!data) $this.data('scrollspy', (data = new AviaScrollSpy(this, options))); 328 if (typeof option == 'string') data[option](); 329 }); 330 }; 331 332 $.fn.avia_scrollspy.Constructor = AviaScrollSpy; 333 334 $.fn.avia_scrollspy.calc_offset = function() 335 { 336 var offset_1 = (parseInt($('.html_header_sticky #main').data('scroll-offset'), 10)) || 0, 337 offset_2 = ($(".html_header_sticky:not(.html_top_nav_header) #header_main_alternate").outerHeight()) || 0, 338 offset_3 = ($(".html_header_sticky.html_header_unstick_top_disabled #header_meta").outerHeight()) || 0, 339 offset_4 = 1, 340 offset_5 = parseInt($('html').css('margin-top'),10) || 0, 341 offset_6 = parseInt($('.av-frame-top ').outerHeight(),10) || 0; 342 343 return offset_1 + offset_2 + offset_3 + offset_4 + offset_5 + offset_6; 344 }; 345 346 $.fn.avia_scrollspy.defaults = 347 { 348 offset: $.fn.avia_scrollspy.calc_offset(), 349 applyClass: 'current-menu-item' 350 }; 351 352 353 354 355 356 // ------------------------------------------------------------------------------------------- 357 // detect browser and add class to body 358 // ------------------------------------------------------------------------------------------- 359 360 function AviaBrowserDetection(outputClassElement) 361 { 362 363 //code from the old jquery migrate plugin 364 var current_browser = {}, 365 366 uaMatch = function( ua ) { 367 ua = ua.toLowerCase(); 368 369 var match = /(edge)\/([\w.]+)/.exec( ua ) || 370 /(opr)[\/]([\w.]+)/.exec( ua ) || 371 /(chrome)[ \/]([\w.]+)/.exec( ua ) || 372 /(iemobile)[\/]([\w.]+)/.exec( ua ) || 373 /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec( ua ) || 374 /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec( ua ) || 375 /(webkit)[ \/]([\w.]+)/.exec( ua ) || 376 /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || 377 /(msie) ([\w.]+)/.exec( ua ) || 378 ua.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec( ua ) || 379 ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || 380 []; 381 382 return { 383 browser: match[ 5 ] || match[ 3 ] || match[ 1 ] || "", 384 version: match[ 2 ] || match[ 4 ] || "0", 385 versionNumber: match[ 4 ] || match[ 2 ] || "0" 386 }; 387 }; 388
389 var matched = uaMatch( navigator.userAgent ); 390 391 if ( matched.browser ) 392 { 393 current_browser.browser = matched.browser; 394 current_browser[ matched.browser ] = true; 395 current_browser.version = matched.version; 396 } 397 398 // Chrome is Webkit, but Webkit is also Safari. 399 if ( current_browser.chrome ) { 400 current_browser.webkit = true; 401 } else if ( current_browser.webkit ) { 402 current_browser.safari = true; 403 } 404 405 if(typeof(current_browser) !== 'undefined') 406 { 407 var bodyclass = '', version = current_browser.version ? parseInt(current_browser.version) : ""; 408 409 if(current_browser.msie || current_browser.rv || current_browser.iemobile){ 410 bodyclass += 'avia-msie'; 411 }else if(current_browser.webkit){ 412 bodyclass += 'avia-webkit'; 413 }else if(current_browser.mozilla){ 414 bodyclass += 'avia-mozilla'; 415 } 416 417 if(current_browser.version) bodyclass += ' ' + bodyclass + '-' + version + ' '; 418 if(current_browser.browser) bodyclass += ' avia-' + current_browser.browser + ' avia-' +current_browser.browser +'-' + version + ' '; 419 } 420 421 if(outputClassElement) $(outputClassElement).addClass(bodyclass); 422 423 return bodyclass; 424 } 425 426 // ------------------------------------------------------------------------------------------- 427 // html 5 videos 428 // ------------------------------------------------------------------------------------------- 429 $.fn.avia_html5_activation = function(options) 430 { 431 var defaults = 432 { 433 ratio: '16:9' 434 }; 435 436 var options = $.extend(defaults, options), 437 isMobile = $.avia_utilities.isMobile; 438 439 // if(isMobile) return; 440 441 this.each(function() 442 { 443 var fv = $(this), 444 id_to_apply = '#' + fv.attr('id'), 445 posterImg = fv.attr('poster'); 446 447 448 fv.mediaelementplayer({ 449 // if the <video width> is not specified, this is the default 450 defaultVideoWidth: 480, 451 // if the <video height> is not specified, this is the default 452 defaultVideoHeight: 270, 453 // if set, overrides <video width> 454 videoWidth: -1, 455 // if set, overrides <video height> 456 videoHeight: -1, 457 // width of audio player 458 audioWidth: 400, 459 // height of audio player 460 audioHeight: 30, 461 // initial volume when the player starts 462 startVolume: 0.8, 463 // useful for <audio> player loops 464 loop: false, 465 // enables Flash and Silverlight to resize to content size 466 enableAutosize: false, 467 // the order of controls you want on the control bar (and other plugins below) 468 features: ['playpause','progress','current','duration','tracks','volume'], 469 // Hide controls when playing and mouse is not over the video 470 alwaysShowControls: false, 471 // force iPad's native controls 472 iPadUseNativeControls: false, 473 // force iPhone's native controls 474 iPhoneUseNativeControls: false, 475 // force Android's native controls 476 AndroidUseNativeControls: false, 477 // forces the hour marker (##:00:00) 478 alwaysShowHours: false, 479 // show framecount in timecode (##:00:00:00) 480 showTimecodeFrameCount: false, 481 // used when showTimecodeFrameCount is set to true 482 framesPerSecond: 25, 483 // turns keyboard support on and off for this instance 484 enableKeyboard: true, 485 // when this player starts, it will pause other players 486 pauseOtherPlayers: false, 487 poster: posterImg, 488 success: function (mediaElement, domObject, instance) { 489 490 //make the medialement instance accesible by storing it. usually not necessary but safari has problems since wp version 4.9 491 $.AviaVideoAPI.players[ fv.attr('id').replace(/_html5/,'') ] = instance; 492 493 setTimeout(function() 494 { 495 if (mediaElement.pluginType == 'flash') 496 { 497 mediaElement.addEventListener('canplay', function() { fv.trigger('av-mediajs-loaded'); }, false); 498 } 499 else 500 { 501 fv.trigger('av-mediajs-loaded').addClass('av-mediajs-loaded'); 502 } 503 504 mediaElement.addEventListener('ended', function() { fv.trigger('av-mediajs-ended'); }, false); 505 506 },10); 507 508 }, 509 // fires when a problem is detected 510 error: function () { 511 512 }, 513 514 // array of keyboard commands 515 keyActions: [] 516 }); 517 518 }); 519 }; 520 521 522 523 // ------------------------------------------------------------------------------------------- 524 // hover effect for images 525 // ------------------------------------------------------------------------------------------- 526 function avia_hover_effect(container) 527 { 528 //hover overlay for mobile device doesnt really make sense. in addition it often slows down the click event 529 if($.avia_utilities.isMobile) return; 530 531 if( $('body').hasClass( 'av-disable-avia-hover-effect' ) ) 532 { 533 return; 534 } 535
536 var overlay = "", cssTrans = $.avia_utilities.supports('transition'); 537 538 if(container == 'body') 539 { 540 var elements = $('#main a img').parents('a').not('.noLightbox, .noLightbox a, .avia-gallery-thumb a, .ls-wp-container a, .noHover, .noHover a, .av-logo-container .logo a').add('#main .avia-hover-fx'); 541 } 542 else 543 { 544 var elements = $('a img', container).parents('a').not('.noLightbox, .noLightbox a, .avia-gallery-thumb a, .ls-wp-container a, .noHover, .noHover a, .av-logo-container .logo a').add('.avia-hover-fx', container); 545 } 546 547 elements.each(function(e) 548 { 549 var link = $(this), 550 current = link.find('img:first'); 551 552 if(current.hasClass('alignleft')) link.addClass('alignleft').css({float:'left', margin:0, padding:0}); 553 if(current.hasClass('alignright')) link.addClass('alignright').css({float:'right', margin:0, padding:0}); 554 if(current.hasClass('aligncenter')) link.addClass('aligncenter').css({float:'none','text-align':'center', margin:0, padding:0}); 555 556 if(current.hasClass('alignnone')) 557 { 558 link.addClass('alignnone').css({margin:0, padding:0});; 559 if(!link.css('display') || link.css('display') == 'inline') { link.css({display:'inline-block'}); } 560 } 561 562 if(!link.css('position') || link.css('position') == 'static') { link.css({position:'relative', overflow:'hidden'}); } 563 564 var url = link.attr('href'), 565 span_class = "overlay-type-video", 566 opa = link.data('opacity') || 0.7, 567 overlay_offset = 5, 568 overlay = link.find('.image-overlay'); 569 570 if(url) 571 { 572 if( url.match(/(jpg|gif|jpeg|png|tif)/) ) span_class = "overlay-type-image"; 573 if(!url.match(/(jpg|gif|jpeg|png|\.tif|\.mov|\.swf|vimeo\.com|youtube\.com)/) ) span_class = "overlay-type-extern"; 574 } 575 576 if(!overlay.length) 577 { 578 overlay = $("<span class='image-overlay "+span_class+"'><span class='image-overlay-inside'></span></span>").appendTo(link); 579 } 580 581 link.on('mouseenter', function(e) 582 { 583 var current = link.find('img:first'), 584 _self = current.get(0), 585 outerH = current.outerHeight(), 586 outerW = current.outerWidth(), 587 pos = current.position(), 588 linkCss = link.css('display'), 589 overlay = link.find('.image-overlay'); 590 591 if(outerH > 100) 592 { 593 594 if(!overlay.length) 595 { 596 overlay = $("<span class='image-overlay "+span_class+"'><span class='image-overlay-inside'></span></span>").appendTo(link); 597 598 } 599 //can be wrapped into if !overlay.length statement if chrome fixes fade in problem 600 if(link.height() == 0) { link.addClass(_self.className); _self.className = ""; } 601 if(!linkCss || linkCss == 'inline') { link.css({display:'block'}); } 602 //end wrap 603 604 overlay.css({left:(pos.left - overlay_offset) + parseInt(current.css("margin-left"),10), top:pos.top + parseInt(current.css("margin-top"),10)}) 605 .css({overflow:'hidden',display:'block','height':outerH,'width':(outerW + (2*overlay_offset))}); 606 607 if(cssTrans === false ) overlay.stop().animate({opacity:opa}, 400); 608 } 609 else 610 { 611 overlay.css({display:"none"}); 612 } 613 614 }).on('mouseleave', elements, function(){ 615 616 if(overlay.length) 617 { 618 if(cssTrans === false ) overlay.stop().animate({opacity:0}
618, 400); 619 } 620 }); 621 }); 622 } 623 624 625 626 627 628 629 630 631// ------------------------------------------------------------------------------------------- 632// Smooth scrooling when clicking on anchor links 633// todo: maybe use https://github.com/ryanburnette/scrollToBySpeed/blob/master/src/scrolltobyspeed.jquery.js in the future 634// ------------------------------------------------------------------------------------------- 635 636 (function($) 637 { 638 $.fn.avia_smoothscroll = function(apply_to_container) 639 { 640 if(!this.length) return; 641 642 var the_win = $(window), 643 $header = $('#header'), 644 $main = $('.html_header_top.html_header_sticky #main').not('.page-template-template-blank-php #main'), 645 $meta = $('.html_header_top.html_header_unstick_top_disabled #header_meta'), 646 $alt = $('.html_header_top:not(.html_top_nav_header) #header_main_alternate'), 647 menu_above_logo = $('.html_header_top.html_top_nav_header'), 648 shrink = $('.html_header_top.html_header_shrinking').length, 649 frame = $('.av-frame-top'), 650 fixedMainPadding = 0, 651 isMobile = $.avia_utilities.isMobile, 652 sticky_sub = $('.sticky_placeholder:first'), 653 calc_main_padding= function() 654 { 655 if($header.css('position') == "fixed") 656 { 657 var tempPadding = parseInt($main.data('scroll-offset'),10) || 0, 658 non_shrinking = parseInt($meta.outerHeight(),10) || 0, 659 non_shrinking2 = parseInt($alt.outerHeight(),10) || 0; 660 661 if(tempPadding > 0 && shrink) 662 { 663 tempPadding = (tempPadding / 2 ) + non_shrinking + non_shrinking2; 664 } 665 else 666 { 667 tempPadding = tempPadding + non_shrinking + non_shrinking2; 668 } 669 670 tempPadding += parseInt($('html').css('margin-top'),10); 671 fixedMainPadding = tempPadding; 672 } 673 else 674 { 675 fixedMainPadding = parseInt($('html').css('margin-top'),10); 676 } 677 678 if(frame.length){ 679 fixedMainPadding += frame.height(); 680 } 681 682 if(menu_above_logo.length) 683 { 684 //if menu is above logo and we got a sticky height header 685 fixedMainPadding = $('.html_header_sticky #header_main_alternate').height() + parseInt($('html').css('margin-top'),10); 686 } 687 688 if(isMobile) 689 { 690 fixedMainPadding = 0; 691 } 692 693 }; 694 695 if(isMobile) shrink = false; 696 697 calc_main_padding(); 698 the_win.on("debouncedresize av-height-change", calc_main_padding); 699 700 var hash = window.location.hash.replace(/\//g, ""); 701 702 //if a scroll event occurs at pageload and an anchor is set and a coresponding element exists apply the offset to the event 703 if (fixedMainPadding > 0 && hash && apply_to_container == 'body' && hash.charAt(1) != "!" && hash.indexOf("=") === -1) 704 { 705 var scroll_to_el = $(hash), modifier = 0; 706 707 if(scroll_to_el.length) 708 { 709 the_win.on('scroll.avia_first_scroll', function() 710 { 711 setTimeout(function(){ //small delay so other scripts can perform necessary resizing 712 if(sticky_sub.length && scroll_to_el.offset().top > sticky_sub.offset().top) { modifier = sticky_sub.outerHeight() - 3; } 713 the_win.off('scroll.avia_first_scroll').scrollTop( scroll_to_el.offset().top - fixedMainPadding - modifier ); 714 715 },10); 716 }); 717 } 718 } 719 720 return this.each(function() 721 { 722 $(this).click(function(e) { 723 724 var newHash = this.hash.replace(/\//g, ""), 725 clicked = $(this), 726 data = clicked.data(); 727 728 if(newHash != '' && newHash != '#' && newHash != '#prev' && newHash != '#next' && !clicked.is('.comment-reply-link, #cancel-comment-reply-link, .no-scroll')) 729 { 730 var container = "", originHash = ""; 731 732 if("#next-section" == newHash) 733 { 734 originHash = newHash; 735 container = clicked.parents('.container_wrap:eq(0)').nextAll('.container_wrap:eq(0)'); 736 newHash = '#' + container.attr('id') ; 737 } 738 else 739 { 740 container = $(this.hash.replace(/\//g, "")); 741 } 742 743 744 745 if(container.length) 746 { 747 var cur_offset = the_win.scrollTop(), 748 container_offset = container.offset().top, 749 target = container_offset - fixedMainPadding, 750 hash = window.location.hash, 751 hash = hash.replace(/\//g, ""), 752 oldLocation=window.location.href.replace(hash, ''), 753 newLocation=this, 754 duration= data.duration || 1200, 755 easing= data.easing || 'easeInOutQuint'; 756 757 if(sticky_sub.length && container_offset > sticky_sub.offset().top) { target -= sticky_sub.outerHeight() - 3;} 758 759 // make sure it's the same location 760 if(oldLocation+newHash==newLocation || originHash) 761 { 762 if(cur_offset != target) // if current pos and target are the same dont scroll 763 { 764 if(!(cur_offset == 0 && target <= 0 )) // if we are at the top dont tr
764y to scroll to top or above 765 { 766 the_win.trigger('avia_smooth_scroll_start'); 767 768 // animate to target and set the hash to the window.location after the animation 769 $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() { 770 771 // add new hash to the browser location 772 //window.location.href=newLocation; 773 if(window.history.replaceState) 774 window.history.replaceState("", "", newHash); 775 }); 776 } 777 } 778 // cancel default click action 779 e.preventDefault(); 780 } 781 } 782 } 783 }); 784 }); 785 }; 786 })(jQuery); 787 788 789 // ------------------------------------------------------------------------------------------- 790 // iframe fix for firefox and ie so they get proper z index 791 // ------------------------------------------------------------------------------------------- 792 function avia_iframe_fix(container) 793 { 794 var iframe = jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame)', container), 795 youtubeEmbed = jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame) object, iframe[src*="youtube.com"]:not(.av_youtube_frame) embed', container).attr('wmode','opaque'); 796 797 iframe.each(function() 798 { 799 var current = jQuery(this), 800 src = current.attr('src'); 801 802 if(src) 803 { 804 if(src.indexOf('?') !== -1) 805 { 806 src += "&wmode=opaque&rel=0"; 807 } 808 else 809 { 810 src += "?wmode=opaque&rel=0"; 811 } 812 813 current.attr('src', src); 814 } 815 }); 816 } 817 818 // ------------------------------------------------------------------------------------------- 819 // small js fixes for pixel perfection :) 820 // ------------------------------------------------------------------------------------------- 821 function avia_small_fixes(container) 822 { 823 if(!container) container = document; 824 825 //make sure that iframes do resize correctly. uses css padding bottom iframe trick 826 var win = jQuery(window), 827 iframes = jQuery('.avia-iframe-wrap iframe:not(.avia-slideshow iframe):not( iframe.no_resize):not(.avia-video iframe)', container), 828 adjust_iframes = function() 829 { 830 iframes.each(function(){ 831 832 var iframe = jQuery(this), parent = iframe.parent(), proportions = 56.25; 833 834 if(this.width && this.height) 835 { 836 proportions = (100/ this.width) * this.height; 837 parent.css({"padding-bottom":proportions+"%"}); 838 } 839 }); 840 }; 841 842 adjust_iframes(); 843 844 } 845 846 function avia_scroll_top_fade() 847 { 848 var win = $(window), 849 timeo = false, 850 scroll_top = $('#scroll-top-link'), 851 set_status = function() 852 { 853 var st = win.scrollTop(); 854 855 if(st < 500) 856 { 857 scroll_top.removeClass('avia_pop_class'); 858 } 859 else if(!scroll_top.is('.avia_pop_class')) 860 { 861 scroll_top.addClass('avia_pop_class'); 862 } 863 }; 864 865 win.on( 'scroll', function(){ window.requestAnimationFrame( set_status ); } ); 866 set_status(); 867 } 868 869 function avia_hamburger_menu() 870 { 871 var header = $('#header'), 872 header_main = $('#main .av-logo-container'), //check if we got a top menu that is above the header 873 menu = $('#avia-menu'), 874 burger_wrap = $('.av-burger-menu-main a'), 875 htmlEL = $('html').eq(0), 876 overlay = $('<div class="av-burger-overlay"></div>'), 877 overlay_scroll = $('<div class="av-burger-overlay-scroll"></div>').appendTo(overlay), 878 inner_overlay = $('<div class="av-burger-overlay-inner"></div>').appendTo(overlay_scroll), 879 bgColor = $('<div class="av-burger-overlay-bg"></div>').appendTo(overlay), 880 animating = false, 881 first_level = {}, 882 logo_container = $('.av-logo-container .inner-container'), 883 menu_in_logo_container = logo_container.find('.main_menu'), 884 cloneFirst = htmlEL.is('.html_av-submenu-display-click.html_av-submenu-clone, .html_av-submenu-display-hover.html_av-submenu-clone'), 885 menu_generated = false, 886 cloned_menu_cnt = 0; 887 888 /** 889 * Check for alternate mobile menu 890 */ 891 var alternate = $('#avia_alternate_menu'); 892 if( alternate.length > 0 ) 893 { 894 menu = alternate; 895 } 896 897 var set_list_container_height = function() 898 { 899 //necessary for ios since the height is usually not 100% but 100% - menu bar which can be requested by window.innerHeight 900 if($.avia_utilities.isMobile) 901 { 902 overlay_scroll.outerHeight(window.innerHeight); 903 } 904 }, 905 create_list = function( items , append_to ) 906 { 907 if(!items) return; 908 909 var list, link, current, subitems, megacolumns, sub_current, sub_current_list, new_li, new_ul; 910 911 items.each(function() 912 { 913 current = $(this); 914 subitems = current.find(' > .sub-menu > li'); //find sublists of a regular defined menu 915 if( subitems.length == 0 ) 916 { 917 subitems = current.find(' > .children > li'); //find sublists of a fallback menu 918 } 919 megacolumns = current.find( '.avia_mega_div > .sub-menu > li.menu-item' ); 920 921 // href = '#': we have a custom link that should not link to something - is also in use by megamenu for titles 922 var cur_menu = current.find('>a'); 923 var clone_events = true; 924 925 if( cur_menu.length ) 926 { 927 if( cur_menu.get(0).hash == '#' || 'undefined' == typeof cur_menu.attr('href') || cur_menu.attr('href') == '#' ) 928 { 929 // eventhandler conflict 'click' by megamenu (returns false) - ignore all handlers 930 if( subitems.length > 0 || megacolumns.length > 0 ) 931 { 932 clone_events = false;
933 } 934 } 935 } 936 937 link = cur_menu.clone(clone_events).attr('style',''); 938 939 // megamenus can have '' as url in top menu - allow click event in burger 940 if( 'undefined' == typeof cur_menu.attr('href') ) 941 { 942 link.attr( 'href', '#' ); 943 } 944 945 new_li = $('<li>').append( link ); 946 947 // Copy user set classes for menu items - these must not start with menu-item, page-item, page_item (used by default classes) 948 var cls = []; 949 if( 'undefined' != typeof current.attr('class') ) 950 { 951 cls = current.attr('class').split(/\s+/); 952 $.each( cls, function( index, value ){ 953 if( ( value.indexOf('menu-item') != 0 ) && ( value.indexOf('page-item') < 0 ) && ( value.indexOf('page_item') != 0 ) && ( value.indexOf('dropdown_ul') < 0 ) ) 954 { 955 // 'current-menu-item' is also copied !! 956 new_li.addClass( value ); 957 } 958 return true; 959 }); 960 } 961 962 if( 'undefined' != typeof current.attr('id') && '' != current.attr('id') ) 963 { 964 new_li.addClass(current.attr('id')); 965 } 966 else 967 { 968 // fallback menu has no id -> try to find page id in class 969 $.each( cls, function( index, value ){ 970 if( value.indexOf('page-item-') >= 0 ) 971 { 972 new_li.addClass(value); 973 return false; 974 } 975 }); 976 } 977 978 append_to.append(new_li); 979 980 if(subitems.length) 981 { 982 new_ul = $('<ul class="sub-menu">').appendTo(new_li); 983 984 if(cloneFirst && ( link.get(0).hash != '#' && link.attr('href') != '#' )) 985 { 986 new_li.clone(true).prependTo(new_ul); 987 } 988 989 new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">'); 990 991 create_list( subitems , new_ul); 992 } 993 else if(megacolumns.length) //if we got no normal sublists try megamenu columns and sublists 994 { 995 new_ul = $('<ul class="sub-menu">').appendTo(new_li); 996 997 if(cloneFirst && ( link.get(0).hash != '#' && link.attr('href') != '#' )) 998 { 999 new_li.clone(true).prependTo(new_ul); 1000 } 1001 1002 megacolumns.each(function(iteration) 1003 { 1004 var megacolumn = $(this), 1005 mega_current = megacolumn.find( '> .sub-menu' ), // can be 0 if only a column is used without submenus 1006 mega_title = megacolumn.find( '> .mega_menu_title' ), 1007 mega_title_link = mega_title.find('a').attr('href') || "#", 1008 current_megas = mega_current.length > 0 ? mega_current.find('>li') : null, 1009 mega_title_set = false, 1010 mega_link = new_li.find('>a'), 1011 hide_enty = ''; 1012 1013 // ignore columns that have no actual link and no subitems 1014 if( ( current_megas === null ) || ( current_megas.length == 0 ) ) 1015 { 1016 if( mega_title_link == '#' ) 1017 { 1018 hide_enty = ' style="display: none;"'; 1019 } 1020 } 1021 1022 if(iteration == 0) new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">'); 1023 1024 //if we got a title split up submenu items into multiple columns 1025 if(mega_title.length && mega_title.text() != "") 1026 { 1027 mega_title_set = true; 1028 1029 //if we are within the first iteration we got a new submenu, otherwise we start a new one 1030 if(iteration > 0) 1031 { 1032 var check_li = new_li.parents('li').eq(0); 1033 1034 if(check_li.length) new_li = check_li; 1035 1036 new_ul = $('<ul class="sub-menu">').appendTo(new_li); 1037 } 1038 1039 1040 new_li = $('<li' + hide_enty + '>').appendTo(new_ul); 1041 new_ul = $('<ul class="sub-menu">').appendTo(new_li); 1042 1043 $('<a href="'+mega_title_link+'"><span class="avia-bullet"></span><span class="avia-menu-text">' +mega_title.text()+ '</span></a>').insertBefore(new_ul); 1044 mega_link = new_li.find('>a'); 1045 1046 // Clone if we have submenus 1047 if(cloneFirst && ( mega_current.length > 0 ) && ( mega_link.length && mega_link.get(0).hash != '#' && mega_link.attr('href') != '#' )) 1048 { 1049 new_li.clone(true).addClass('av-cloned-title').prependTo(new_ul); 1050 } 1051 1052 } 1053 1054 // do not append av-submenu-indicator if no submenus (otherwise link action is blocked !!!) 1055 if( mega_title_set && ( mega_current.length > 0 ) ) new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">'); 1056 create_list( current_megas , new_ul); 1057 }); 1058 1059 } 1060 1061 }); 1062 1063 burger_wrap.trigger( 'avia_burger_list_created' ); 1064 return list; 1065 }; 1066 1067 var burger_ul, burger; 1068 1069 //prevent scrolling of outer window when scrolling inside 1070 $('body').on( 'mousewheel DOMMouseScroll touchmove', '.av-burger-overlay-scroll', function (e) { 1071 1072 var height = this.offsetHeight, 1073 scrollHeight = this.scrollHeight, 1074 direction = e.originalEvent.wheelDelta; 1075 1076 if(scrollHeight != this.clientHeight) 1077 { 1078 if( (this.scrollTop >= (scrollHeight - height) && direction < 0) || (this.scrollTop <= 0 && direction > 0) ) { 1079 e.preventDefault(); 1080 } 1081 } 1082 else 1083 { 1084 e.preventDefault(); 1085 } 1086 }); 1087 1088 //prevent scrolling for the rest of the screen 1089 $(document).on( 'mousewheel DOMMouseScroll touchmove', '.av-burger-overlay-bg, .av-burger-overlay-active .av-burger-menu
1089-main', function (e) 1090 { 1091 e.preventDefault(); 1092 }); 1093 1094 //prevent scrolling on mobile devices 1095 var touchPos = {}; 1096 1097 $(document).on('touchstart', '.av-burger-overlay-scroll', function(e) 1098 { 1099 touchPos.Y = e.originalEvent.touches[0].clientY; 1100 }); 1101 1102 $(document).on('touchend', '.av-burger-overlay-scroll', function(e) 1103 { 1104 touchPos = {}; 1105 }); 1106 1107 //prevent rubberband scrolling http://blog.christoffer.me/six-things-i-learnt-about-ios-safaris-rubber-band-scrolling/ 1108 $(document).on( 'touchmove', '.av-burger-overlay-scroll', function (e) 1109 { 1110 if(!touchPos.Y) 1111 { 1112 touchPos.Y = e.originalEvent.touches[0].clientY; 1113 } 1114 1115 var differenceY = e.originalEvent.touches[0].clientY - touchPos.Y, 1116 element = this, 1117 top = element.scrollTop, 1118 totalScroll = element.scrollHeight, 1119 currentScroll = top + element.offsetHeight, 1120 direction = differenceY > 0 ? "up" : "down"; 1121 1122 $('body').get(0).scrollTop = touchPos.body; 1123 1124 if ( top <= 0 ) 1125 { 1126 if(direction == "up") e.preventDefault(); 1127 1128 } else if ( currentScroll >= totalScroll ) 1129 { 1130 if(direction == "down") e.preventDefault(); 1131 } 1132 }); 1133 1134 $(window).on( 'debouncedresize', function (e) 1135 { 1136 // close burger menu when returning to desktop 1137 if(burger && burger.length) 1138 { 1139 if( ! burger_wrap.is(':visible') ) 1140 { 1141 burger.filter(".is-active").parents('a').eq(0).trigger('click'); 1142 } 1143 } 1144 1145 set_list_container_height(); 1146 }); 1147 1148 //close overlay on overlay click 1149 $('.html_av-overlay-side').on( 'click', '.av-burger-overlay-bg', function (e) 1150 { 1151 e.preventDefault(); 1152 burger.parents('a').eq(0).trigger('click'); 1153 }); 1154 1155 //close overlay when smooth scrollign begins 1156 $(window).on('avia_smooth_scroll_start', function() 1157 { 1158 if(burger && burger.length) 1159 { 1160 burger.filter(".is-active").parents('a').eq(0).trigger('click'); 1161 } 1162 }); 1163 1164 1165 //toogle hide/show for submenu items 1166 $('.html_av-submenu-display-hover').on( 'mouseenter', '.av-width-submenu', function (e) 1167 { 1168 $(this).children("ul.sub-menu").slideDown('fast'); 1169 }); 1170 1171 $('.html_av-submenu-display-hover').on( 'mouseleave', '.av-width-submenu', function (e) 1172 { 1173 $(this).children("ul.sub-menu").slideUp('fast'); 1174 }); 1175 1176 $('.html_av-submenu-display-hover').on( 'click', '.av-width-submenu > a', function (e) 1177 { 1178 e.preventDefault(); 1179 e.stopImmediatePropagation(); 1180 }); 1181 1182 // for mobile we use same behaviour as submenu-display-click 1183 $('.html_av-submenu-display-hover').on( 'touchstart', '.av-width-submenu > a', function (e) 1184 { 1185 var menu = $(this); 1186 toggle_submenu( menu, e ); 1187 }); 1188 1189 1190 //toogle hide/show for submenu items 1191 $('.html_av-submenu-display-click').on( 'click', '.av-width-submenu > a', function (e) 1192 { 1193 var menu = $(this); 1194 toggle_submenu( menu, e ); 1195 }); 1196 1197 1198 // close mobile menu if click on active menu item 1199 $('.html_av-submenu-display-click').on( 'click', '.av-burger-overlay a', function (e) 1200 { 1201 var loc = window.location.href.match(/(^[^#]*)/)[0]; 1202 var cur = $(this).attr('href').match(/(^[^#]*)/)[0]; 1203 1204 if( cur == loc ) 1205 { 1206 e.preventDefault(); 1207 e.stopImmediatePropagation(); 1208 1209 burger.parents('a').eq(0).trigger('click'); 1210 return false; 1211 } 1212 return true; 1213 }); 1214 1215 1216 function toggle_submenu( menu, e ) 1217 { 1218 e.preventDefault(); 1219 e.stopImmediatePropagation(); 1220 1221 var parent = menu.parents('li').eq(0); 1222 1223 parent.toggleClass('av-show-submenu'); 1224 1225 if(parent.is('.av-show-submenu')) 1226 { 1227 parent.children("ul.sub-menu").slideDown('fast'); 1228 } 1229 else 1230 { 1231 parent.children("ul.sub-menu").slideUp('fast'); 1232 } 1233 }; 1234 1235 1236 (function normalize_layout() 1237 { 1238 //if we got the menu outside of the main menu container we need to add it to the container as well 1239 if(menu_in_logo_container.length) return; 1240 1241 var menu2 = $('#header .main_menu').clone(true), 1242 ul = menu2.find('ul.av-main-nav'), 1243 id = ul.attr('id'); 1244 1245 if( 'string' == typeof id && '' != id.trim() ) 1246 { 1247 ul.attr('id', id + '-' + cloned_menu_cnt++ ); 1248 } 1249 menu2.find('.menu-item:not(.menu-item-avia-special)').remove(); 1250 menu2.insertAfter(logo_container.find('.logo').first()); 1251 1252 //check if we got social icons and append it to the secondary menu 1253 var social = $('#header .social_bookmarks').clone(true); 1254 if(!social.length) social = $('.av-logo-container .social_bookmarks').clone(true); 1255 1256 if( social.length ) 1257 { 1258 menu2.find('.avia-menu').addClass('av_menu_icon_beside'); 1259 menu2.append(social); 1260 } 1261 1262 //re select the burger menu if we added a new one
1263 burger_wrap = $('.av-burger-menu-main a'); 1264 }()); 1265 1266 1267 1268 burger_wrap.click(function(e) 1269 { 1270 if(animating) return; 1271 burger = $(this).find('.av-hamburger'), 1272 animating = true; 1273 1274 if(!menu_generated) 1275 { 1276 menu_generated = true; 1277 burger.addClass("av-inserted-main-menu"); 1278 1279 burger_ul = $('<ul>').attr({id:'av-burger-menu-ul', class:''}); 1280 var first_level_items = menu.find('> li:not(.menu-item-avia-special)'); //select all first level items that are not special items 1281 var list = create_list( first_level_items , burger_ul); 1282 1283 burger_ul.find('.noMobile').remove(); //remove any menu items with the class noMobile so user can filter manually if he wants 1284 burger_ul.appendTo(inner_overlay); 1285 first_level = inner_overlay.find('#av-burger-menu-ul > li'); 1286 1287 if($.fn.avia_smoothscroll){ 1288 $('a[href*="#"]', overlay).avia_smoothscroll(overlay); 1289 } 1290 } 1291 1292 if(burger.is(".is-active")) 1293 { 1294 burger.removeClass("is-active"); 1295 htmlEL.removeClass("av-burger-overlay-active-delayed"); 1296 1297 overlay.animate({opacity:0}
1297, function() 1298 { 1299 overlay.css({display:'none'}); 1300 htmlEL.removeClass("av-burger-overlay-active"); 1301 animating = false; 1302 }); 1303 1304 } 1305 else 1306 { 1307 set_list_container_height(); 1308 1309 var offsetTop = header_main.length ? header_main.outerHeight() + header_main.position().top : header.outerHeight() + header.position().top; 1310 1311 overlay.appendTo($(e.target).parents('.avia-menu')); 1312 1313 burger_ul.css({padding:( offsetTop ) + "px 0px"}); 1314 1315 first_level.removeClass('av-active-burger-items'); 1316 1317 burger.addClass("is-active"); 1318 htmlEL.addClass("av-burger-overlay-active"); 1319 overlay.css({display:'block'}).animate({opacity:1}, function() 1320 { 1321 animating = false; 1322 }); 1323 1324 setTimeout(function() 1325 { 1326 htmlEL.addClass("av-burger-overlay-active-delayed"); 1327 1328 }, 100); 1329 1330 first_level.each(function(i) 1331 { 1332 var _self = $(this); 1333 setTimeout(function() 1334 { 1335 _self.addClass('av-active-burger-items'); 1336 }, (i + 1) * 125); 1337 }); 1338 1339 } 1340 1341 e.preventDefault(); 1342 }); 1343 1344 1345 } 1346 1347 1348 1349 1350 $.AviaAjaxSearch = function(options) 1351 { 1352 var defaults = { 1353 delay: 300, //delay in ms until the user stops typing. 1354 minChars: 3, //dont start searching before we got at least that much characters 1355 scope: 'body' 1356 1357 }; 1358 1359 this.options = $.extend({}, defaults, options); 1360 this.scope = $(this.options.scope); 1361 this.timer = false; 1362 this.lastVal = ""; 1363 1364 this.bind_events(); 1365 1366 1367 }; 1368 1369 1370 $.AviaAjaxSearch.prototype = 1371 { 1372 1373 bind_events: function() 1374 { 1375 this.scope.on('keyup', '#s:not(".av_disable_ajax_search #s")' , $.proxy( this.try_search, this)); 1376 this.scope.on('click', '#s.av-results-parked' , $.proxy( this.reset, this)); 1377 1378 }, 1379 1380 try_search: function(e) 1381 { 1382 var form = $(e.currentTarget).parents('form:eq(0)'), 1383 resultscontainer = form.find('.ajax_search_response'); 1384 1385 clearTimeout(this.timer); 1386 1387 //only execute search if chars are at least "minChars" and search differs from last one 1388 if(e.currentTarget.value.length >= this.options.minChars && this.lastVal != $.trim(e.currentTarget.value)) 1389 { 1390 //wait at least "delay" miliseconds to execute ajax. if user types again during that time dont execute 1391 this.timer = setTimeout($.proxy( this.do_search, this, e), this.options.delay); 1392 1393 } 1394 //remove the results container if the input field has been emptied 1395 else if (e.currentTarget.value.length == 0){ 1396 this.timer = setTimeout($.proxy( this.reset, this, e), this.options.delay); 1397 } 1398 1399 // close on ESC 1400 if (e.keyCode === 27) { 1401 this.reset(e); 1402 } 1403 1404 }, 1405 1406 reset: function(e){ 1407 var form = $(e.currentTarget).parents('form:eq(0)'), 1408 resultscontainer = form.find('.ajax_search_response'), 1409 alternative_resultscontainer = $(form.attr('data-ajaxcontainer')).find('.ajax_search_response'), 1410 searchInput = $(e.currentTarget); 1411 1412 // bring back results that were hidden when user clicked outside the form element 1413 if ($(e.currentTarget).hasClass('av-results-parked')) { 1414 resultscontainer.show(); 1415 alternative_resultscontainer.show(); 1416 1417 // in case results container is attached to body 1418 $('body > .ajax_search_response').show(); 1419 } 1420 else { 1421 // remove results and delete the input value 1422 resultscontainer.remove(); 1423 alternative_resultscontainer.remove(); 1424 searchInput.val(''); 1425 1426 // in case results container is attached to body 1427 $('body > .ajax_search_response').remove(); 1428 } 1429 1430 1431 }, 1432 1433 do_search: function(e) 1434 { 1435 var obj = this, 1436 currentField = $(e.currentTarget).attr( "autocomplete", "off" ), 1437 currentFieldWrapper = $(e.currentTarget).parents('.av_searchform_wrapper:eq(0)'), 1438 currentField_position = currentFieldWrapper.offset(), 1439 currentField_width = currentFieldWrapper.outerWidth(), 1440 currentField_height = currentFieldWrapper.outerHeight(), 1441 form = currentField.parents('form:eq(0)'), 1442 submitbtn = form.find('#searchsubmit'), 1443 resultscontainer = form, 1444 results = resultscontainer.find('.ajax_search_response'), 1445 loading = $('<div class="ajax_load"><span class="ajax_load_inner"></span></div>'), 1446 action = form.attr('action'), 1447 values = form.serialize(); 1448 values += '&action=avia_ajax_search'; 1449 1450 // define results div if not found 1451 if(!results.length) { 1452 results = $('<div class="ajax_search_response" style="display:none;"></div>'); 1453 } 1454 1455 // add class to differentiate betweeen search element and header search 1456 if (form.attr('id') == 'searchform_element'){ 1457 results.addClass('av_searchform_element_results'); 1458 } 1459 1460 //check if the form got get parameters applied and also apply them 1461 if(action.indexOf('?') != -1) 1462 { 1463 action = action.split('?'); 1464 values += "&" + action[1]; 1465 } 1466 1467 //check if there is a results container defined 1468 if (form.attr('data-ajaxcontainer')) { 1469 1470 var rescon = form.attr('data-ajaxcontainer'); 1471 1472 // check if defined container exists 1473 if ($(rescon).length) { 1474 1475 // remove previous search results 1476 $(rescon).find('.ajax_search_response').remove(); 1477 1478 resultscontainer = $(rescon); 1479 } 1480 1481 } 1482 1483 /* 1484 * For the placement option: "Under the search form - overlay other content", 1485 * we have to attach the results to the body in order to overlay the other content,
1486 * and we calculate it's position using the search field 1487 */ 1488 1489 results_css = {}; 1490 1491 if ( form.hasClass('av_results_container_fixed') ){ 1492 1493 // remove previous search results 1494 $('body').find('.ajax_search_response').remove(); 1495 1496 resultscontainer = $('body'); 1497 1498 // add class and position to results if defined above 1499 var results_css = { 1500 top: currentField_position.top + currentField_height, 1501 left: currentField_position.left, 1502 width: currentField_width 1503 }; 1504 1505 // make sure default stylesheet is applied 1506 results.addClass('main_color'); 1507 1508 // remove results and reset if window is resized 1509 $( window ).resize(function() { 1510 results.remove(); 1511 $.proxy( this.reset, this); 1512 currentField.val(''); 1513 }); 1514 1515 } 1516 1517 // add additional styles 1518 if ( form.attr('data-results_style') ) { 1519 var results_style = JSON.parse(form.attr('data-results_style')); 1520 results_css = Object.assign(results_css, results_style); 1521 1522 // add class if font color is applied, so we can use color: inherit 1523 if ("color" in results_css) { 1524 results.addClass('av_has_custom_color'); 1525 } 1526 1527 } 1528 1529 // apply inline styles 1530 results.css(results_css); 1531 1532 // add .container class if resultscontainer in a color section 1533 if (resultscontainer.hasClass('avia-section')){ 1534 results.addClass('container'); 1535 } 1536 1537 // append results to defined container 1538 results.appendTo(resultscontainer); 1539 1540 1541 //return if we already hit a no result and user is still typing 1542 if(results.find('.ajax_not_found').length && e.currentTarget.value.indexOf(this.lastVal) != -1) return; 1543 1544 this.lastVal = e.currentTarget.value; 1545 1546 $.ajax({ 1547 url: avia_framework_globals.ajaxurl, 1548 type: "POST", 1549 data:values, 1550 beforeSend: function() 1551 { 1552 // add loader after submit button 1553 loading.insertAfter(submitbtn); 1554 form.addClass('ajax_loading_now'); 1555 }, 1556 success: function(response) 1557 { 1558 if(response == 0) response = ""; 1559 results.html(response).show(); 1560 }, 1561 complete: function() 1562 { 1563 loading.remove(); 1564 form.removeClass('ajax_loading_now'); 1565 } 1566 }); 1567 1568 // Hide search resuls if user clicks anywhere outside the form element 1569 $(document).on('click',function(e) { 1570 if(!$(e.target).closest(form).length) { 1571 if($(results).is(":visible")) { 1572 $(results).hide(); 1573 currentField.addClass('av-results-parked'); 1574 } 1575 } 1576 }); 1577 } 1578 1579 1580 }; 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 $.AviaTooltip = function(options) 1592 { 1593 var defaults = { 1594 delay: 1500, //delay in ms until the tooltip appears 1595 delayOut: 300, //delay in ms when instant showing should stop 1596 delayHide: 0, //delay hiding of tooltip in ms 1597 "class": "avia-tooltip", //tooltip classname for css styling and alignment 1598 scope: "body", //area the tooltip should be applied to 1599 data: "avia-tooltip", //data attribute that contains the tooltip text 1600 attach:"body", //either attach the tooltip to the "mouse" or to the "element" // todo: implement mouse, make sure that it doesnt overlap with screen borders 1601 event: 'mouseenter', //mousenter and leave or click and leave 1602 position:'top', //top or bottom 1603 extraClass:'avia-tooltip-class', //extra class that is defined by a tooltip element data attribute 1604 permanent: false, // always display the tooltip? 1605 within_screen: false // if the tooltip is displayed outside the screen adjust its position 1606 1607 }; 1608 1609 this.options = $.extend({}, defaults, options); 1610 this.body = $('body'); 1611 this.scope = $(this.options.scope); 1612 this.tooltip = $('<div class="'+this.options['class']+' avia-tt"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></div>'); 1613 this.inner = $('<div class="inner_tooltip"></div>').prependTo(this.tooltip); 1614 this.open = false;
1615 this.timer = false; 1616 this.active = false; 1617 1618 this.bind_events(); 1619 }; 1620 1621 $.AviaTooltip.openTTs = []; 1622 $.AviaTooltip.openTT_Elements = []; 1623 1624 $.AviaTooltip.prototype = 1625 { 1626 bind_events: function() 1627 { 1628 var perma_tooltips = '.av-permanent-tooltip [data-'+this.options.data+']', 1629 default_tooltips = '[data-'+this.options.data+']:not( .av-permanent-tooltip [data-'+this.options.data+'])'; 1630 1631 this.scope.on('av_permanent_show', perma_tooltips, $.proxy( this.display_tooltip, this) ); 1632 $(perma_tooltips).addClass('av-perma-tooltip').trigger('av_permanent_show'); 1633 1634 1635 this.scope.on(this.options.event + ' mouseleave', default_tooltips, $.proxy( this.start_countdown, this) ); 1636 1637 if(this.options.event != 'click') 1638 { 1639 this.scope.on('mouseleave', default_tooltips, $.proxy( this.hide_tooltip, this) ); 1640 this.scope.on('click', default_tooltips, $.proxy( this.hide_on_click_tooltip, this) ); 1641 } 1642 else 1643 { 1644 this.body.on('mousedown', $.proxy( this.hide_tooltip, this) ); 1645 } 1646 1647 }, 1648 1649 start_countdown: function(e) 1650 { 1651 clearTimeout(this.timer); 1652 1653 var target = this.options.event == "click" ? e.target : e.currentTarget, 1654 element = $(target); 1655 1656 if(e.type == this.options.event) 1657 { 1658 var delay = this.options.event == 'click' ? 0 : this.open ? 0 : this.options.delay; 1659 1660 this.timer = setTimeout($.proxy( this.display_tooltip, this, e), delay ); 1661 } 1662 else if(e.type == 'mouseleave') 1663 { 1664 if( ! element.hasClass( 'av-close-on-click-tooltip' ) ) 1665 { 1666 this.timer = setTimeout($.proxy( this.stop_instant_open, this, e), this.options.delayOut); 1667 } 1668 } 1669 e.preventDefault(); 1670 }, 1671 1672 reset_countdown: function(e) 1673 { 1674 clearTimeout(this.timer); 1675 this.timer = false; 1676 }, 1677 1678 display_tooltip: function(e) 1679 { 1680 var _self = this, 1681 target = this.options.event == "click" ? e.target : e.currentTarget, 1682 element = $(target), 1683 text = element.data(this.options.data), 1684 tip_index = element.data('avia-created-tooltip'), 1685 extraClass = element.data('avia-tooltip-class'), 1686 attach = this.options.attach == 'element' ? element : this.body, 1687 offset = this.options.attach == 'element' ? element.position() : element.offset(), 1688 position = element.data('avia-tooltip-position'), 1689 align = element.data('avia-tooltip-alignment'), 1690 force_append= false, 1691 newTip = false, 1692 is_new_tip = false; 1693 1694 text = $.trim(text); 1695 1696 if(element.is('.av-perma-tooltip')) 1697 { 1698 offset = {top:0, left:0 }; 1699 attach = element; 1700 force_append = true; 1701 } 1702 1703 if(text == "") return; 1704 if(position == "" || typeof position == 'undefined') position = this.options.position; 1705 if(align == "" || typeof align == 'undefined') align = 'center'; 1706 1707 if(typeof tip_index != 'undefined') 1708 { 1709 newTip = $.AviaTooltip.openTTs[tip_index]; 1710 } 1711 else 1712 { 1713 this.inner.html(text); 1714 newTip = this.tooltip.clone(); 1715 is_new_tip = true; 1716 1717 if(this.options.attach == 'element' && force_append !== true) 1718 { 1719 newTip.insertAfter(attach); 1720 } 1721 else 1722 { 1723 newTip.appendTo(attach); 1724 } 1725 1726 if(extraClass != "") newTip.addClass(extraClass); 1727 } 1728 1729 if( this.open && this.active == newTip ) 1730 { 1731 return; 1732 } 1733 1734 if( element.hasClass( 'av-close-on-click-tooltip' ) ) 1735 { 1736 this.hide_all_tooltips(); 1737 } 1738 1739 this.open = true; 1740 this.active = newTip; 1741 1742 if((newTip.is(':animated:visible') && e.type == 'click') || element.is('.'+this.options['class']) || element.parents('.'+this.options['class']).length != 0) return; 1743 1744 1745 var animate1 = {}, animate2 = {}, pos1 = "", pos2 = ""; 1746 1747 if(position == "top" ||Â position == "bottom") 1748 { 1749 switch(align) 1750 {
1751 case "left": pos2 = offset.left; break; 1752 case "right": pos2 = offset.left + element.outerWidth() - newTip.outerWidth(); break; 1753 default: pos2 = (offset.left + (element.outerWidth() / 2)) - (newTip.outerWidth() / 2); break; 1754 } 1755 1756 if(_self.options.within_screen) //used to keep search field inside screen 1757 { 1758 var boundary = element.offset().left + (element.outerWidth() / 2) - (newTip.outerWidth() / 2) + parseInt(newTip.css('margin-left'),10); 1759 if(boundary < 0) 1760 { 1761 pos2 = pos2 - boundary; 1762 } 1763 1764 } 1765 } 1766 else 1767 { 1768 switch(align) 1769 { 1770 case "top": pos1 = offset.top; break; 1771 case "bottom": pos1 = offset.top + element.outerHeight() - newTip.outerHeight(); break; 1772 default: pos1 = (offset.top + (element.outerHeight() / 2)) - (newTip.outerHeight() / 2); break; 1773 } 1774 } 1775 1776 switch(position) 1777 { 1778 case "top": 1779 pos1 = offset.top - newTip.outerHeight(); 1780 animate1 = {top: pos1 - 10, left: pos2}; 1781 animate2 = {top: pos1}; 1782 break; 1783 case "bottom": 1784 pos1 = offset.top + element.outerHeight(); 1785 animate1 = {top: pos1 + 10, left: pos2}; 1786 animate2 = {top: pos1}; 1787 break; 1788 case "left": 1789 pos2 = offset.left - newTip.outerWidth();
1790 animate1 = {top: pos1, left: pos2 -10}; 1791 animate2 = {left: pos2}; 1792 break; 1793 case "right": 1794 pos2 = offset.left + element.outerWidth(); 1795 animate1 = {top: pos1, left: pos2 + 10}; 1796 animate2 = {left: pos2}; 1797 break; 1798 } 1799 1800 animate1['display'] = "block"; 1801 animate1['opacity'] = 0; 1802 animate2['opacity'] = 1; 1803 1804 1805 newTip.css(animate1).stop().animate(animate2,200); 1806 newTip.find('input, textarea').focus(); 1807 if( is_new_tip ) 1808 { 1809 $.AviaTooltip.openTTs.push(newTip); 1810 $.AviaTooltip.openTT_Elements.push(element); 1811 element.data('avia-created-tooltip', $.AviaTooltip.openTTs.length - 1); 1812 } 1813 }, 1814 1815 hide_on_click_tooltip: function(e) 1816 { 1817 if( this.options.event == "click" ) 1818 { 1819 return; 1820 } 1821 1822 var element = $( e.currentTarget ); 1823 1824 if( ! element.hasClass('av-close-on-click-tooltip') ) 1825 { 1826 return; 1827 } 1828 1829 if( ! element.find( 'a' ) ) 1830 { 1831 e.preventDefault(); 1832 } 1833 1834 // Default behaviour when using mouse - click on active tooltip closes it (moving mouse to another tooltip close others automatically 1835 // On mobile devices or when using touchscreen we show element on click (= old behaviour) and hide when same element 1836 var ttip_index = element.data('avia-created-tooltip'); 1837 1838 if( 'undefined' != typeof ttip_index ) 1839 { 1840 var current = $.AviaTooltip.openTTs[ttip_index]; 1841 if( 'undefined' != typeof current && current == this.active ) 1842 { 1843 this.hide_all_tooltips(); 1844 } 1845 } 1846 1847 }, 1848 1849 hide_all_tooltips: function() 1850 { 1851 var ttip, 1852 position, 1853 element; 1854 1855 for(var index = 0; index < $.AviaTooltip.openTTs.length; ++index) 1856 { 1857 ttip = $.AviaTooltip.openTTs[index]; 1858 element = $.AviaTooltip.openTT_Elements[index]; 1859 position = element.data('avia-tooltip-position'), 1860 this.animate_hide_tooltip( ttip, position ); 1861 } 1862 1863 this.open = false; 1864 this.active = false; 1865 }, 1866 1867 hide_tooltip: function(e) 1868 { 1869 var element = $(e.currentTarget) , newTip, animateTo, 1870 position = element.data('avia-tooltip-position'), 1871 align = element.data('avia-tooltip-alignment'), 1872 newTip = false; 1873 1874 if(position == "" || typeof position == 'undefined') position = this.options.position; 1875 if(align == "" || typeof align == 'undefined') align = 'center'; 1876 1877 if(this.options.event == 'click') 1878 { 1879 element = $(e.target); 1880 1881 if(!element.is('.'+this.options['class']) && element.parents('.'+this.options['class']).length == 0) 1882 { 1883 if(this.active.length) { newTip = this.active; this.active = false;} 1884 } 1885 } 1886 else 1887 { 1888 if( ! element.hasClass( 'av-close-on-click-tooltip' ) ) 1889 { 1890 newTip = element.data('avia-created-tooltip'); 1891 newTip = typeof newTip != 'undefined' ? $.AviaTooltip.openTTs[newTip] : false; 1892 } 1893 } 1894 1895 this.animate_hide_tooltip( newTip, position ); 1896 }, 1897 1898 animate_hide_tooltip: function( ttip, position ) 1899 { 1900 if(ttip) 1901 { 1902 var animate = {opacity:0}; 1903 1904 switch(position) 1905 { 1906 case "top": 1907 animate['top'] = parseInt(ttip.css('top'),10) - 10; 1908 break; 1909 case "bottom": 1910 animate['top'] = parseInt(ttip.css('top'),10) + 10; 1911 break; 1912 case "left": 1913 animate['left'] = parseInt(ttip.css('left'), 10) - 10; 1914 break; 1915 case "right": 1916 animate['left'] = parseInt(ttip.css('left'), 10) + 10; 1917 break; 1918 } 1919 1920 ttip.animate(animate, 200, function() 1921 { 1922 ttip.css({display:'none'}); 1923 }); 1924 } 1925 }, 1926 1927 stop_instant_open: function(e) 1928 { 1929 this.open = false; 1930 } 1931 }; 1932 1933 1934})( jQuery ); 1935 1936 1937 1938 1939 1940 1941 1942 1943/*! 1944Waypoints - 3.1.1 1945Copyright © 2011-2015 Caleb Troughton 1946Licensed under the MIT license. 1947https://github.com/imakewebthings/waypoints/blog/master/licenses.txt 1948*/ 1949!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,480 bytes, line 1949
1949this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var n in t){var r=t[n];for(var s in this.waypoints[n]){var a,l,h,p,u,c=this.waypoints[n][s],d=c.options.offset,f=c.triggerPoint,w=0,y=null==f;c.element!==c.element.window&&(w=c.adapter.offset()[r.offsetProp]),"function"==typeof d?d=d.apply(c):"string"==typeof d&&(d=parseFloat(d),c.options.offset.indexOf("%")>-1&&(d=Math.ceil(r.contextDimension*d/100))),a=r.contextScroll-r.contextOffset,c.triggerPoint=w+a-d,l=f<r.oldScroll,h=c.triggerPoint>=r.oldScroll,p=l&&h,u=!l&&!h,!y&&p?(c.queueTrigger(r.backward),o[c.group.id]=c.group):!y&&u?(c.queueTrigger(r.forward),o[c.group.id]=c.group):y&&r.oldScroll>=c.triggerPoint&&(c.queueTrigger(r.forward),o[c.group.id]=c.group)}}for(var g in o)o[g].flushTriggers();return this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
1949ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 1950 1951 1952// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 1953// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel. can be removed if IE9 is no longer supported or all parallax scripts are gone 1954// MIT license 1955(function(){var lastTime=0;var vendors=['ms','moz','webkit','o'];for(var x=0;x<vendors.length&&!window.requestAnimationFrame;++x){window.requestAnimationFrame=window[vendors[x]+'RequestAnimationFrame'];window.cancelAnimationFrame=window[vendors[x]+'CancelAnimationFrame']||window[vendors[x]+'CancelRequestAnimationFrame']}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(callback,element){var currTime=new Date().getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=window.setTimeout(function(){callback(currTime+timeToCall)},timeToCall);lastTime=currTime+timeToCall;return id};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=function(id){clearTimeout(id)}}()); 1956 1957jQuery.expr[':'].regex = function(elem, index, match) { 1958 var matchParams = match[3].split(','), 1959 validLabels = /^(data|css):/, 1960 attr = { 1961 method: matchParams[0].match(validLabels) ? 1962 matchParams[0].split(':')[0] : 'attr', 1963 property: matchParams.shift().replace(validLabels,'') 1964 }, 1965 regexFlags = 'ig', 1966 regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags); 1967 return regex.test(jQuery(elem)[attr.method](attr.property)); 1968}; 1969 1970 1971 1972 1973
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.