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 9 ? define('ev-emitter/ev-emitter', t) 10 : 'object' == typeof module && module.exports 11 ? (module.exports = t()) 12 : (e.EvEmitter = t()); 13})('undefined' != typeof window ? window : this, function () { 14 function e() {} 15 var t = e.prototype; 16 return ( 17 (t.on = function (e, t) { 18 if (e && t) { 19 var i = (this._events = this._events || {}), 20 n = (i[e] = i[e] || []); 21 return n.indexOf(t) == -1 && n.push(t), this; 22 } 23 }), 24 (t.once = function (e, t) { 25 if (e && t) { 26 this.on(e, t); 27 var i = (this._onceEvents = this._onceEvents || {}), 28 n = (i[e] = i[e] || {}); 29 return (n[t] = !0), this; 30 } 31 }), 32 (t.off = function (e, t) { 33 var i = this._events && this._events[e]; 34 if (i && i.length) { 35 var n = i.indexOf(t); 36 return n != -1 && i.splice(n, 1), this; 37 } 38 }), 39 (t.emitEvent = function (e, t) { 40 var i = this._events && this._events[e]; 41 if (i && i.length) { 42 (i = i.slice(0)), (t = t || []); 43 for (var n = this._onceEvents && this._onceEvents[e], o = 0; o < i.length; o++) { 44 var r = i[o], 45 s = n && n[r]; 46 s && (this.off(e, r), delete n[r]), r.apply(this, t); 47 } 48 return this; 49 } 50 }), 51 (t.allOff = function () { 52 delete this._events, delete this._onceEvents; 53 }), 54 e 55 ); 56}), 57 (function (e, t) { 58 'use strict'; 59 'function' == typeof define && define.amd 60 ? define(['ev-emitter/ev-emitter'], function (i) { 61 return t(e, i); 62 }) 63 : 'object' == typeof module && module.exports 64 ? (module.exports = t(e, require('ev-emitter'))) 65 : (e.imagesLoaded = t(e, e.EvEmitter)); 66 })('undefined' != typeof window ? window : this, function (e, t) { 67 function i(e, t) { 68 for (var i in t) e[i] = t[i]; 69 return e; 70 } 71 function n(e) { 72 if (Array.isArray(e)) return e; 73 var t = 'object' == typeof e && 'number' == typeof e.length; 74 return t ? d.call(e) : [e]; 75 } 76 function o(e, t, r) { 77 if (!(this instanceof o)) return new o(e, t, r); 78 var s = e; 79 return ( 80 'string' == typeof e && (s = document.querySelectorAll(e)), 81 s 82 ? ((this.elements = n(s)), 83 (this.options = i({}, this.options)), 84 'function' == typeof t ? (r = t) : i(this.options, t), 85 r && this.on('always', r), 86 this.getImages(), 87 h && (this.jqDeferred = new h.Deferred()), 88 void setTimeout(this.check.bind(this))) 89 : void a.error('Bad element for imagesLoaded ' + (s || e)) 90 ); 91 } 92 function r(e) { 93 this.img = e; 94 } 95 function s(e, t) { 96 (this.url = e), (this.element = t), (this.img = new Image()); 97 } 98 var h = e.jQuery, 99 a = e.console, 100 d = Array.prototype.slice; 101 (o.prototype = Object.create(t.prototype)), 102 (o.prototype.options = {}), 103 (o.prototype.getImages = function () { 104 (this.images = []), this.elements.forEach(this.addElementImages, this); 105 }), 106 (o.prototype.addElementImages = function (e) { 107 'IMG' == e.nodeName && this.addImage(e), this.options.background === !0 && this.addElementBackgroun
107dImages(e); 108 var t = e.nodeType; 109 if (t && u[t]) { 110 for (var i = e.querySelectorAll('img'), n = 0; n < i.length; n++) { 111 var o = i[n]; 112 this.addImage(o); 113 } 114 if ('string' == typeof this.options.background) { 115 var r = e.querySelectorAll(this.options.background); 116 for (n = 0; n < r.length; n++) { 117 var s = r[n]; 118 this.addElementBackgroundImages(s); 119 } 120 } 121 } 122 }); 123 var u = { 1: !0, 9: !0, 11: !0 }; 124 return ( 125 (o.prototype.addElementBackgroundImages = function (e) { 126 var t = getComputedStyle(e); 127 if (t) 128 for (var i = /url\((['"])?(.*?)\1\)/gi, n = i.exec(t.backgroundImage); null !== n; ) { 129 var o = n && n[2]; 130 o && this.addBackground(o, e), (n = i.exec(t.backgroundImage)); 131 } 132 }), 133 (o.prototype.addImage = function (e) { 134 var t = new r(e); 135 this.images.push(t); 136 }), 137 (o.prototype.addBackground = function (e, t) { 138 var i = new s(e, t); 139 this.images.push(i); 140 }), 141 (o.prototype.check = function () { 142 function e(e, i, n) { 143 setTimeout(function () { 144 t.progress(e, i, n); 145 }); 146 } 147 var t = this; 148 return ( 149 (this.progressedCount = 0), 150 (this.hasAnyBroken = !1), 151 this.images.length 152 ? void this.images.forEach(function (t) { 153 t.once('progress', e), t.check(); 154 }) 155 : void this.complete() 156 ); 157 }), 158 (o.prototype.progress = function (e, t, i) { 159 this.progressedCount++, 160 (this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded), 161 this.emitEvent('progress', [this, e, t]), 162 this.jqDeferred && this.jqDeferred.notify && this.jqDeferred.notify(this, e), 163 this.progressedCount == this.images.length && this.complete(), 164 this.options.debug && a && a.log('progress: ' + i, e, t); 165 }), 166 (o.prototype.complete = function () { 167 var e = this.hasAnyBroken ? 'fail' : 'done'; 168 if (((this.isComplete = !0), this.emitEvent(e, [this]), this.emitEvent('always', [this]), this.jqDeferred)) { 169 var t = this.hasAnyBroken ? 'reject' : 'resolve'; 170 this.jqDeferred[t](this); 171 } 172 }), 173 (r.prototype = Object.create(t.prototype)), 174 (r.prototype.check = function () { 175 var e = this.getIsImageComplete(); 176 return e 177 ? void this.confirm(0 !== this.img.naturalWidth, 'naturalWidth') 178 : ((this.proxyImage = new Image()), 179 this.proxyImage.addEventListener('load', this), 180 this.proxyImage.addEventListener('error', this), 181 this.img.addEventListener('load', this), 182 this.img.addEventListener('error', this), 183 void (this.proxyImage.src = this.img.src)); 184 }), 185 (r.prototype.getIsImageComplete = function () { 186 return this.img.complete && this.img.naturalWidth; 187 }), 188 (r.prototype.confirm = function (e, t) { 189 (this.isLoaded = e), this.emitEvent('progress', [this, this.img, t]); 190 }), 191 (r.prototype.handleEvent = function (e) { 192 var t = 'on' + e.type; 193 this[t] && this[t](e); 194 }), 195 (r.prototype.onload = function () { 196 this.confirm(!0, 'onload'), this.unbindEvents(); 197 }), 198 (r.prototype.onerror = function () { 199 this.confirm(!1, 'onerror'), this.unbindEvents(); 200 }), 201 (r.prototype.unbindEvents = function () { 202 this.proxyImage.removeEventListener('load', this), 203 this.proxyImage.removeEventListener('error', this), 204 this.img.removeEventListener('load', this), 205 this.img.removeEventListener('error', this); 206 }), 207 (s.prototype = Object.create(r.prototype)),
208 (s.prototype.check = function () { 209 this.img.addEventListener('load', this), this.img.addEventListener('error', this), (this.img.src = this.url); 210 var e = this.getIsImageComplete(); 211 e && (this.confirm(0 !== this.img.naturalWidth, 'naturalWidth'), this.unbindEvents()); 212 }), 213 (s.prototype.unbindEvents = function () { 214 this.img.removeEventListener('load', this), this.img.removeEventListener('error', this); 215 }), 216 (s.prototype.confirm = function (e, t) { 217 (this.isLoaded = e), this.emitEvent('progress', [this, this.element, t]); 218 }), 219 (o.makeJQueryPlugin = function (t) { 220 (t = t || e.jQuery), 221 t && 222 ((h = t), 223 (h.fn.imagesLoaded = function (e, t) { 224 var i = new o(this, e, t); 225 return i.jqDeferred.promise(h(this)); 226 })); 227 }), 228 o.makeJQueryPlugin(), 229 o 230 ); 231 });
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.