1(function($){ 2 3 4 var xhr = new window.XMLHttpRequest(); 5 xhr.addEventListener('progress', function(e) { 6 if (e.lengthComputable) { 7 // $('.progressbar .bar').css('width', '' + (100 * e.loaded / e.total) + '%'); 8 $("#qwPercLoad").text( (100 * e.loaded / e.total) + '%'); 9 } 10 11 }); 12 13 14 15 $(window).load(function(e){ 16 //$('div.qw-loading-page').fadeOut('slow'); 17 18 }); 19 ////////////////////////////////////////////////////////////////// 20 21 $(document).ready(function () { 22 "use strict" 23 24 25 if($("body").hasClass("qw-is_mobile ")){ 26 return; 27 } 28 29 30 //indexOf support for IE8 and below. 31 if (!Array.prototype.indexOf){ 32 Array.prototype.indexOf = function(elt /*, from*/){ 33 var len = this.length >>> 0; 34 35 var from = Number(arguments[1]) || 0; 36 from = (from < 0) 37 ? Math.ceil(from) 38 : Math.floor(from); 39 if (from < 0) 40 from += len; 41 42 for (; from < len; from++){ 43 if (from in this && 44 this[from] === elt) 45 return from; 46 } 47 return -1; 48 }; 49 } 50 51 //bgImg for holding background images in the page & img array for images present in the document(<img src="">). 52 var bgImg = [], img = [], count=0, percentage = 0; 53 54 //Creating loader holder. 55 /* $('<div id="loaderMask"><span>0%</span></div>').css({ 56 position:"fixed", 57 top:0, 58 bottom:0, 59 left:0, 60 right:0, 61 background:'#fff' 62 }).appendTo('body');*/ 63 64 //Using jQuery filter method we parse all elemnts in the page and adds background image url & images src into respective arrays. 65 $('*').filter(function() { 66 67 var val = $(this).css('background-image').replace(/url\(/g,'').replace(/\)/,'').replace(/"/g,''); 68 var imgVal = $(this).not('script').attr('src'); 69 70 //Getting urls of background images. 71 if(val !== 'none' && !/linear-gradient/g.test(val) && bgImg.indexOf(val) === -1){ 72 bgImg.push(val) 73 } 74 75 //Getting src of images in the document. 76 if(imgVal !== undefined && img.indexOf(imgVal) === -1){ 77 img.push(imgVal) 78 } 79 80 }); 81 82 //Merging both bg image array & img src array 83 var imgArray = bgImg.concat(img); 84 85 //Adding events for all the images in the array. 86 $.each(imgArray, function(i,val){ 87 //Attaching load event 88 $("<img />").attr("src", val).bind("load", function () { 89 completeImageLoading(); 90 }); 91 92 //Attaching error event 93 $("<img />").attr("src", val).bind("error", function () { 94 imgError(this); 95 }); 96 }) 97 98 99 100 101 102 103 104 105 //After each successful image load we will create percentage. 106 function completeImageLoading(){ 107 count++; 108 percentage = Math.floor(count / imgArray.length * 100); 109 $('#loaderMask span').html(percentage + '%'); 110 111 //When percentage is 100 we will remove loader and display page. 112 if(percentage === 100){ 113 $('#loaderMask').html('<span>100%</span>'); 114 /**/ 115 $('#loaderMask').fadeOut(function(){ 116 $('#loaderMask').remove(); 117 }) 118 } 119 } 120 121 //Error handling - When image fails to load we will remove the mask & shows the page. 122 function imgError (arg) { 123 $('#loaderMask span').html("Loading..").delay(500).fadeOut(1000, function(){ 124 $('#loaderMask').remove(); 125 }) 126 } 127 128 129 $("body").delay(10000).promise().done( function(){ 130 $('#loaderMask span').html("Loading..").delay(500).fadeOut(1000, function(){ 131 $('#loaderMask').remove(); 132 }) 133 }); 134 135 136 137 138 139 140 }); 141 142 143 144 145})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.