From 81cf774c6a7f4d8f7f3909e225a65d8acb10cb20 Mon Sep 17 00:00:00 2001 From: Alexander Farkas Date: Sat, 27 Mar 2021 11:05:40 +0100 Subject: [PATCH] 5.3.1 --- CHANGELOG.md | 3 +++ lazysizes-umd.min.js | 2 +- lazysizes.min.js | 2 +- package.json | 2 +- plugins/artdirect/ls.artdirect.min.js | 2 +- plugins/aspectratio/ls.aspectratio.min.js | 2 +- plugins/attrchange/ls.attrchange.min.js | 2 +- plugins/bgset/ls.bgset.min.js | 2 +- plugins/blur-up/ls.blur-up.min.js | 2 +- plugins/custommedia/ls.custommedia.min.js | 2 +- plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.min.js | 2 +- plugins/fix-ios-sizes/fix-ios-sizes.min.js | 2 +- plugins/include/ls.include.min.js | 2 +- plugins/native-loading/ls.native-loading.min.js | 2 +- plugins/noscript/ls.noscript.min.js | 2 +- plugins/object-fit/ls.object-fit.min.js | 2 +- plugins/optimumx/ls.optimumx.min.js | 2 +- plugins/parent-fit/ls.parent-fit.min.js | 2 +- plugins/print/ls.print.min.js | 2 +- plugins/progressive/ls.progressive.min.js | 2 +- plugins/respimg/ls.respimg.min.js | 2 +- plugins/rias/ls.rias.min.js | 2 +- plugins/static-gecko-picture/ls.static-gecko-picture.min.js | 2 +- plugins/twitter/ls.twitter.min.js | 2 +- plugins/unload/ls.unload.min.js | 2 +- plugins/unveilhooks/ls.unveilhooks.min.js | 2 +- plugins/video-embed/ls.video-embed.min.js | 2 +- 27 files changed, 29 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3000e7b..cc675a0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +### 5.3.1 +- Added basic Typescript support + ### 5.3.0 - BGSet: Support adding multiple images/backgrounds through `event.detail.fullSrc` ([#827](https://github.com/aFarkas/lazysizes/issues/827)) diff --git a/lazysizes-umd.min.js b/lazysizes-umd.min.js index f261cff6..671e2f3f 100644 --- a/lazysizes-umd.min.js +++ b/lazysizes-umd.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(e){var t=function(f,D,u){"use strict";var k,H;if(function(){var e;var t={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:true,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:true,ricTimeout:0,throttleDelay:125};H=f.lazySizesConfig||f.lazysizesConfig||{};for(e in t){if(!(e in H)){H[e]=t[e]}}}(),!D||!D.getElementsByClassName){return{init:function(){},cfg:H,noSupport:true}}var O=D.documentElement,i=f.HTMLPictureElement,P="addEventListener",$="getAttribute",q=f[P].bind(f),I=f.setTimeout,U=f.requestAnimationFrame||I,o=f.requestIdleCallback,j=/^picture$/i,r=["load","error","lazyincluded","_lazyloaded"],a={},G=Array.prototype.forEach,J=function(e,t){if(!a[t]){a[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")}return a[t].test(e[$]("class")||"")&&a[t]},K=function(e,t){if(!J(e,t)){e.setAttribute("class",(e[$]("class")||"").trim()+" "+t)}},Q=function(e,t){var a;if(a=J(e,t)){e.setAttribute("class",(e[$]("class")||"").replace(a," "))}},V=function(t,a,e){var i=e?P:"removeEventListener";if(e){V(t,a)}r.forEach(function(e){t[i](e,a)})},X=function(e,t,a,i,r){var n=D.createEvent("Event");if(!a){a={}}a.instance=k;n.initEvent(t,!i,!r);n.detail=a;e.dispatchEvent(n);return n},Y=function(e,t){var a;if(!i&&(a=f.picturefill||H.pf)){if(t&&t.src&&!e[$]("srcset")){e.setAttribute("srcset",t.src)}a({reevaluate:true,elements:[e]})}else if(t&&t.src){e.src=t.src}},Z=function(e,t){return(getComputedStyle(e,null)||{})[t]},s=function(e,t,a){a=a||e.offsetWidth;while(a49?function(){o(t,{timeout:n});if(n!==H.ricTimeout){n=H.ricTimeout}}:te(function(){I(t)},true);return function(e){var t;if(e=e===true){n=33}if(a){return}a=true;t=r-(u.now()-i);if(t<0){t=0}if(e||t<9){s()}else{I(s,t)}}},ie=function(e){var t,a;var i=99;var r=function(){t=null;e()};var n=function(){var e=u.now()-a;if(e0;if(r&&Z(i,"overflow")!="visible"){a=i.getBoundingClientRect();r=C>a.left&&pa.top-1&&g500&&O.clientWidth>500?500:370:H.expand;k._defEx=f;u=f*H.expFactor;c=H.hFac;A=null;if(w2&&h>2&&!D.hidden){w=u;N=0}else if(h>1&&N>1&&M<6){w=f}else{w=_}}if(l!==n){y=innerWidth+n*c;z=innerHeight+n;s=n*-1;l=n}a=d[t].getBoundingClientRect();if((b=a.bottom)>=s&&(g=a.top)<=z&&(C=a.right)>=s*c&&(p=a.left)<=y&&(b||C||p||g)&&(H.loadHidden||x(d[t]))&&(m&&M<3&&!o&&(h<3||N<4)||W(d[t],n))){R(d[t]);r=true;if(M>9){break}}else if(!r&&m&&!i&&M<4&&N<4&&h>2&&(v[0]||H.preloadAfterLoad)&&(v[0]||!o&&(b||C||p||g||d[t][$](H.sizesAttr)!="auto"))){i=v[0]||d[t]}}if(i&&!r){R(i)}}};var a=ae(t);var S=function(e){var t=e.target;if(t._lazyCache){delete t._lazyCache;return}L(e);K(t,H.loadedClass);Q(t,H.loadingClass);V(t,B);X(t,"lazyloaded")};var i=te(S);var B=function(e){i({target:e.target})};var T=function(e,t){var a=e.getAttribute("data-load-mode")||H.iframeLoadMode;if(a==0){e.contentWindow.location.replace(t)}else if(a==1){e.src=t}};var F=function(e){var t;var a=e[$](H.srcsetAttr);if(t=H.customMedia[e[$]("data-media")||e[$]("media")]){e.setAttribute("media",t)}if(a){e.setAttribute("srcset",a)}};var s=te(function(t,e,a,i,r){var n,s,o,l,f,u;if(!(f=X(t,"lazybeforeunveil",e)).defaultPrevented){if(i){if(a){K(t,H.autosizesClass)}else{t.setAttribute("sizes",i)}}s=t[$](H.srcsetAttr);n=t[$](H.srcAttr);if(r){o=t.parentNode;l=o&&j.test(o.nodeName||"")}u=e.firesLoad||"src"in t&&(s||n||l);f={target:t};K(t,H.loadingClass);if(u){clearTimeout(c);c=I(L,2500);V(t,B,true)}if(l){G.call(o.getElementsByTagName("source"),F)}if(s){t.setAttribute("srcset",s)}else if(n&&!l){if(d.test(t.nodeName)){T(t,n)}else{t.src=n}}if(r&&(s||l)){Y(t,{src:n})}}if(t._lazyRace){delete t._lazyRace}Q(t,H.lazyClass);ee(function(){var e=t.complete&&t.naturalWidth>1;if(!u||e){if(e){K(t,H.fastLoadedClass)}S(f);t._lazyCache=true;I(function(){if("_lazyCache"in t){delete t._lazyCache}},9)}if(t.loading=="lazy"){M--}},true)});var R=function(e){if(e._lazyRace){return}var t;var a=n.test(e.nodeName);var i=a&&(e[$](H.sizesAttr)||e[$]("sizes"));var r=i=="auto";if((r||!m)&&a&&(e[$]("src")||e.srcset)&&!e.complete&&!J(e,H.errorClass)&&J(e,H.lazyClass)){return}t=X(e,"lazyunveilread").detail;if(r){re.updateElem(e,true,e.offsetWidth)}e._lazyRace=true;M++;s(e,t,r,i,a)};var r=ie(function(){H.loadMode=3;a()});var o=function(){if(H.loadMode==3){H.loadMode=2}r()};var l=function(){if(m){return}if(u.now()-e<999){I(l,999);return}m=true;H.loadMode=3;a();q("scroll",o,true)};return{_:function(){e=u.now();k.elements=D.getElementsByClassName(H.lazyClass);v=D.getElementsByClassName(H.lazyClass+" "+H.preloadClass);q("scroll",a,true);q("resize",a,true);q("pageshow",function(e){if(e.persisted){var t=D.querySelectorAll("."+H.loadingClass);if(t.length&&t.forEach){U(function(){t.forEach(function(e){if(e.complete){R(e)}})})}}});if(f.MutationObserver){new MutationObserver(a).observe(O,{childList:true,subtree:true,attributes:true})}else{O[P]("DOMNodeInserted",a,true);O[P]("DOMAttrModified",a,true);setInterval(a,999)}q("hashchange",a,true);["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){D[P](e,a,true)});if(/d$|^c/.test(D.readyState)){l()}else{q("load",l);D[P]("DOMContentLoaded",a);I(l,2e4)}if(k.elements.length){t();ee._lsFlush()}else{a()}},checkElems:a,unveil:R,_aLSL:o}}(),re=function(){var a;var n=te(function(e,t,a,i){var r,n,s;e._lazysizesWidth=i;i+="px";e.setAttribute("sizes",i);if(j.test(t.nodeName||"")){r=t.getElementsByTagName("source");for(n=0,s=r.length;n49?function(){o(t,{timeout:n});if(n!==H.ricTimeout){n=H.ricTimeout}}:te(function(){I(t)},true);return function(e){var t;if(e=e===true){n=33}if(a){return}a=true;t=r-(f.now()-i);if(t<0){t=0}if(e||t<9){s()}else{I(s,t)}}},ie=function(e){var t,a;var i=99;var r=function(){t=null;e()};var n=function(){var e=f.now()-a;if(e0;if(r&&Z(i,"overflow")!="visible"){a=i.getBoundingClientRect();r=C>a.left&&pa.top-1&&g500&&O.clientWidth>500?500:370:H.expand;k._defEx=u;f=u*H.expFactor;c=H.hFac;A=null;if(w2&&h>2&&!D.hidden){w=f;N=0}else if(h>1&&N>1&&M<6){w=u}else{w=_}}if(l!==n){y=innerWidth+n*c;z=innerHeight+n;s=n*-1;l=n}a=d[t].getBoundingClientRect();if((b=a.bottom)>=s&&(g=a.top)<=z&&(C=a.right)>=s*c&&(p=a.left)<=y&&(b||C||p||g)&&(H.loadHidden||x(d[t]))&&(m&&M<3&&!o&&(h<3||N<4)||W(d[t],n))){R(d[t]);r=true;if(M>9){break}}else if(!r&&m&&!i&&M<4&&N<4&&h>2&&(v[0]||H.preloadAfterLoad)&&(v[0]||!o&&(b||C||p||g||d[t][$](H.sizesAttr)!="auto"))){i=v[0]||d[t]}}if(i&&!r){R(i)}}};var a=ae(t);var S=function(e){var t=e.target;if(t._lazyCache){delete t._lazyCache;return}L(e);K(t,H.loadedClass);Q(t,H.loadingClass);V(t,B);X(t,"lazyloaded")};var i=te(S);var B=function(e){i({target:e.target})};var T=function(e,t){var a=e.getAttribute("data-load-mode")||H.iframeLoadMode;if(a==0){e.contentWindow.location.replace(t)}else if(a==1){e.src=t}};var F=function(e){var t;var a=e[$](H.srcsetAttr);if(t=H.customMedia[e[$]("data-media")||e[$]("media")]){e.setAttribute("media",t)}if(a){e.setAttribute("srcset",a)}};var s=te(function(t,e,a,i,r){var n,s,o,l,u,f;if(!(u=X(t,"lazybeforeunveil",e)).defaultPrevented){if(i){if(a){K(t,H.autosizesClass)}else{t.setAttribute("sizes",i)}}s=t[$](H.srcsetAttr);n=t[$](H.srcAttr);if(r){o=t.parentNode;l=o&&j.test(o.nodeName||"")}f=e.firesLoad||"src"in t&&(s||n||l);u={target:t};K(t,H.loadingClass);if(f){clearTimeout(c);c=I(L,2500);V(t,B,true)}if(l){G.call(o.getElementsByTagName("source"),F)}if(s){t.setAttribute("srcset",s)}else if(n&&!l){if(d.test(t.nodeName)){T(t,n)}else{t.src=n}}if(r&&(s||l)){Y(t,{src:n})}}if(t._lazyRace){delete t._lazyRace}Q(t,H.lazyClass);ee(function(){var e=t.complete&&t.naturalWidth>1;if(!f||e){if(e){K(t,H.fastLoadedClass)}S(u);t._lazyCache=true;I(function(){if("_lazyCache"in t){delete t._lazyCache}},9)}if(t.loading=="lazy"){M--}},true)});var R=function(e){if(e._lazyRace){return}var t;var a=n.test(e.nodeName);var i=a&&(e[$](H.sizesAttr)||e[$]("sizes"));var r=i=="auto";if((r||!m)&&a&&(e[$]("src")||e.srcset)&&!e.complete&&!J(e,H.errorClass)&&J(e,H.lazyClass)){return}t=X(e,"lazyunveilread").detail;if(r){re.updateElem(e,true,e.offsetWidth)}e._lazyRace=true;M++;s(e,t,r,i,a)};var r=ie(function(){H.loadMode=3;a()});var o=function(){if(H.loadMode==3){H.loadMode=2}r()};var l=function(){if(m){return}if(f.now()-e<999){I(l,999);return}m=true;H.loadMode=3;a();q("scroll",o,true)};return{_:function(){e=f.now();k.elements=D.getElementsByClassName(H.lazyClass);v=D.getElementsByClassName(H.lazyClass+" "+H.preloadClass);q("scroll",a,true);q("resize",a,true);q("pageshow",function(e){if(e.persisted){var t=D.querySelectorAll("."+H.loadingClass);if(t.length&&t.forEach){U(function(){t.forEach(function(e){if(e.complete){R(e)}})})}}});if(u.MutationObserver){new MutationObserver(a).observe(O,{childList:true,subtree:true,attributes:true})}else{O[P]("DOMNodeInserted",a,true);O[P]("DOMAttrModified",a,true);setInterval(a,999)}q("hashchange",a,true);["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){D[P](e,a,true)});if(/d$|^c/.test(D.readyState)){l()}else{q("load",l);D[P]("DOMContentLoaded",a);I(l,2e4)}if(k.elements.length){t();ee._lsFlush()}else{a()}},checkElems:a,unveil:R,_aLSL:o}}(),re=function(){var a;var n=te(function(e,t,a,i){var r,n,s;e._lazysizesWidth=i;i+="px";e.setAttribute("sizes",i);if(j.test(t.nodeName||"")){r=t.getElementsByTagName("source");for(n=0,s=r.length;n", diff --git a/plugins/artdirect/ls.artdirect.min.js b/plugins/artdirect/ls.artdirect.min.js index 85a0a8ca..61bb03ff 100644 --- a/plugins/artdirect/ls.artdirect.min.js +++ b/plugins/artdirect/ls.artdirect.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(e,t){var i;e&&(i=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",i,!0)},t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?i():e.addEventListener("lazyunveilread",i,!0))}("undefined"!=typeof window?window:0,function(o,e,u){"use strict";var d,t,l,f,m,h,p,s;function g(e){return'source[data-tag~="'+e+'"]'}function n(e){var t,i,a,r,s,n,c=e.getAttribute("media");return{source:e,aspectRatio:(t=e,s=parseFloat(t.getAttribute("data-aspectratio")),n=t.getAttribute(d.srcsetAttr)||t.getAttribute("srcset"),s||(r=(i=n.match(f))?"w"==i[2]?(a=i[1],i[3]):(a=i[3],i[1]):(a=t.getAttribute("width"),t.getAttribute("height")),s=a/r),s),isSelected:!c||o.matchMedia(c).matches}}function c(e,t){return e.aspectRatioMath.abs(e[a].aspectRatio-t)&&(i=e[a]);return i}(t.selector?a.filter(function(e){return e.source.matches(t.selector)}):a,i);r.isSelected||y(r.source,"(min-width: 1px)"),a.filter(function(e){return e!=r&&e.isSelected}).forEach(function(e){y(e.source,"(x)")})}o.addEventListener&&(d=u.cfg,t=(o.Element||Node||o.HTMLElement).prototype,l=/artdirect/,f=/\s+(\d+)(w|h)\s+(\d+)(w|h)/,m=/artdirect["']*\s*:\s*["']*(.+?)(?=($|'|"|;))/,h=/^picture$/i,p=/[\s,]+/g,s=[].slice,t.matches||(t.matches=t.matchesSelector||t.webkitMatchesSelector||t.msMatchesSelector||t.oMatchesSelector),o.addEventListener("lazybeforesizes",function(e){var t,i,a,r,s,n,c;e.detail.instance==u&&(t=e.target,r=(a=t).parentNode,s=h.test(r.nodeName||""),n=(o.getComputedStyle(a)||{}).fontFamily,c=null,s&&(d.autoArtDirect||l.test(n||""))&&(c={picture:r,img:a,tags:n.match(m)}).tags&&(c.selector=c.tags[1].split(p).map(g).join(",")),(i=c)&&b(i))},!0))}); \ No newline at end of file diff --git a/plugins/aspectratio/ls.aspectratio.min.js b/plugins/aspectratio/ls.aspectratio.min.js index 74b8504c..b4cc7708 100644 --- a/plugins/aspectratio/ls.aspectratio.min.js +++ b/plugins/aspectratio/ls.aspectratio.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(e,t){var i=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",i,!0)};t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?i():e.addEventListener("lazyunveilread",i,!0)}(window,function(o,r,e){"use strict";var s,t,i,n,d,c,a,u,f,l,m,h,p;function g(){this.ratioElems=r.getElementsByClassName("lazyaspectratio"),this._setupEvents(),this.processImages()}o.addEventListener&&(s=Array.prototype.forEach,d=/^picture$/i,a="img["+(c="data-aspectratio")+"]",u=function(e){return o.matchMedia?(u=function(e){return!e||(matchMedia(e)||{}).matches})(e):o.Modernizr&&Modernizr.mq?!e||Modernizr.mq(e):!e},f=e.aC,l=e.rC,m=e.cfg,g.prototype={_setupEvents:function(){function t(e){e.naturalWidth<36?n.addAspectRatio(e,!0):n.removeAspectRatio(e,!0)}function e(){n.processImages()}var i,n=this;function a(){s.call(n.ratioElems,t)}r.addEventListener("load",function(e){e.target.getAttribute&&e.target.getAttribute(c)&&t(e.target)},!0),addEventListener("resize",function(){clearTimeout(i),i=setTimeout(a,99)}),r.addEventListener("DOMContentLoaded",e),addEventListener("load",e)},processImages:function(e){for(var t=("length"in(e=e||r)&&!e.nodeName?e:e.querySelectorAll(a)),i=0;it._lazysizesWidth)&&(t._lazysizesWidth=a),t._lazysizesWidth))}))}); \ No newline at end of file diff --git a/plugins/blur-up/ls.blur-up.min.js b/plugins/blur-up/ls.blur-up.min.js index 2e74a315..6eca63f4 100644 --- a/plugins/blur-up/ls.blur-up.min.js +++ b/plugins/blur-up/ls.blur-up.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(e,t){var a;e&&(a=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)},t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0))}("undefined"!=typeof window?window:0,function(l,b,A){"use strict";var a;!function(){var e,t={blurUpClass:"ls-blur-up-img",blurUpLoadingClass:"ls-blur-up-is-loading",blurUpInviewClass:"ls-inview",blurUpLoadedClass:"ls-blur-up-loaded",blurUpLoadedOriginalClass:"ls-original-loaded"};for(e in a=A.cfg||{},t)e in a||(a[e]=t[e])}();function r(e,t){var i;return(e?n.call(e.querySelectorAll("source, img")):[t]).forEach(function(e){var t,a,n,r;i||(!(t=e.getAttribute("data-lowsrc"))||(n=(a=e).getAttribute("data-media")||a.getAttribute("media"),(r=a.getAttribute("type"))&&!o.test(r)||n&&!l.matchMedia(A.cfg.customMedia[n]||n).matches)||(i=t))}),i}function i(e,t,a,n){function r(){l&&A.rAF(function(){A.rC(t,A.cfg.blurUpLoadingClass);try{l.parentNode.removeChild(l)}catch(e){}l=null})}function i(e){c++,u=e||u,e?r():1=c)){if(!(i.d<=n)&&(r=e.cands[c-1],a=i.d,d=n,s=u=void 0,r&&r.d&&(s=.7=d||((u=Math.pow(r.d-s,1.6)||.1)<.1?u=.1:3=devicePixelRatio||(!u||!a._lazyOptimumx||d.reloaded||c.unloadedClass&&s.hC(a,c.unloadedClass)||(a._lazyOptimumx=null),n=l(a,"_lazyOptimumx"),(i=d.width)&&(n.width||0)=e.d){!n.cached&&(t=e[a-1])&&t.d>e.d-.13*Math.pow(e.d,2.2)&&(r=Math.pow(t.d-.6,1.6),t.cached&&(t.d+=.15*r),t.d+(n.d-e.d)*r>e.d&&(n=t));break}return n}(n.sort(v)),n.src=a):a=n.src):a=n[0],a}function E(e){var t;g&&e.parentNode&&"PICTURE"!=e.parentNode.nodeName.toUpperCase()||(t=A(e))&&t.u&&e._lazypolyfill.cur!=t.u&&(e._lazypolyfill.cur=t.u,t.cached=!0,e.setAttribute(y.srcAttr,t.u),e.setAttribute("src",t.u))}y.supportsType||(y.supportsType=function(e){return!e}),d.HTMLPictureElement&&g?!p.hasHDescriptorFix&&n.msElementsFromPoint&&(p.hasHDescriptorFix=!0,z()):d.picturefill||y.pf||(y.pf=function(e){var t,r;if(!d.picturefill)for(t=0,r=e.elements.length;t img:not([srcset])."].forEach(function(e){u.push(e+y.loadedClass),u.push(e+y.loadingClass)}),y.pf({elements:n.querySelectorAll(u.join(", "))})))}); \ No newline at end of file diff --git a/plugins/rias/ls.rias.min.js b/plugins/rias/ls.rias.min.js index 4405da58..196bd564 100644 --- a/plugins/rias/ls.rias.min.js +++ b/plugins/rias/ls.rias.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(t,e){var r=function(){e(t.lazySizes),t.removeEventListener("lazyunveilread",r,!0)};e=e.bind(null,t,t.document),"object"==typeof module&&module.exports?e(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],e):t.lazySizes?r():t.addEventListener("lazyunveilread",r,!0)}(window,function(f,u,g){"use strict";var b,m,i=g.cfg,d={string:1,number:1},l=/^\-*\+*\d+\.*\d*$/,p=/^picture$/i,v=/\s*\{\s*width\s*\}\s*/i,y=/\s*\{\s*height\s*\}\s*/i,h=/\s*\{\s*([a-z0-9]+)\s*\}\s*/gi,z=/^\[.*\]|\{.*\}$/,A=/^(?:auto|\d+(px)?)$/,w=u.createElement("a"),t=u.createElement("img"),P="srcset"in t&&!("sizes"in t),E=!!f.HTMLPictureElement&&!P;function N(a,t,s){var e,r,i,n,o,c=f.getComputedStyle(a);if(s){for(n in o={},s)o[n]=s[n];s=o}else r=a.parentNode,s={isPicture:!(!r||!p.test(r.nodeName||""))};for(e in i=function(t,e){var r,i=a.getAttribute("data-"+t);if(i||(r=c.getPropertyValue("--ls-"+t))&&(i=r.trim()),i){if("true"==i)i=!0;else if("false"==i)i=!1;else if(l.test(i))i=parseFloat(i);else if("function"==typeof m[t])i=m[t](a,i);else if(z.test(i))try{i=JSON.parse(i)}catch(t){}s[t]=i}else t in m&&"function"!=typeof m[t]&&!s[t]?s[t]=m[t]:e&&"function"==typeof m[t]&&(s[t]=m[t](a,i))},m)i(e);return t.replace(h,function(t,e){e in s||i(e,!0)}),s}function _(t,e,r){var s,n,o,i=0,a=0,c=r;if(t){if("container"===e.ratio){for(i=c.scrollWidth,a=c.scrollHeight;!(i&&a||c===u);)i=(c=c.parentNode).scrollWidth,a=c.scrollHeight;i&&a&&(e.ratio=e.traditionalRatio?a/i:i/a)}s=t,n=e,(o=[]).srcset=[],n.absUrl&&(w.setAttribute("href",s),s=w.href),s=((n.prefix||"")+s+(n.postfix||"")).replace(h,function(t,e){return d[typeof n[e]]?n[e]:t}),n.widths.forEach(function(t){var e=n.widthmap[t]||t,r=n.aspectratio||n.ratio,i=!n.aspectratio&&m.traditionalRatio,a={u:s.replace(v,e).replace(y,r?i?Math.round(t*r):Math.round(t/r):""),w:t};o.push(a),o.srcset.push(a.c=a.u+" "+t+"w")}),(t=o).isPicture=e.isPicture,P&&"IMG"==r.nodeName.toUpperCase()?r.removeAttribute(b.srcsetAttr):r.setAttribute(b.srcsetAttr,t.srcset.join(", ")),Object.defineProperty(r,"_lazyrias",{value:t,writable:!0})}}function x(t){return t.getAttribute(t.getAttribute("data-srcattr")||m.srcAttr)||t.getAttribute(b.srcsetAttr)||t.getAttribute(b.srcAttr)||t.getAttribute("data-pfsrcset")||""}!function(){var t,e={prefix:"",postfix:"",srcAttr:"data-src",absUrl:!1,modifyOptions:function(){},widthmap:{},ratio:!1,traditionalRatio:!1,aspectratio:!1};for(t in(b=g&&g.cfg).supportsType||(b.supportsType=function(t){return!t}),b.rias||(b.rias={}),"widths"in(m=b.rias)||(m.widths=[],function(t){for(var e,r=0;!e||e<3e3;)30<(r+=5)&&(r+=1),e=36*r,t.push(e)}(m.widths)),e)t in m||(m[t]=e[t])}(),addEventListener("lazybeforesizes",function(t){if(t.detail.instance==g){var e,r,i,a,s,n,o,c,u,d,f,l=t.target;if(t.detail.dataAttr&&!t.defaultPrevented&&!m.disabled&&(o=l.getAttribute(b.sizesAttr)||l.getAttribute("sizes"))&&A.test(o)){var p,y,h=x(l);if(y=N(p=l,h),m.modifyOptions.call(p,{target:p,details:y,detail:y}),g.fire(p,"lazyriasmodifyoptions",y),e=y,u=v.test(e.prefix)||v.test(e.postfix),e.isPicture&&(r=l.parentNode))for(a=0,s=(i=r.getElementsByTagName("source")).length;a=t.d){!a.cached&&(e=t[s-1])&&e.d>t.d-.13*Math.pow(t.d,2.2)&&(r=Math.pow(e.d-.6,1.6),e.cached&&(e.d+=.15*r),e.d+(a.d-t.d)*r>t.d&&(a=e));break}return a}(d.sort(L))),n}}); \ No newline at end of file diff --git a/plugins/static-gecko-picture/ls.static-gecko-picture.min.js b/plugins/static-gecko-picture/ls.static-gecko-picture.min.js index 29161e66..b7ca02e0 100644 --- a/plugins/static-gecko-picture/ls.static-gecko-picture.min.js +++ b/plugins/static-gecko-picture/ls.static-gecko-picture.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(e,t){var i=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",i,!0)};t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?i():e.addEventListener("lazyunveilread",i,!0)}(window,function(e,i,t){var n,a,s,o,r=navigator.userAgent;function d(){for(var e=i.querySelectorAll("picture > img, img[srcset][sizes]"),t=0;te._pfLastSize)&&(e._pfLastSize=e.offsetWidth,i=e.sizes,e.sizes+=",100vw",setTimeout(function(){e.sizes=i}))}(e[t])}function c(){clearTimeout(a),a=setTimeout(d,99)}function f(){c(),o&&o.addListener&&o.addListener(c)}e.HTMLPictureElement&&/ecko/.test(r)&&(n=r.match(/rv\:(\d+)/))&&n[1]<41&&addEventListener("resize",(s=i.createElement("source"),o=e.matchMedia&&matchMedia("(orientation: landscape)"),s.srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",/^[c|i]|d$/.test(i.readyState||"")?f():i.addEventListener("DOMContentLoaded",f),c))}); \ No newline at end of file diff --git a/plugins/twitter/ls.twitter.min.js b/plugins/twitter/ls.twitter.min.js index 61834871..c69f3f12 100644 --- a/plugins/twitter/ls.twitter.min.js +++ b/plugins/twitter/ls.twitter.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(e,t){var i;e&&(i=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",i,!0)},t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?i():e.addEventListener("lazyunveilread",i,!0))}("undefined"!=typeof window?window:0,function(r,a,d){"use strict";var o;a.addEventListener("lazybeforeunveil",function(e){var t,i,n;e.detail.instance!=d||(t=e.target.getAttribute("data-twitter"))&&(d.aC(e.target,t),r.twttr&&twttr.widgets?twttr.widgets.load():o||(i=a.createElement("script"),n=a.getElementsByTagName("script")[0],i.src="//platform.twitter.com/widgets.js",o=!0,n.parentNode.insertBefore(i,n)))})}); \ No newline at end of file diff --git a/plugins/unload/ls.unload.min.js b/plugins/unload/ls.unload.min.js index 8615f072..121dd02d 100644 --- a/plugins/unload/ls.unload.min.js +++ b/plugins/unload/ls.unload.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(e,t){var a=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)};t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(s,d,i){"use strict";var r,u,o,c,f,A;d.addEventListener&&(o=i.cfg,c=[],f=s.requestAnimationFrame||setTimeout,A={checkElements:function(){for(var e,t=1.1*(i._defEx+99),a=-1*t,n=a,l=innerHeight+t,s=innerWidth+t,d=0,o=u.length;dl||e.bottoms||e.rightr.unloadPixelThreshold&&e.target.className&&e.target.className.indexOf&&-1!=e.target.className.indexOf(o.loadingClass)&&-1==e.target.className.indexOf(o.preloadClass)&&i.aC(e.target,o.unloadClass)},!0),i.unloader=A,u=d.getElementsByClassName([r.unloadClass,r.loadedClass].join(" ")),setInterval(a,9999),addEventListener("lazybeforeunveil",a),addEventListener("lazybeforeunveil",A._reload,!0))}))}); \ No newline at end of file diff --git a/plugins/unveilhooks/ls.unveilhooks.min.js b/plugins/unveilhooks/ls.unveilhooks.min.js index e53b74ec..80672571 100644 --- a/plugins/unveilhooks/ls.unveilhooks.min.js +++ b/plugins/unveilhooks/ls.unveilhooks.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(e,t){var a=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)};t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(e,i,o){"use strict";var l,d,u={};function s(e,t,a){var n,r;u[e]||(n=i.createElement(t?"link":"script"),r=i.getElementsByTagName("script")[0],t?(n.rel="stylesheet",n.href=e):(n.onload=function(){n.onerror=null,n.onload=null,a()},n.onerror=n.onload,n.src=e),u[e]=!0,u[n.src||n.href]=!0,r.parentNode.insertBefore(n,r))}i.addEventListener&&(l=function(e,t){var a=i.createElement("img");a.onload=function(){a.onload=null,a.onerror=null,a=null,t()},a.onerror=a.onload,a.src=e,a&&a.complete&&a.onload&&a.onload()},addEventListener("lazybeforeunveil",function(e){var t,a,n;if(e.detail.instance==o&&!e.defaultPrevented){var r=e.target;if("none"==r.preload&&(r.preload=r.getAttribute("data-preload")||"auto"),null!=r.getAttribute("data-autoplay"))if(r.getAttribute("data-expand")&&!r.autoplay)try{r.play()}catch(e){}else requestAnimationFrame(function(){r.setAttribute("data-expand","-10"),o.aC(r,o.cfg.lazyClass)});(t=r.getAttribute("data-link"))&&s(t,!0),(t=r.getAttribute("data-script"))&&(e.detail.firesLoad=!0,s(t,null,function(){e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(t=r.getAttribute("data-require"))&&(o.cfg.requireJs?o.cfg.requireJs([t]):s(t)),(a=r.getAttribute("data-bg"))&&(e.detail.firesLoad=!0,l(a,function(){r.style.backgroundImage="url("+(d.test(a)?JSON.stringify(a):a)+")",e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(n=r.getAttribute("data-poster"))&&(e.detail.firesLoad=!0,l(n,function(){r.poster=n,e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)}))}},!(d=/\(|\)|\s|'/)))}); \ No newline at end of file diff --git a/plugins/video-embed/ls.video-embed.min.js b/plugins/video-embed/ls.video-embed.min.js index b8763632..bef4f277 100644 --- a/plugins/video-embed/ls.video-embed.min.js +++ b/plugins/video-embed/ls.video-embed.min.js @@ -1,3 +1,3 @@ -/*! lazysizes - v5.3.0 */ +/*! lazysizes - v5.3.1 */ !function(e,t){var a;e&&(a=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)},t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0))}("undefined"!=typeof window?window:0,function(l,o,u){"use strict";var e,d,c,s,r,n,m,f,v,p;function b(e,t){var a,i,r,n;a=v.replace(c,e),i=function(e){e&&e.thumbnail_url&&(t.style.backgroundImage="url("+e.thumbnail_url+")")},r="vimeoCallback"+d,n=o.createElement("script"),a+="&callback="+r,d++,l[r]=function(e){n.parentNode.removeChild(n),delete l[r],i(e)},n.src=a,o.head.appendChild(n),t.addEventListener("click",y)}function y(e){var t=e.currentTarget,a=t.getAttribute("data-vimeo"),i=t.getAttribute("data-vimeoparams")||"";t.removeEventListener("click",y),a&&n.test(a)&&(!i||n.test(i))&&(i&&!r.test(i)&&(i="&"+i),e.preventDefault(),t.innerHTML='')}function g(e){var t=e.currentTarget,a=t.getAttribute("data-youtube"),i=t.getAttribute("data-ytparams")||"";t.removeEventListener("click",g),a&&n.test(a)&&(!i||n.test(i))&&(i&&!r.test(i)&&(i="&"+i),e.preventDefault(),t.innerHTML='')}o.getElementsByClassName&&(e="https:"==location.protocol?"https:":"http:",d=Date.now(),c=/\{\{id}}/,s=/\{\{hqdefault}}/,r=/^&/,n=/^[a-z0-9-_&=]+$/i,m=e+"//img.youtube.com/vi/{{id}}/{{hqdefault}}.jpg",f=e+"//www.youtube.com/embed/{{id}}?autoplay=1",v=e+"//vimeo.com/api/oembed.json?url=https%3A//vimeo.com/{{id}}",p=e+"//player.vimeo.com/video/{{id}}?autoplay=1",o.addEventListener("lazybeforeunveil",function(e){var t,a,i,r,n,l;e.detail.instance==u&&(a=(t=e.target).getAttribute("data-youtube"),i=t.getAttribute("data-vimeo"),a&&t&&(r=a,l=(n=t).getAttribute("data-thumb-size")||u.cfg.ytThumb||"hqdefault",n.style.backgroundImage="url("+m.replace(c,r).replace(s,l)+")",n.addEventListener("click",g)),i&&t&&b(i,t))}))}); \ No newline at end of file