From 801016a4893954426bf63df3563efb9d44caabf9 Mon Sep 17 00:00:00 2001 From: Max Kloker Date: Fri, 15 May 2020 14:58:35 +0200 Subject: [PATCH 1/2] Added AMD to all plug-ins UMD corresponding to /src/umd.wrapper --- plugins/artdirect/ls.artdirect.js | 2 ++ plugins/aspectratio/ls.aspectratio.js | 2 ++ plugins/attrchange/ls.attrchange.js | 2 ++ plugins/bgset/ls.bgset.js | 2 ++ plugins/blur-up/ls.blur-up.js | 2 ++ plugins/custommedia/ls.custommedia.js | 2 ++ plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js | 2 ++ plugins/fix-ios-sizes/fix-ios-sizes.js | 2 ++ plugins/include/ls.include.js | 2 ++ plugins/native-loading/ls.native-loading.js | 2 ++ plugins/noscript/ls.noscript.js | 2 ++ plugins/object-fit/ls.object-fit.js | 2 ++ plugins/optimumx/ls.optimumx.js | 2 ++ plugins/parent-fit/ls.parent-fit.js | 2 ++ plugins/print/ls.print.js | 2 ++ plugins/progressive/ls.progressive.js | 2 ++ plugins/respimg/ls.respimg.js | 2 ++ plugins/rias/ls.rias.js | 2 ++ plugins/static-gecko-picture/ls.static-gecko-picture.js | 2 ++ plugins/twitter/ls.twitter.js | 2 ++ plugins/unload/ls.unload.js | 2 ++ plugins/unveilhooks/ls.unveilhooks.js | 2 ++ plugins/video-embed/ls.video-embed.js | 2 ++ 23 files changed, 46 insertions(+) diff --git a/plugins/artdirect/ls.artdirect.js b/plugins/artdirect/ls.artdirect.js index 3c348507..23a138fb 100644 --- a/plugins/artdirect/ls.artdirect.js +++ b/plugins/artdirect/ls.artdirect.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/aspectratio/ls.aspectratio.js b/plugins/aspectratio/ls.aspectratio.js index b22e7f69..74c8dbd6 100644 --- a/plugins/aspectratio/ls.aspectratio.js +++ b/plugins/aspectratio/ls.aspectratio.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/attrchange/ls.attrchange.js b/plugins/attrchange/ls.attrchange.js index 14bcb54d..0ed15739 100644 --- a/plugins/attrchange/ls.attrchange.js +++ b/plugins/attrchange/ls.attrchange.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/bgset/ls.bgset.js b/plugins/bgset/ls.bgset.js index d4f3a691..aa000df9 100644 --- a/plugins/bgset/ls.bgset.js +++ b/plugins/bgset/ls.bgset.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/blur-up/ls.blur-up.js b/plugins/blur-up/ls.blur-up.js index 9eab38d5..7757c61c 100644 --- a/plugins/blur-up/ls.blur-up.js +++ b/plugins/blur-up/ls.blur-up.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/custommedia/ls.custommedia.js b/plugins/custommedia/ls.custommedia.js index cdea7dd7..a67b69f0 100644 --- a/plugins/custommedia/ls.custommedia.js +++ b/plugins/custommedia/ls.custommedia.js @@ -14,6 +14,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js b/plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js index 05c1e6c8..51aaeba2 100644 --- a/plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js +++ b/plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/fix-ios-sizes/fix-ios-sizes.js b/plugins/fix-ios-sizes/fix-ios-sizes.js index 70bd45aa..e322521e 100644 --- a/plugins/fix-ios-sizes/fix-ios-sizes.js +++ b/plugins/fix-ios-sizes/fix-ios-sizes.js @@ -24,6 +24,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/include/ls.include.js b/plugins/include/ls.include.js index a152a4b8..8a1d5898 100644 --- a/plugins/include/ls.include.js +++ b/plugins/include/ls.include.js @@ -12,6 +12,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/native-loading/ls.native-loading.js b/plugins/native-loading/ls.native-loading.js index b303f5e3..3eef77b2 100644 --- a/plugins/native-loading/ls.native-loading.js +++ b/plugins/native-loading/ls.native-loading.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/noscript/ls.noscript.js b/plugins/noscript/ls.noscript.js index dfe20e48..f3eac402 100644 --- a/plugins/noscript/ls.noscript.js +++ b/plugins/noscript/ls.noscript.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/object-fit/ls.object-fit.js b/plugins/object-fit/ls.object-fit.js index 9b83be13..162f1afe 100644 --- a/plugins/object-fit/ls.object-fit.js +++ b/plugins/object-fit/ls.object-fit.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/optimumx/ls.optimumx.js b/plugins/optimumx/ls.optimumx.js index 2d475ea6..6f4657b3 100644 --- a/plugins/optimumx/ls.optimumx.js +++ b/plugins/optimumx/ls.optimumx.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/parent-fit/ls.parent-fit.js b/plugins/parent-fit/ls.parent-fit.js index 9521961f..34e21fd8 100644 --- a/plugins/parent-fit/ls.parent-fit.js +++ b/plugins/parent-fit/ls.parent-fit.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/print/ls.print.js b/plugins/print/ls.print.js index 562a19d0..7aeaaaf5 100644 --- a/plugins/print/ls.print.js +++ b/plugins/print/ls.print.js @@ -12,6 +12,8 @@ In case the user starts to print lazysizes will load all images. if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/progressive/ls.progressive.js b/plugins/progressive/ls.progressive.js index 580bf186..b854cb31 100644 --- a/plugins/progressive/ls.progressive.js +++ b/plugins/progressive/ls.progressive.js @@ -11,6 +11,8 @@ This lazysizes plugin optimizes perceived performance by adding better support f if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/respimg/ls.respimg.js b/plugins/respimg/ls.respimg.js index 4fdcb452..4d38aeed 100644 --- a/plugins/respimg/ls.respimg.js +++ b/plugins/respimg/ls.respimg.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/rias/ls.rias.js b/plugins/rias/ls.rias.js index 3a8a4f69..5584e419 100644 --- a/plugins/rias/ls.rias.js +++ b/plugins/rias/ls.rias.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/static-gecko-picture/ls.static-gecko-picture.js b/plugins/static-gecko-picture/ls.static-gecko-picture.js index b99f9f88..aee7de72 100644 --- a/plugins/static-gecko-picture/ls.static-gecko-picture.js +++ b/plugins/static-gecko-picture/ls.static-gecko-picture.js @@ -11,6 +11,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/twitter/ls.twitter.js b/plugins/twitter/ls.twitter.js index 27fa9f39..e9f615c3 100644 --- a/plugins/twitter/ls.twitter.js +++ b/plugins/twitter/ls.twitter.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/unload/ls.unload.js b/plugins/unload/ls.unload.js index 9c52daea..ee0d3a5a 100644 --- a/plugins/unload/ls.unload.js +++ b/plugins/unload/ls.unload.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/unveilhooks/ls.unveilhooks.js b/plugins/unveilhooks/ls.unveilhooks.js index 1f2189f1..6675f1ac 100644 --- a/plugins/unveilhooks/ls.unveilhooks.js +++ b/plugins/unveilhooks/ls.unveilhooks.js @@ -42,6 +42,8 @@ For background images, use data-bg attribute: if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/video-embed/ls.video-embed.js b/plugins/video-embed/ls.video-embed.js index 8a0d6e7f..18430f3d 100644 --- a/plugins/video-embed/ls.video-embed.js +++ b/plugins/video-embed/ls.video-embed.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { From e2ab14ef1ecccbe3740f7118abbdb7230e579931 Mon Sep 17 00:00:00 2001 From: Max Kloker Date: Fri, 15 May 2020 15:00:02 +0200 Subject: [PATCH 2/2] Build with AMD for plug-ins UMD --- 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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/plugins/artdirect/ls.artdirect.min.js b/plugins/artdirect/ls.artdirect.min.js index d6adb4a5..6f9bc5d6 100644 --- a/plugins/artdirect/ls.artdirect.min.js +++ b/plugins/artdirect/ls.artdirect.min.js @@ -1,2 +1,2 @@ /*! lazysizes - v5.2.0 */ -!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 +!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")):"function"==typeof define&&define.amd?require(["lazysizes"],b):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 6da4cd01..8a389234 100644 --- a/plugins/aspectratio/ls.aspectratio.min.js +++ b/plugins/aspectratio/ls.aspectratio.min.js @@ -1,2 +1,2 @@ /*! lazysizes - v5.2.0 */ -!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;b36?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 +!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")):"function"==typeof define&&define.amd?require(["lazysizes"],b):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}(window,function(a,b,c){"use strict";if(a.addEventListener){var d=c.cfg,e=/\s+/g,f=/\s*\|\s+|\s+\|\s*/g,g=/^(.+?)(?:\s+\[\s*(.+?)\s*\])(?:\s+\[\s*(.+?)\s*\])?$/,h=/^\s*\(*\s*type\s*:\s*(.+?)\s*\)*\s*$/,i=/\(|\)|'/,j={contain:1,cover:1},k=function(a){var b=c.gW(a,a.parentNode);return(!a._lazysizesWidth||b>a._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 79b53fb1..d846d152 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.2.0 */ -!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 +!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")):"function"==typeof define&&define.amd?require(["lazysizes"],b):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 99fc3c18..8c2f4197 100644 --- a/plugins/custommedia/ls.custommedia.min.js +++ b/plugins/custommedia/ls.custommedia.min.js @@ -1,2 +1,2 @@ /*! lazysizes - v5.2.0 */ -!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;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).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 +!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")):"function"==typeof define&&define.amd?require(["lazysizes"],b):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}}("undefined"!=typeof window?window:0,function(a,b,c){"use strict";if(a.addEventListener){var d=/\s+(\d+)(w|h)\s+(\d+)(w|h)/,e=/parent-fit["']*\s*:\s*["']*(contain|cover|width)/,f=/parent-container["']*\s*:\s*["']*(.+?)(?=(\s|$|,|'|"|;))/,g=/^picture$/i,h=c.cfg,i=function(a){return getComputedStyle(a,null)||{}},j={getParent:function(b,c){var d=b,e=b.parentNode;return c&&"prev"!=c||!e||!g.test(e.nodeName||"")||(e=e.parentNode),"self"!=c&&(d="prev"==c?b.previousElementSibling:c&&(e.closest||a.jQuery)?(e.closest?e.closest(c):jQuery(e).closest(c)[0])||e:e),d},getFit:function(a){var b,c,d=i(a),g=d.content||d.fontFamily,h={fit:a._lazysizesParentFit||a.getAttribute("data-parent-fit")};return!h.fit&&g&&(b=g.match(e))&&(h.fit=b[1]),h.fit?(c=a._lazysizesParentContainer||a.getAttribute("data-parent-container"),!c&&g&&(b=g.match(f))&&(c=b[1]),h.parent=j.getParent(a,c)):h.fit=d.objectFit,h},getImageRatio:function(b){var c,e,f,i,j,k,l,m=b.parentNode,n=m&&g.test(m.nodeName||"")?m.querySelectorAll("source, img"):[b];for(c=0;ce)&&(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 095303f6..6b0b2f94 100644 --- a/plugins/print/ls.print.min.js +++ b/plugins/print/ls.print.min.js @@ -1,2 +1,2 @@ /*! lazysizes - v5.2.0 */ -!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 +!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")):"function"==typeof define&&define.amd?require(["lazysizes"],b):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}}("undefined"!=typeof window?window:0,function(a,b,c){"use strict";var d,e=c.cfg,f=b.createElement("img"),g="sizes"in f&&"srcset"in f,h=/\s+\d+h/g,i=function(){var a=/\s+(\d+)(w|h)\s+(\d+)(w|h)/,d=Array.prototype.forEach;return function(){var f=b.createElement("img"),g=function(b){var c,d,f=b.getAttribute(e.srcsetAttr);f&&(d=f.match(a))&&(c="w"==d[2]?d[1]/d[3]:d[3]/d[1],c&&b.setAttribute("data-aspectratio",c),b.setAttribute(e.srcsetAttr,f.replace(h,"")))},i=function(a){if(a.detail.instance==c){var b=a.target.parentNode;b&&"PICTURE"==b.nodeName&&d.call(b.getElementsByTagName("source"),g),g(a.target)}},j=function(){f.currentSrc&&b.removeEventListener("lazybeforeunveil",i)};b.addEventListener("lazybeforeunveil",i),f.onload=j,f.onerror=j,f.srcset="data:,a 1w 1h",f.complete&&j()}}();if(e.supportsType||(e.supportsType=function(a){return!a}),a.HTMLPictureElement&&g)return void(!c.hasHDescriptorFix&&b.msElementsFromPoint&&(c.hasHDescriptorFix=!0,i()));a.picturefill||e.pf||(e.pf=function(b){var c,e;if(!a.picturefill)for(c=0,e=b.elements.length;c=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 a207f3b9..05148099 100644 --- a/plugins/rias/ls.rias.min.js +++ b/plugins/rias/ls.rias.min.js @@ -1,2 +1,2 @@ /*! lazysizes - v5.2.0 */ -!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;i30&&(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;aa._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.righte.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')}function g(a,b){var d=b.getAttribute("data-thumb-size")||c.cfg.ytThumb||"hqdefault";b.style.backgroundImage="url("+o.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")||"";b.removeEventListener("click",h),c&&n.test(c)&&(!d||n.test(d))&&(d&&!m.test(d)&&(d="&"+d),a.preventDefault(),b.innerHTML='')}if(b.getElementsByClassName){var i="https:"==location.protocol?"https:":"http:",j=Date.now(),k=/\{\{id}}/,l=/\{\{hqdefault}}/,m=/^&/,n=/^[a-z0-9-_&=]+$/i,o=i+"//img.youtube.com/vi/{{id}}/{{hqdefault}}.jpg",p=i+"//www.youtube.com/embed/{{id}}?autoplay=1",q=i+"//vimeo.com/api/oembed.json?url=https%3A//vimeo.com/{{id}}",r=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 +!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")):"function"==typeof define&&define.amd?require(["lazysizes"],b):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}}("undefined"!=typeof window?window:0,function(a,b,c){"use strict";function d(c,d){var e="vimeoCallback"+j,f=b.createElement("script");c+="&callback="+e,j++,a[e]=function(b){f.parentNode.removeChild(f),delete a[e],d(b)},f.src=c,b.head.appendChild(f)}function e(a,b){d(q.replace(k,a),function(a){a&&a.thumbnail_url&&(b.style.backgroundImage="url("+a.thumbnail_url+")")}),b.addEventListener("click",f)}function f(a){var b=a.currentTarget,c=b.getAttribute("data-vimeo"),d=b.getAttribute("data-vimeoparams")||"";b.removeEventListener("click",f),c&&n.test(c)&&(!d||n.test(d))&&(d&&!m.test(d)&&(d="&"+d),a.preventDefault(),b.innerHTML='')}function g(a,b){var d=b.getAttribute("data-thumb-size")||c.cfg.ytThumb||"hqdefault";b.style.backgroundImage="url("+o.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")||"";b.removeEventListener("click",h),c&&n.test(c)&&(!d||n.test(d))&&(d&&!m.test(d)&&(d="&"+d),a.preventDefault(),b.innerHTML='')}if(b.getElementsByClassName){var i="https:"==location.protocol?"https:":"http:",j=Date.now(),k=/\{\{id}}/,l=/\{\{hqdefault}}/,m=/^&/,n=/^[a-z0-9-_&=]+$/i,o=i+"//img.youtube.com/vi/{{id}}/{{hqdefault}}.jpg",p=i+"//www.youtube.com/embed/{{id}}?autoplay=1",q=i+"//vimeo.com/api/oembed.json?url=https%3A//vimeo.com/{{id}}",r=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