vendor: 4,254 bytes, lines 1-123
1/*! 2 * imagesLoaded PACKAGED v4.1.4 3 * JavaScript is all like "You images are done yet or what?" 4 * MIT License 5 */ 6 7! function (e, t) { 8 "function" == typeof define && define.amd ? define("ev-emitter/ev-emitter", t) : "object" == typeof module && module.exports ? module.exports = t() : e.EvEmitter = t() 9}("undefined" != typeof window ? window : this, function () { 10 function e() {} 11 var t = e.prototype; 12 return t.on = function (e, t) { 13 if (e && t) { 14 var i = this._events = this._events || {}, 15 n = i[e] = i[e] || []; 16 return n.indexOf(t) == -1 && n.push(t), this 17 } 18 }, t.once = function (e, t) { 19 if (e && t) { 20 this.on(e, t); 21 var i = this._onceEvents = this._onceEvents || {}, 22 n = i[e] = i[e] || {}; 23 return n[t] = !0, this 24 } 25 }, t.off = function (e, t) { 26 var i = this._events && this._events[e]; 27 if (i && i.length) { 28 var n = i.indexOf(t); 29 return n != -1 && i.splice(n, 1), this 30 } 31 }, t.emitEvent = function (e, t) { 32 var i = this._events && this._events[e]; 33 if (i && i.length) { 34 i = i.slice(0), t = t || []; 35 for (var n = this._onceEvents && this._onceEvents[e], o = 0; o < i.length; o++) { 36 var r = i[o], 37 s = n && n[r]; 38 s && (this.off(e, r), delete n[r]), r.apply(this, t) 39 } 40 return this 41 } 42 }, t.allOff = function () { 43 delete this._events, delete this._onceEvents 44 }, e 45}), 46function (e, t) { 47 "use strict"; 48 "function" == typeof define && define.amd ? define(["ev-emitter/ev-emitter"], function (i) { 49 return t(e, i) 50 }) : "object" == typeof module && module.exports ? module.exports = t(e, require("ev-emitter")) : e.imagesLoaded = t(e, e.EvEmitter) 51}("undefined" != typeof window ? window : this, function (e, t) { 52 function i(e, t) { 53 for (var i in t) e[i] = t[i]; 54 return e 55 } 56 57 function n(e) { 58 if (Array.isArray(e)) return e; 59 var t = "object" == typeof e && "number" == typeof e.length; 60 return t ? d.call(e) : [e] 61 } 62 63 function o(e, t, r) { 64 if (!(this instanceof o)) return new o(e, t, r); 65 var s = e; 66 return "string" == typeof e && (s = document.querySelectorAll(e)), s ? (this.elements = n(s), this.options = i({}, this.options), "function" == typeof t ? r = t : i(this.options, t), r && this.on("always", r), this.getImages(), h && (this.jqDeferred = new h.Deferred), void setTimeout(this.check.bind(this))) : void a.error("Bad element for imagesLoaded " + (s || e)) 67 } 68 69 function r(e) { 70 this.img = e 71 } 72 73 function s(e, t) { 74 this.url = e, this.element = t, this.img = new Image 75 } 76 var h = e.jQuery, 77 a = e.console, 78 d = Array.prototype.slice; 79 o.prototype = Object.create(t.prototype), o.prototype.options = {}, o.prototype.getImages = function () { 80 this.images = [], this.elements.forEach(this.addElementImages, this) 81 }, o.prototype.addElementImages = function (e) { 82 "IMG" == e.nodeName && this.addImage(e), this.options.background === !0 && this.addElementBackgroundImages(e); 83 var t = e.nodeType; 84 if (t && u[t]) { 85 for (var i = e.querySelectorAll("img"), n = 0; n < i.length; n++) { 86 var o = i[n]; 87 this.addImage(o) 88 } 89 if ("string" == typeof this.options.background) { 90 var r = e.querySelectorAll(this.options.background); 91 for (n = 0; n < r.length; n++) { 92 var s = r[n]; 93 this.addElementBackgroundImages(s) 94 } 95 } 96 } 97 }; 98 var u = { 99 1: !0, 100 9: !0, 101 11: !0 102 }; 103 return o.prototype.addElementBackgroundImages = function (e) { 104 var t = getComputedStyle(e); 105 if (t) 106 for (var i = /url\((['"])?(.*?)\1\)/gi, n = i.exec(t.backgroundImage); null !== n;) { 107 var o = n && n[2]; 108 o && this.addBackground(o, e), n = i.exec(t.backgroundImage) 109 } 110 }, o.prototype.addImage = function (e) { 111 var t = new r(e); 112 this.images.push(t) 113 }, o.prototype.addBackground = function (e, t) { 114 var i = new s(e, t); 115 this.images.push(i) 116 }, o.prototype.check = function () { 117 function e(e, i, n) { 118 setTimeout(function () { 119 t.progress(e, i, n) 120 }) 121 } 122 var t = this; 123 return this.progressedCount = 0, this.hasAnyBroken = !1, this.images.length ? void this.images.forEac
vendor: 2,761 bytes, lines 123-164
123h(function (t) { 124 t.once("progress", e), t.check() 125 }) : void this.complete() 126 }, o.prototype.progress = function (e, t, i) { 127 this.progressedCount++, this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded, this.emitEvent("progress", [this, e, t]), this.jqDeferred && this.jqDeferred.notify && this.jqDeferred.notify(this, e), this.progressedCount == this.images.length && this.complete(), this.options.debug && a && a.log("progress: " + i, e, t) 128 }, o.prototype.complete = function () { 129 var e = this.hasAnyBroken ? "fail" : "done"; 130 if (this.isComplete = !0, this.emitEvent(e, [this]), this.emitEvent("always", [this]), this.jqDeferred) { 131 var t = this.hasAnyBroken ? "reject" : "resolve"; 132 this.jqDeferred[t](this) 133 } 134 }, r.prototype = Object.create(t.prototype), r.prototype.check = function () { 135 var e = this.getIsImageComplete(); 136 return e ? void this.confirm(0 !== this.img.naturalWidth, "naturalWidth") : (this.proxyImage = new Image, this.proxyImage.addEventListener("load", this), this.proxyImage.addEventListener("error", this), this.img.addEventListener("load", this), this.img.addEventListener("error", this), void(this.proxyImage.src = this.img.src)) 137 }, r.prototype.getIsImageComplete = function () { 138 return this.img.complete && this.img.naturalWidth 139 }, r.prototype.confirm = function (e, t) { 140 this.isLoaded = e, this.emitEvent("progress", [this, this.img, t]) 141 }, r.prototype.handleEvent = function (e) { 142 var t = "on" + e.type; 143 this[t] && this[t](e) 144 }, r.prototype.onload = function () { 145 this.confirm(!0, "onload"), this.unbindEvents() 146 }, r.prototype.onerror = function () { 147 this.confirm(!1, "onerror"), this.unbindEvents() 148 }, r.prototype.unbindEvents = function () { 149 this.proxyImage.removeEventListener("load", this), this.proxyImage.removeEventListener("error", this), this.img.removeEventListener("load", this), this.img.removeEventListener("error", this) 150 }, s.prototype = Object.create(r.prototype), s.prototype.check = function () { 151 this.img.addEventListener("load", this), this.img.addEventListener("error", this), this.img.src = this.url; 152 var e = this.getIsImageComplete(); 153 e && (this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), this.unbindEvents()) 154 }, s.prototype.unbindEvents = function () { 155 this.img.removeEventListener("load", this), this.img.removeEventListener("error", this) 156 }, s.prototype.confirm = function (e, t) { 157 this.isLoaded = e, this.emitEvent("progress", [this, this.element, t]) 158 }, o.makeJQueryPlugin = function (t) { 159 t = t || e.jQuery, t && (h = t, h.fn.imagesLoaded = function (e, t) { 160 var i = new o(this, e, t); 161 return i.jqDeferred.promise(h(this)) 162 }) 163 }, o.makeJQueryPlugin(), o 164});
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.