From 4b0ea6925279a3974135db8330b03840dd197ef5 Mon Sep 17 00:00:00 2001 From: Alexander Farkas Date: Sat, 5 Oct 2019 12:41:20 +0200 Subject: [PATCH] 5.1.2 --- CHANGELOG.md | 4 ++++ 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, 30 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85bb65ee..3b6539cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 5.1.2 + +Fix visibility check (fixes [#709](https://github.com/aFarkas/lazysizes/issues/709)) + ## 5.1.1 * Fix ratio calculation in rias plugin (fixed in [#685](https://github.com/aFarkas/lazysizes/pull/685) by [tikotzky](https://github.com/tikotzky)) diff --git a/lazysizes-umd.min.js b/lazysizes-umd.min.js index 6bfa4359..1ac172f7 100644 --- a/lazysizes-umd.min.js +++ b/lazysizes-umd.min.js @@ -1,2 +1,2 @@ -/*! lazysizes - v5.1.1 */ +/*! lazysizes - v5.1.2 */ !function(a,b){var c=b(a,a.document);"object"==typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd?define(c):a.lazySizes=c}(window,function(a,b){"use strict";var c,d;if(function(){var b,c={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:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};d=a.lazySizesConfig||a.lazysizesConfig||{};for(b in c)b in d||(d[b]=c[b])}(),!b||!b.getElementsByClassName)return{init:function(){},cfg:d,noSupport:!0};var e=b.documentElement,f=a.Date,g=a.HTMLPictureElement,h="addEventListener",i="getAttribute",j=a[h],k=a.setTimeout,l=a.requestAnimationFrame||k,m=a.requestIdleCallback,n=/^picture$/i,o=["load","error","lazyincluded","_lazyloaded"],p={},q=Array.prototype.forEach,r=function(a,b){return p[b]||(p[b]=new RegExp("(\\s|^)"+b+"(\\s|$)")),p[b].test(a[i]("class")||"")&&p[b]},s=function(a,b){r(a,b)||a.setAttribute("class",(a[i]("class")||"").trim()+" "+b)},t=function(a,b){var c;(c=r(a,b))&&a.setAttribute("class",(a[i]("class")||"").replace(c," "))},u=function(a,b,c){var d=c?h:"removeEventListener";c&&u(a,b),o.forEach(function(c){a[d](c,b)})},v=function(a,d,e,f,g){var h=b.createEvent("Event");return e||(e={}),e.instance=c,h.initEvent(d,!f,!g),h.detail=e,a.dispatchEvent(h),h},w=function(b,c){var e;!g&&(e=a.picturefill||d.pf)?(c&&c.src&&!b[i]("srcset")&&b.setAttribute("srcset",c.src),e({reevaluate:!0,elements:[b]})):c&&c.src&&(b.src=c.src)},x=function(a,b){return(getComputedStyle(a,null)||{})[b]},y=function(a,b,c){for(c=c||a.offsetWidth;c49?function(){m(h,{timeout:g}),g!==d.ricTimeout&&(g=d.ricTimeout)}:A(function(){k(h)},!0);return function(a){var d;(a=!0===a)&&(g=33),b||(b=!0,d=e-(f.now()-c),d<0&&(d=0),a||d<9?i():k(i,d))}},C=function(a){var b,c,d=99,e=function(){b=null,a()},g=function(){var a=f.now()-c;a0)&&"visible"!=x(f,"overflow")&&(d=f.getBoundingClientRect(),g=H>d.left&&Gd.top-1&&F500&&e.clientWidth>500?500:370:d.expand,c._defEx=r,s=r*d.expFactor,t=d.hFac,J=null,O2&&o>2&&!b.hidden?(O=s,Q=0):O=o>1&&Q>1&&P<6?r:N),q!==m&&(y=innerWidth+m*t,D=innerHeight+m,n=-1*m,q=m),h=u[f].getBoundingClientRect(),(I=h.bottom)>=n&&(F=h.top)<=D&&(H=h.right)>=n*t&&(G=h.left)<=y&&(I||H||G||F)&&(d.loadHidden||S(u[f]))&&(l&&P<3&&!p&&(o<3||Q<4)||T(u[f],m))){if(aa(u[f]),k=!0,P>9)break}else!k&&l&&!j&&P<4&&Q<4&&o>2&&(g[0]||d.preloadAfterLoad)&&(g[0]||!p&&(I||H||G||F||"auto"!=u[f][i](d.sizesAttr)))&&(j=g[0]||u[f]);j&&!k&&aa(j)}},V=B(U),W=function(a){var b=a.target;if(b._lazyCache)return void delete b._lazyCache;R(a),s(b,d.loadedClass),t(b,d.loadingClass),u(b,Y),v(b,"lazyloaded")},X=A(W),Y=function(a){X({target:a.target})},Z=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.src=b}},$=function(a){var b,c=a[i](d.srcsetAttr);(b=d.customMedia[a[i]("data-media")||a[i]("media")])&&a.setAttribute("media",b),c&&a.setAttribute("srcset",c)},_=A(function(a,b,c,e,f){var g,h,j,l,o,p;(o=v(a,"lazybeforeunveil",b)).defaultPrevented||(e&&(c?s(a,d.autosizesClass):a.setAttribute("sizes",e)),h=a[i](d.srcsetAttr),g=a[i](d.srcAttr),f&&(j=a.parentNode,l=j&&n.test(j.nodeName||"")),p=b.firesLoad||"src"in a&&(h||g||l),o={target:a},s(a,d.loadingClass),p&&(clearTimeout(m),m=k(R,2500),u(a,Y,!0)),l&&q.call(j.getElementsByTagName("source"),$),h?a.setAttribute("srcset",h):g&&!l&&(L.test(a.nodeName)?Z(a,g):a.src=g),f&&(h||l)&&w(a,{src:g})),a._lazyRace&&delete a._lazyRace,t(a,d.lazyClass),z(function(){var b=a.complete&&a.naturalWidth>1;p&&!b||(b&&s(a,"ls-is-cached"),W(o),a._lazyCache=!0,k(function(){"_lazyCache"in a&&delete a._lazyCache},9)),"lazy"==a.loading&&P--},!0)}),aa=function(a){if(!a._lazyRace){var b,c=K.test(a.nodeName),e=c&&(a[i](d.sizesAttr)||a[i]("sizes")),f="auto"==e;(!f&&l||!c||!a[i]("src")&&!a.srcset||a.complete||r(a,d.errorClass)||!r(a,d.lazyClass))&&(b=v(a,"lazyunveilread").detail,f&&E.updateElem(a,!0,a.offsetWidth),a._lazyRace=!0,P++,_(a,b,f,e,c))}},ba=C(function(){d.loadMode=3,V()}),ca=function(){3==d.loadMode&&(d.loadMode=2),ba()},da=function(){if(!l){if(f.now()-p<999)return void k(da,999);l=!0,d.loadMode=3,V(),j("scroll",ca,!0)}};return{_:function(){p=f.now(),c.elements=b.getElementsByClassName(d.lazyClass),g=b.getElementsByClassName(d.lazyClass+" "+d.preloadClass),j("scroll",V,!0),j("resize",V,!0),a.MutationObserver?new MutationObserver(V).observe(e,{childList:!0,subtree:!0,attributes:!0}):(e[h]("DOMNodeInserted",V,!0),e[h]("DOMAttrModified",V,!0),setInterval(V,999)),j("hashchange",V,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(a){b[h](a,V,!0)}),/d$|^c/.test(b.readyState)?da():(j("load",da),b[h]("DOMContentLoaded",V),k(da,2e4)),c.elements.length?(U(),z._lsFlush()):V()},checkElems:V,unveil:aa,_aLSL:ca}}(),E=function(){var a,c=A(function(a,b,c,d){var e,f,g;if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),n.test(b.nodeName||""))for(e=b.getElementsByTagName("source"),f=0,g=e.length;f49?function(){m(h,{timeout:g}),g!==d.ricTimeout&&(g=d.ricTimeout)}:A(function(){k(h)},!0);return function(a){var d;(a=!0===a)&&(g=33),b||(b=!0,d=e-(f.now()-c),d<0&&(d=0),a||d<9?i():k(i,d))}},C=function(a){var b,c,d=99,e=function(){b=null,a()},g=function(){var a=f.now()-c;a0)&&"visible"!=x(f,"overflow")&&(d=f.getBoundingClientRect(),g=H>d.left&&Gd.top-1&&F500&&e.clientWidth>500?500:370:d.expand,c._defEx=r,s=r*d.expFactor,t=d.hFac,J=null,O2&&o>2&&!b.hidden?(O=s,Q=0):O=o>1&&Q>1&&P<6?r:N),q!==m&&(y=innerWidth+m*t,D=innerHeight+m,n=-1*m,q=m),h=u[f].getBoundingClientRect(),(I=h.bottom)>=n&&(F=h.top)<=D&&(H=h.right)>=n*t&&(G=h.left)<=y&&(I||H||G||F)&&(d.loadHidden||S(u[f]))&&(l&&P<3&&!p&&(o<3||Q<4)||T(u[f],m))){if(aa(u[f]),k=!0,P>9)break}else!k&&l&&!j&&P<4&&Q<4&&o>2&&(g[0]||d.preloadAfterLoad)&&(g[0]||!p&&(I||H||G||F||"auto"!=u[f][i](d.sizesAttr)))&&(j=g[0]||u[f]);j&&!k&&aa(j)}},V=B(U),W=function(a){var b=a.target;if(b._lazyCache)return void delete b._lazyCache;R(a),s(b,d.loadedClass),t(b,d.loadingClass),u(b,Y),v(b,"lazyloaded")},X=A(W),Y=function(a){X({target:a.target})},Z=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.src=b}},$=function(a){var b,c=a[i](d.srcsetAttr);(b=d.customMedia[a[i]("data-media")||a[i]("media")])&&a.setAttribute("media",b),c&&a.setAttribute("srcset",c)},_=A(function(a,b,c,e,f){var g,h,j,l,o,p;(o=v(a,"lazybeforeunveil",b)).defaultPrevented||(e&&(c?s(a,d.autosizesClass):a.setAttribute("sizes",e)),h=a[i](d.srcsetAttr),g=a[i](d.srcAttr),f&&(j=a.parentNode,l=j&&n.test(j.nodeName||"")),p=b.firesLoad||"src"in a&&(h||g||l),o={target:a},s(a,d.loadingClass),p&&(clearTimeout(m),m=k(R,2500),u(a,Y,!0)),l&&q.call(j.getElementsByTagName("source"),$),h?a.setAttribute("srcset",h):g&&!l&&(L.test(a.nodeName)?Z(a,g):a.src=g),f&&(h||l)&&w(a,{src:g})),a._lazyRace&&delete a._lazyRace,t(a,d.lazyClass),z(function(){var b=a.complete&&a.naturalWidth>1;p&&!b||(b&&s(a,"ls-is-cached"),W(o),a._lazyCache=!0,k(function(){"_lazyCache"in a&&delete a._lazyCache},9)),"lazy"==a.loading&&P--},!0)}),aa=function(a){if(!a._lazyRace){var b,c=K.test(a.nodeName),e=c&&(a[i](d.sizesAttr)||a[i]("sizes")),f="auto"==e;(!f&&l||!c||!a[i]("src")&&!a.srcset||a.complete||r(a,d.errorClass)||!r(a,d.lazyClass))&&(b=v(a,"lazyunveilread").detail,f&&E.updateElem(a,!0,a.offsetWidth),a._lazyRace=!0,P++,_(a,b,f,e,c))}},ba=C(function(){d.loadMode=3,V()}),ca=function(){3==d.loadMode&&(d.loadMode=2),ba()},da=function(){if(!l){if(f.now()-p<999)return void k(da,999);l=!0,d.loadMode=3,V(),j("scroll",ca,!0)}};return{_:function(){p=f.now(),c.elements=b.getElementsByClassName(d.lazyClass),g=b.getElementsByClassName(d.lazyClass+" "+d.preloadClass),j("scroll",V,!0),j("resize",V,!0),a.MutationObserver?new MutationObserver(V).observe(e,{childList:!0,subtree:!0,attributes:!0}):(e[h]("DOMNodeInserted",V,!0),e[h]("DOMAttrModified",V,!0),setInterval(V,999)),j("hashchange",V,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(a){b[h](a,V,!0)}),/d$|^c/.test(b.readyState)?da():(j("load",da),b[h]("DOMContentLoaded",V),k(da,2e4)),c.elements.length?(U(),z._lsFlush()):V()},checkElems:V,unveil:aa,_aLSL:ca}}(),E=function(){var a,c=A(function(a,b,c,d){var e,f,g;if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),n.test(b.nodeName||""))for(e=b.getElementsByTagName("source"),f=0,g=e.length;f", diff --git a/plugins/artdirect/ls.artdirect.min.js b/plugins/artdirect/ls.artdirect.min.js index 9f7a202f..f22fcbc7 100644 --- a/plugins/artdirect/ls.artdirect.min.js +++ b/plugins/artdirect/ls.artdirect.min.js @@ -1,2 +1,2 @@ -/*! lazysizes - v5.1.1 */ +/*! lazysizes - v5.1.2 */ !function(a,b){if(a){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}}("undefined"!=typeof window?window:0,function(a,b,c){"use strict";function d(a){var b,c,d,e=parseFloat(a.getAttribute("data-aspectratio")),f=a.getAttribute(n.srcsetAttr)||a.getAttribute("srcset");return e||(b=f.match(q),b?"w"==b[2]?(c=b[1],d=b[3]):(c=b[3],d=b[1]):(c=a.getAttribute("width"),d=a.getAttribute("height")),e=c/d),e}function e(a){return a.offsetWidth/a.offsetHeight}function f(a){return'source[data-tag~="'+a+'"]'}function g(b){var c=b.parentNode,d=s.test(c.nodeName||""),e=(a.getComputedStyle(b)||{}).fontFamily,g=null;return d&&(n.autoArtDirect||p.test(e||""))&&(g={picture:c,img:b,tags:e.match(r)},g.tags&&(g.selector=g.tags[1].split(t).map(f).join(","))),g}function h(b){var c=b.getAttribute("media");return{source:b,aspectRatio:d(b),isSelected:!c||a.matchMedia(c).matches}}function i(a,b){return a.aspectRatioMath.abs(a[c].aspectRatio-b)&&(e=a[c]);return e}function k(a,b){a._lsMedia=b,c.rAF(function(){a._lsMedia&&delete a._lsMedia,a.setAttribute("media",b)})}function l(a){var b=e(a.img),c=u.call(a.picture.getElementsByTagName("source")).map(h).sort(i),d=a.selector?c.filter(function(b){return b.source.matches(a.selector)}):c,f=j(d,b);f.isSelected||k(f.source,"(min-width: 1px)"),c.filter(function(a){return a!=f&&a.isSelected}).forEach(function(a){k(a.source,"(x)")})}function m(a){if(a.detail.instance==c){var b=a.target,d=g(b);d&&l(d)}}if(a.addEventListener){var n=c.cfg,o=(a.Element||Node||a.HTMLElement).prototype,p=/artdirect/,q=/\s+(\d+)(w|h)\s+(\d+)(w|h)/,r=/artdirect["']*\s*:\s*["']*(.+?)(?=($|'|"|;))/,s=/^picture$/i,t=/[\s,]+/g,u=[].slice;o.matches||(o.matches=o.matchesSelector||o.webkitMatchesSelector||o.msMatchesSelector||o.oMatchesSelector),a.addEventListener("lazybeforesizes",m,!0)}}); \ No newline at end of file diff --git a/plugins/aspectratio/ls.aspectratio.min.js b/plugins/aspectratio/ls.aspectratio.min.js index bad87e5f..05b022cd 100644 --- a/plugins/aspectratio/ls.aspectratio.min.js +++ b/plugins/aspectratio/ls.aspectratio.min.js @@ -1,2 +1,2 @@ -/*! lazysizes - v5.1.1 */ +/*! lazysizes - v5.1.2 */ !function(a,b){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}(window,function(a,b,c){"use strict";function d(){this.ratioElems=b.getElementsByClassName("lazyaspectratio"),this._setupEvents(),this.processImages()}if(a.addEventListener){var e,f,g,h=Array.prototype.forEach,i=/^picture$/i,j="data-aspectratio",k="img["+j+"]",l=function(b){return a.matchMedia?(l=function(a){return!a||(matchMedia(a)||{}).matches})(b):a.Modernizr&&Modernizr.mq?!b||Modernizr.mq(b):!b},m=c.aC,n=c.rC,o=c.cfg;d.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(j)&&c(a.target)},!0),addEventListener("resize",function(){var b,d=function(){h.call(a.ratioElems,c)};return function(){clearTimeout(b),b=setTimeout(d,99)}}()),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(k);for(d=0;d36?this.removeAspectRatio(c[d]):this.addAspectRatio(c[d])},getSelectedRatio:function(a){var b,c,d,e,f,g=a.parentNode;if(g&&i.test(g.nodeName||""))for(d=g.getElementsByTagName("source"),b=0,c=d.length;ba._lazysizesWidth)&&(a._lazysizesWidth=b),a._lazysizesWidth},l=function(a){var b;return b=(getComputedStyle(a)||{getPropertyValue:function(){}}).getPropertyValue("background-size"),!j[b]&&j[a.style.backgroundSize]&&(b=a.style.backgroundSize),b},m=function(a,b){if(b){var c=b.match(h);c&&c[1]?a.setAttribute("type",c[1]):a.setAttribute("media",d.customMedia[b]||b)}},n=function(a,c,h){var i=b.createElement("picture"),j=c.getAttribute(d.sizesAttr),k=c.getAttribute("data-ratio"),l=c.getAttribute("data-optimumx");c._lazybgset&&c._lazybgset.parentNode==c&&c.removeChild(c._lazybgset),Object.defineProperty(h,"_lazybgset",{value:c,writable:!0}),Object.defineProperty(c,"_lazybgset",{value:i,writable:!0}),a=a.replace(e," ").split(f),i.style.display="none",h.className=d.lazyClass,1!=a.length||j||(j="auto"),a.forEach(function(a){var c,e=b.createElement("source");j&&"auto"!=j&&e.setAttribute("sizes",j),(c=a.match(g))?(e.setAttribute(d.srcsetAttr,c[1]),m(e,c[2]),m(e,c[3])):e.setAttribute(d.srcsetAttr,a),i.appendChild(e)}),j&&(h.setAttribute(d.sizesAttr,j),c.removeAttribute(d.sizesAttr),c.removeAttribute("sizes")),l&&h.setAttribute("data-optimumx",l),k&&h.setAttribute("data-ratio",k),i.appendChild(h),c.appendChild(i)},o=function(a){if(a.target._lazybgset){var b=a.target,d=b._lazybgset,e=b.currentSrc||b.src;if(e){var f=c.fire(d,"bgsetproxy",{src:e,useSrc:i.test(e)?JSON.stringify(e):e});f.defaultPrevented||(d.style.backgroundImage="url("+f.detail.useSrc+")")}b._lazybgsetLoading&&(c.fire(d,"_lazyloaded",{},!1,!0),delete b._lazybgsetLoading)}};addEventListener("lazybeforeunveil",function(a){var d,e,f;!a.defaultPrevented&&(d=a.target.getAttribute("data-bgset"))&&(f=a.target,e=b.createElement("img"),e.alt="",e._lazybgsetLoading=!0,a.detail.firesLoad=!0,n(d,f,e),setTimeout(function(){c.loader.unveil(e),c.rAF(function(){c.fire(e,"_lazyloaded",{},!0,!0),e.complete&&o({target:e})})}))}),b.addEventListener("load",o,!0),a.addEventListener("lazybeforesizes",function(a){if(a.detail.instance==c&&a.target._lazybgset&&a.detail.dataAttr){var b=a.target._lazybgset,d=l(b);j[d]&&(a.target._lazysizesParentFit=d,c.rAF(function(){a.target.setAttribute("data-parent-fit",d),a.target._lazysizesParentFit&&delete a.target._lazysizesParentFit}))}},!0),b.documentElement.addEventListener("lazybeforesizes",function(a){!a.defaultPrevented&&a.target._lazybgset&&a.detail.instance==c&&(a.detail.width=k(a.target._lazybgset))})}}); \ 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 531b53fd..2008583a 100644 --- a/plugins/blur-up/ls.blur-up.min.js +++ b/plugins/blur-up/ls.blur-up.min.js @@ -1,2 +1,2 @@ -/*! lazysizes - v5.1.1 */ +/*! lazysizes - v5.1.2 */ !function(a,b){if(a){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}}("undefined"!=typeof window?window:0,function(a,b,c){"use strict";var d=[].slice,e=/blur-up["']*\s*:\s*["']*(always|auto)/,f=/image\/(jpeg|png|gif|svg\+xml)/,g=function(b){var d=b.getAttribute("data-media")||b.getAttribute("media"),e=b.getAttribute("type");return(!e||f.test(e))&&(!d||a.matchMedia(c.cfg.customMedia[d]||d).matches)},h=function(a,b){var c;return(a?d.call(a.querySelectorAll("source, img")):[b]).forEach(function(a){if(!c){var b=a.getAttribute("data-lowsrc");b&&g(a)&&(c=b)}}),c},i=function(a,d,e,f){var g,h=!1,i=!1,j="always"==f?0:Date.now(),k=0,l=(a||d).parentNode,m=function(){if(e){var j=function(a){h=!0,g||(g=a.target),c.rAF(function(){c.rC(d,"ls-blur-up-is-loading"),g&&c.aC(g,"ls-blur-up-loaded")}),g&&(g.removeEventListener("load",j),g.removeEventListener("error",j))};g=b.createElement("img"),g.addEventListener("load",j),g.addEventListener("error",j),g.className="ls-blur-up-img",g.src=e,g.alt="",g.setAttribute("aria-hidden","true"),l.insertBefore(g,(a||d).nextSibling),"always"!=f&&(g.style.visibility="hidden",c.rAF(function(){g&&setTimeout(function(){g&&c.rAF(function(){!i&&g&&(g.style.visibility="")})},c.cfg.blurupCacheDelay||33)}))}},n=function(){g&&c.rAF(function(){c.rC(d,"ls-blur-up-is-loading");try{g.parentNode.removeChild(g)}catch(a){}g=null})},o=function(a){k++,i=a||i,a?n():k>1&&setTimeout(n,5e3)},p=function(){d.removeEventListener("load",p),d.removeEventListener("error",p),g&&c.rAF(function(){g&&c.aC(g,"ls-original-loaded")}),"always"!=f&&(!h||Date.now()-j<66)?o(!0):o()};m(),d.addEventListener("load",p),d.addEventListener("error",p),c.aC(d,"ls-blur-up-is-loading");var q=function(a){l==a.target&&(c.aC(g||d,"ls-inview"),o(),l.removeEventListener("lazybeforeunveil",q))};l.getAttribute("data-expand")||l.setAttribute("data-expand",-1),l.addEventListener("lazybeforeunveil",q),c.aC(l,c.cfg.lazyClass)};a.addEventListener("lazybeforeunveil",function(a){var b=a.detail;if(b.instance==c&&b.blurUp){var d=a.target,e=d.parentNode;"PICTURE"!=e.nodeName&&(e=null),i(e,d,h(e,d)||"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",b.blurUp)}}),a.addEventListener("lazyunveilread",function(a){var b=a.detail;if(b.instance==c){var d=a.target,f=(getComputedStyle(d,null)||{fontFamily:""}).fontFamily.match(e);(f||d.getAttribute("data-lowsrc"))&&(b.blurUp=f&&f[1]||c.cfg.blurupMode||"always")}})}); \ No newline at end of file diff --git a/plugins/custommedia/ls.custommedia.min.js b/plugins/custommedia/ls.custommedia.min.js index e597b012..e248ee46 100644 --- a/plugins/custommedia/ls.custommedia.min.js +++ b/plugins/custommedia/ls.custommedia.min.js @@ -1,2 +1,2 @@ -/*! lazysizes - v5.1.1 */ +/*! lazysizes - v5.1.2 */ !function(a,b){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}(window,function(a,b,c){"use strict";var d=b.documentElement;c.getCustomMedias=function(){var a=/['"]/g,d=/\s*\|\s*/g,e=/^([a-z0-9_-]+)\s*:\s*(.+)$/i,f=function(b,c){return((getComputedStyle(b,c)||{getPropertyValue:function(){}}).getPropertyValue("content")||"none").replace(a,"").trim()},g=function(a,b){a.split(d).forEach(function(a){var c=a.match(e);c&&(b[c[1]]=c[2])})};return function(a,d){return a=a||c.cfg.customMedia,d=d||b.querySelector("html"),g(f(d,":before"),a),g(f(d,":after"),a),a}}(),c.updateCustomMedia=function(){var a,b,e,f=d.querySelectorAll("source[media][data-media][srcset]");for(c.getCustomMedias(),a=0,b=f.length;a1?c.aC(a,"lazyconditionalinclude"):c.rC(a,"lazyconditionalinclude")),g}function g(b,c){var d=!c.condition;return c.condition&&(h(),y[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 h(){var a;y||(x||(x=b.querySelector(w.contentElement)),x?(a=(I(x,":after").getPropertyValue("content")||"none").replace(F,""),y={},a&&(y[a]=1),(a=(I(x,":before").getPropertyValue("content")||"none").replace(F,""))&&(y[a]=1)):y={})}function i(a){var b,c,d=a.lazyInclude;if(d&&d.candidates)for(b=0;b=200&&g<300||304===g),oldCandidate:i,insert:!0,resetHTML:j},l={target:a,details:k,detail:k};b.modules=f,i&&i.modules&&(i.modules.forEach(q,l),i.modules=null,k.resetHTML&&null==k.content&&b.initial&&b.initial.saved&&(k.content=b.initial.content)),f.forEach(p,l),d=c.fire(a,"lazyincludeloaded",k),k.insert&&k.isSuccess&&!d.defaultPrevented&&null!=k.content&&k.content!=a.innerHTML&&(a.innerHTML=k.content),J.d(),f.forEach(r,l),setTimeout(function(){c.fire(a,"lazyincluded",k)}),e=null,f=null},a.lazyInclude.current=b,a.setAttribute("data-currentinclude",b.name),b.urls.css&&(g=!0,o(b.urls.css,function(){g=!1,h()})),null==m.content&&b.urls.include?j(m,function(a){e=a,h()}):e=m,b.urls.amd||b.urls.module){var n=function(){f=Array.prototype.slice.call(arguments),h()};b.urls.amd?k(b.urls.amd,n):l(b.urls.module,n)}else f=[];h()}function t(a){var b;if(f(a).candidates.length&&G.contains(a))return b=i(a),b&&s(a,b),!0}function u(a){a.detail.instance==c&&!a.defaultPrevented&&a.target.getAttribute("data-include")&&(J.q(a.target),a.detail.firesLoad=!0)}if(b.getElementsByClassName){var v,w,x,y,z=/\s*,+\s+/,A={complete:1,loaded:1},B={},C=/\s+/,D=/^(amd|css|module)\:(.+)/i,E=/(.+)\s+(\(\s*(.+)\s*\))/,F=/['"]/g,G=b.documentElement,H=b.getElementsByClassName("lazyconditionalinclude"),I=function(b,c){var d=b.ownerDocument.defaultView;return d.opener||(d=a),d.getComputedStyle(b,c||null)||{getPropertyValue:function(){},isNull:!0}},J=function(){var a=2,b=a,c=0,d=0,e=[],f=function(){var a,b=function(){e.length&&(c=0,e.d())};return function(){clearTimeout(a),a=setTimeout(b,999)}}();return{q:function(a){var g=null==a.getAttribute("data-lazyqueue");g&&(d++,b=3),c>b?e[g?"unshift":"push"](a):t(a)&&(c++,f())},d:function(){if(c&&c--,d>0&&(--d||(b=a)),!(c>b)){for(;e.length;)if(t(e.shift())){c++;break}f()}}}}(),K=function(){var a,b=function(){for(var a=0,b=H.length;a.7?.6:.4,!(a.d>=c)&&(d=Math.pow(a.d-e,1.6)||.1,d<.1?d=.1:d>3&&(d=3),a.d+(b-c)*d=e)){if(!(f.d<=d||a(b.cands[e-1],f.d,d)))break;b.cSrcset.push(f.c),b.index=e}}}()},j=function(){var a=function(a,b,c,d,e){var f,g=a[e];g&&(f=g.index,i[e](g,b,c),g.dirty&&f==g.index||(g.cSrcset.join(", "),a.setAttribute(d,g.cSrcset.join(", ")),g.dirty=!0))};return function(b,c,d,e,f){var g,h,i,j,k=b[f];if(k.width=c,k.picture&&(h=b.parentNode))for(g=h.getElementsByTagName("source"),j=0,i=g.length;j2.6?b*=.6:b>1.9?b*=.8:b-=.01,Math.min(Math.round(100*b)/100,2)}),a.devicePixelRatio&&addEventListener("lazybeforesizes",function(a){if(a.detail.instance==c){var b,e,f,g,i=a.target,l=a.detail,m=l.dataAttr;a.defaultPrevented||!(b=k(i))||b>=devicePixelRatio||(!m||!i._lazyOptimumx||l.reloaded||d.unloadedClass&&c.hC(i,d.unloadedClass)||(i._lazyOptimumx=null),e=h(i,"_lazyOptimumx"),(f=l.width)&&(e.width||0)e)&&(f=b*(e/c))),f):b}};c.parentFit=j,b.addEventListener("lazybeforesizes",function(a){if(!a.defaultPrevented&&a.detail.instance==c){var b=a.target;a.detail.width=j.calculateSize(b,a.detail.width)}})}}); \ No newline at end of file diff --git a/plugins/print/ls.print.min.js b/plugins/print/ls.print.min.js index a9502fc7..5e069995 100644 --- a/plugins/print/ls.print.min.js +++ b/plugins/print/ls.print.min.js @@ -1,2 +1,2 @@ -/*! lazysizes - v5.1.1 */ +/*! lazysizes - v5.1.2 */ !function(a,b){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}(window,function(a,b,c){"use strict";var d,e,f,g;a.addEventListener&&(d=c&&c.cfg,e=d.lazyClass||"lazyload",f=function(){var a,d;if("string"==typeof e&&(e=b.getElementsByClassName(e)),c)for(a=0,d=e.length;a=a.d){!e.cached&&(b=a[f-1])&&b.d>a.d-.13*Math.pow(a.d,2.2)&&(c=Math.pow(b.d-.6,1.6),b.cached&&(b.d+=.15*c),b.d+(e.d-a.d)*c>a.d&&(e=b));break}return e},k=function(){var a,b=/(([^,\s].[^\s]+)\s+(\d+)w)/g,c=/\s/,d=function(b,c,d,e){a.push({c:c,u:d,w:1*e})};return function(e){return a=[],e=e.trim(),e.replace(h,"").replace(b,d),a.length||!e||c.test(e)||a.push({c:e,u:e,w:99}),a}}(),l=function(){l.init||(l.init=!0,addEventListener("resize",function(){var a,c=b.getElementsByClassName("lazymatchmedia"),e=function(){var a,b;for(a=0,b=c.length;a1?(p=h.getAttribute("sizes")||"",p=i.test(p)&&parseInt(p,10)||c.gW(a,a.parentNode),k.d=n(a),!k.src||!k.w||k.w img:not([srcset])."].forEach(function(b){a.push(b+e.loadedClass),a.push(b+e.loadingClass)}),e.pf({elements:b.querySelectorAll(a.join(", "))})}())}); \ No newline at end of file diff --git a/plugins/rias/ls.rias.min.js b/plugins/rias/ls.rias.min.js index 00735257..bc3f2739 100644 --- a/plugins/rias/ls.rias.min.js +++ b/plugins/rias/ls.rias.min.js @@ -1,2 +1,2 @@ -/*! lazysizes - v5.1.1 */ +/*! lazysizes - v5.1.2 */ !function(a,b){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}(window,function(a,b,c){"use strict";function d(b,c){var d,e,f,g,h=a.getComputedStyle(b);e=b.parentNode,g={isPicture:!(!e||!n.test(e.nodeName||""))},f=function(a,c){var d=b.getAttribute("data-"+a);if(!d){var e=h.getPropertyValue("--ls-"+a);e&&(d=e.trim())}if(d){if("true"==d)d=!0;else if("false"==d)d=!1;else if(m.test(d))d=parseFloat(d);else if("function"==typeof j[a])d=j[a](b,d);else if(r.test(d))try{d=JSON.parse(d)}catch(a){}g[a]=d}else a in j&&"function"!=typeof j[a]?g[a]=j[a]:c&&"function"==typeof j[a]&&(g[a]=j[a](b,d))};for(d in j)f(d);return c.replace(q,function(a,b){b in g||f(b,!0)}),g}function e(a,b){var c=[],d=function(a,c){return l[typeof b[c]]?b[c]:a};return c.srcset=[],b.absUrl&&(t.setAttribute("href",a),a=t.href),a=((b.prefix||"")+a+(b.postfix||"")).replace(q,d),b.widths.forEach(function(d){var e=b.widthmap[d]||d,f=b.aspectratio||b.ratio,g=!b.aspectratio&&j.traditionalRatio,h={u:a.replace(o,e).replace(p,f?g?Math.round(d*f):Math.round(d/f):""),w:d};c.push(h),c.srcset.push(h.c=h.u+" "+d+"w")}),c}function f(a,c,d){var f=0,g=0,h=d;if(a){if("container"===c.ratio){for(f=h.scrollWidth,g=h.scrollHeight;!(f&&g||h===b);)h=h.parentNode,f=h.scrollWidth,g=h.scrollHeight;f&&g&&(c.ratio=c.traditionalRatio?g/f:f/g)}a=e(a,c),a.isPicture=c.isPicture,v&&"IMG"==d.nodeName.toUpperCase()?d.removeAttribute(i.srcsetAttr):d.setAttribute(i.srcsetAttr,a.srcset.join(", ")),Object.defineProperty(d,"_lazyrias",{value:a,writable:!0})}}function g(a,b){var e=d(a,b);return j.modifyOptions.call(a,{target:a,details:e,detail:e}),c.fire(a,"lazyriasmodifyoptions",e),e}function h(a){return a.getAttribute(a.getAttribute("data-srcattr")||j.srcAttr)||a.getAttribute(i.srcsetAttr)||a.getAttribute(i.srcAttr)||a.getAttribute("data-pfsrcset")||""}var i,j,k=c.cfg,l={string:1,number:1},m=/^\-*\+*\d+\.*\d*$/,n=/^picture$/i,o=/\s*\{\s*width\s*\}\s*/i,p=/\s*\{\s*height\s*\}\s*/i,q=/\s*\{\s*([a-z0-9]+)\s*\}\s*/gi,r=/^\[.*\]|\{.*\}$/,s=/^(?:auto|\d+(px)?)$/,t=b.createElement("a"),u=b.createElement("img"),v="srcset"in u&&!("sizes"in u),w=!!a.HTMLPictureElement&&!v;!function(){var a,b=function(){},d={prefix:"",postfix:"",srcAttr:"data-src",absUrl:!1,modifyOptions:b,widthmap:{},ratio:!1,traditionalRatio:!1,aspectratio:!1};i=c&&c.cfg,i.supportsType||(i.supportsType=function(a){return!a}),i.rias||(i.rias={}),"widths"in(j=i.rias)||(j.widths=[],function(a){for(var b,c=0;!b||b<3e3;)c+=5,c>30&&(c+=1),b=36*c,a.push(b)}(j.widths));for(a in d)a in j||(j[a]=d[a])}(),addEventListener("lazybeforesizes",function(a){if(a.detail.instance==c){var b,d,e,k,l,m,n,p,q,r,t,u,v;if(b=a.target,a.detail.dataAttr&&!a.defaultPrevented&&!j.disabled&&(q=b.getAttribute(i.sizesAttr)||b.getAttribute("sizes"))&&s.test(q)){if(d=h(b),e=g(b,d),t=o.test(e.prefix)||o.test(e.postfix),e.isPicture&&(k=b.parentNode))for(l=k.getElementsByTagName("source"),m=0,n=l.length;m=a.d){!e.cached&&(b=a[f-1])&&b.d>a.d-.13*Math.pow(a.d,2.2)&&(c=Math.pow(b.d-.6,1.6),b.cached&&(b.d+=.15*c),b.d+(e.d-a.d)*c>a.d&&(e=b));break}return e},f=function(a,b){var d;return!a._lazyrias&&c.pWS&&(d=c.pWS(a.getAttribute(i.srcsetAttr||""))).length&&(Object.defineProperty(a,"_lazyrias",{value:d,writable:!0}),b&&a.parentNode&&(d.isPicture="PICTURE"==a.parentNode.nodeName.toUpperCase())),a._lazyrias},g=function(b){var d=a.devicePixelRatio||1,e=c.getX&&c.getX(b);return Math.min(e||d,2.4,d)},h=function(b,c){var h,i,j,k,l,m;if(l=b._lazyrias,l.isPicture&&a.matchMedia)for(i=0,h=b.parentNode.getElementsByTagName("source"),j=h.length;ia._pfLastSize)&&(a._pfLastSize=a.offsetWidth,c=a.sizes,a.sizes+=",100vw",setTimeout(function(){a.sizes=c}))},f=function(){var a,c=b.querySelectorAll("picture > img, img[srcset][sizes]");for(a=0;ae.unloadPixelThreshold&&a.target.className&&a.target.className.indexOf&&-1!=a.target.className.indexOf(g.loadingClass)&&-1==a.target.className.indexOf(g.preloadClass)&&c.aC(a.target,g.unloadClass)},!0),c.unloader=j,f=b.getElementsByClassName([e.unloadClass,e.loadedClass].join(" ")),setInterval(i,9999),addEventListener("lazybeforeunveil",i),addEventListener("lazybeforeunveil",j._reload,!0)}}if(b.addEventListener){var e,f,g=c.cfg,h=[],i=a.requestAnimationFrame||setTimeout,j={checkElements:function(){var a,b,d,g=1.1*(c._defEx+99),k=-1*g,l=k,m=innerHeight+g,n=innerWidth+g;for(a=0,b=f.length;am||d.bottomn||d.right',b.removeEventListener("click",f)}function g(a,b){var d=b.getAttribute("data-thumb-size")||c.cfg.ytThumb||"hqdefault";b.style.backgroundImage="url("+n.replace(k,a).replace(l,d)+")",b.addEventListener("click",h)}function h(a){var b=a.currentTarget,c=b.getAttribute("data-youtube"),d=b.getAttribute("data-ytparams")||"";d&&!m.test(d)&&(d="&"+d),a.preventDefault(),b.innerHTML='',b.removeEventListener("click",h)}if(b.getElementsByClassName){var i="https:"==location.protocol?"https:":"http:",j=Date.now(),k=/\{\{id}}/,l=/\{\{hqdefault}}/,m=/^&/,n=i+"//img.youtube.com/vi/{{id}}/{{hqdefault}}.jpg",o=i+"//www.youtube.com/embed/{{id}}?autoplay=1",p=i+"//vimeo.com/api/oembed.json?url=https%3A//vimeo.com/{{id}}",q=i+"//player.vimeo.com/video/{{id}}?autoplay=1";b.addEventListener("lazybeforeunveil",function(a){if(a.detail.instance==c){var b=a.target,d=b.getAttribute("data-youtube"),f=b.getAttribute("data-vimeo");d&&b&&g(d,b),f&&b&&e(f,b)}})}}); \ No newline at end of file