vendor: 13,045 bytes, lines 1-502
1var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; 2if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } 3{ 4 let window = _____WB$wombat$assign$function_____("window"); 5 let self = _____WB$wombat$assign$function_____("self"); 6 let document = _____WB$wombat$assign$function_____("document"); 7 let location = _____WB$wombat$assign$function_____("location"); 8 let top = _____WB$wombat$assign$function_____("top"); 9 let parent = _____WB$wombat$assign$function_____("parent"); 10 let frames = _____WB$wombat$assign$function_____("frames"); 11 let opener = _____WB$wombat$assign$function_____("opener"); 12 13/*! 14 * imagesLoaded PACKAGED v4.1.0 15 * JavaScript is all like "You images are done yet or what?" 16 * MIT License 17 */ 18 19/** 20 * EvEmitter v1.0.1 21 * Lil' event emitter 22 * MIT License 23 */ 24 25/* jshint unused: true, undef: true, strict: true */ 26 27( function( global, factory ) { 28 // universal module definition 29 /* jshint strict: false */ /* globals define, module */ 30 if ( typeof define == 'function' && define.amd ) { 31 // AMD - RequireJS 32 define( 'ev-emitter/ev-emitter',factory ); 33 } else if ( typeof module == 'object' && module.exports ) { 34 // CommonJS - Browserify, Webpack 35 module.exports = factory(); 36 } else { 37 // Browser globals 38 global.EvEmitter = factory(); 39 } 40 41}( this, function() { 42 43 44 45function EvEmitter() {} 46 47var proto = EvEmitter.prototype; 48 49proto.on = function( eventName, listener ) { 50 if ( !eventName || !listener ) { 51 return; 52 } 53 // set events hash 54 var events = this._events = this._events || {}; 55 // set listeners array 56 var listeners = events[ eventName ] = events[ eventName ] || []; 57 // only add once 58 if ( listeners.indexOf( listener ) == -1 ) { 59 listeners.push( listener ); 60 } 61 62 return this; 63}; 64 65proto.once = function( eventName, listener ) { 66 if ( !eventName || !listener ) { 67 return; 68 } 69 // add event 70 this.on( eventName, listener ); 71 // set once flag 72 // set onceEvents hash 73 var onceEvents = this._onceEvents = this._onceEvents || {}; 74 // set onceListeners array 75 var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || []; 76 // set flag 77 onceListeners[ listener ] = true; 78 79 return this; 80}; 81 82proto.off = function( eventName, listener ) { 83 var listeners = this._events && this._events[ eventName ]; 84 if ( !listeners || !listeners.length ) { 85 return; 86 } 87 var index = listeners.indexOf( listener ); 88 if ( index != -1 ) { 89 listeners.splice( index, 1 ); 90 } 91 92 return this; 93}; 94 95proto.emitEvent = function( eventName, args ) { 96 var listeners = this._events && this._events[ eventName ]; 97 if ( !listeners || !listeners.length ) { 98 return; 99 } 100 var i = 0; 101 var listener = listeners[i]; 102 args = args || []; 103 // once stuff 104 var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; 105 106 while ( listener ) { 107 var isOnce = onceListeners && onceListeners[ listener ]; 108 if ( isOnce ) { 109 // remove listener 110 // remove before trigger to prevent recursion 111 this.off( eventName, listener ); 112 // unset once flag 113 delete onceListeners[ listener ]; 114 } 115 // trigger listener 116 listener.apply( this, args ); 117 // get next listener 118 i += isOnce ? 0 : 1; 119 listener = listeners[i]; 120 } 121 122 return this; 123}; 124 125return EvEmitter; 126 127})); 128 129/*! 130 * imagesLoaded v4.1.0 131 * JavaScript is all like "You images are done yet or what?" 132 * MIT License 133 */ 134 135( function( window, factory ) { 'use strict'; 136 // universal module definition 137 138 /*global define: false, module: false, require: false */ 139 140 if ( typeof define == 'function' && define.amd ) { 141 // AMD 142 define( [ 143 'ev-emitter/ev-emitter' 144 ], function( EvEmitter ) { 145 return factory( window, EvEmitter ); 146 }); 147 } else if ( typeof module == 'object' && module.exports ) { 148 // CommonJS 149 module.exports = factory( 150 window, 151 require('ev-emitter') 152 ); 153 } else { 154 // browser global 155 window.imagesLoaded = factory( 156 window, 157 window.EvEmitter 158 ); 159 } 160 161})( window, 162 163// -------------------------- factory -------------------------- // 164 165function factory( window, EvEmitter ) { 166 167 168 169var $ = window.jQuery; 170var console = window.console; 171 172// -------------------------- helpers -------------------------- // 173 174// extend objects 175function extend( a, b ) { 176 for ( var prop in b ) { 177 a[ prop ] = b[ prop ]; 178 } 179 return a; 180} 181 182// turn element or nodeList into an array 183function makeArray( obj ) { 184 var ary = []; 185 if ( Array.isArray( obj ) ) { 186 // use object if already an array 187 ary = obj; 188 } else if ( typeof obj.length == 'number' ) { 189 // convert nodeList to array 190 for ( var i=0; i < obj.length; i++ ) { 191 ary.push( obj[i] ); 192 } 193 } else { 194 // array of single index 195 ary.push( obj ); 196 } 197 return ary; 198} 199 200// -------------------------- imagesLoaded -------------------------- // 201 202/** 203 * @param {Array, Element, NodeList, String} elem 204 * @param {Object or Function} options - if function, use as callback 205 * @param {Function} onAlways - callback function 206 */ 207function ImagesLoaded( elem, options, onAlways ) { 208 // coerce ImagesLoaded() without new, to be new ImagesLoaded() 209 if ( !( this instanceof ImagesLoaded ) ) { 210 return new ImagesLoaded( elem, options, onAlways ); 211 } 212 // use elem as selector string 213 if ( typeof elem == 'string' ) { 214 elem = document.querySelectorAll( elem ); 215 } 216 217 this.elements = makeArray( elem ); 218 this.options = extend( {}, this.options ); 219 220 if ( typeof options == 'function' ) { 221 onAlways = options; 222 } else { 223 extend( this.options, options ); 224 } 225 226 if ( onAlways ) { 227 this.on( 'always', onAlways ); 228 } 229 230 this.getImages(); 231 232 if ( $ ) { 233 // add jQuery Deferred object 234 this.jqDeferred = new $.Deferred(); 235 } 236 237 // HACK check async to allow time to bind listeners 238 setTimeout( function() { 239 this.check(); 240 }.bind( this )); 241} 242 243ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); 244 245ImagesLoaded.prototype.options = {}; 246 247ImagesLoaded.prototype.getImages = function() { 248 this.images = []; 249 250 // filter & find items if we have an item selector 251 this.elements.forEach( this.addElementImages, this ); 252}; 253 254/** 255 * @param {Node} element 256 */ 257ImagesLoaded.prototype.addElementImages = function( elem ) { 258 // filter siblings 259 if ( elem.nodeName == 'IMG' ) { 260 this.addImage( elem ); 261 } 262 // get background image on element 263 if ( this.options.background === true ) { 264 this.addElementBackgroundImages( elem ); 265 } 266 267 // find children 268 // no non-element nodes, #143 269 var nodeType = elem.nodeType; 270 if ( !nodeType || !elementNodeTypes[ nodeType ] ) { 271 return; 272 } 273 var childImgs = elem.querySelectorAll('img'); 274 // concat childElems to filterFound array 275 for ( var i=0; i < childImgs.length; i++ ) { 276 var img = childImgs[i]; 277 this.addImage( img ); 278 } 279 280 // get child background images 281 if ( typeof this.options.background == 'string' ) { 282 var children = elem.querySelectorAll( this.options.background ); 283 for ( i=0; i < children.length; i++ ) { 284 var child = children[i]; 285 this.addElementBackgroundImages( child ); 286 } 287 } 288}; 289 290var elementNodeTypes = { 291 1: true, 292 9: true, 293 11: true 294}; 295 296ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { 297 var style = getComputedStyle( elem ); 298 if ( !style ) { 299 // Firefox returns null if in a hidden iframe https://bugzil.la/548397 300 return; 301 } 302 // get url inside url("...") 303 var reURL = /url\((['"])?(.*?)\1\)/gi; 304 var matches = reURL.exec( style.backgroundImage ); 305 while ( matches !== null ) { 306 var url = matches && matches[2]; 307 if ( url ) { 308 this.addBackground( url, elem ); 309 } 310 matches = reURL.exec( style.backgroundImage ); 311 } 312}; 313 314/** 315 * @param {Image} img 316 */ 317ImagesLoaded.prototype.addImage = function( img ) { 318 var loadingImage = new LoadingImage( img ); 319 this.images.push( loadingImage ); 320}; 321 322ImagesLoaded.prototype.addBackground = function( url, elem ) { 323 var background = new Background( url, elem ); 324 this.images.push( background ); 325}; 326 327ImagesLoaded.prototype.check = function() { 328 var _this = this; 329 this.progressedCount = 0; 330 this.hasAnyBroken = false; 331 // complete if no images 332 if ( !this.images.length ) { 333 this.complete(); 334 return; 335 } 336 337 function onProgress( image, elem, message ) { 338 // HACK - Chrome triggers event before object properties have changed. #83 339 setTimeout( function() { 340 _this.progress( image, elem, message ); 341 }); 342 } 343 344 this.images.forEach( function( loadingImage ) { 345 loadingImage.once( 'progress', onProgress ); 346 loadingImage.check(); 347 }); 348}; 349 350ImagesLoaded.prototype.progress = function( image, elem, message ) { 351 this.progressedCount++; 352 this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; 353 // progress event 354 this.emitEvent( 'progress', [ this, image, elem ] ); 355 if ( this.jqDeferred && this.jqDeferred.notify ) { 356 this.jqDeferred.notify( this, image ); 357 } 358 // check if completed 359 if ( this.progressedCount == this.images.length ) { 360 this.complete(); 361 } 362 363 if ( this.options.debug && console ) { 364 console.log( 'progress: ' + message, image, elem ); 365 } 366}; 367 368ImagesLoaded.prototype.complete = function() { 369 var eventName = this.hasAnyBroken ? 'fail' : 'done'; 370 this.isComplete = true; 371 this.emitEvent( eventName, [ this ] ); 372 this.emitEvent( 'always', [ this ] ); 373 if ( this.jqDeferred ) { 374 var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; 375 this.jqDeferred[ jqMethod ]( this ); 376 } 377}; 378 379// -------------------------- -------------------------- // 380 381function LoadingImage( img ) { 382 this.img = img; 383} 384 385LoadingImage.prototype = Object.create( EvEmitter.prototype ); 386 387LoadingImage.prototype.check = function() { 388 // If complete is true and browser supports natural sizes, 389 // try to check for image status manually. 390 var isComplete = this.getIsImageComplete(); 391 if ( isComplete ) { 392 // report based on naturalWidth 393 this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 394 return; 395 } 396 397 // If none of the checks above matched, simulate loading on detached element. 398 this.proxyImage = new Image(); 399 this.proxyImage.addEventListener( 'load', this ); 400 this.proxyImage.addEventListener( 'error', this ); 401 // bind to image as well for Firefox. #191 402 this.img.addEventListener( 'load', this ); 403 this.img.addEventListener( 'error', this ); 404 this.proxyImage.src = this.img.src; 405}; 406 407LoadingImage.prototype.getIsImageComplete = function() { 408 return this.img.complete && this.img.naturalWidth !== undefined; 409}; 410 411LoadingImage.prototype.confirm = function( isLoaded, message ) { 412 this.isLoaded = isLoaded; 413 this.emitEvent( 'progress', [ this, this.img, message ] ); 414}; 415 416// ----- events ----- // 417 418// trigger specified handler for event type 419LoadingImage.prototype.handleEvent = function( event ) { 420 var method = 'on' + event.type; 421 if ( this[ method ] ) { 422 this[ method ]( event ); 423 } 424}; 425 426LoadingImage.prototype.onload = function() { 427 this.confirm( true, 'onload' ); 428 this.unbindEvents(); 429}; 430 431LoadingImage.prototype.onerror = function() { 432 this.confirm( false, 'onerror' ); 433 this.unbindEvents(); 434}; 435 436LoadingImage.prototype.unbindEvents = function() { 437 this.proxyImage.removeEventListener( 'load', this ); 438 this.proxyImage.removeEventListener( 'error', this ); 439 this.img.removeEventListener( 'load', this ); 440 this.img.removeEventListener( 'error', this ); 441}; 442 443// -------------------------- Background -------------------------- // 444 445function Background( url, element ) { 446 this.url = url; 447 this.element = element; 448 this.img = new Image(); 449} 450 451// inherit LoadingImage prototype 452Background.prototype = Object.create( LoadingImage.prototype ); 453 454Background.prototype.check = function() { 455 this.img.addEventListener( 'load', this ); 456 this.img.addEventListener( 'error', this ); 457 this.img.src = this.url; 458 // check if image is already complete 459 var isComplete = this.getIsImageComplete(); 460 if ( isComplete ) { 461 this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 462 this.unbindEvents(); 463 } 464}; 465 466Background.prototype.unbindEvents = function() { 467 this.img.removeEventListener( 'load', this ); 468 this.img.removeEventListener( 'error', this ); 469}; 470 471Background.prototype.confirm = function( isLoaded, message ) { 472 this.isLoaded = isLoaded; 473 this.emitEvent( 'progress', [ this, this.element, message ] ); 474}; 475 476// -------------------------- jQuery -------------------------- // 477 478ImagesLoaded.makeJQueryPlugin = function( jQuery ) { 479 jQuery = jQuery || window.jQuery; 480 if ( !jQuery ) { 481 return; 482 } 483 // set local variable 484 $ = jQuery; 485 // $().imagesLoaded() 486 $.fn.imagesLoaded = function( options, callback ) { 487 var instance = new ImagesLoaded( this, options, callback ); 488 return instance.jqDeferred.promise( $(this) ); 489 }; 490}; 491// try making plugin 492ImagesLoaded.makeJQueryPlugin(); 493 494// -------------------------- -------------------------- // 495 496return ImagesLoaded; 497 498}); 499 500 501 502}
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.