1/*! 2* Lazy Load - JavaScript plugin for lazy loading images 3* 4* Copyright (c) 2007-2017 Mika Tuupola 5* 6* Licensed under the MIT license: 7* http://www.opensource.org/licenses/mit-license.php 8* 9* Project home: 10* https://appelsiini.net/projects/lazyload 11* 12* Version: 2.0.0-beta.2 13* 14*/(function(root,factory){if(typeof exports==="object"){module.exports=factory(root);}else if(typeof define==="function"&&define.amd){define([],factory(root));}else{root.LazyLoad=factory(root);}})(typeof global!=="undefined"?global:this.window||this.global,function(root){"use strict";const defaults={src:"data-src",srcset:"data-srcset",selector:".lazyload"};const extend=function(){let extended={};let deep=false;let i=0;let length=arguments.length;if(Object.prototype.toString.call(arguments[0])==="[object Boolean]"){deep=arguments[0];i++;} 15let merge=function(obj){for(let prop in obj){if(Object.prototype.hasOwnProperty.call(obj,prop)){if(deep&&Object.prototype.toString.call(obj[prop])==="[object Object]"){extended[prop]=extend(true,extended[prop],obj[prop]);}else{extended[prop]=obj[prop];}}}};for(;i<length;i++){let obj=arguments[i];merge(obj);} 16return extended;};function LazyLoad(images,options){this.settings=extend(defaults,options||{});this.images=images||document.querySelectorAll(this.settings.selector);this.observer=null;this.init();} 17LazyLoad.prototype={init:function(){if(!root.IntersectionObserver){this.loadImages();return;} 18let self=this;let observerConfig={root:null,rootMargin:"0px",threshold:[0]};this.observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.intersectionRatio>0){self.observer.unobserve(entry.target);let src=entry.target.getAttribute(self.settings.src);let srcset=entry.target.getAttribute(self.settings.srcset);if("img"===entry.target.tagName.toLowerCase()){if(src){entry.target.src=src;} 19if(srcset){entry.target.srcset=srcset;}}else{entry.target.style.backgroundImage="url("+src+")";}}});},observerConfig);this.images.forEach(function(image){self.observer.observe(image);});},loadAndDestroy:function(){if(!this.settings){return;} 20this.loadImages();this.destroy();},loadImages:function(){if(!this.settings){return;} 21let self=this;this.images.forEach(function(image){let src=image.getAttribute(self.settings.src);let srcset=image.getAttribute(self.settings.srcset);if("img"===image.tagName.toLowerCase()){if(src){image.src=src;} 22if(srcset){image.srcset=srcset;}}else{image.style.backgroundImage="url('"+src+"')";}});},destroy:function(){if(!this.settings){return;} 23this.observer.disconnect();this.settings=null;}};root.lazyload=function(images,options){return new LazyLoad(images,options);};if(root.jQuery){const $=root.jQuery;$.fn.lazyload=function(options){options=options||{};options.attribute=options.attribute||"data-src";new LazyLoad($.makeArray(this),options);return this;};} 24return LazyLoad;});
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.