PageSourceSearch

https://ear-lab.com/wp-content/themes/enfold/js/avia-snippet-site-preloader.js?ver=4.6.3.1

js ear-lab.com collected 2026-10-07 23:15:21 UTC 2,062 bytes, 86 lines download raw bytes

1(function($)
2{	
3    "use strict";
4    
5    //fix back forward cache issue: http://stackoverflow.com/questions/11979156/mobile-safari-back-button
6    $(window).on("pageshow", function(event) {
7	    if (event.originalEvent.persisted) {
8	     avia_site_preloader();
9	    }
10	});
11    
12    $(document).ready(function()
13    {	
14		//site preloader script
15        avia_site_preloader();
16    });
17	
18	
19	function avia_site_preloader()
20	{
21		var win = $(window), preloader_active = $('html.av-preloader-active'), pre_wrap;
22		
23		if( preloader_active.length )
24		{	
25			var hide = function()
26			{
27				pre_wrap.avia_animate({opacity:0}, function()
28	    		{
29	    			preloader_active.removeClass('av-preloader-active');
30	    		});
31			};
32			
33			
34			pre_wrap = $('.av-siteloader-wrap');
35			setTimeout(function()
36			{
37				$.avia_utilities.preload({container: preloader_active, global_callback: hide });
38				
39				//fallback
40				setTimeout(function()
41				{
42					if(preloader_active.is('.av-preloader-active')) 
43					{ 
44						hide(); 
45						$.avia_utilities.log('Hide Preloader (Fallback)');
46					}
47				
48				},4000);
49				
50				if( pre_wrap.is('.av-transition-enabled') )
51				{
52					var comp = new RegExp(location.host), 
53						exclude = " .no-transition, .mfp-iframe, .lightbox-added, a.avianolink, .grid-links-ajax a, #menu-item-search a, .wp-playlist-caption";
54					
55					preloader_active.on('click', 'a:not('+exclude+')',function(e)
56					{	
57						if(!e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
58						{	
59							var link = this; 
60							if(comp.test(link.href) && link.href.split('#')[0] != location.href.split('#')[0] && link.target == "")
61							{
62								if(link.href.indexOf('mailto:') == -1 && link.href.indexOf('add-to-cart=') == -1 )
63								{
64							       	e.preventDefault();
65							       	preloader_active.addClass('av-preloader-active av-preloader-reactive');
66									pre_wrap.avia_animate({opacity:1}, function()
67									{
68										window.location = link.href;
69									});
70								}
71							}
72						}
73					});
74				}
75				
76				
77			}, 500);
78		}
79	}
80
81
82})(jQuery);
83
84
85
86

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.