lazysizes
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -59,3 +59,3 @@ (function (window, factory) { | ||
var updatePolyfill = function (el, full){ | ||
var imageData, src; | ||
var imageData, attr; | ||
if(!window.HTMLPictureElement){ | ||
@@ -66,6 +66,7 @@ | ||
} else if(window.respimage){ | ||
if(full && (full.srcset || full.src)){ | ||
if(full && (attr = (full.srcset && 'srcset') || (full.src && 'src'))){ | ||
imageData = el[respimage._.ns]; | ||
if(imageData){ | ||
imageData[full.srcset ? 'srcset' : 'src'] = undefined; | ||
if(imageData && imageData[attr] != full[attr] && el.getAttribute(attr) == full[attr]){ | ||
imageData[attr] = undefined; | ||
} | ||
@@ -86,10 +87,4 @@ } | ||
var getWidth = function(elem, parent){ | ||
var width, alt; | ||
if(!elem._lazysizesWidth){ | ||
alt = elem.getAttribute('alt'); | ||
elem.alt = ''; | ||
} | ||
var width = elem.offsetWidth; | ||
width = elem.offsetWidth; | ||
while(width < lazySizesConfig.minSize && parent && parent != document.body && !elem._lazysizesWidth){ | ||
@@ -100,9 +95,2 @@ width = parent.offsetWidth; | ||
if(!elem._lazysizesWidth){ | ||
if(alt == null){ | ||
elem.removeAttribute('alt'); | ||
} else { | ||
elem.alt = alt; | ||
} | ||
} | ||
return width; | ||
@@ -367,3 +355,3 @@ }; | ||
if(srcset || sizes){ | ||
if(srcset || sizes || isPicture){ | ||
updatePolyfill(elem, {srcset: srcset, src: src}); | ||
@@ -529,3 +517,3 @@ } | ||
onlyLargerSizes: true, | ||
minSize: 40 | ||
minSize: 50 | ||
}; | ||
@@ -543,4 +531,6 @@ | ||
autoSizer.init(); | ||
loader.init(); | ||
setTimeout(function(){ | ||
autoSizer.init(); | ||
loader.init(); | ||
}); | ||
})(); | ||
@@ -547,0 +537,0 @@ |
@@ -1,3 +0,3 @@ | ||
/*! lazysizes - v0.8.0 - 2015-01-19 | ||
/*! lazysizes - v0.8.1 - 2015-01-19 | ||
Licensed MIT */ | ||
!function(a,b){a.lazySizes=b(a,a.document),"function"==typeof define&&define.amd&&define(a.lazySizes)}(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d=b.documentElement,e=/^picture$/i,f=["load","error","lazyincluded","_lazyloaded"],g=function(a,b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");return a.className.match(c)&&c},h=function(a,b){g(a,b)||(a.className+=" "+b)},i=function(a,b){var c;(c=g(a,b))&&(a.className=a.className.replace(c," "))},j=function(a,b,c){var d=c?"addEventListener":"removeEventListener";c&&j(a,b),f.forEach(function(c){a[d](c,b)})},k=function(a,c,d){var e=b.createEvent("Event");return e.initEvent(c,!0,!0),e.details=d||{},a.dispatchEvent(e),e},l=function(b,c){var d;a.HTMLPictureElement||(a.picturefill?picturefill({reevaluate:!0,reparse:!0,elements:[b]}):a.respimage?(c&&(c.srcset||c.src)&&(d=b[respimage._.ns],d&&(d[c.srcset?"srcset":"src"]=void 0)),respimage({reparse:!0,elements:[b]})):c&&c.src&&(b.src=c.src))},m=function(a,b){return getComputedStyle(a,null)[b]},n=function(a,d){var e,f;for(a._lazysizesWidth||(f=a.getAttribute("alt"),a.alt=""),e=a.offsetWidth;e<c.minSize&&d&&d!=b.body&&!a._lazysizesWidth;)e=d.offsetWidth,d=d.parentNode;return a._lazysizesWidth||(null==f?a.removeAttribute("alt"):a.alt=f),e},o=function(a){var b;return setInterval(function(){b&&(b=!1,a())},66),function(c){c===!0?(b=!1,a()):b=!0}},p=function(){var f,g,n,p,r,s,t,u,v,w,x,y,z=navigator.userAgent,A=a.HTMLPictureElement&&z.match(/hrome\/(\d+)/)&&40==RegExp.$1,B=/blink|webkit/i.test(z),C=/^img$/i,D=/^iframe$/i,E=-2,F=E,G=E,H=E,I=!0,J=0,K=0,L=0,M=function(a){K--,a&&a.target&&j(a.target,M),(!a||0>K||!a.target)&&(K=0)},N=function(a,c){var e,f=a,g="hidden"!=m(a,"visibility");for(v-=c,y+=c,w-=c,x+=c;g&&(f=f.offsetParent)&&f!=d&&f!=b.body;)g=p&&4>K||(m(f,"opacity")||1)>0,g&&"visible"!=m(f,"overflow")&&(e=f.getBoundingClientRect(),g=x>e.left-1&&w<e.right+1&&y>e.top-1&&v<e.bottom+1);return g},O=function(){var a,b,d,e,h,i,j,k=f.length,l=Date.now(),m=L;if(I||T(),k){for(;k>m&&f[m];m++,L++)if((i=f[m].getAttribute("data-expand"))&&(e=1*i)||(e=H),!(K>6&&(!i||"src"in f[m])))if(K>3&&e>E&&(e=E),j!==e&&(t=innerWidth+e,u=innerHeight+e,h=-1*e,j=e),a=f[m].getBoundingClientRect(),(y=a.bottom)>=h&&(v=a.top)<=u&&(x=a.right)>=h&&(w=a.left)<=t&&(y||x||w||v)&&(p&&H==F&&3>K&&4>J&&!i||N(f[m],e)))L--,l++,S(f[m]),d=!0;else{if(!s&&Date.now()-l>3)return L++,s=!0,void P();!d&&p&&!b&&3>K&&4>J&&(g[0]||c.preloadAfterLoad)&&(g[0]||!i&&(y||x||w||v||"auto"!=f[m].getAttribute(c.sizesAttr)))&&(b=g[0]||f[m])}L=0,s=!1,J++,G>H&&2>K&&J>4?(H=G,J=0,P()):H!=F&&(H=F),b&&!d&&S(b)}},P=o(O),Q=function(a){h(a.target,c.loadedClass),i(a.target,c.loadingClass),j(a.target,Q)},R=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.setAttribute("src",b)}},S=function(a,b){var d,f,g,m,n,o,s,t,u,v,w,x=a.currentSrc||a.src,y=C.test(a.nodeName);if(B||p||!y||!x||a.complete){if(!(v=k(a,"lazybeforeunveil",{force:!!b})).defaultPrevented){if(n=a.getAttribute(c.sizesAttr)||a.getAttribute("sizes"),n&&("auto"==n?q.updateElem(a,!0):a.setAttribute("sizes",n)),s=a.getAttribute(c.srcsetAttr),o=a.getAttribute(c.srcAttr),w=v.details.firesLoad||"src"in a&&(s||o),w&&(K++,j(a,M,!0),clearTimeout(r),r=setTimeout(M,3e3),y&&(t=a.parentNode,u=e.test(t.nodeName||""))),s||o){if(u)for(d=t.getElementsByTagName("source"),f=0,g=d.length;g>f;f++)m=d[f].getAttribute(c.srcsetAttr),m&&d[f].setAttribute("srcset",m);s?(a.setAttribute("srcset",s),A&&n&&a.removeAttribute("src")):o&&(D.test(a.nodeName)?R(a,o):a.setAttribute("src",o))}c.addClasses&&(h(a,c.loadingClass),j(a,Q,!0))}setTimeout(function(){"auto"==n&&h(a,c.autosizesClass),(s||n)&&l(a,{srcset:s,src:o}),i(a,c.lazyClass),(!w||a.complete&&x==(a.currentSrc||a.src))&&(w&&M({target:a}),c.addClasses&&Q({target:a})),a=null})}},T=function(){n&&!I&&(F=Math.max(Math.min(c.expand||c.threshold||150,300),9),G=Math.min(4*F,Math.max(1.1*innerHeight,d.clientHeight,3*F))),I=!0},U=function(){n=!0,I=!1},V=function(){p=!0,U(),P(!0)},W=function(){f=b.getElementsByClassName(c.lazyClass),g=b.getElementsByClassName(c.lazyClass+" "+c.preloadClass),c.scroll&&addEventListener("scroll",P,!0),addEventListener("resize",function(){I=!1,P()},!1),a.MutationObserver?new MutationObserver(P).observe(d,{childList:!0,subtree:!0,attributes:!0}):(d.addEventListener("DOMNodeInserted",P,!0),d.addEventListener("DOMAttrModified",P,!0)),addEventListener("hashchange",P,!0),["transitionstart","transitionend","load","focus","mouseover","animationend"].forEach(function(a){b.addEventListener(a,P,!0)}),(p=/d$|^c/.test(b.readyState))||(addEventListener("load",V,!1),b.addEventListener("DOMContentLoaded",P,!1)),setTimeout(U,666),P()};return{init:W,checkElems:P,unveil:S}}(),q=function(){var a,d=function(a,b){var d,f,g,h,i,j=a.parentNode;if(j&&(d=n(a,j),i=k(a,"lazybeforesizes",{width:d,dataAttr:!!b}),!i.defaultPrevented&&(d=i.details.width,d&&d!==a._lazysizesWidth&&(!c.onlyLargerSizes||!a._lazysizesWidth||a._lazysizesWidth<d)))){if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),e.test(j.nodeName||""))for(f=j.getElementsByTagName("source"),g=0,h=f.length;h>g;g++)f[g].setAttribute("sizes",d);i.details.dataAttr||l(a,i.details)}},f=function(){var b,c=a.length;if(c)for(b=0;c>b;b++)d(a[b])},g=o(f),h=function(){a=b.getElementsByClassName(c.autosizesClass),addEventListener("resize",g,!1)};return{init:h,checkElems:g,updateElem:d}}();return function(){var b,d={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",scroll:!0,autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",onlyLargerSizes:!0,minSize:40};c=a.lazySizesConfig||{};for(b in d)b in c||(c[b]=d[b]);a.lazySizesConfig=c,q.init(),p.init()}(),{cfg:c,autoSizer:q,loader:p,updateAllSizes:q.updateElems,updateAllLazy:p.checkElems,unveilLazy:p.unveil,uS:q.updateElem,uP:l,aC:h,rC:i,hC:g,fire:k,gW:n}}}); | ||
!function(a,b){a.lazySizes=b(a,a.document),"function"==typeof define&&define.amd&&define(a.lazySizes)}(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d=b.documentElement,e=/^picture$/i,f=["load","error","lazyincluded","_lazyloaded"],g=function(a,b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");return a.className.match(c)&&c},h=function(a,b){g(a,b)||(a.className+=" "+b)},i=function(a,b){var c;(c=g(a,b))&&(a.className=a.className.replace(c," "))},j=function(a,b,c){var d=c?"addEventListener":"removeEventListener";c&&j(a,b),f.forEach(function(c){a[d](c,b)})},k=function(a,c,d){var e=b.createEvent("Event");return e.initEvent(c,!0,!0),e.details=d||{},a.dispatchEvent(e),e},l=function(b,c){var d,e;a.HTMLPictureElement||(a.picturefill?picturefill({reevaluate:!0,reparse:!0,elements:[b]}):a.respimage?(c&&(e=c.srcset&&"srcset"||c.src&&"src")&&(d=b[respimage._.ns],d&&d[e]!=c[e]&&b.getAttribute(e)==c[e]&&(d[e]=void 0)),respimage({reparse:!0,elements:[b]})):c&&c.src&&(b.src=c.src))},m=function(a,b){return getComputedStyle(a,null)[b]},n=function(a,d){for(var e=a.offsetWidth;e<c.minSize&&d&&d!=b.body&&!a._lazysizesWidth;)e=d.offsetWidth,d=d.parentNode;return e},o=function(a){var b;return setInterval(function(){b&&(b=!1,a())},66),function(c){c===!0?(b=!1,a()):b=!0}},p=function(){var f,g,n,p,r,s,t,u,v,w,x,y,z=navigator.userAgent,A=a.HTMLPictureElement&&z.match(/hrome\/(\d+)/)&&40==RegExp.$1,B=/blink|webkit/i.test(z),C=/^img$/i,D=/^iframe$/i,E=-2,F=E,G=E,H=E,I=!0,J=0,K=0,L=0,M=function(a){K--,a&&a.target&&j(a.target,M),(!a||0>K||!a.target)&&(K=0)},N=function(a,c){var e,f=a,g="hidden"!=m(a,"visibility");for(v-=c,y+=c,w-=c,x+=c;g&&(f=f.offsetParent)&&f!=d&&f!=b.body;)g=p&&4>K||(m(f,"opacity")||1)>0,g&&"visible"!=m(f,"overflow")&&(e=f.getBoundingClientRect(),g=x>e.left-1&&w<e.right+1&&y>e.top-1&&v<e.bottom+1);return g},O=function(){var a,b,d,e,h,i,j,k=f.length,l=Date.now(),m=L;if(I||T(),k){for(;k>m&&f[m];m++,L++)if((i=f[m].getAttribute("data-expand"))&&(e=1*i)||(e=H),!(K>6&&(!i||"src"in f[m])))if(K>3&&e>E&&(e=E),j!==e&&(t=innerWidth+e,u=innerHeight+e,h=-1*e,j=e),a=f[m].getBoundingClientRect(),(y=a.bottom)>=h&&(v=a.top)<=u&&(x=a.right)>=h&&(w=a.left)<=t&&(y||x||w||v)&&(p&&H==F&&3>K&&4>J&&!i||N(f[m],e)))L--,l++,S(f[m]),d=!0;else{if(!s&&Date.now()-l>3)return L++,s=!0,void P();!d&&p&&!b&&3>K&&4>J&&(g[0]||c.preloadAfterLoad)&&(g[0]||!i&&(y||x||w||v||"auto"!=f[m].getAttribute(c.sizesAttr)))&&(b=g[0]||f[m])}L=0,s=!1,J++,G>H&&2>K&&J>4?(H=G,J=0,P()):H!=F&&(H=F),b&&!d&&S(b)}},P=o(O),Q=function(a){h(a.target,c.loadedClass),i(a.target,c.loadingClass),j(a.target,Q)},R=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.setAttribute("src",b)}},S=function(a,b){var d,f,g,m,n,o,s,t,u,v,w,x=a.currentSrc||a.src,y=C.test(a.nodeName);if(B||p||!y||!x||a.complete){if(!(v=k(a,"lazybeforeunveil",{force:!!b})).defaultPrevented){if(n=a.getAttribute(c.sizesAttr)||a.getAttribute("sizes"),n&&("auto"==n?q.updateElem(a,!0):a.setAttribute("sizes",n)),s=a.getAttribute(c.srcsetAttr),o=a.getAttribute(c.srcAttr),w=v.details.firesLoad||"src"in a&&(s||o),w&&(K++,j(a,M,!0),clearTimeout(r),r=setTimeout(M,3e3),y&&(t=a.parentNode,u=e.test(t.nodeName||""))),s||o){if(u)for(d=t.getElementsByTagName("source"),f=0,g=d.length;g>f;f++)m=d[f].getAttribute(c.srcsetAttr),m&&d[f].setAttribute("srcset",m);s?(a.setAttribute("srcset",s),A&&n&&a.removeAttribute("src")):o&&(D.test(a.nodeName)?R(a,o):a.setAttribute("src",o))}c.addClasses&&(h(a,c.loadingClass),j(a,Q,!0))}setTimeout(function(){"auto"==n&&h(a,c.autosizesClass),(s||n||u)&&l(a,{srcset:s,src:o}),i(a,c.lazyClass),(!w||a.complete&&x==(a.currentSrc||a.src))&&(w&&M({target:a}),c.addClasses&&Q({target:a})),a=null})}},T=function(){n&&!I&&(F=Math.max(Math.min(c.expand||c.threshold||150,300),9),G=Math.min(4*F,Math.max(1.1*innerHeight,d.clientHeight,3*F))),I=!0},U=function(){n=!0,I=!1},V=function(){p=!0,U(),P(!0)},W=function(){f=b.getElementsByClassName(c.lazyClass),g=b.getElementsByClassName(c.lazyClass+" "+c.preloadClass),c.scroll&&addEventListener("scroll",P,!0),addEventListener("resize",function(){I=!1,P()},!1),a.MutationObserver?new MutationObserver(P).observe(d,{childList:!0,subtree:!0,attributes:!0}):(d.addEventListener("DOMNodeInserted",P,!0),d.addEventListener("DOMAttrModified",P,!0)),addEventListener("hashchange",P,!0),["transitionstart","transitionend","load","focus","mouseover","animationend"].forEach(function(a){b.addEventListener(a,P,!0)}),(p=/d$|^c/.test(b.readyState))||(addEventListener("load",V,!1),b.addEventListener("DOMContentLoaded",P,!1)),setTimeout(U,666),P()};return{init:W,checkElems:P,unveil:S}}(),q=function(){var a,d=function(a,b){var d,f,g,h,i,j=a.parentNode;if(j&&(d=n(a,j),i=k(a,"lazybeforesizes",{width:d,dataAttr:!!b}),!i.defaultPrevented&&(d=i.details.width,d&&d!==a._lazysizesWidth&&(!c.onlyLargerSizes||!a._lazysizesWidth||a._lazysizesWidth<d)))){if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),e.test(j.nodeName||""))for(f=j.getElementsByTagName("source"),g=0,h=f.length;h>g;g++)f[g].setAttribute("sizes",d);i.details.dataAttr||l(a,i.details)}},f=function(){var b,c=a.length;if(c)for(b=0;c>b;b++)d(a[b])},g=o(f),h=function(){a=b.getElementsByClassName(c.autosizesClass),addEventListener("resize",g,!1)};return{init:h,checkElems:g,updateElem:d}}();return function(){var b,d={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",scroll:!0,autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",onlyLargerSizes:!0,minSize:50};c=a.lazySizesConfig||{};for(b in d)b in c||(c[b]=d[b]);a.lazySizesConfig=c,setTimeout(function(){q.init(),p.init()})}(),{cfg:c,autoSizer:q,loader:p,updateAllSizes:q.updateElems,updateAllLazy:p.checkElems,unveilLazy:p.unveil,uS:q.updateElem,uP:l,aC:h,rC:i,hC:g,fire:k,gW:n}}}); |
{ | ||
"name": "lazysizes", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"filename": "lazysizes.min.js", | ||
@@ -16,2 +16,3 @@ "author": "Alexander Farkas <info@corrupt-system.de>", | ||
"grunt-contrib-jshint": "~0.10.0", | ||
"grunt-contrib-qunit": "^0.5.2", | ||
"grunt-contrib-uglify": "^0.7.0", | ||
@@ -21,3 +22,6 @@ "grunt-contrib-watch": "~0.4.0", | ||
"grunt-plato": "^1.2.1", | ||
"grunt-uncss": "~0.3.7" | ||
"grunt-uncss": "~0.3.7", | ||
"jquery-deparam": "^0.1.0", | ||
"qunitjs": "^1.17.0", | ||
"respimage": "^1.2.1" | ||
}, | ||
@@ -24,0 +28,0 @@ "npmName": "lazysizes", |
@@ -1,3 +0,3 @@ | ||
/*! lazysizes - v0.8.0 - 2015-01-19 | ||
/*! lazysizes - v0.8.1 - 2015-01-19 | ||
Licensed MIT */ | ||
addEventListener("lazybeforeunveil",function(){"use strict";var a=document.createElement("div");return function(b){var c,d,e,f;!b.defaultPrevented&&(c=b.target.getAttribute("data-bgset"))&&(d=document.createElement("img"),f=b.target.getAttribute("data-sizes"),d.setAttribute("sizes",f&&"auto"!=f?f:b.target.offsetWidth+"px"),e=function(){var c=d.currentSrc||d.src;c&&(b.target.style.backgroundImage="url("+c+")"),b.details.firesLoad=!1,lazySizes.fire(b.target,"_lazyloaded"),d.onload=null,d.onerror=null,a.removeChild(d),d=null},b.details.firesLoad=!0,d.onload=e,d.onerror=e,d.setAttribute("srcset",c),a.appendChild(d),window.HTMLPictureElement||(window.respimage?respimage({elements:[d]}):window.picturefill&&picturefill({elements:[d]})),d&&d.onload&&d.complete&&(d.src||d.currentSrc)&&e())}}()); |
@@ -1,3 +0,3 @@ | ||
/*! lazysizes - v0.8.0 - 2015-01-19 | ||
/*! lazysizes - v0.8.1 - 2015-01-19 | ||
Licensed MIT */ | ||
!function(a,b){"use strict";function c(a){a.match(z)?this.urls[RegExp.$1]=t.map[RegExp.$2]||RegExp.$2:this.urls.include=t.map[a]||a}function d(a){var b,d,e;return a=a.trim(),a=t.map[a]||a,d=a.match(A),d?(e=RegExp.$1,b={condition:s.include.conditions[RegExp.$3]||RegExp.$2||null,name:RegExp.$3}):(e=a,b={condition:null,name:""}),b.urls={},(t.map[e]||e).split(y).forEach(c,b),!b.urls.include&&b.urls.amd&&(this.saved=!0,b.initial=this),b}function e(a){var b,c,e=a.getAttribute("data-include")||"",f=a.lazyInclude;return f&&f.str==e||(c={saved:!1,content:null},f={str:e,candidates:(t.map[e]||e).split(w).map(d,c)},!(b=f.candidates.length)||f.candidates[b-1].condition?(c.saved=!0,f.candidates.push({urls:{},condition:null,name:"initial",content:c})):c.saved&&1==f.candidates.length&&(c.saved=!1),f.initialContent=c,c.saved&&(c.content=a.innerHTML),a.lazyInclude=f,f.candidates.length>1?lazySizes.aC(a,"lazyconditionalinclude"):lazySizes.rC(a,"lazyconditionalinclude")),f}function f(b,c){var d=!c.condition;return c.condition&&(g(),v[c.name]?d=!0:a.matchMedia&&"string"==typeof c.condition?d=(matchMedia(c.condition)||{}).matches:"function"==typeof c.condition&&(d=c.condition(b,c))),d}function g(){var a;v||(u||(u=b.querySelector(t.contentElement)),u?(a=(getComputedStyle(u,":after").getPropertyValue("content")||"none").replace(B,""),v={},a&&(v[a]=1),a=(getComputedStyle(u,":before").getPropertyValue("content")||"none").replace(B,""),a&&(v[a]=1)):v={})}function h(a){var b,c,d=a.lazyInclude;if(d&&d.candidates)for(b=0;b<d.candidates.length&&(c=d.candidates[b],!f(a,c));b++);return c&&c!=d.current||(c=null),c}function i(a,b){var c=new XMLHttpRequest;c.addEventListener("readystatechange",function(){var a=this.DONE||4;this.readyState===a&&(b(c),c=null)},!1),c.open.apply(c,a.openArgs),c.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.xhrModifier&&a.xhrModifier(c,elem,candidate),c.send(a.sendData)}function j(a,b){a=a.split("|,|"),require(a,function(){b(Array.prototype.slice.call(arguments))})}function k(a){if(!x[a]){var c=b.createElement("link"),d=b.getElementsByTagName("script")[0];c.rel="stylesheet",c.href=a,d.parentNode.insertBefore(c,d),x[a]=!0,x[c.href]=!0}}function l(a){a=a.split("|,|"),a.forEach(k)}function m(a){a&&"function"==typeof a.lazytransform&&a.lazytransform(this)}function n(a){a&&"function"==typeof a.lazyunload&&a.lazyunload(this)}function o(a){a&&"function"==typeof a.lazyload&&a.lazyload(this)}function p(b,c){var d,e,f,g=b.lazyInclude.current||null,h={candidate:c,openArgs:["GET",c.urls.include,!0],sendData:null,xhrModifier:null,content:c.content&&c.content.content||c.content,oldCandidate:g},k=lazySizes.fire(b,"lazyincludeload",h);return k.defaultPrevented?void E.d():(d=function(){var d,h=e.status,i=e.content||e.responseText,j=!(null!=i||!g||!g.urls.include),k={candidate:c,content:i,text:e.responseText||e.content,response:e.response,xml:e.responseXML,isSuccess:"status"in e?h>=200&&300>h||304===h:!0,oldCandidate:g,insert:!0,resetHTML:j},l={target:b,details:k};c.modules=f,g&&g.modules&&(g.modules.forEach(n,l),g.modules=null,k.resetHTML&&null==k.content&&c.initial&&c.initial.saved&&(k.content=c.initial.content)),f.forEach(m,l),d=lazySizes.fire(b,"lazyincludeloaded",k),k.insert&&k.isSuccess&&!d.defaultPrevented&&null!=k.content&&k.content!=b.innerHTML&&(a.jQuery?jQuery(b).html(k.content):b.innerHTML=k.content),E.d(),f.forEach(o,l),setTimeout(function(){lazySizes.fire(b,"lazyincluded",k)}),e=null,f=null},b.lazyInclude.current=c,b.setAttribute("data-currentinclude",c.name),c.urls.css&&l(c.urls.css),null==h.content&&c.urls.include?i(h,function(a){e=a,f&&d()}):e=h,c.urls.amd?j(c.urls.amd,function(a){f=a,e&&d()}):f=[],void(e&&f&&d()))}function q(a){var b,c=e(a);return c.candidates.length&&C.contains(a)?(b=h(a),b&&p(a,b),!0):void 0}function r(a){!a.defaultPrevented&&a.target.getAttribute("data-include")&&(E.q(a.target),a.details.firesLoad=!0)}if(b.getElementsByClassName){var s,t,u,v,w=/\s*,+\s+/,x={},y=/\s+/,z=/^(amd|css)\:(.+)/i,A=/(.+)\s+(\(\s*(.+)\s*\))/,B=/['"]/g,C=b.documentElement,D=b.getElementsByClassName("lazyconditionalinclude"),E=function(){var a=2,b=3,c=a,d=0,e=0,f=[],g=function(){var a,b=function(){f.length&&(d=0,f.d())};return function(){clearTimeout(a),a=setTimeout(b,999)}}();return{q:function(a){var h=null==a.getAttribute("data-lazyqueue");h&&(e++,c=b),d>c?f[h?"unshift":"push"](a):q(a)&&(d++,g())},d:function(){if(d&&d--,e>0&&(e--,e||(c=a)),!(d>c)){for(;f.length;)if(q(f.shift())){d++;break}g()}}}}(),F=function(){var a,b=function(){for(var a=0,b=D.length;b>a;a++)!lazySizes.hC(D[a],s.lazyClass)&&h(D[a])&&lazySizes.aC(D[a],s.lazyClass)};return function(c){clearTimeout(a),v=null,a=setTimeout(b,"resize"==c.type?31:0)}}();s=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig,s||(s={},a.lazySizesConfig=s),s.include||(s.include={}),t=s.include,t.contentElement||(t.contentElement="html"),t.conditions||(t.conditions={}),t.map||(t.map={}),"preloadAfterLoad"in s||(s.preloadAfterLoad=!0),addEventListener("lazybeforeunveil",r,!1),addEventListener("resize",F,!1),addEventListener("lazyrefreshincludes",F,!1)}}(window,document); |
@@ -138,3 +138,3 @@ /* | ||
function constrainSrces(elem, width, attr){ | ||
var curIndex; | ||
var curIndex, srcset; | ||
var lazyData = elem._lazyOptimumx; | ||
@@ -148,2 +148,3 @@ | ||
if(!lazyData.dirty || curIndex != lazyData.index){ | ||
srcset = lazyData.cSrcset.join(', '); | ||
elem.setAttribute(attr, lazyData.cSrcset.join(', ')); | ||
@@ -157,2 +158,3 @@ lazyData.dirty = true; | ||
} | ||
return srcset; | ||
} | ||
@@ -200,4 +202,4 @@ | ||
} | ||
constrainSrces(e.target, width, attr); | ||
e.details.srcset = true; | ||
e.details.srcset = constrainSrces(e.target, width, attr); | ||
} | ||
@@ -204,0 +206,0 @@ }, false); |
@@ -1,3 +0,3 @@ | ||
/*! lazysizes - v0.8.0 - 2015-01-19 | ||
/*! lazysizes - v0.8.1 - 2015-01-19 | ||
Licensed MIT */ | ||
!function(a){"use strict";function b(a,b){return a.w-b.w}function c(a){var c={srcset:a.getAttribute(lazySizes.cfg.srcsetAttr)||""},d=k(c.srcset);return a._lazyOptimumx=c,c.cands=d,c.index=0,c.dirty=!1,d[0]&&d[0].w?(d.sort(b),c.cSrcset=[d[0].c]):(c.cSrcset=c.srcset?[c.srcset]:[],c.cands=[]),c}function d(a){var b,d,e,f=a.parentNode||{},g=c(a);if(g.isImg=!0,l.test(f.nodeName||""))for(g.picture=!0,b=f.getElementsByTagName("source"),d=0,e=b.length;e>d;d++)c(b[d]).isImg=!1;return g}function e(a,b,c){var d,e;return a&&a.w?a.w>c?!1:(d=1-a.w/c,e=b/c-1,0>e-d):!0}function f(a,b){var c,d;for(c=a.index+1;c<a.cands.length&&(d=a.cands[c],d.w<=b||e(a.cands[c-1],d.w,b));c++)a.cSrcset.push(d.c),a.index=c}function g(a,b,c){var d,e=a._lazyOptimumx;e&&(d=e.index,f(e,b),e.dirty&&d==e.index||(a.setAttribute(c,e.cSrcset.join(", ")),e.dirty=!0,e.cSrcset.length>=e.cands.length&&(a.removeAttribute("data-optimumx"),a.removeAttribute("data-maxdpr"))))}function h(a){var b=a.getAttribute("data-optimumx")||a.getAttribute("data-maxdpr");return b&&(b="auto"==b?i.getOptimumX(a):parseFloat(b,10)),b}var i,j,k,l=/^picture$/i;a.devicePixelRatio&&(k=function(){var a,b=/([^,\s].[^\s]+\s+(\d+)w)/g,c=/\s+\d+h/g,d=function(b,c,d){a.push({c:c,w:1*d})};return function(e){return a=[],e.replace(c,"").replace(b,d),a}}(),i=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig,i||(i={},a.lazySizesConfig=i),"function"!=typeof i.getOptimumX&&(i.getOptimumX=function(){var b=a.devicePixelRatio;return b*=b>2.4?.63:b>1.9?.8:b>1.4?.9:.99,Math.round(100*b)/100}),j=function(){a.lazySizes&&!a.lazySizes.getOptimumX&&(lazySizes.getX=h)},addEventListener("lazybeforesizes",function(b){var c,e,f,i,j,k,l,m;if(!(b.defaultPrevented||!(c=h(b.target))||c>=a.devicePixelRatio)&&(e=b.target._lazyOptimumx||d(b.target),f=b.details.width*c,f&&(e.width||0)<f)){if(i=b.details.dataAttr?lazySizes.cfg.srcsetAttr:"srcset",e.width=f,e.picture&&(j=b.target.parentNode))for(k=j.getElementsByTagName("source"),l=0,m=k.length;m>l;l++)g(k[l],f,i);g(b.target,f,i),b.details.srcset=!0}},!1),j(),setTimeout(j))}(window,document); | ||
!function(a){"use strict";function b(a,b){return a.w-b.w}function c(a){var c={srcset:a.getAttribute(lazySizes.cfg.srcsetAttr)||""},d=k(c.srcset);return a._lazyOptimumx=c,c.cands=d,c.index=0,c.dirty=!1,d[0]&&d[0].w?(d.sort(b),c.cSrcset=[d[0].c]):(c.cSrcset=c.srcset?[c.srcset]:[],c.cands=[]),c}function d(a){var b,d,e,f=a.parentNode||{},g=c(a);if(g.isImg=!0,l.test(f.nodeName||""))for(g.picture=!0,b=f.getElementsByTagName("source"),d=0,e=b.length;e>d;d++)c(b[d]).isImg=!1;return g}function e(a,b,c){var d,e;return a&&a.w?a.w>c?!1:(d=1-a.w/c,e=b/c-1,0>e-d):!0}function f(a,b){var c,d;for(c=a.index+1;c<a.cands.length&&(d=a.cands[c],d.w<=b||e(a.cands[c-1],d.w,b));c++)a.cSrcset.push(d.c),a.index=c}function g(a,b,c){var d,e,g=a._lazyOptimumx;return g?(d=g.index,f(g,b),g.dirty&&d==g.index||(e=g.cSrcset.join(", "),a.setAttribute(c,g.cSrcset.join(", ")),g.dirty=!0,g.cSrcset.length>=g.cands.length&&(a.removeAttribute("data-optimumx"),a.removeAttribute("data-maxdpr"))),e):void 0}function h(a){var b=a.getAttribute("data-optimumx")||a.getAttribute("data-maxdpr");return b&&(b="auto"==b?i.getOptimumX(a):parseFloat(b,10)),b}var i,j,k,l=/^picture$/i;a.devicePixelRatio&&(k=function(){var a,b=/([^,\s].[^\s]+\s+(\d+)w)/g,c=/\s+\d+h/g,d=function(b,c,d){a.push({c:c,w:1*d})};return function(e){return a=[],e.replace(c,"").replace(b,d),a}}(),i=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig,i||(i={},a.lazySizesConfig=i),"function"!=typeof i.getOptimumX&&(i.getOptimumX=function(){var b=a.devicePixelRatio;return b*=b>2.4?.63:b>1.9?.8:b>1.4?.9:.99,Math.round(100*b)/100}),j=function(){a.lazySizes&&!a.lazySizes.getOptimumX&&(lazySizes.getX=h)},addEventListener("lazybeforesizes",function(b){var c,e,f,i,j,k,l,m;if(!(b.defaultPrevented||!(c=h(b.target))||c>=a.devicePixelRatio)&&(e=b.target._lazyOptimumx||d(b.target),f=b.details.width*c,f&&(e.width||0)<f)){if(i=b.details.dataAttr?lazySizes.cfg.srcsetAttr:"srcset",e.width=f,e.picture&&(j=b.target.parentNode))for(k=j.getElementsByTagName("source"),l=0,m=k.length;m>l;l++)g(k[l],f,i);b.details.srcset=g(b.target,f,i)}},!1),j(),setTimeout(j))}(window,document); |
@@ -1,3 +0,3 @@ | ||
/*! lazysizes - v0.8.0 - 2015-01-19 | ||
/*! lazysizes - v0.8.1 - 2015-01-19 | ||
Licensed MIT */ | ||
!function(a){"use strict";var b,c,d,e;a.addEventListener&&(b=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig||{},c=b.lazyClass||"lazyload",d=function(){var b,d;if("string"==typeof c&&(c=document.getElementsByClassName(c)),a.lazySizes)for(b=0,d=c.length;d>b;b++)lazySizes.unveilLazy(c[b])},addEventListener("beforeprint",d,!1),!("onbeforeprint"in a)&&a.matchMedia&&(e=matchMedia("print"))&&e.addListener&&e.addListener(function(){e.matches&&d()}))}(window); |
@@ -1,3 +0,3 @@ | ||
/*! lazysizes - v0.8.0 - 2015-01-19 | ||
/*! lazysizes - v0.8.1 - 2015-01-19 | ||
Licensed MIT */ | ||
!function(a,b){"use strict";function c(a,b){var c,d,e,f;d=a.parentNode,f={isPicture:!(!d||!l.test(d.nodeName||""))},e=function(b,c){var d=a.getAttribute("data-"+b);if(null!=d){if("true"==d)d=!0;else if("false"==d)d=!1;else if(k.test(d))d=parseFloat(d);else if("function"==typeof i[b])d=i[b](a,d);else if(o.test(d))try{d=JSON.parse(d)}catch(e){}f[b]=d}else b in i&&"function"!=typeof i[b]?f[b]=i[b]:c&&"function"==typeof i[b]&&(f[b]=i[b](a,d))};for(c in i)e(c);return b.replace(n,function(a,b){b in f||e(b,!0)}),f}function d(a,b){var c=[],d=function(a,c){return j[typeof b[c]]?b[c]:a};return c.srcset=[],b.absUrl&&(p.setAttribute("href",a),a=p.href),a=((b.prefix||"")+a+(b.postfix||"")).replace(n,d),b.widths.forEach(function(d){var e=a.replace(m,b.widthmap[d]||d);c.push({url:e,w:d}),c.srcset.push(e+" "+d+"w")}),c}function e(a,b,c){a&&(a=d(a,b),c.setAttribute(h.srcsetAttr,a.srcset.join(", ")),q(c,a))}function f(a,d){var e=c(a,d),f=b.createEvent("Event");return i.modifyOptions.call(a,{target:a,details:e}),f.initEvent("lazyriasmodifyoptions",!0,!1),f.details=e,a.dispatchEvent(f),e}function g(a){return a.getAttribute(a.getAttribute("data-srcattr")||i.srcAttr)||a.getAttribute(h.srcsetAttr)||a.getAttribute(h.srcAttr)||""}if(b.addEventListener){var h,i,j={string:1,number:1},k=/^\-*\+*\d+\.*\d*$/,l=/^picture$/i,m=/\s*\{\s*width\s*\}\s*/i,n=/\s*\{\s*([a-z0-9]+)\s*\}\s*/gi,o=/^\[.*\]|\{.*\}$/,p=b.createElement("a"),q=function(){var b=function(a,b,c,d){return Math.abs(b.w-d.w)<Math.abs(a.w-d.w)?b:a};return function(c,d){var e,f;a.HTMLPictureElement||a.respimage||a.picturefill||!(f=c.parentNode)||(d.w=lazySizes.gW(c,f)*(lazySizes.getX?lazySizes.getX(c):Math.min(a.devicePixelRatio||1,2)),e=d.reduce(b),e&&e.url&&(c.setAttribute(h.srcAttr,e.url),c.setAttribute("src",e.url)))}}();!function(){var b,c=function(){},d={prefix:"",postfix:"",srcAttr:"data-src",absUrl:!1,modifyOptions:c,widthmap:{}};h=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig,h||(h={},a.lazySizesConfig=h),h.rias||(h.rias={}),i=h.rias,"widths"in i||(i.widths=[],function(a){var b,c=0;for(a.push(96);!b||2800>b;)c+=10,c>60&&(c+=10),b=16*c,a.push(b)}(i.widths));for(b in d)b in i||(i[b]=d[b])}(),addEventListener("lazybeforeunveil",function(a){var b,c,d,j,k,l,n,o;if(!a.defaultPrevented&&(c=g(a.target))&&!i.disabled&&(a.target.getAttribute(h.sizesAttr)||a.getAttribute("sizes"))&&(b=a.target,d=f(b,c),m.test(c)||m.test(d.prefix)||m.test(d.postfix))){if(d.isPicture&&(j=b.parentNode))for(k=j.getElementsByTagName("source"),l=0,n=k.length;n>l;l++)o=g(k[l]),e(o,d,k[l]);e(c,d,b)}},!1)}}(window,document); |
@@ -1,3 +0,3 @@ | ||
/*! lazysizes - v0.8.0 - 2015-01-19 | ||
/*! lazysizes - v0.8.1 - 2015-01-19 | ||
Licensed MIT */ | ||
!function(a,b){"use strict";var c;a.addEventListener&&(c=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig,c||(c={},a.lazySizesConfig=c),c.scroll=!1,addEventListener("scroll",function(){var c,d,e,f,g,h=function(){var a=d.scrollTop||d.pageYOffset||0,b=d.scrollLeft||d.pageXOffset||0;d=null,Math.abs(f-a)<66&&Math.abs(g-b)<66&&i()},i=function(){a.lazySizes&&lazySizes.updateAllLazy(),clearTimeout(c),clearTimeout(e),d=null};return function(j){var k=j.target==b?a:j.target;clearTimeout(c),c=setTimeout(i,44),d?k!=d&&i():(d=k,f=d.scrollTop||d.pageYOffset||0,g=d.scrollLeft||d.pageXOffset||0,clearTimeout(e),e=setTimeout(h,99)),k=null}}(),!0))}(window,document); |
@@ -1,3 +0,3 @@ | ||
/*! lazysizes - v0.8.0 - 2015-01-19 | ||
/*! lazysizes - v0.8.1 - 2015-01-19 | ||
Licensed MIT */ | ||
!function(a,b){"use strict";function c(a,c){if(!f[a]){var d=b.createElement(c?"link":"script"),e=b.getElementsByTagName("script")[0];c?(d.rel="stylesheet",d.href=a):d.src=a,f[a]=!0,f[d.src||d.href]=!0,e.parentNode.insertBefore(d,e)}}var d,e,f={};b.addEventListener&&a.getComputedStyle&&(d=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig||{},e=function(a,c){var d=b.createElement("img");d.onload=function(){d.onload=null,d.onerror=null,d=null,c()},d.onerror=d.onload,d.src=a,d&&d.complete&&d.onload&&d.onload()},addEventListener("lazybeforeunveil",function(b){var d,f,g,h;b.defaultPrevented||("none"==b.target.preload&&(b.target.preload="auto"),d=b.target.getAttribute("data-link"),d&&c(d,!0),d=b.target.getAttribute("data-script"),d&&c(d),d=b.target.getAttribute("data-require"),d&&a.require&&require([d]),g=b.target.getAttribute("data-bg"),g&&(b.details.firesLoad=!0,f=function(){b.target.style.backgroundImage="url("+g+")",b.details.firesLoad=!1,lazySizes.fire(b.target,"_lazyloaded")},e(g,f)),h=b.target.getAttribute("data-poster"),h&&(b.details.firesLoad=!0,f=function(){b.target.poster=h,b.details.firesLoad=!1,lazySizes.fire(b.target,"_lazyloaded")},e(h,f)))},!1))}(window,document); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
0
100
4
118985
13
27
1401