1(function ($) { 2 /*jslint undef: false, browser: true, devel: false, eqeqeq: false, bitwise: false, white: false, plusplus: false, regexp: false */ 3 /*global jQuery,setTimeout */ 4 5 $.pixelentity = $.pixelentity || {version: '1.0.0'}; 6 7 if ($.pixelentity.preloader) { 8 return; 9 } 10 11 function loaded(e) { 12 var image = $(e.currentTarget); 13 //var loaderInfo = image.data("peUtilsLoader"); 14 var loaderInfo; 15 16 while (image.data("peUtilsLoader") && (loaderInfo = image.data("peUtilsLoader").shift())) { 17 if (--loaderInfo.total <= 0) { 18 var cb = loaderInfo.callback; 19 var target = loaderInfo.target; 20 image.unbind("load error",loaded); 21 if (typeof cb === "function") { 22 cb(target); 23 } 24 } 25 } 26 } 27 28 var preloader = $.pixelentity.preloader = { 29 load: function (el,callback,noreplace) { 30 el = (el instanceof jQuery) ? el : $(el); 31 var images = (el[0].tagName.toLowerCase() == "img") ? [el[0]] : el.find("img").get(); 32 33 var image; 34 var list = []; 35 var complete; 36 37 while ((image = images.shift())) { 38 complete = image.complete; 39 try { 40 if (!(image.src && complete && !(image.src.match(/blank.png$/i) !== null && image.getAttribute("data-src")))) { 41 list.push(image); 42 } 43 } catch (x) { 44 } 45 } 46 47 if (list.length > 0) { 48 var loaderInfo = { 49 target: el, 50 callback: callback, 51 total: list.length 52 }; 53 54 while ((image = list.shift())) { 55 56 image = $(image); 57 58 if (!noreplace && $.browser.msie && image[0].src.match(/blank.png$/i) !== null) { 59 image.removeAttr("src"); 60 image.replaceWith(image.clone()); 61 if (!image.attr("data-src")) { 62 // nothing to be loaded here 63 loaderInfo.total--; 64 //continue; 65 } 66 } 67 68 if (image.data("peUtilsLoader")) { 69 image.data("peUtilsLoader").push(loaderInfo); 70 } else { 71 image.data("peUtilsLoader",[loaderInfo]); 72 } 73 74 image 75 .one("load error",loaded); 76 77 if (image.attr("data-src")) { 78 image.attr("src",image.attr("data-src")); 79 image.removeAttr("data-src"); 80 } else if ($.browser.msie) { 81 image.attr("src",image.attr("src")); 82 } 83 84 image = undefined; 85 86 } 87 } else { 88 callback(el); 89 } 90 }, 91 clear: function(el,callback) { 92 el = (el instanceof jQuery) ? el : $(el); 93 var images = (el[0].tagName.toLowerCase() == "img") ? [el[0]] : el.find("img").get(); 94 var image,loaderInfo,cb; 95 while ((image = images.shift())) { 96 image = $(image); 97 while (image.data("peUtilsLoader") && (loaderInfo = image.data("peUtilsLoader").shift())) { 98 cb = loaderInfo.callback; 99 if (cb === callback) { 100 loaderInfo.callback = false; 101 break; 102 } 103 } 104 } 105 106 } 107 }; 108 109}(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.