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 887 /** 888 * Check for alternate mobile menu 889 */ 890 var alternate = $('#avia_alternate_menu'); 891 if( alternate.length > 0 ) 892 { 893 menu = alternate; 894 } 895 896 var set_list_container_height = function() 897 { 898 //necessary for ios since the height is usually not 100% but 100% - menu bar which can be requested by window.innerHeight 899 if($.avia_utilities.isMobile) 900 { 901 overlay_scroll.outerHeight(window.innerHeight); 902 } 903 }, 904 create_list = function( items , append_to ) 905 { 906 if(!items) return; 907 908 var list, link, current, subitems, megacolumns, sub_current, sub_current_list, new_li, new_ul; 909 910 items.each(function() 911 { 912 current = $(this); 913 subitems = current.find(' > .sub-menu > li'); //find sublists of a regular defined menu 914 if( subitems.length == 0 ) 915 { 916 subitems = current.find(' > .children > li'); //find sublists of a fallback menu 917 } 918 megacolumns = current.find( '.avia_mega_div > .sub-menu > li.menu-item' ); 919 920 // href = '#': we have a custom link that should not link to something - is also in use by megamenu for titles 921 var cur_menu = current.find('>a'); 922 var clone_events = true; 923 924 if( cur_menu.length ) 925 { 926 if( cur_menu.get(0).hash == '#' || 'undefined' == typeof cur_menu.attr('href') || cur_menu.attr('href') == '#' ) 927 { 928 // eventhandler conflict 'click' by megamenu (returns false) - ignore all handlers 929 if( subitems.length > 0 || megacolumns.length > 0 ) 930 { 931 clone_events = false;
932 } 933 } 934 } 935 936 link = cur_menu.clone(clone_events).attr('style',''); 937 938 // megamenus can have '' as url in top menu - allow click event in burger 939 if( 'undefined' == typeof cur_menu.attr('href') ) 940 { 941 link.attr( 'href', '#' ); 942 } 943 944 new_li = $('<li>').append( link ); 945 946 // Copy user set classes for menu items - these must not start with menu-item, page-item, page_item (used by default classes) 947 var cls = []; 948 if( 'undefined' != typeof current.attr('class') ) 949 { 950 cls = current.attr('class').split(/\s+/); 951 $.each( cls, function( index, value ){ 952 if( ( value.indexOf('menu-item') != 0 ) && ( value.indexOf('page-item') < 0 ) && ( value.indexOf('page_item') != 0 ) && ( value.indexOf('dropdown_ul') < 0 ) ) 953 { 954 // 'current-menu-item' is also copied !! 955 new_li.addClass( value ); 956 } 957 return true; 958 }); 959 } 960 961 if( 'undefined' != typeof current.attr('id') && '' != current.attr('id') ) 962 { 963 new_li.addClass(current.attr('id')); 964 } 965 else 966 { 967 // fallback menu has no id -> try to find page id in class 968 $.each( cls, function( index, value ){ 969 if( value.indexOf('page-item-') >= 0 ) 970 { 971 new_li.addClass(value); 972 return false; 973 } 974 }); 975 } 976 977 append_to.append(new_li); 978 979 if(subitems.length) 980 { 981 new_ul = $('<ul class="sub-menu">').appendTo(new_li); 982 983 if(cloneFirst && ( link.get(0).hash != '#' && link.attr('href') != '#' )) 984 { 985 new_li.clone(true).prependTo(new_ul); 986 } 987 988 new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">'); 989 990 create_list( subitems , new_ul); 991 } 992 else if(megacolumns.length) //if we got no normal sublists try megamenu columns and sublists 993 { 994 new_ul = $('<ul class="sub-menu">').appendTo(new_li); 995 996 if(cloneFirst && ( link.get(0).hash != '#' && link.attr('href') != '#' )) 997 { 998 new_li.clone(true).prependTo(new_ul); 999 } 1000 1001 megacolumns.each(function(iteration) 1002 { 1003 var megacolumn = $(this), 1004 mega_current = megacolumn.find( '> .sub-menu' ), // can be 0 if only a column is used without submenus 1005 mega_title = megacolumn.find( '> .mega_menu_title' ), 1006 mega_title_link = mega_title.find('a').attr('href') || "#", 1007 current_megas = mega_current.length > 0 ? mega_current.find('>li') : null, 1008 mega_title_set = false, 1009 mega_link = new_li.find('>a'), 1010 hide_enty = ''; 1011 1012 // ignore columns that have no actual link and no subitems 1013 if( ( current_megas === null ) || ( current_megas.length == 0 ) ) 1014 { 1015 if( mega_title_link == '#' ) 1016 { 1017 hide_enty = ' style="display: none;"'; 1018 } 1019 } 1020 1021 if(iteration == 0) new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">'); 1022 1023 //if we got a title split up submenu items into multiple columns 1024 if(mega_title.length && mega_title.text() != "") 1025 { 1026 mega_title_set = true; 1027 1028 //if we are within the first iteration we got a new submenu, otherwise we start a new one 1029 if(iteration > 0) 1030 { 1031 var check_li = new_li.parents('li').eq(0); 1032 1033 if(check_li.length) new_li = check_li; 1034 1035 new_ul = $('<ul class="sub-menu">').appendTo(new_li); 1036 } 1037 1038 1039 new_li = $('<li' + hide_enty + '>').appendTo(new_ul); 1040 new_ul = $('<ul class="sub-menu">').appendTo(new_li); 1041 1042 $('<a href="'+mega_title_link+'"><span class="avia-bullet"></span><span class="avia-menu-text">' +mega_title.text()+ '</span></a>').insertBefore(new_ul); 1043 mega_link = new_li.find('>a'); 1044 1045 // Clone if we have submenus 1046 if(cloneFirst && ( mega_current.length > 0 ) && ( mega_link.length && mega_link.get(0).hash != '#' && mega_link.attr('href') != '#' )) 1047 { 1048 new_li.clone(true).addClass('av-cloned-title').prependTo(new_ul); 1049 } 1050 1051 } 1052 1053 // do not append av-submenu-indicator if no submenus (otherwise link action is blocked !!!) 1054 if( mega_title_set && ( mega_current.length > 0 ) ) new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">'); 1055 create_list( current_megas , new_ul); 1056 }); 1057 1058 } 1059 1060 }); 1061 1062 burger_wrap.trigger( 'avia_burger_list_created' ); 1063 return list; 1064 }; 1065 1066 var burger_ul, burger; 1067 1068 //prevent scrolling of outer window when scrolling inside 1069 $('body').on( 'mousewheel DOMMouseScroll touchmove', '.av-burger-overlay-scroll', function (e) { 1070 1071 var height = this.offsetHeight, 1072 scrollHeight = this.scrollHeight, 1073 direction = e.originalEvent.wheelDelta; 1074 1075 if(scrollHeight != this.clientHeight) 1076 { 1077 if( (this.scrollTop >= (scrollHeight - height) && direction < 0) || (this.scrollTop <= 0 && direction > 0) ) { 1078 e.preventDefault(); 1079 } 1080 } 1081 else 1082 { 1083 e.preventDefault(); 1084 } 1085 }); 1086 1087 //prevent scrolling for the rest of the screen 1088 $(document).on( 'mousewheel DOMMouseScroll touchmove', '.av-burger-overlay-bg, .av-burger-overlay-active .av-burger-menu
1088-main', function (e) 1089 { 1090 e.preventDefault(); 1091 }); 1092 1093 //prevent scrolling on mobile devices 1094 var touchPos = {}; 1095 1096 $(document).on('touchstart', '.av-burger-overlay-scroll', function(e) 1097 { 1098 touchPos.Y = e.originalEvent.touches[0].clientY; 1099 }); 1100 1101 $(document).on('touchend', '.av-burger-overlay-scroll', function(e) 1102 { 1103 touchPos = {}; 1104 }); 1105 1106 //prevent rubberband scrolling http://blog.christoffer.me/six-things-i-learnt-about-ios-safaris-rubber-band-scrolling/ 1107 $(document).on( 'touchmove', '.av-burger-overlay-scroll', function (e) 1108 { 1109 if(!touchPos.Y) 1110 { 1111 touchPos.Y = e.originalEvent.touches[0].clientY; 1112 } 1113 1114 var differenceY = e.originalEvent.touches[0].clientY - touchPos.Y, 1115 element = this, 1116 top = element.scrollTop, 1117 totalScroll = element.scrollHeight, 1118 currentScroll = top + element.offsetHeight, 1119 direction = differenceY > 0 ? "up" : "down"; 1120 1121 $('body').get(0).scrollTop = touchPos.body; 1122 1123 if ( top <= 0 ) 1124 { 1125 if(direction == "up") e.preventDefault(); 1126 1127 } else if ( currentScroll >= totalScroll ) 1128 { 1129 if(direction == "down") e.preventDefault(); 1130 } 1131 }); 1132 1133 $(window).on( 'debouncedresize', function (e) 1134 { 1135 // close burger menu when returning to desktop 1136 if(burger && burger.length) 1137 { 1138 if( ! burger_wrap.is(':visible') ) 1139 { 1140 burger.filter(".is-active").parents('a').eq(0).trigger('click'); 1141 } 1142 } 1143 1144 set_list_container_height(); 1145 }); 1146 1147 //close overlay on overlay click 1148 $('.html_av-overlay-side').on( 'click', '.av-burger-overlay-bg', function (e) 1149 { 1150 e.preventDefault(); 1151 burger.parents('a').eq(0).trigger('click'); 1152 }); 1153 1154 //close overlay when smooth scrollign begins 1155 $(window).on('avia_smooth_scroll_start', function() 1156 { 1157 if(burger && burger.length) 1158 { 1159 burger.filter(".is-active").parents('a').eq(0).trigger('click'); 1160 } 1161 }); 1162 1163 1164 //toogle hide/show for submenu items 1165 $('.html_av-submenu-display-hover').on( 'mouseenter', '.av-width-submenu', function (e) 1166 { 1167 $(this).children("ul.sub-menu").slideDown('fast'); 1168 }); 1169 1170 $('.html_av-submenu-display-hover').on( 'mouseleave', '.av-width-submenu', function (e) 1171 { 1172 $(this).children("ul.sub-menu").slideUp('fast'); 1173 }); 1174 1175 $('.html_av-submenu-display-hover').on( 'click', '.av-width-submenu > a', function (e) 1176 { 1177 e.preventDefault(); 1178 e.stopImmediatePropagation(); 1179 }); 1180 1181 // for mobile we use same behaviour as submenu-display-click 1182 $('.html_av-submenu-display-hover').on( 'touchstart', '.av-width-submenu > a', function (e) 1183 { 1184 var menu = $(this); 1185 toggle_submenu( menu, e ); 1186 }); 1187 1188 1189 //toogle hide/show for submenu items 1190 $('.html_av-submenu-display-click').on( 'click', '.av-width-submenu > a', function (e) 1191 { 1192 var menu = $(this); 1193 toggle_submenu( menu, e ); 1194 }); 1195 1196 1197 function toggle_submenu( menu, e ) 1198 { 1199 e.preventDefault(); 1200 e.stopImmediatePropagation(); 1201 1202 var parent = menu.parents('li').eq(0); 1203 1204 parent.toggleClass('av-show-submenu'); 1205 1206 if(parent.is('.av-show-submenu')) 1207 { 1208 parent.children("ul.sub-menu").slideDown('fast'); 1209 } 1210 else 1211 { 1212 parent.children("ul.sub-menu").slideUp('fast'); 1213 } 1214 }; 1215 1216 1217 (function normalize_layout() 1218 { 1219 //if we got the menu outside of the main menu container we need to add it to the container as well 1220 if(menu_in_logo_container.length) return; 1221 1222 var menu2 = $('#header .main_menu').clone(true); 1223 menu2.find('.menu-item:not(.menu-item-avia-special)').remove(); 1224 menu2.insertAfter(logo_container.find('.logo').first()); 1225 1226 //check if we got social icons and append it to the secondary menu 1227 var social = $('#header .social_bookmarks').clone(true); 1228 if(!social.length) social = $('.av-logo-container .social_bookmarks').clone(true); 1229 1230 if( social.length ) 1231 { 1232 menu2.find('.avia-menu').addClass('av_menu_icon_beside'); 1233 menu2.append(social); 1234 } 1235 1236 //re select the burger menu if we added a new one 1237 burger_wrap = $('.av-burger-menu-main a'); 1238 }()); 1239 1240 1241 1242 burger_wrap.click(function(e) 1243 { 1244 if(animating) return; 1245 burger = $(this).find('.av-hamburger'), 1246 animating = true; 1247 1248 if(!menu_generated) 1249 { 1250 menu_generated = true; 1251 burger.addClass("av-inserted-main-menu"); 1252 1253 burger_ul = $('<ul>
1253').attr({id:'av-burger-menu-ul', class:''}); 1254 var first_level_items = menu.find('> li:not(.menu-item-avia-special)'); //select all first level items that are not special items 1255 var list = create_list( first_level_items , burger_ul); 1256 1257 burger_ul.find('.noMobile').remove(); //remove any menu items with the class noMobile so user can filter manually if he wants 1258 burger_ul.appendTo(inner_overlay); 1259 first_level = inner_overlay.find('#av-burger-menu-ul > li'); 1260 1261 if($.fn.avia_smoothscroll){ 1262 $('a[href*="#"]', overlay).avia_smoothscroll(overlay); 1263 } 1264 } 1265 1266 if(burger.is(".is-active")) 1267 { 1268 burger.removeClass("is-active"); 1269 htmlEL.removeClass("av-burger-overlay-active-delayed"); 1270 1271 overlay.animate({opacity:0}, function() 1272 { 1273 overlay.css({display:'none'}); 1274 htmlEL.removeClass("av-burger-overlay-active"); 1275 animating = false; 1276 }); 1277 1278 } 1279 else 1280 { 1281 set_list_container_height(); 1282 1283 var offsetTop = header_main.length ? header_main.outerHeight() + header_main.position().top : header.outerHeight() + header.position().top; 1284 1285 overlay.appendTo($(e.target).parents('.avia-menu')); 1286 1287 burger_ul.css({padding:( offsetTop ) + "px 0px"}); 1288 1289 first_level.removeClass('av-active-burger-items'); 1290 1291 burger.addClass("is-active"); 1292 htmlEL.addClass("av-burger-overlay-active"); 1293 overlay.css({display:'block'}).animate({opacity:1}, function() 1294 { 1295 animating = false; 1296 }); 1297 1298 setTimeout(function() 1299 { 1300 htmlEL.addClass("av-burger-overlay-active-delayed"); 1301 1302 }, 100); 1303 1304 first_level.each(function(i) 1305 { 1306 var _self = $(this); 1307 setTimeout(function() 1308 { 1309 _self.addClass('av-active-burger-items'); 1310 }, (i + 1) * 125); 1311 }); 1312 1313 } 1314 1315 e.preventDefault(); 1316 }); 1317 1318 1319 } 1320 1321 1322 1323 1324 $.AviaAjaxSearch = function(options) 1325 { 1326 var defaults = { 1327 delay: 300, //delay in ms until the user stops typing. 1328 minChars: 3, //dont start searching before we got at least that much characters 1329 scope: 'body' 1330 1331 }; 1332 1333 this.options = $.extend({}, defaults, options); 1334 this.scope = $(this.options.scope); 1335 this.timer = false; 1336 this.lastVal = ""; 1337 1338 this.bind_events(); 1339 1340 1341 }; 1342 1343 1344 $.AviaAjaxSearch.prototype = 1345 { 1346 1347 bind_events: function() 1348 { 1349 this.scope.on('keyup', '#s:not(".av_disable_ajax_search #s")' , $.proxy( this.try_search, this)); 1350 this.scope.on('click', '#s.av-results-parked' , $.proxy( this.reset, this)); 1351 1352 }, 1353 1354 try_search: function(e) 1355 { 1356 var form = $(e.currentTarget).parents('form:eq(0)'), 1357 resultscontainer = form.find('.ajax_search_response'); 1358 1359 clearTimeout(this.timer); 1360 1361 //only execute search if chars are at least "minChars" and search differs from last one 1362 if(e.currentTarget.value.length >= this.options.minChars && this.lastVal != $.trim(e.currentTarget.value)) 1363 { 1364 //wait at least "delay" miliseconds to execute ajax. if user types again during that time dont execute 1365 this.timer = setTimeout($.proxy( this.do_search, this, e), this.options.delay); 1366 1367 } 1368 //remove the results container if the input field has been emptied 1369 else if (e.currentTarget.value.length == 0){ 1370 this.timer = setTimeout($.proxy( this.reset, this, e), this.options.delay); 1371 } 1372 1373 // close on ESC 1374 if (e.keyCode === 27) { 1375 this.reset(e); 1376 } 1377 1378 }, 1379 1380 reset: function(e){ 1381 var form = $(e.currentTarget).parents('form:eq(0)'), 1382 resultscontainer = form.find('.ajax_search_response'), 1383 alternative_resultscontainer = $(form.attr('data-ajaxcontainer')).find('.ajax_search_response'), 1384 searchInput = $(e.currentTarget); 1385 1386 // bring back results that were hidden when user clicked outside the form element 1387 if ($(e.currentTarget).hasClass('av-results-parked')) { 1388 resultscontainer.show(); 1389 alternative_resultscontainer.show(); 1390 1391 // in case results container is attached to body 1392 $('body > .ajax_search_response').show(); 1393 } 1394 else { 1395 // remove results and delete the input value 1396 resultscontainer.remove(); 1397 alternative_resultscontainer.remove(); 1398 searchInput.val(''); 1399 1400 // in case results container is attached to body 1401 $('body > .ajax_search_response').remove(); 1402 } 1403 1404 1405 }, 1406 1407 do_search: function(e) 1408 { 1409 var obj = this, 1410 currentField = $(e.currentTarget).attr( "autocomplete", "off" ), 1411 currentFieldWrapper = $(e.currentTarget).parents('.av_searchform_wrapper:eq(0)'), 1412 currentField_position = currentFieldWrapper.offset(), 1413 currentField_width = currentFieldWrapper.outerWidth(), 1414 currentField_height = currentFieldWrapper.outerHeight(), 1415 form = currentField.parents('form:eq(0)'), 1416 submitbtn = form.find('#searchsubmit'), 1417 resultscontainer = form, 1418 results = resultscontainer.find('.ajax_search_response'), 1419 loading = $('<div class="ajax_load"><span class="ajax_load_inner"></span></div>'), 1420 action = form.attr('action'), 1421 values = form.serialize(); 1422 values += '&action=avia_ajax_search'; 1423 1424 // define results div if not found 1425 if(!results.length) { 1426 results = $('<div class="ajax_search_response" style="display:none;"></div>'); 1427 } 1428 1429 // add class to differentiate betweeen search element and header search 1430 if (form.attr('id') == 'searchform_element'){ 1431 results.addClass('av_searchform_element_results'); 1432 } 1433 1434 //check if the form got get parameters applied and also apply them 1435 if(action.indexOf('?') != -1) 1436 { 1437 action = action.split('?'); 1438 values += "&" + action[1]; 1439 } 1440 1441 //check if there is a results container defined 1442 if (form.attr('data-ajaxcontainer')) { 1443 1444 var rescon = form.attr('data-ajaxcontainer'); 1445 1446 // check if defined container exists 1447 if ($(rescon).length) { 1448 1449 // remove previous search results 1450 $(rescon).find('.ajax_search_response').remove(); 1451 1452 resultscontainer = $(rescon); 1453 } 1454 1455 } 1456 1457 /* 1458 * For the placement option: "Under the search form - overlay other content", 1459 * we have to attach the results to the body in order to overlay the other content,
1460 * and we calculate it's position using the search field 1461 */ 1462 1463 results_css = {}; 1464 1465 if ( form.hasClass('av_results_container_fixed') ){ 1466 1467 // remove previous search results 1468 $('body').find('.ajax_search_response').remove(); 1469 1470 resultscontainer = $('body'); 1471 1472 // add class and position to results if defined above 1473 var results_css = { 1474 top: currentField_position.top + currentField_height, 1475 left: currentField_position.left, 1476 width: currentField_width 1477 } 1478 1479 // make sure default stylesheet is applied 1480 results.addClass('main_color'); 1481 1482 // remove results and reset if window is resized 1483 $( window ).resize(function() { 1484 results.remove(); 1485 $.proxy( this.reset, this); 1486 currentField.val(''); 1487 }); 1488 1489 } 1490 1491 // add additional styles 1492 if ( form.attr('data-results_style') ) { 1493 var results_style = JSON.parse(form.attr('data-results_style')); 1494 results_css = Object.assign(results_css, results_style); 1495 1496 // add class if font color is applied, so we can use color: inherit 1497 if ("color" in results_css) { 1498 results.addClass('av_has_custom_color'); 1499 } 1500 1501 } 1502 1503 // apply inline styles 1504 results.css(results_css); 1505 1506 // add .container class if resultscontainer in a color section 1507 if (resultscontainer.hasClass('avia-section')){ 1508 results.addClass('container'); 1509 } 1510 1511 // append results to defined container 1512 results.appendTo(resultscontainer); 1513 1514 1515 //return if we already hit a no result and user is still typing 1516 if(results.find('.ajax_not_found').length && e.currentTarget.value.indexOf(this.lastVal) != -1) return; 1517 1518 this.lastVal = e.currentTarget.value; 1519 1520 $.ajax({ 1521 url: avia_framework_globals.ajaxurl, 1522 type: "POST", 1523 data:values, 1524 beforeSend: function() 1525 { 1526 // add loader after submit button 1527 loading.insertAfter(submitbtn); 1528 form.addClass('ajax_loading_now'); 1529 }, 1530 success: function(response) 1531 { 1532 if(response == 0) response = ""; 1533 results.html(response).show(); 1534 }, 1535 complete: function() 1536 { 1537 loading.remove(); 1538 form.removeClass('ajax_loading_now'); 1539 } 1540 }); 1541 1542 // Hide search resuls if user clicks anywhere outside the form element 1543 $(document).on('click',function(e) { 1544 if(!$(e.target).closest(form).length) { 1545 if($(results).is(":visible")) { 1546 $(results).hide(); 1547 currentField.addClass('av-results-parked'); 1548 } 1549 } 1550 }); 1551 } 1552 1553 1554 }; 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 $.AviaTooltip = function(options) 1566 { 1567 var defaults = { 1568 delay: 1500, //delay in ms until the tooltip appears 1569 delayOut: 300, //delay in ms when instant showing should stop 1570 delayHide: 0, //delay hiding of tooltip in ms 1571 "class": "avia-tooltip", //tooltip classname for css styling and alignment 1572 scope: "body", //area the tooltip should be applied to 1573 data: "avia-tooltip", //data attribute that contains the tooltip text 1574 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 1575 event: 'mouseenter', //mousenter and leave or click and leave 1576 position:'top', //top or bottom 1577 extraClass:'avia-tooltip-class', //extra class that is defined by a tooltip element data attribute 1578 permanent: false, // always display the tooltip? 1579 within_screen: false // if the tooltip is displayed outside the screen adjust its position 1580 1581 }; 1582 1583 this.options = $.extend({}, defaults, options); 1584 this.body = $('body'); 1585 this.scope = $(this.options.scope); 1586 this.tooltip = $('<div class="'+this.options['class']+' avia-tt"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></div>'); 1587 this.inner = $('<div class="inner_tooltip"></div>').prependTo(this.tooltip); 1588 this.open = false;
1589 this.timer = false; 1590 this.active = false; 1591 1592 this.bind_events(); 1593 }; 1594 1595 $.AviaTooltip.openTTs = []; 1596 $.AviaTooltip.prototype = 1597 { 1598 bind_events: function() 1599 { 1600 var perma_tooltips = '.av-permanent-tooltip [data-'+this.options.data+']', 1601 default_tooltips = '[data-'+this.options.data+']:not( .av-permanent-tooltip [data-'+this.options.data+'])'; 1602 1603 this.scope.on('av_permanent_show', perma_tooltips, $.proxy( this.display_tooltip, this) ); 1604 $(perma_tooltips).addClass('av-perma-tooltip').trigger('av_permanent_show'); 1605 1606 1607 this.scope.on(this.options.event + ' mouseleave', default_tooltips, $.proxy( this.start_countdown, this) ); 1608 1609 if(this.options.event != 'click') 1610 { 1611 this.scope.on('mouseleave', default_tooltips, $.proxy( this.hide_tooltip, this) ); 1612 } 1613 else 1614 { 1615 this.body.on('mousedown', $.proxy( this.hide_tooltip, this) ); 1616 } 1617 1618 }, 1619 1620 start_countdown: function(e) 1621 { 1622 clearTimeout(this.timer); 1623 1624 if(e.type == this.options.event) 1625 { 1626 var delay = this.options.event == 'click' ? 0 : this.open ? 0 : this.options.delay; 1627 1628 this.timer = setTimeout($.proxy( this.display_tooltip, this, e), delay); 1629 } 1630 else if(e.type == 'mouseleave') 1631 { 1632 this.timer = setTimeout($.proxy( this.stop_instant_open, this, e), this.options.delayOut); 1633 } 1634 e.preventDefault(); 1635 }, 1636 1637 reset_countdown: function(e) 1638 { 1639 clearTimeout(this.timer); 1640 this.timer = false; 1641 }, 1642 1643 display_tooltip: function(e) 1644 { 1645 var _self = this, 1646 target = this.options.event == "click" ? e.target : e.currentTarget, 1647 element = $(target), 1648 text = element.data(this.options.data), 1649 newTip = element.data('avia-created-tooltip'), 1650 extraClass = element.data('avia-tooltip-class'), 1651 attach = this.options.attach == 'element' ? element : this.body, 1652 offset = this.options.attach == 'element' ? element.position() : element.offset(), 1653 position = element.data('avia-tooltip-position'), 1654 align = element.data('avia-tooltip-alignment'), 1655 force_append= false; 1656 1657 text = $.trim(text); 1658 1659 if(element.is('.av-perma-tooltip')) 1660 { 1661 offset = {top:0, left:0 }; 1662 attach = element; 1663 force_append = true; 1664 } 1665 1666 if(text == "") return; 1667 if(position == "" || typeof position == 'undefined') position = this.options.position; 1668 if(align == "" || typeof align == 'undefined') align = 'center'; 1669 1670 if(typeof newTip != 'undefined') 1671 { 1672 newTip = $.AviaTooltip.openTTs[newTip]; 1673 } 1674 else 1675 { 1676 this.inner.html(text); 1677 newTip = this.tooltip.clone(); 1678 1679 if(this.options.attach == 'element' && force_append !== true) 1680 { 1681 newTip.insertAfter(attach); 1682 } 1683 else 1684 { 1685 newTip.appendTo(attach); 1686 } 1687 1688 if(extraClass != "") newTip.addClass(extraClass); 1689 } 1690 1691 this.open = true; 1692 this.active = newTip; 1693 1694 if((newTip.is(':animated:visible') && e.type == 'click') || element.is('.'+this.options['class']) || element.parents('.'+this.options['class']).length != 0) return; 1695 1696 1697 var animate1 = {}, animate2 = {}, pos1 = "", pos2 = ""; 1698 1699 if(position == "top" ||Â position == "bottom") 1700 { 1701 switch(align) 1702 { 1703 case "left": pos2 = offset.left; break; 1704 case "right": pos2 = offset.left + element.outerWidth() - newTip.outerWidth(); break; 1705 default: pos2 = (offset.left + (element.outerWidth() / 2)) - (newTip.outerWidth() / 2); break; 1706 } 1707 1708 if(_self.options.within_screen) //used to keep search field inside screen 1709 { 1710 var boundary = element.offset().left + (element.outerWidth() / 2) - (newTip.outerWidth() / 2) + parseInt(newTip.css('margin-left'),10); 1711 if(boundary < 0) 1712 { 1713 pos2 = pos2 - boundary; 1714 } 1715 1716 } 1717 1718 1719 } 1720 else 1721 {
1722 switch(align) 1723 { 1724 case "top": pos1 = offset.top; break; 1725 case "bottom": pos1 = offset.top + element.outerHeight() - newTip.outerHeight(); break; 1726 default: pos1 = (offset.top + (element.outerHeight() / 2)) - (newTip.outerHeight() / 2); break; 1727 } 1728 } 1729 1730 switch(position) 1731 { 1732 case "top": 1733 pos1 = offset.top - newTip.outerHeight(); 1734 animate1 = {top: pos1 - 10, left: pos2}; 1735 animate2 = {top: pos1}; 1736 break; 1737 case "bottom": 1738 pos1 = offset.top + element.outerHeight(); 1739 animate1 = {top: pos1 + 10, left: pos2}; 1740 animate2 = {top: pos1}; 1741 break; 1742 case "left": 1743 pos2 = offset.left - newTip.outerWidth(); 1744 animate1 = {top: pos1, left: pos2 -10}; 1745 animate2 = {left: pos2}; 1746 break; 1747 case "right": 1748 pos2 = offset.left + element.outerWidth(); 1749 animate1 = {top: pos1, left: pos2 + 10}; 1750 animate2 = {left: pos2}; 1751 break; 1752 } 1753 1754 animate1['display'] = "block"; 1755 animate1['opacity'] = 0; 1756 animate2['opacity'] = 1; 1757 1758 1759 newTip.css(animate1).stop().animate(animate2,200); 1760 newTip.find('input, textarea').focus(); 1761 $.AviaTooltip.openTTs.push(newTip); 1762 element.data('avia-created-tooltip', $.AviaTooltip.openTTs.length - 1); 1763 1764 }, 1765 1766 hide_tooltip: function(e) 1767 { 1768 var element = $(e.currentTarget) , newTip, animateTo, 1769 position = element.data('avia-tooltip-position'), 1770 align = element.data('avia-tooltip-alignment'); 1771 1772 if(position == "" || typeof position == 'undefined') position = this.options.position; 1773 if(align == "" || typeof align == 'undefined') align = 'center'; 1774 1775 if(this.options.event == 'click') 1776 { 1777 element = $(e.target); 1778 1779 if(!element.is('.'+this.options['class']) && element.parents('.'+this.options['class']).length == 0) 1780 { 1781 if(this.active.length) { newTip = this.active; this.active = false;} 1782 } 1783 } 1784 else 1785 { 1786 newTip = element.data('avia-created-tooltip'); 1787 newTip = typeof newTip != 'undefined' ? $.AviaTooltip.openTTs[newTip] : false; 1788 } 1789 1790 if(newTip) 1791 { 1792 var animate = {opacity:0}; 1793 1794 switch(position) 1795 { 1796 case "top": 1797 animate['top'] = parseInt(newTip.css('top'),10) - 10; 1798 break; 1799 case "bottom": 1800 animate['top'] = parseInt(newTip.css('top'),10) + 10; 1801 break; 1802 case "left": 1803 animate['left'] = parseInt(newTip.css('left'), 10) - 10; 1804 break; 1805 case "right": 1806 animate['left'] = parseInt(newTip.css('left'), 10) + 10; 1807 break; 1808 } 1809 1810 newTip.animate(animate, 200, function() 1811 { 1812 newTip.css({display:'none'}); 1813 }); 1814 } 1815 }, 1816 1817 stop_instant_open: function(e) 1818 { 1819 this.open = false; 1820 } 1821 }; 1822 1823 1824})( jQuery ); 1825 1826 1827 1828 1829 1830 1831 1832 1833/*! 1834Waypoints - 3.1.1 1835Copyright © 2011-2015 Caleb Troughton 1836Licensed under the MIT license. 1837https://github.com/imakewebthings/waypoints/blog/master/licenses.txt 1838*/ 1839!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");this.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()}
vendor: 5,060 bytes, line 1839
1839,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
1839ight:[]}},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))}(); 1840 1841 1842// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 1843// 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 1844// MIT license 1845(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)}}()); 1846 1847jQuery.expr[':'].regex = function(elem, index, match) { 1848 var matchParams = match[3].split(','), 1849 validLabels = /^(data|css):/, 1850 attr = { 1851 method: matchParams[0].match(validLabels) ? 1852 matchParams[0].split(':')[0] : 'attr', 1853 property: matchParams.shift().replace(validLabels,'') 1854 }, 1855 regexFlags = 'ig', 1856 regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags); 1857 return regex.test(jQuery(elem)[attr.method](attr.property)); 1858}; 1859 1860 1861 1862 1863
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.