lazysizes
Advanced tools
Comparing version 1.1.0-rc1 to 1.1.0-rc2
@@ -20,2 +20,6 @@ (function(window, factory) { | ||
var setTimeout = window.setTimeout; | ||
var rAF = window.requestAnimationFrame || setTimeout; | ||
var regPicture = /^picture$/i; | ||
@@ -90,7 +94,4 @@ | ||
var rAF = window.requestAnimationFrame || setTimeout; | ||
var throttle = function(fn){ | ||
var running; | ||
var throttledBy = 99; | ||
var lastTime = 0; | ||
@@ -105,3 +106,3 @@ var run = function(){ | ||
}; | ||
var onRAF = function(){ | ||
var getRAF = function(){ | ||
rAF(afterRAF); | ||
@@ -114,10 +115,10 @@ }; | ||
} | ||
var delay = throttledBy - (Date.now() - lastTime); | ||
var delay = lazySizesConfig.throttle - (Date.now() - lastTime); | ||
running = true; | ||
if(delay < 0){ | ||
delay = 0; | ||
if(delay < 9){ | ||
delay = 9; | ||
} | ||
setTimeout(onRAF, delay); | ||
setTimeout(getRAF, delay); | ||
}; | ||
@@ -183,8 +184,6 @@ }; | ||
var checkElements = function() { | ||
var i, start, rect, autoLoadElem, loadedSomething, elemExpand, elemNegativeExpand, elemExpandVal, beforeExpandVal; | ||
var eLlen, i, start, rect, autoLoadElem, loadedSomething, elemExpand, elemNegativeExpand, elemExpandVal, beforeExpandVal; | ||
var eLlen = lazyloadElems.length; | ||
if((loadMode = lazySizesConfig.loadMode) && (eLlen = lazyloadElems.length)){ | ||
if(eLlen && (loadMode = lazySizesConfig.loadMode)){ | ||
start = Date.now(); | ||
@@ -216,6 +215,2 @@ i = checkElementsIndex; | ||
if(elemExpand > shrinkExpand && (loadMode < 2 || isLoading > 3)){ | ||
elemExpand = shrinkExpand; | ||
} | ||
if(beforeExpandVal !== elemExpand){ | ||
@@ -307,2 +302,4 @@ eLvW = innerWidth + elemExpand; | ||
addRemoveLoadEvents(elem, resetPreloading, true); | ||
clearTimeout(resetPreloadingTimer); | ||
resetPreloadingTimer = setTimeout(resetPreloading, 2500); | ||
} | ||
@@ -329,5 +326,2 @@ } | ||
clearTimeout(resetPreloadingTimer); | ||
resetPreloadingTimer = setTimeout(resetPreloading, 2500); | ||
if(isPicture){ | ||
@@ -522,3 +516,4 @@ sources = parent.getElementsByTagName('source'); | ||
expand: 374, | ||
loadMode: 2 | ||
loadMode: 2, | ||
throttle: 99 | ||
}; | ||
@@ -525,0 +520,0 @@ |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
!function(a,b){var c=b(a,a.document);a.lazySizes=c,"object"==typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd&&define(c)}(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d=b.documentElement,e=a.addEventListener,f=/^picture$/i,g=["load","error","lazyincluded","_lazyloaded"],h=function(a,b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");return a.className.match(c)&&c},i=function(a,b){h(a,b)||(a.className+=" "+b)},j=function(a,b){var c;(c=h(a,b))&&(a.className=a.className.replace(c," "))},k=function(a,b,c){var d=c?"addEventListener":"removeEventListener";c&&k(a,b),g.forEach(function(c){a[d](c,b)})},l=function(a,c,d,e,f){var g=b.createEvent("CustomEvent");return g.initCustomEvent(c,!e,!f,d),g.details=g.detail,a.dispatchEvent(g),g},m=function(b,d){var e;a.HTMLPictureElement||((e=a.picturefill||a.respimage||c.pf)?e({reevaluate:!0,reparse:!0,elements:[b]}):d&&d.src&&(b.src=d.src))},n=function(a,b){return getComputedStyle(a,null)[b]},o=function(a,b,d){for(d=d||a.offsetWidth;d<c.minSize&&b&&!a._lazysizesWidth;)d=b.offsetWidth,b=b.parentNode;return d},p=a.requestAnimationFrame||setTimeout,q=function(a){var b,c=99,d=0,e=function(){b=!1,d=Date.now(),a()},f=function(){setTimeout(e)},g=function(){p(f)};return function(){if(!b){var a=c-(Date.now()-d);b=!0,0>a&&(a=0),setTimeout(g,a)}}},r=function(){var g,o,r,t,u,v,w,x,y,z,A,B,C,D=/^img$/i,E=/^iframe$/i,F="onscroll"in a&&!/glebot/.test(navigator.userAgent),G=0,H=0,I=0,J=0,K=0,L=function(a){J--,a&&a.target&&k(a.target,L),(!a||0>J||!a.target)&&(J=0)},M=function(a,b){var c,d=a,e="hidden"!=n(a,"visibility");for(x-=b,A+=b,y-=b,z+=b;e&&(d=d.offsetParent);)e=(n(d,"opacity")||1)>0,e&&"visible"!=n(d,"overflow")&&(c=d.getBoundingClientRect(),e=z>c.left&&y<c.right&&A>c.top-1&&x<c.bottom+1);return e},N=function(){var a,b,d,e,f,h,i,j,k,l=g.length;if(l&&(u=c.loadMode)){for(b=Date.now(),a=K,I++,C>H&&1>J&&I>4&&u>2?(H=C,I=0):H=H!=B&&u>1&&I>3?B:G;l>a;a++,K++)if(g[a]&&!g[a]._lazyRace)if(F){if((j=g[a].getAttribute("data-expand"))&&(h=1*j)||(h=H),!(J>6&&(!j||"src"in g[a])))if(h>G&&(2>u||J>3)&&(h=G),k!==h&&(v=innerWidth+h,w=innerHeight+h,i=-1*h,k=h),d=g[a].getBoundingClientRect(),(A=d.bottom)>=i&&(x=d.top)<=w&&(z=d.right)>=i&&(y=d.left)<=v&&(A||z||y||x)&&(r&&3>J&&4>I&&!j&&u>2||M(g[a],h)))R(g[a],!1,d.width),K--,b++,f=!0;else{if(I&&Date.now()-b>3)return K++,void O();!f&&r&&!e&&3>J&&4>I&&u>2&&(o[0]||c.preloadAfterLoad)&&(o[0]||!j&&(A||z||y||x||"auto"!=g[a].getAttribute(c.sizesAttr)))&&(e=o[0]||g[a])}}else R(g[a]);e&&!f&&R(e)}K=0},O=q(N),P=function(a){i(a.target,c.loadedClass),j(a.target,c.loadingClass),k(a.target,P)},Q=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.setAttribute("src",b)}},R=function(a,b,d){var e,g,n,o,q,u,v,w,x,y,z,A=a.currentSrc||a.src,B=D.test(a.nodeName),C=a.getAttribute(c.sizesAttr)||a.getAttribute("sizes"),F="auto"==C;(!F&&r||!B||!A||a.complete||h(a,c.errorClass))&&(a._lazyRace=!0,(x=l(a,"lazybeforeunveil",{force:!!b})).defaultPrevented||(u=a.getAttribute(c.srcsetAttr),q=a.getAttribute(c.srcAttr),B&&(v=a.parentNode,w=f.test(v.nodeName||"")),y=x.detail.firesLoad||"src"in a&&(u||q||w),y&&(J++,k(a,L,!0))),p(function(){if(a._lazyRace&&delete a._lazyRace,j(a,c.lazyClass),C&&(F?(s.updateElem(a,!0,d),i(a,c.autosizesClass),u=a.getAttribute(c.srcsetAttr),q=a.getAttribute(c.srcAttr)):a.setAttribute("sizes",C)),clearTimeout(t),t=setTimeout(L,2500),w)for(e=v.getElementsByTagName("source"),g=0,n=e.length;n>g;g++)(z=c.customMedia[e[g].getAttribute("data-media")||e[g].getAttribute("media")])&&e[g].setAttribute("media",z),o=e[g].getAttribute(c.srcsetAttr),o&&e[g].setAttribute("srcset",o);u?a.setAttribute("srcset",u):q&&(E.test(a.nodeName)?Q(a,q):a.setAttribute("src",q)),(u||w)&&m(a,{src:q}),!y||a.complete&&A==(a.currentSrc||a.src)?y&&L(x):(i(a,c.loadingClass),k(a,P,!0)),a=null}))},S=function(){var a,b=function(){c.loadMode=3,O()};r=!0,I+=8,c.loadMode=3,e("scroll",function(){3==c.loadMode&&(c.loadMode=2),clearTimeout(a),a=setTimeout(b,99)},!0)};return{_:function(){g=b.getElementsByClassName(c.lazyClass),o=b.getElementsByClassName(c.lazyClass+" "+c.preloadClass),B=c.expand,C=Math.round(B*c.expFactor),e("scroll",O,!0),e("resize",O,!0),a.MutationObserver?new MutationObserver(O).observe(d,{childList:!0,subtree:!0,attributes:!0}):(d.addEventListener("DOMNodeInserted",O,!0),d.addEventListener("DOMAttrModified",O,!0),setInterval(O,999)),e("hashchange",O,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(a){b.addEventListener(a,O,!0)}),(r=/d$|^c/.test(b.readyState))?S():(e("load",S),b.addEventListener("DOMContentLoaded",O)),O()},checkElems:O,unveil:R}}(),s=function(){var a,d=function(a,b,c){var d,e,g,h,i=a.parentNode;if(i&&(c=o(a,i,c),h=l(a,"lazybeforesizes",{width:c,dataAttr:!!b}),!h.defaultPrevented&&(c=h.detail.width,c&&c!==a._lazysizesWidth))){if(a._lazysizesWidth=c,c+="px",a.setAttribute("sizes",c),f.test(i.nodeName||""))for(d=i.getElementsByTagName("source"),e=0,g=d.length;g>e;e++)d[e].setAttribute("sizes",c);h.detail.dataAttr||m(a,h.detail)}},g=function(){var b,c=a.length;if(c)for(b=0;c>b;b++)d(a[b])},h=q(g);return{_:function(){a=b.getElementsByClassName(c.autosizesClass),e("resize",h)},checkElems:h,updateElem:d}}(),t=function(){t.i||(t.i=!0,s._(),r._())};return function(){var b,d={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:2,expand:374,loadMode:2};c=a.lazySizesConfig||a.lazysizesConfig||{};for(b in d)b in c||(c[b]=d[b]);a.lazySizesConfig=c,setTimeout(function(){c.init&&t()})}(),{cfg:c,autoSizer:s,loader:r,init:t,uP:m,aC:i,rC:j,hC:h,fire:l,gW:o}}}); | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(a,b){var c=b(a,a.document);a.lazySizes=c,"object"==typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd&&define(c)}(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d=b.documentElement,e=a.addEventListener,f=a.setTimeout,g=a.requestAnimationFrame||f,h=/^picture$/i,i=["load","error","lazyincluded","_lazyloaded"],j=function(a,b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");return a.className.match(c)&&c},k=function(a,b){j(a,b)||(a.className+=" "+b)},l=function(a,b){var c;(c=j(a,b))&&(a.className=a.className.replace(c," "))},m=function(a,b,c){var d=c?"addEventListener":"removeEventListener";c&&m(a,b),i.forEach(function(c){a[d](c,b)})},n=function(a,c,d,e,f){var g=b.createEvent("CustomEvent");return g.initCustomEvent(c,!e,!f,d),g.details=g.detail,a.dispatchEvent(g),g},o=function(b,d){var e;a.HTMLPictureElement||((e=a.picturefill||a.respimage||c.pf)?e({reevaluate:!0,reparse:!0,elements:[b]}):d&&d.src&&(b.src=d.src))},p=function(a,b){return getComputedStyle(a,null)[b]},q=function(a,b,d){for(d=d||a.offsetWidth;d<c.minSize&&b&&!a._lazysizesWidth;)d=b.offsetWidth,b=b.parentNode;return d},r=function(a){var b,d=0,e=function(){b=!1,d=Date.now(),a()},h=function(){f(e)},i=function(){g(h)};return function(){if(!b){var a=c.throttle-(Date.now()-d);b=!0,9>a&&(a=9),f(i,a)}}},s=function(){var i,q,s,u,v,w,x,y,z,A,B,C,D,E=/^img$/i,F=/^iframe$/i,G="onscroll"in a&&!/glebot/.test(navigator.userAgent),H=0,I=0,J=0,K=0,L=0,M=function(a){K--,a&&a.target&&m(a.target,M),(!a||0>K||!a.target)&&(K=0)},N=function(a,b){var c,d=a,e="hidden"!=p(a,"visibility");for(y-=b,B+=b,z-=b,A+=b;e&&(d=d.offsetParent);)e=(p(d,"opacity")||1)>0,e&&"visible"!=p(d,"overflow")&&(c=d.getBoundingClientRect(),e=A>c.left&&z<c.right&&B>c.top-1&&y<c.bottom+1);return e},O=function(){var a,b,d,e,f,g,h,j,k,l;if((v=c.loadMode)&&(a=i.length)){for(d=Date.now(),b=L,J++,D>I&&1>K&&J>4&&v>2?(I=D,J=0):I=I!=C&&v>1&&J>3?C:H;a>b;b++,L++)if(i[b]&&!i[b]._lazyRace)if(G){if((k=i[b].getAttribute("data-expand"))&&(h=1*k)||(h=I),!(K>6&&(!k||"src"in i[b])))if(l!==h&&(w=innerWidth+h,x=innerHeight+h,j=-1*h,l=h),e=i[b].getBoundingClientRect(),(B=e.bottom)>=j&&(y=e.top)<=x&&(A=e.right)>=j&&(z=e.left)<=w&&(B||A||z||y)&&(s&&3>K&&4>J&&!k&&v>2||N(i[b],h)))S(i[b],!1,e.width),L--,d++,g=!0;else{if(J&&Date.now()-d>3)return L++,void P();!g&&s&&!f&&3>K&&4>J&&v>2&&(q[0]||c.preloadAfterLoad)&&(q[0]||!k&&(B||A||z||y||"auto"!=i[b].getAttribute(c.sizesAttr)))&&(f=q[0]||i[b])}}else S(i[b]);f&&!g&&S(f)}L=0},P=r(O),Q=function(a){k(a.target,c.loadedClass),l(a.target,c.loadingClass),m(a.target,Q)},R=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.setAttribute("src",b)}},S=function(a,b,d){var e,i,p,q,r,v,w,x,y,z,A,B=a.currentSrc||a.src,C=E.test(a.nodeName),D=a.getAttribute(c.sizesAttr)||a.getAttribute("sizes"),G="auto"==D;(!G&&s||!C||!B||a.complete||j(a,c.errorClass))&&(a._lazyRace=!0,(y=n(a,"lazybeforeunveil",{force:!!b})).defaultPrevented||(v=a.getAttribute(c.srcsetAttr),r=a.getAttribute(c.srcAttr),C&&(w=a.parentNode,x=h.test(w.nodeName||"")),z=y.detail.firesLoad||"src"in a&&(v||r||x),z&&(K++,m(a,M,!0),clearTimeout(u),u=f(M,2500))),g(function(){if(a._lazyRace&&delete a._lazyRace,l(a,c.lazyClass),D&&(G?(t.updateElem(a,!0,d),k(a,c.autosizesClass),v=a.getAttribute(c.srcsetAttr),r=a.getAttribute(c.srcAttr)):a.setAttribute("sizes",D)),x)for(e=w.getElementsByTagName("source"),i=0,p=e.length;p>i;i++)(A=c.customMedia[e[i].getAttribute("data-media")||e[i].getAttribute("media")])&&e[i].setAttribute("media",A),q=e[i].getAttribute(c.srcsetAttr),q&&e[i].setAttribute("srcset",q);v?a.setAttribute("srcset",v):r&&(F.test(a.nodeName)?R(a,r):a.setAttribute("src",r)),(v||x)&&o(a,{src:r}),!z||a.complete&&B==(a.currentSrc||a.src)?z&&M(y):(k(a,c.loadingClass),m(a,Q,!0)),a=null}))},T=function(){var a,b=function(){c.loadMode=3,P()};s=!0,J+=8,c.loadMode=3,e("scroll",function(){3==c.loadMode&&(c.loadMode=2),clearTimeout(a),a=f(b,99)},!0)};return{_:function(){i=b.getElementsByClassName(c.lazyClass),q=b.getElementsByClassName(c.lazyClass+" "+c.preloadClass),C=c.expand,D=Math.round(C*c.expFactor),e("scroll",P,!0),e("resize",P,!0),a.MutationObserver?new MutationObserver(P).observe(d,{childList:!0,subtree:!0,attributes:!0}):(d.addEventListener("DOMNodeInserted",P,!0),d.addEventListener("DOMAttrModified",P,!0),setInterval(P,999)),e("hashchange",P,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(a){b.addEventListener(a,P,!0)}),(s=/d$|^c/.test(b.readyState))?T():(e("load",T),b.addEventListener("DOMContentLoaded",P)),P()},checkElems:P,unveil:S}}(),t=function(){var a,d=function(a,b,c){var d,e,f,g,i=a.parentNode;if(i&&(c=q(a,i,c),g=n(a,"lazybeforesizes",{width:c,dataAttr:!!b}),!g.defaultPrevented&&(c=g.detail.width,c&&c!==a._lazysizesWidth))){if(a._lazysizesWidth=c,c+="px",a.setAttribute("sizes",c),h.test(i.nodeName||""))for(d=i.getElementsByTagName("source"),e=0,f=d.length;f>e;e++)d[e].setAttribute("sizes",c);g.detail.dataAttr||o(a,g.detail)}},f=function(){var b,c=a.length;if(c)for(b=0;c>b;b++)d(a[b])},g=r(f);return{_:function(){a=b.getElementsByClassName(c.autosizesClass),e("resize",g)},checkElems:g,updateElem:d}}(),u=function(){u.i||(u.i=!0,t._(),s._())};return function(){var b,d={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:2,expand:374,loadMode:2,throttle:99};c=a.lazySizesConfig||a.lazysizesConfig||{};for(b in d)b in c||(c[b]=d[b]);a.lazySizesConfig=c,f(function(){c.init&&u()})}(),{cfg:c,autoSizer:t,loader:s,init:u,uP:o,aC:k,rC:l,hC:j,fire:n,gW:q}}}); |
{ | ||
"name": "lazysizes", | ||
"version": "1.1.0-rc1", | ||
"version": "1.1.0-rc2", | ||
"filename": "lazysizes.min.js", | ||
@@ -5,0 +5,0 @@ "author": "Alexander Farkas <info@corrupt-system.de>", |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(a,b){"use strict";function c(){this.ratioElems=b.getElementsByClassName("lazyaspectratio"),this._setupEvents(),this.processImages()}if(a.addEventListener){var d,e,f,g=/^picture$/i,h="data-aspectratio",i="img["+h+"]",j=function(b){return a.matchMedia?(j=function(a){return!a||(matchMedia(a)||{}).matches})(b):a.Modernizr&&Modernizr.mq?!b||Modernizr.mq(b):!b},k=function(b,c){f?f(b).addClass(c):a.lazySizes?lazySizes.aC(b,c):b.classList.add(c)},l=function(b,c){f?f(b).removeClass(c):a.lazySizes?lazySizes.rC(b,c):b.classList.remove(c)};c.prototype={_setupEvents:function(){var a=this,c=function(b){b.naturalWidth<36?a.addAspectRatio(b,!0):a.removeAspectRatio(b,!0)},d=function(){a.processImages()};b.addEventListener("load",function(a){a.target.getAttribute&&a.target.getAttribute(h)&&c(a.target)},!0),addEventListener("resize",function(){var b,d=function(){var b,d;for(b=0,d=a.ratioElems.length;d>b;b++)c(a.ratioElems[b])};return function(){clearTimeout(b),b=setTimeout(d,33)}}()),b.addEventListener("DOMContentLoaded",d),addEventListener("load",d)},processImages:function(a){var c,d;a||(a=b),c="length"in a&&!a.nodeName?a:a.querySelectorAll(i);for(d=0;d<c.length;d++)c[d].naturalWidth>36?this.removeAspectRatio(c[d]):this.addAspectRatio(c[d])},getSelectedRatio:function(b){var c,d,e,f,i,k=b.parentNode;if(k&&g.test(k.nodeName||""))for(e=k.getElementsByTagName("source"),c=0,d=e.length;d>c;c++)if(f=e[c].getAttribute("data-media")||e[c].getAttribute("media"),a.lazySizesConfig&&lazySizesConfig.customMedia[f]&&(f=lazySizesConfig.customMedia[f]),j(f)){i=e[c].getAttribute(h);break}return i||b.getAttribute(h)||""},parseRatio:function(){var a=/^\s*([+\d\.]+)(\s*[\/x]\s*([+\d\.]+))?\s*$/,b={};return function(c){return!b[c]&&c.match(a)&&(b[c]=RegExp.$3?RegExp.$1/RegExp.$3:1*RegExp.$1),b[c]}}(),addAspectRatio:function(b,c){var d,e=b.offsetWidth;return c||k(b,"lazyaspectratio"),36>e?void(e&&a.console&&console.log("Define width of image, so we can calculate the height")):(d=this.getSelectedRatio(b),d=this.parseRatio(d),void(d&&(b.style.height=e/d+"px")))},removeAspectRatio:function(a){l(a,"lazyaspectratio"),a.style.height="",a.removeAttribute(h)}},e=function(){f=a.jQuery||a.Zepto||a.shoestring||a.$,f&&f.fn&&!f.fn.imageRatio&&f.fn.filter&&f.fn.add&&f.fn.find?f.fn.imageRatio=function(){return d.processImages(this.find(i).add(this.filter(i))),this}:f=!1},e(),setTimeout(e),d=new c,a.imageRatio=d,"object"==typeof module&&module.exports?module.exports=d:"function"==typeof define&&define.amd&&define(d)}}(window,document); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(){"use strict";if(window.addEventListener){var a=/\s*\|\s+|\s+\|\s*/g,b=/^(.+?)(?:\s+\[\s*(.+?)\s*\])?$/,c=function(a){var b=lazySizes.gW(a,a.parentNode);return(!a._lazysizesWidth||b>a._lazysizesWidth)&&(a._lazysizesWidth=b),a._lazysizesWidth},d=function(c,d,e){var f=document.createElement("picture"),g=d.getAttribute(lazySizesConfig.sizesAttr),h=d.getAttribute("data-optimumx");d._lazybgset&&d._lazybgset.parentNode==d&&d.removeChild(d._lazybgset),Object.defineProperty(e,"_lazybgset",{value:d,writable:!0}),Object.defineProperty(d,"_lazybgset",{value:f,writable:!0}),c=c.split(a),f.style.display="none",e.className=lazySizesConfig.lazyClass,1!=c.length||g||(g="auto"),c.forEach(function(a){var c=document.createElement("source");g&&"auto"!=g&&c.setAttribute("sizes",g),a.match(b)&&(c.setAttribute(lazySizesConfig.srcsetAttr,RegExp.$1),RegExp.$2&&c.setAttribute("media",RegExp.$2)),f.appendChild(c)}),g&&(e.setAttribute(lazySizesConfig.sizesAttr,g),d.removeAttribute(lazySizesConfig.sizesAttr)),h&&e.setAttribute("data-optimumx",h),f.appendChild(e),d.appendChild(f)};addEventListener("lazybeforeunveil",function(a){var b,c,e;!a.defaultPrevented&&(b=a.target.getAttribute("data-bgset"))&&(e=a.target,c=document.createElement("img"),c._lazybgsetLoading=!0,a.detail.firesLoad=!0,d(b,e,c),lazySizes.loader.unveil(c),lazySizes.fire(c,"_lazyloaded",{},!0,!0))}),document.addEventListener("load",function(a){if(a.target._lazybgset){var b=a.target,c=b._lazybgset,d=b.currentSrc||b.src;d&&(c.style.backgroundImage="url("+d+")"),b._lazybgsetLoading&&(lazySizes.fire(c,"_lazyloaded",{},!1,!0),delete b._lazybgsetLoading)}},!0),addEventListener("lazybeforesizes",function(a){!a.defaultPrevented&&a.target._lazybgset&&(a.detail.width=c(a.target._lazybgset))})}}(); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(a){"use strict";var b=document.documentElement,c=function(){if(a.lazySizes&&!a.lazySizes.getCustomMedias){var d=a.lazySizes;d.getCustomMedias=function(){var a=/['"]/g,b=/\s*\|\s*/g,c=/^([a-z0-9_-]+)\s*:\s*(.+)$/i,e=function(b,c){return(getComputedStyle(b,c).getPropertyValue("content")||"none").replace(a,"").trim()},f=function(a,d){a.split(b).forEach(function(a){a.match(c)&&(d[RegExp.$1]=RegExp.$2)})};return function(a,b){return a=a||d.cfg.customMedia,b=b||document.querySelector("html"),f(e(b,":before"),a),f(e(b,":after"),a),a}}(),d.updateCustomMedia=function(){var c,e,f,g=b.querySelectorAll("source[media][data-media][srcset]");for(d.getCustomMedias(),c=0,e=g.length;e>c;c++)(f=d.cfg.customMedia[g[c].getAttribute("data-media")||g[c].getAttribute("media")])&&g[c].setAttribute("media",f);if(!a.HTMLPictureElement)for(g=b.querySelector("source[media][data-media][srcset] ~ img"),c=0,e=g.length;e>c;c++)d.uP(g[c]);d.autoSizer.checkElems()},d.getCustomMedias(),b.removeEventListener("lazybeforeunveil",c)}};a.addEventListener&&(b.addEventListener("lazybeforeunveil",c),c(),setTimeout(c))}(window); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(a){"use strict";var b,c=a.createElement("img");"srcset"in c&&!("sizes"in c)&&(b=/^picture$/i,a.addEventListener("lazybeforeunveil",function(c){var d,e,f,g,h,i,j;!c.defaultPrevented&&!lazySizesConfig.noIOSFix&&(d=c.target)&&(f=d.getAttribute(lazySizesConfig.srcsetAttr))&&(e=d.parentNode)&&((h=b.test(e.nodeName||""))||(g=d.getAttribute("sizes")||d.getAttribute(lazySizesConfig.sizesAttr)))&&(i=h?e:a.createElement("picture"),d._lazyImgSrc||Object.defineProperty(d,"_lazyImgSrc",{value:a.createElement("source"),writable:!0}),j=d._lazyImgSrc,g&&j.setAttribute("sizes",g),j.setAttribute(lazySizesConfig.srcsetAttr,f),d.setAttribute("data-pfsrcset",f),d.removeAttribute(lazySizesConfig.srcsetAttr),h||(e.insertBefore(i,d),i.appendChild(d)),i.insertBefore(j,d))}))}(document); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - 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]||s.customMedia[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,detail: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.detail.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); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(){"use strict";if(window.addEventListener){var a={nodeName:""},b=!!window.HTMLPictureElement,c=function(c){var d,e,f,g,h,i=c.target.querySelectorAll("img, iframe");for(d=0;d<i.length;d++)e=i[d].getAttribute("srcset")||"picture"==(i[d].parentNode||a).toLowerCase(),!b&&e&&lazySizes.uP(i[d]),i[d].complete||!e&&!i[d].src||(c.detail.firesLoad=!0,g&&h||(h=0,g=function(a){h--,a&&!(1>h)||f||(f=!0,c.detail.firesLoad=!1,lazySizes.fire(c.target,"_lazyloaded",{},!1,!0)),a&&a.target&&(a.target.removeEventListener("load",g),a.target.removeEventListener("error",g))},setTimeout(g,3500)),h++,i[d].addEventListener("load",g),i[d].addEventListener("error",g))};addEventListener("lazybeforeunveil",function(a){if(!a.defaultPrevented&&null!=a.target.getAttribute("data-noscript")){var b=a.target.querySelector('noscript, script[type*="html"]')||{},d=b.textContent||b.innerText;d&&(a.target.innerHTML=d,c(a))}})}}(); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(a,b){"use strict";if(a.addEventListener){var c,d=/^picture$/i,e=b.documentElement,f=function(){var a,b=/(([^,\s].[^\s]+)\s+(\d+)w)/g,c=/\s+\d+h/g,d=function(b,c,d,e){a.push({c:c,u:d,w:1*e})};return function(e){return a=[],e.replace(c,"").replace(b,d),a}}(),g=function(){var a=function(a,b){return a.w-b.w},b=function(b,c){var d={srcset:b.getAttribute(lazySizes.cfg.srcsetAttr)||""},e=f(d.srcset);return Object.defineProperty(b,c,{value:d,writable:!0}),d.cands=e,d.index=0,d.dirty=!1,e[0]&&e[0].w?(e.sort(a),d.cSrcset=[e[d.index].c]):(d.cSrcset=d.srcset?[d.srcset]:[],d.cands=[]),d};return function(a,c){var e,f,g,h;if(!a[c]&&(h=a.parentNode||{},a[c]=b(a,c),a[c].isImg=!0,d.test(h.nodeName||"")))for(a[c].picture=!0,e=h.getElementsByTagName("source"),f=0,g=e.length;g>f;f++)b(e[f],c).isImg=!1;return a[c]}}(),h={_lazyOptimumx:function(){var a=function(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};return function(b,c){var d,e;for(d=b.index+1;d<b.cands.length&&(e=b.cands[d],e.w<=c||a(b.cands[d-1],e.w,c));d++)b.cSrcset.push(e.c),b.index=d}}()},i=function(){var a=function(a,b,c,d){var e,f=a[d];f&&(e=f.index,h[d](f,b),f.dirty&&e==f.index||(f.cSrcset.join(", "),a.setAttribute(c,f.cSrcset.join(", ")),f.dirty=!0))};return function(b,c,d,e){var f,g,h,i,j=b[e];if(j.width=c,j.picture&&(g=b.parentNode))for(f=g.getElementsByTagName("source"),i=0,h=f.length;h>i;i++)a(f[i],c,d,e);a(b,c,d,e)}}(),j=function(a){var b=a.getAttribute("data-optimumx")||a.getAttribute("data-maxdpr");return b&&(b="auto"==b?c.getOptimumX(a):parseFloat(b,10)),b},k=function(){a.lazySizes&&!a.lazySizes.getOptimumX&&(lazySizes.getX=j,lazySizes.pWS=f,e.removeEventListener("lazybeforeunveil",k))};e.addEventListener("lazybeforeunveil",k),setTimeout(k),c=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig,c||(c={},a.lazySizesConfig=c),"function"!=typeof c.getOptimumX&&(c.getOptimumX=function(){var b=a.devicePixelRatio||1;return b>2.4?b*=.63:b>1.9?b*=.8:b>1.4&&(b*=.9),Math.min(Math.round(100*b)/100,2)}),a.devicePixelRatio&&(addEventListener("lazybeforesizes",function(a){var b,c,d,e;a.defaultPrevented||!(b=j(a.target))||b>=devicePixelRatio||(c=g(a.target,"_lazyOptimumx"),d=a.detail.width*b,d&&(c.width||0)<d&&(e=a.detail.dataAttr?lazySizes.cfg.srcsetAttr:"srcset",i(a.target,d,e,"_lazyOptimumx")))}),addEventListener("lazybeforeunveil",function(a){a.target._lazyOptimumx&&(a.target._lazyOptimumx=null)}))}}(window,document); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - 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.loader.unveil(c[b])},addEventListener("beforeprint",d,!1),!("onbeforeprint"in a)&&a.matchMedia&&(e=matchMedia("print"))&&e.addListener&&e.addListener(function(){e.matches&&d()}))}(window); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(a){"use strict";var b,c;"srcset"in a.createElement("img")&&(b=/^img$/i,c=function(a){a.target.style.backgroundSize="",a.target.style.backgroundImage="",a.target.removeEventListener(a.type,c)},a.addEventListener("lazybeforeunveil",function(a){var d=a.target;if(b.test(d.nodeName)){var e=d.getAttribute("src");e&&(d.style.backgroundSize="100% 100%",d.style.backgroundImage="url("+e+")",d.removeAttribute("src"),d.addEventListener("load",c))}},!1))}(document); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(a,b){"use strict";var c,d=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig;d||(d={},a.lazySizesConfig=d),d.supportsType||(d.supportsType=function(a){return!a}),a.picturefill||a.respimage||d.pf||(d.pf=function(b){var d,e;if(!a.picturefill&&!a.respimage)for(d=0,e=b.elements.length;e>d;d++)c(b.elements[d])},c=function(){var e=function(a,b,c,d){return Math.abs(b.w-d.w)<Math.abs(a.w-d.w)?b:a},f=function(){var a,b=/(([^,\s].[^\s]+)\s+(\d+)w)/g,c=/\s+\d+h/g,d=/\s/,e=function(b,c,d,e){a.push({c:c,u:d,w:1*e})};return function(f){return a=[],f=f.trim(),f.replace(c,"").replace(b,e),a.length||!f||d.test(f)||a.push({c:f,u:f,w:99}),a}}(),g=function(){g.init||(g.init=!0,addEventListener("resize",function(){var a,d=b.getElementsByClassName("lazymatchmedia"),e=function(){var a,b;for(a=0,b=d.length;b>a;a++)c(d[a])};return function(){clearTimeout(a),a=setTimeout(e,66)}}()))},h=function(b,c){var e,h=b.getAttribute("srcset")||b.getAttribute(d.srcsetAttr);!h&&c&&(h=b._lazypolyfill?b._lazypolyfill._set:b.getAttribute("src")||b.getAttribute(d.srcAttr)),b._lazypolyfill&&b._lazypolyfill._set==h||(e=f(h||""),c&&b.parentNode&&(e.isPicture="PICTURE"==b.parentNode.nodeName.toUpperCase(),e.isPicture&&(lazySizes.aC(b,"lazymatchmedia"),(a.matchMedia||a.Modernizr&&Modernizr.mq)&&g())),e._set=h,Object.defineProperty(b,"_lazypolyfill",{value:e,writable:!0}))},i=function(b){var c=a.devicePixelRatio||1,d=lazySizes.getX&&lazySizes.getX(b),e=Math.min(d||c,2.2,c);return 1.2>e?e*=1.05:e>1.6&&!d&&(e*=.95),e},j=function(b){return a.matchMedia?(j=function(a){return!a||(matchMedia(a)||{}).matches})(b):a.Modernizr&&Modernizr.mq?!b||Modernizr.mq(b):!b},k=function(a){var b,c,f,g,k,l,m;if(g=a,h(g,!0),k=g._lazypolyfill,k.isPicture)for(c=0,b=a.parentNode.getElementsByTagName("source"),f=b.length;f>c;c++)if(d.supportsType(b[c].getAttribute("type"),a)&&j(b[c].getAttribute("media"))){g=b[c],h(g),k=g._lazypolyfill;break}return k.length>1?(m=Math.round(parseInt(g.getAttribute("sizes"),10)*i(a))||lazySizes.getWidth(a,a.parentNode),(!k.w||k.w<m)&&(k.w=m),l=k.reduce(e)):l=k[0],l},l=function(a){var b=k(a);b&&b.u&&a._lazypolyfill.cur!=b.u&&(a._lazypolyfill.cur=b.u,a.setAttribute(d.srcAttr,b.u),a.setAttribute("src",b.u))};return l.parse=f,l}(),a.HTMLPictureElement||d.loadedClass&&d.loadingClass&&!function(){var a=[];['img[sizes$="px"][srcset].',"picture > img:not([srcset])."].forEach(function(b){a.push(b+d.loadedClass),a.push(b+d.loadingClass)}),d.pf({elements:b.querySelectorAll(a.join(", "))})}())}(window,document),function(a){"use strict";var b,c=a.createElement("img");"srcset"in c&&!("sizes"in c)&&(b=/^picture$/i,a.addEventListener("lazybeforeunveil",function(c){var d,e,f,g,h,i,j;!c.defaultPrevented&&!lazySizesConfig.noIOSFix&&(d=c.target)&&(f=d.getAttribute(lazySizesConfig.srcsetAttr))&&(e=d.parentNode)&&((h=b.test(e.nodeName||""))||(g=d.getAttribute("sizes")||d.getAttribute(lazySizesConfig.sizesAttr)))&&(i=h?e:a.createElement("picture"),d._lazyImgSrc||Object.defineProperty(d,"_lazyImgSrc",{value:a.createElement("source"),writable:!0}),j=d._lazyImgSrc,g&&j.setAttribute("sizes",g),j.setAttribute(lazySizesConfig.srcsetAttr,f),d.setAttribute("data-pfsrcset",f),d.removeAttribute(lazySizesConfig.srcsetAttr),h||(e.insertBefore(i,d),i.appendChild(d)),i.insertBefore(j,d))}))}(document); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - 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&&(q.setAttribute("href",a),a=q.href),a=((b.prefix||"")+a+(b.postfix||"")).replace(n,d),b.widths.forEach(function(d){var e={u:a.replace(m,b.widthmap[d]||d),w:d};c.push(e),c.srcset.push(e.c=e.u+" "+d+"w")}),c}function e(a,b,c){a&&(a=d(a,b),a.isPicture=b.isPicture,c.setAttribute(h.srcsetAttr,a.srcset.join(", ")),Object.defineProperty(c,"_lazyrias",{value:a,writable:!0}))}function f(a,b){var d=c(a,b);return i.modifyOptions.call(a,{target:a,details:d,detail:d}),lazySizes.fire(a,"lazyriasmodifyoptions",d),d}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=/^(?:auto|\d+(px)?)$/,q=b.createElement("a");!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.supportsType||(h.supportsType=function(a){return!a}),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,q,s;if(b=a.target,!a.defaultPrevented&&(c=g(b))&&!i.disabled&&(q=b.getAttribute(h.sizesAttr)||b.getAttribute("sizes"))&&p.test(q)){if(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)}"auto"!=q&&(s={width:parseInt(q,10)},r({target:b,detail:s,details:s}))}});var r=function(){var c=function(a,b,c,d){return Math.abs(b.w-d.w)<Math.abs(a.w-d.w)?b:a},d=function(a,b){var c;return!a._lazyrias&&lazySizes.pWS&&(c=lazySizes.pWS(a.getAttribute(h.srcsetAttr||""))).length&&(Object.defineProperty(a,"_lazyrias",{value:c,writable:!0}),b&&a.parentNode&&(c.isPicture="PICTURE"==a.parentNode.nodeName.toUpperCase())),a._lazyrias},e=function(b){var c=a.devicePixelRatio||1,d=lazySizes.getX&&lazySizes.getX(b),e=Math.min(d||c,2.2,c);return 1.2>e?e*=1.05:e>1.6&&!d&&(e*=.95),e},f=function(b,f){var g,h,i,j,k;if(f=Math.round(f*e(b)),k=b._lazyrias,k.isPicture&&a.matchMedia)for(h=0,g=b.parentNode.getElementsByTagName("source"),i=g.length;i>h;h++)if(d(g[h])&&!g[h].getAttribute("type")&&(!(j=g[h].getAttribute("media"))||(matchMedia(j)||{}).matches)){k=g[h]._lazyrias;break}return(!k.w||k.w<f)&&(k.w=f),k.reduce(c)},g=function(c){var e,i=c.target;return a.HTMLPictureElement||a.respimage||a.picturefill||lazySizesConfig.pf?void b.removeEventListener("lazybeforesizes",g):void((i._lazyrias||c.detail.dataAttr&&d(i,!0))&&(e=f(i,c.detail.width),e&&e.u&&i._lazyrias.cur!=e.u&&(i._lazyrias.cur=e.u,i.setAttribute(h.srcAttr,e.u),i.setAttribute("src",e.u))))};return b.addEventListener("lazybeforesizes",g),g}()}}(window,document); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(){var a=navigator.userAgent;window.HTMLPictureElement&&/ecko/.test(a)&&a.match(/rv\:(\d+)/)&&RegExp.$1<40&&addEventListener("resize",function(){var a,b=function(a){var c=window.jQuery||window.Zepto||window.shoestring||window.$;return(b=c&&c.fn&&c.fn.clone?function(a){return c(a).clone(!0)[0]}:function(a){return a.cloneNode()})(a)},c=["_lazybgset","_lazyOptimumx","_lazyrias"],d=function(a){var d,e=0,f=a.parentNode,g=a.getAttribute("src"),h=a.getAttribute("srcset");for(a.removeAttribute("src"),a.removeAttribute("srcset"),d=b(a),f.removeChild(a);3>e;e++)a[c[e]]&&Object.defineProperty(d,c[e],{value:a[c[e]],writable:!0});f.appendChild(d),null!=h&&d.setAttribute("srcset",h),null!=g&&d.setAttribute("src",g)},e=function(){var a,b=document.querySelectorAll("picture > img");for(a=0;a<b.length;a++)if(b[a].complete)b[a].currentSrc&&d(b[a]);else if(b[a].currentSrc){removeEventListener("resize",f);break}},f=function(){clearTimeout(a),a=setTimeout(e,66)};return f}())}(); |
@@ -1,2 +0,2 @@ | ||
/*! lazysizes - v1.1.0-rc1 - Licensed MIT */ | ||
/*! lazysizes - v1.1.0-rc2 - Licensed MIT */ | ||
!function(a,b){"use strict";function c(a,c){if(!e[a]){var d=b.createElement(c?"link":"script"),f=b.getElementsByTagName("script")[0];c?(d.rel="stylesheet",d.href=a):d.src=a,e[a]=!0,e[d.src||d.href]=!0,f.parentNode.insertBefore(d,f)}}var d,e={};b.addEventListener&&a.getComputedStyle&&(d=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 e,f,g,h;b.defaultPrevented||("none"==b.target.preload&&(b.target.preload="auto"),e=b.target.getAttribute("data-link"),e&&c(e,!0),e=b.target.getAttribute("data-script"),e&&c(e),e=b.target.getAttribute("data-require"),e&&a.require&&require([e]),g=b.target.getAttribute("data-bg"),g&&(b.detail.firesLoad=!0,f=function(){b.target.style.backgroundImage="url("+g+")",b.detail.firesLoad=!1,lazySizes.fire(b.target,"_lazyloaded",{},!0,!0)},d(g,f)),h=b.target.getAttribute("data-poster"),h&&(b.detail.firesLoad=!0,f=function(){b.target.poster=h,b.detail.firesLoad=!1,lazySizes.fire(b.target,"_lazyloaded",{},!0,!0)},d(h,f)))},!1))}(window,document); |
@@ -225,3 +225,3 @@ #lazysizes | ||
* ``lazySizesConfig.expFactor`` (default: ``2``): The ``expFactor`` is used to calculate the "preload expand", by multiplying the normal ``expand`` with the ``expFactor``, which is used to preload assets while the browser is idling (no important network traffic and no scrolling). (Reasonable values are between ``1.5`` and ``10`` depending on the ``expand`` option). | ||
* ``lazySizesConfig.loadMode`` (default: ``2``): The ``loadMode`` can be used to constrain the allowed loading mode. Possible values are 1 = only load visible elements, 2 = load also very near view elements (``expand`` option) and 3 = load also not so near elements (``expand`` * ``expFactor`` option). This value is automatically set to ``3`` after onload. Change this value to ``1`` if you (also) optimize for the onload event or change it to ``3`` if your onload event is already heavily delayed. | ||
* ``lazySizesConfig.loadMode`` (default: ``2``): The ``loadMode`` can be used to constrain the allowed loading mode. Possible values are 0 = don't load anything, 1 = only load visible elements, 2 = load also very near view elements (``expand`` option) and 3 = load also not so near elements (``expand`` * ``expFactor`` option). This value is automatically set to ``3`` after onload. Change this value to ``1`` if you (also) optimize for the onload event or change it to ``3`` if your onload event is already heavily delayed. | ||
* ``lazySizesConfig.init`` (default: ``true``): By default lazysizes initializes itself as soon as possible, to load inview assets as soon as possible. In the unlikely case you need to setup/configure something with a later script you can set this option to ``false`` and call ``lazySizes.init();`` later explicitly. | ||
@@ -358,2 +358,6 @@ | ||
####``lazySizes.loader.checkElems()`` | ||
Tests whether new elements has came into view. Normally this method only needs to be called, if ``lazySizesConfig.loadMode`` was set to ``0``. | ||
#####``lazySizes.init()`` | ||
@@ -360,0 +364,0 @@ |
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
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
558
4
178954
45
2157