1/*! 2 * imagesLoaded PACKAGED v3.0.4 3 * JavaScript is all like "You images are done yet or what?" 4 */ 5 6/*! 7 * EventEmitter v4.2.0 - git.io/ee 8 * Oliver Caldwell 9 * MIT license 10 * @preserve 11 */ 12 13(function () { 14 // Place the script in strict mode 15 'use strict'; 16 17 /** 18 * Class for managing events. 19 * Can be extended to provide event functionality in other classes. 20 * 21 * @class EventEmitter Manages event registering and emitting. 22 */ 23 function EventEmitter() {} 24 25 // Shortcuts to improve speed and size 26 27 // Easy access to the prototype 28 var proto = EventEmitter.prototype; 29 30 /** 31 * Finds the index of the listener for the event in it's storage array. 32 * 33 * @param {Function[]} listeners Array of listeners to search through. 34 * @param {Function} listener Method to look for. 35 * @return {Number} Index of the specified listener, -1 if not found 36 * @api private 37 */ 38 function indexOfListener(listeners, listener) { 39 var i = listeners.length; 40 while (i--) { 41 if (listeners[i].listener === listener) { 42 return i; 43 } 44 } 45 46 return -1; 47 } 48 49 /** 50 * Returns the listener array for the specified event. 51 * Will initialise the event object and listener arrays if required. 52 * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object c
vendor: 15,102 bytes, lines 52-437
52ontaining bar and baz. But only if you have either defined them with defineEvent or added some listeners to them. 53 * Each property in the object response is an array of listener functions. 54 * 55 * @param {String|RegExp} evt Name of the event to return the listeners from. 56 * @return {Function[]|Object} All listener functions for the event. 57 */ 58 proto.getListeners = function getListeners(evt) { 59 var events = this._getEvents(); 60 var response; 61 var key; 62 63 // Return a concatenated array of all matching events if 64 // the selector is a regular expression. 65 if (typeof evt === 'object') { 66 response = {}; 67 for (key in events) { 68 if (events.hasOwnProperty(key) && evt.test(key)) { 69 response[key] = events[key]; 70 } 71 } 72 } 73 else { 74 response = events[evt] || (events[evt] = []); 75 } 76 77 return response; 78 }; 79 80 /** 81 * Takes a list of listener objects and flattens it into a list of listener functions. 82 * 83 * @param {Object[]} listeners Raw listener objects. 84 * @return {Function[]} Just the listener functions. 85 */ 86 proto.flattenListeners = function flattenListeners(listeners) { 87 var flatListeners = []; 88 var i; 89 90 for (i = 0; i < listeners.length; i += 1) { 91 flatListeners.push(listeners[i].listener); 92 } 93 94 return flatListeners; 95 }; 96 97 /** 98 * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful. 99 * 100 * @param {String|RegExp} evt Name of the event to return the listeners from. 101 * @return {Object} All listener functions for an event in an object. 102 */ 103 proto.getListenersAsObject = function getListenersAsObject(evt) { 104 var listeners = this.getListeners(evt); 105 var response; 106 107 if (listeners instanceof Array) { 108 response = {}; 109 response[evt] = listeners; 110 } 111 112 return response || listeners; 113 }; 114 115 /** 116 * Adds a listener function to the specified event. 117 * The listener will not be added if it is a duplicate. 118 * If the listener returns true then it will be removed after it is called. 119 * If you pass a regular expression as the event name then the listener will be added to all events that match it. 120 * 121 * @param {String|RegExp} evt Name of the event to attach the listener to. 122 * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. 123 * @return {Object} Current instance of EventEmitter for chaining. 124 */ 125 proto.addListener = function addListener(evt, listener) { 126 var listeners = this.getListenersAsObject(evt); 127 var listenerIsWrapped = typeof listener === 'object'; 128 var key; 129 130 for (key in listeners) { 131 if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) { 132 listeners[key].push(listenerIsWrapped ? listener : { 133 listener: listener, 134 once: false 135 }); 136 } 137 } 138 139 return this; 140 }; 141 142 /** 143 * Alias of addListener 144 */ 145 proto.on = proto.addListener; 146 147 /** 148 * Semi-alias of addListener. It will add a listener that will be 149 * automatically removed after it's first execution. 150 * 151 * @param {String|RegExp} evt Name of the event to attach the listener to. 152 * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. 153 * @return {Object} Current instance of EventEmitter for chaining. 154 */ 155 proto.addOnceListener = function addOnceListener(evt, listener) { 156 return this.addListener(evt, { 157 listener: listener, 158 once: true 159 }); 160 }; 161 162 /** 163 * Alias of addOnceListener. 164 */ 165 proto.once = proto.addOnceListener; 166 167 /** 168 * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad. 169 * You need to tell it what event names should be matched by a regex. 170 * 171 * @param {String} evt Name of the event to create. 172 * @return {Object} Current instance of EventEmitter for chaining. 173 */ 174 proto.defineEvent = function defineEvent(evt) { 175 this.getListeners(evt); 176 return this; 177 }; 178 179 /** 180 * Uses defineEvent to define multiple events. 181 * 182 * @param {String[]} evts An array of event names to define. 183 * @return {Object} Current instance of EventEmitter for chaining. 184 */ 185 proto.defineEvents = function defineEvents(evts) { 186 for (var i = 0; i < evts.length; i += 1) { 187 this.defineEvent(evts[i]); 188 } 189 return this; 190 }; 191 192 /** 193 * Removes a listener function from the specified event. 194 * When passed a regular expression as the event name, it will remove the listener from all events that match it. 195 * 196 * @param {String|RegExp} evt Name of the event to remove the listener from. 197 * @param {Function} listener Method to remove from the event. 198 * @return {Object} Current instance of EventEmitter for chaining. 199 */ 200 proto.removeListener = function removeListener(evt, listener) { 201 var listeners = this.getListenersAsObject(evt); 202 var index; 203 var key; 204 205 for (key in listeners) { 206 if (listeners.hasOwnProperty(key)) { 207 index = indexOfListener(listeners[key], listener); 208 209 if (index !== -1) { 210 listeners[key].splice(index, 1); 211 } 212 } 213 } 214 215 return this; 216 }; 217 218 /** 219 * Alias of removeListener 220 */ 221 proto.off = proto.removeListener; 222 223 /** 224 * Adds listeners in bulk using the manipulateListeners method. 225 * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added. 226 * You can also pass it a regular expression to add the array of listeners to all events that match it. 227 * Yeah, this function does quite a bit. That's probably a bad thing. 228 * 229 * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once. 230 * @param {Function[]} [listeners] An optional array of listener functions to add. 231 * @return {Object} Current instance of EventEmitter for chaining. 232 */ 233 proto.addListeners = function addListeners(evt, listeners) { 234 // Pass through to manipulateListeners 235 return this.manipulateListeners(false, evt, listeners); 236 }; 237 238 /** 239 * Removes listeners in bulk using the manipulateListeners method. 240 * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. 241 * You can also pass it an event name and an array of listeners to be removed. 242 * You can also pass it a regular expression to remove the listeners from all events that match it. 243 * 244 * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once. 245 * @param {Function[]} [listeners] An optional array of listener functions to remove. 246 * @return {Object} Current instance of EventEmitter for chaining. 247 */ 248 proto.removeListeners = function removeListeners(evt, listeners) { 249 // Pass through to manipulateListeners 250 return this.manipulateListeners(true, evt, listeners); 251 }; 252 253 /** 254 * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level. 255 * The first argument will determine if the listeners are removed (true) or added (false). 256 * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. 257 * You can also pass it an event name and an array of listeners to be added/removed. 258 * You can also pass it a regular expression to manipulate the listeners of all events that match it. 259 * 260 * @param {Boolean} remove True if you want to remove listeners, false if you want to add. 261 * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once. 262 * @param {Function[]} [listeners] An optional array of listener functions to add/remove. 263 * @return {Object} Current instance of EventEmitter for chaining. 264 */ 265 proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) { 266 var i; 267 var value; 268 var single = remove ? this.removeListener : this.addListener; 269 var multiple = remove ? this.removeListeners : this.addListeners; 270 271 // If evt is an object then pass each of it's properties to this method 272 if (typeof evt === 'object' && !(evt instanceof RegExp)) { 273 for (i in evt) { 274 if (evt.hasOwnProperty(i) && (value = evt[i])) { 275 // Pass the single listener straight through to the singular method 276 if (typeof value === 'function') { 277 single.call(this, i, value); 278 } 279 else { 280 // Otherwise pass back to the multiple function 281 multiple.call(this, i, value); 282 } 283 } 284 } 285 } 286 else { 287 // So evt must be a string 288 // And listeners must be an array of listeners 289 // Loop over it and pass each one to the multiple method 290 i = listeners.length; 291 while (i--) { 292 single.call(this, evt, listeners[i]); 293 } 294 } 295 296 return this; 297 }; 298 299 /** 300 * Removes all listeners from a specified event. 301 * If you do not specify an event then all listeners will be removed. 302 * That means every event will be emptied. 303 * You can also pass a regex to remove all events that match it. 304 * 305 * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed. 306 * @return {Object} Current instance of EventEmitter for chaining. 307 */ 308 proto.removeEvent = function removeEvent(evt) { 309 var type = typeof evt; 310 var events = this._getEvents(); 311 var key; 312 313 // Remove different things depending on the state of evt 314 if (type === 'string') { 315 // Remove all listeners for the specified event 316 delete events[evt]; 317 } 318 else if (type === 'object') { 319 // Remove all events matching the regex. 320 for (key in events) { 321 if (events.hasOwnProperty(key) && evt.test(key)) { 322 delete events[key]; 323 } 324 } 325 } 326 else { 327 // Remove all listeners in all events 328 delete this._events; 329 } 330 331 return this; 332 }; 333 334 /** 335 * Emits an event of your choice. 336 * When emitted, every listener attached to that event will be executed. 337 * If you pass the optional argument array then those arguments will be passed to every listener upon execution. 338 * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. 339 * So they will not arrive within the array on the other side, they will be separate. 340 * You can also pass a regular expression to emit to all events that match it. 341 * 342 * @param {String|RegExp} evt Name of the event to emit and execute listeners for. 343 * @param {Array} [args] Optional array of arguments to be passed to each listener. 344 * @return {Object} Current instance of EventEmitter for chaining. 345 */ 346 proto.emitEvent = function emitEvent(evt, args) { 347 var listeners = this.getListenersAsObject(evt); 348 var listener; 349 var i; 350 var key; 351 var response; 352 353 for (key in listeners) { 354 if (listeners.hasOwnProperty(key)) { 355 i = listeners[key].length; 356 357 while (i--) { 358 // If the listener returns true then it shall be removed from the event 359 // The function is executed either with a basic call or an apply if there is an args array 360 listener = listeners[key][i]; 361 response = listener.listener.apply(this, args || []); 362 if (response === this._getOnceReturnValue() || listener.once === true) { 363 this.removeListener(evt, listeners[key][i].listener); 364 } 365 } 366 } 367 } 368 369 return this; 370 }; 371 372 /** 373 * Alias of emitEvent 374 */ 375 proto.trigger = proto.emitEvent; 376 377 /** 378 * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on. 379 * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. 380 * 381 * @param {String|RegExp} evt Name of the event to emit and execute listeners for. 382 * @param {...*} Optional additional arguments to be passed to each listener. 383 * @return {Object} Current instance of EventEmitter for chaining. 384 */ 385 proto.emit = function emit(evt) { 386 var args = Array.prototype.slice.call(arguments, 1); 387 return this.emitEvent(evt, args); 388 }; 389 390 /** 391 * Sets the current value to check against when executing listeners. If a 392 * listeners return value matches the one set here then it will be removed 393 * after execution. This value defaults to true. 394 * 395 * @param {*} value The new value to check for when executing listeners. 396 * @return {Object} Current instance of EventEmitter for chaining. 397 */ 398 proto.setOnceReturnValue = function setOnceReturnValue(value) { 399 this._onceReturnValue = value; 400 return this; 401 }; 402 403 /** 404 * Fetches the current value to check against when executing listeners. If 405 * the listeners return value matches this one then it should be removed 406 * automatically. It will return true by default. 407 * 408 * @return {*|Boolean} The current value to check for or the default, true. 409 * @api private 410 */ 411 proto._getOnceReturnValue = function _getOnceReturnValue() { 412 if (this.hasOwnProperty('_onceReturnValue')) { 413 return this._onceReturnValue; 414 } 415 else { 416 return true; 417 } 418 }; 419 420 /** 421 * Fetches the events object and creates one if required. 422 * 423 * @return {Object} The events storage object. 424 * @api private 425 */ 426 proto._getEvents = function _getEvents() { 427 return this._events || (this._events = {}); 428 }; 429 430 // Expose the class either via AMD, CommonJS or the global object 431 if (typeof define === 'function' && define.amd) { 432 // -------------------------------------------------- 433 // ADDED A MODULE ID 434 // -------------------------------------------------- 435 define("eventEmitter/EventEmitter", function () { 436 return EventEmitter; 437 });
438 } 439 else if (typeof module !== 'undefined' && module.exports){ 440 module.exports = EventEmitter; 441 } 442 else { 443 this.EventEmitter = EventEmitter; 444 } 445}.call(this)); 446 447/*! 448 * eventie v1.0.3 449 * event binding helper 450 * eventie.bind( elem, 'click', myFn ) 451 * eventie.unbind( elem, 'click', myFn ) 452 */ 453 454/*jshint browser: true, undef: true, unused: true */ 455/*global define: false */ 456 457( function( window ) { 458 459'use strict'; 460 461var docElem = document.documentElement; 462 463var bind = function() {}; 464 465if ( docElem.addEventListener ) { 466 bind = function( obj, type, fn ) { 467 obj.addEventListener( type, fn, false ); 468 }; 469} else if ( docElem.attachEvent ) { 470 bind = function( obj, type, fn ) { 471 obj[ type + fn ] = fn.handleEvent ? 472 function() { 473 var event = window.event; 474 // add event.target 475 event.target = event.target || event.srcElement; 476 fn.handleEvent.call( fn, event ); 477 } : 478 function() { 479 var event = window.event; 480 // add event.target 481 event.target = event.target || event.srcElement; 482 fn.call( obj, event ); 483 }; 484 obj.attachEvent( "on" + type, obj[ type + fn ] ); 485 }; 486} 487 488var unbind = function() {}; 489 490if ( docElem.removeEventListener ) { 491 unbind = function( obj, type, fn ) { 492 obj.removeEventListener( type, fn, false ); 493 }; 494} else if ( docElem.detachEvent ) { 495 unbind = function( obj, type, fn ) { 496 obj.detachEvent( "on" + type, obj[ type + fn ] ); 497 try { 498 delete obj[ type + fn ]; 499 } catch ( err ) { 500 // can't delete window object properties 501 obj[ type + fn ] = undefined; 502 } 503 }; 504} 505 506var eventie = { 507 bind: bind, 508 unbind: unbind 509}; 510 511// transport 512if ( typeof define === 'function' && define.amd ) { 513 // AMD 514 // -------------------------------------------------- 515 // ADDED A MODULE ID 516 // -------------------------------------------------- 517 define("eventie/eventie", eventie ); 518} else { 519 // browser global 520 window.eventie = eventie; 521} 522 523})( this ); 524 525/*! 526 * imagesLoaded v3.0.4 527 * JavaScript is all like "You images are done yet or what?" 528 */ 529 530( function( window ) { 531 532'use strict'; 533 534var $ = window.jQuery; 535var console = window.console; 536var hasConsole = typeof console !== 'undefined'; 537 538// -------------------------- helpers -------------------------- // 539 540// extend objects 541function extend( a, b ) { 542 for ( var prop in b ) { 543 a[ prop ] = b[ prop ]; 544 } 545 return a; 546} 547 548var objToString = Object.prototype.toString; 549function isArray( obj ) { 550 return objToString.call( obj ) === '[object Array]'; 551} 552 553// turn element or nodeList into an array 554function makeArray( obj ) { 555 var ary = []; 556 if ( isArray( obj ) ) { 557 // use object if already an array 558 ary = obj; 559 } else if ( typeof obj.length === 'number' ) { 560 // convert nodeList to array 561 for ( var i=0, len = obj.length; i < len; i++ ) { 562 ary.push( obj[i] ); 563 } 564 } else { 565 // array of single index 566 ary.push( obj ); 567 } 568 return ary; 569} 570 571// -------------------------- -------------------------- // 572 573function defineImagesLoaded( EventEmitter, eventie ) { 574 575 /** 576 * @param {Array, Element, NodeList, String} elem 577 * @param {Object or Function} options - if function, use as callback 578 * @param {Function} onAlways - callback function 579 */ 580 function ImagesLoaded( elem, options, onAlways ) { 581 // coerce ImagesLoaded() without new, to be new ImagesLoaded() 582 if ( !( this instanceof ImagesLoaded ) ) { 583 return new ImagesLoaded( elem, options ); 584 } 585 // use elem as selector string 586 if ( typeof elem === 'string' ) { 587 elem = document.querySelectorAll( elem ); 588 } 589 590 this.elements = makeArray( elem ); 591 this.options = extend( {}, this.options ); 592 593 if ( typeof options === 'function' ) { 594 onAlways = options; 595 } else { 596 extend( this.options, options ); 597 } 598 599 if ( onAlways ) { 600 this.on( 'always', onAlways ); 601 } 602 603 this.getImages(); 604 605 if ( $ ) { 606 // add jQuery Deferred object 607 this.jqDeferred = new $.Deferred(); 608 } 609 610 // HACK check async to allow time to bind listeners 611 var _this = this; 612 setTimeout( function() { 613 _this.check(); 614 });
615 } 616 617 ImagesLoaded.prototype = new EventEmitter(); 618 619 ImagesLoaded.prototype.options = {}; 620 621 ImagesLoaded.prototype.getImages = function() { 622 this.images = []; 623 624 // filter & find items if we have an item selector 625 for ( var i=0, len = this.elements.length; i < len; i++ ) { 626 var elem = this.elements[i]; 627 // filter siblings 628 if ( elem.nodeName === 'IMG' ) { 629 this.addImage( elem ); 630 } 631 // find children 632 var childElems = elem.querySelectorAll('img'); 633 // concat childElems to filterFound array 634 for ( var j=0, jLen = childElems.length; j < jLen; j++ ) { 635 var img = childElems[j]; 636 this.addImage( img ); 637 } 638 } 639 }; 640 641 /** 642 * @param {Image} img 643 */ 644 ImagesLoaded.prototype.addImage = function( img ) { 645 var loadingImage = new LoadingImage( img ); 646 this.images.push( loadingImage ); 647 }; 648 649 ImagesLoaded.prototype.check = function() { 650 var _this = this; 651 var checkedCount = 0; 652 var length = this.images.length; 653 this.hasAnyBroken = false; 654 // complete if no images 655 if ( !length ) { 656 this.complete(); 657 return; 658 } 659 660 function onConfirm( image, message ) { 661 if ( _this.options.debug && hasConsole ) { 662 console.log( 'confirm', image, message ); 663 } 664 665 _this.progress( image ); 666 checkedCount++; 667 if ( checkedCount === length ) { 668 _this.complete(); 669 } 670 return true; // bind once 671 } 672 673 for ( var i=0; i < length; i++ ) { 674 var loadingImage = this.images[i]; 675 loadingImage.on( 'confirm', onConfirm ); 676 loadingImage.check(); 677 } 678 }; 679 680 ImagesLoaded.prototype.progress = function( image ) { 681 this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; 682 // HACK - Chrome triggers event before object properties have changed. #83 683 var _this = this; 684 setTimeout( function() { 685 _this.emit( 'progress', _this, image ); 686 if ( _this.jqDeferred ) { 687 _this.jqDeferred.notify( _this, image ); 688 } 689 }); 690 }; 691 692 ImagesLoaded.prototype.complete = function() { 693 var eventName = this.hasAnyBroken ? 'fail' : 'done'; 694 this.isComplete = true; 695 var _this = this; 696 // HACK - another setTimeout so that confirm happens after progress 697 setTimeout( function() { 698 _this.emit( eventName, _this ); 699 _this.emit( 'always', _this ); 700 if ( _this.jqDeferred ) { 701 var jqMethod = _this.hasAnyBroken ? 'reject' : 'resolve'; 702 _this.jqDeferred[ jqMethod ]( _this ); 703 } 704 }); 705 }; 706 707 // -------------------------- jquery -------------------------- // 708 709 if ( $ ) { 710 $.fn.imagesLoaded = function( options, callback ) { 711 var instance = new ImagesLoaded( this, options, callback ); 712 return instance.jqDeferred.promise( $(this) ); 713 }; 714 } 715 716 717 // -------------------------- -------------------------- // 718 719 var cache = {}; 720 721 function LoadingImage( img ) { 722 this.img = img; 723 } 724 725 LoadingImage.prototype = new EventEmitter(); 726 727 LoadingImage.prototype.check = function() { 728 // first check cached any previous images that have same src 729 var cached = cache[ this.img.src ]; 730 if ( cached ) { 731 this.useCached( cached ); 732 return; 733 } 734 // add this to cache 735 cache[ this.img.src ] = this; 736 737 // If complete is true and browser supports natural sizes, 738 // try to check for image status manually. 739 if ( this.img.complete && this.img.naturalWidth !== undefined ) { 740 // report based on naturalWidth 741 this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 742 return; 743 } 744 745 // If none of the checks above matched, simulate loading on detached element. 746 var proxyImage = this.proxyImage = new Image(); 747 eventie.bind( proxyImage, 'load', this ); 748 eventie.bind( proxyImage, 'error', this ); 749 proxyImage.src = this.img.src; 750 }; 751 752 LoadingImage.prototype.useCached = function( cached ) { 753 if ( cached.isConfirmed ) {
754 this.confirm( cached.isLoaded, 'cached was confirmed' ); 755 } else { 756 var _this = this; 757 cached.on( 'confirm', function( image ) { 758 _this.confirm( image.isLoaded, 'cache emitted confirmed' ); 759 return true; // bind once 760 }); 761 } 762 }; 763 764 LoadingImage.prototype.confirm = function( isLoaded, message ) { 765 this.isConfirmed = true; 766 this.isLoaded = isLoaded; 767 this.emit( 'confirm', this, message ); 768 }; 769 770 // trigger specified handler for event type 771 LoadingImage.prototype.handleEvent = function( event ) { 772 var method = 'on' + event.type; 773 if ( this[ method ] ) { 774 this[ method ]( event ); 775 } 776 }; 777 778 LoadingImage.prototype.onload = function() { 779 this.confirm( true, 'onload' ); 780 this.unbindProxyEvents(); 781 }; 782 783 LoadingImage.prototype.onerror = function() { 784 this.confirm( false, 'onerror' ); 785 this.unbindProxyEvents(); 786 }; 787 788 LoadingImage.prototype.unbindProxyEvents = function() { 789 eventie.unbind( this.proxyImage, 'load', this ); 790 eventie.unbind( this.proxyImage, 'error', this ); 791 }; 792 793 // ----- ----- // 794 795 return ImagesLoaded; 796} 797 798// -------------------------- transport -------------------------- // 799 800if ( typeof define === 'function' && define.amd ) { 801 // AMD 802 // -------------------------------------------------- 803 // ADDED A MODULE ID 804 // -------------------------------------------------- 805 define("imagesLoaded", [ 806 'eventEmitter/EventEmitter', 807 'eventie/eventie' 808 ], 809 defineImagesLoaded ); 810} else { 811 // browser global 812 window.imagesLoaded = defineImagesLoaded( 813 window.EventEmitter, 814 window.eventie 815 ); 816} 817 818})( window );
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.