Version Description
- Enhancement: Update lazyload script to the latest version
- Enhancement: Add a way to lazyload the Youtube thumbnail image
- Enhancement: Add width and height attributes to the Youtube thumbnail image depending on the resolution
- Enhancement: Disable polyfill for intersectionObserver by default, added a way to activate it instead
- Enhancement: Add data-cfasync="false" to the lazyload script tag
- Enhancement: Prevent lazyload on the Oxygen Builder page editor
- Bugfix: Wrap no JS CSS in noscript tag and remove the no-js identifier
Download this release
Release Info
Developer | wp_media |
Plugin | Lazy Load by WP Rocket |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.1.2
- assets/js/{lazyload-11.0.2.js → 11.0.3/lazyload.js} +1 -1
- assets/js/{lazyload-11.0.2.min.js → 11.0.3/lazyload.min.js} +2 -2
- assets/js/11.0.3/lazyload.min.js.map +1 -0
- assets/js/lazyload-11.0.2.min.js.map +0 -1
- composer.lock +11 -11
- readme.txt +11 -1
- rocket-lazy-load.php +2 -2
- src/Subscriber/LazyloadSubscriber.php +26 -13
- vendor/composer/installed.json +6 -6
- vendor/wp-media/rocket-lazyload-common/src/Assets.php +43 -15
assets/js/{lazyload-11.0.2.js → 11.0.3/lazyload.js}
RENAMED
@@ -374,7 +374,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
|
|
374 |
};
|
375 |
|
376 |
var isIntersecting = function isIntersecting(entry) {
|
377 |
-
return entry.intersectionRatio > 0;
|
378 |
};
|
379 |
|
380 |
var getObserverSettings = function getObserverSettings(settings) {
|
374 |
};
|
375 |
|
376 |
var isIntersecting = function isIntersecting(entry) {
|
377 |
+
return entry.isIntersecting || entry.intersectionRatio > 0;
|
378 |
};
|
379 |
|
380 |
var getObserverSettings = function getObserverSettings(settings) {
|
assets/js/{lazyload-11.0.2.min.js → 11.0.3/lazyload.min.js}
RENAMED
@@ -1,2 +1,2 @@
|
|
1 |
-
function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.LazyLoad=e()}(this,function(){"use strict";var t="undefined"!=typeof window,e=t&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),n=t&&"IntersectionObserver"in window,o=t&&"classList"in document.createElement("p"),r={elements_selector:"img",container:e||t?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,auto_unobserve:!0,callback_enter:null,callback_exit:null,callback_reveal:null,callback_loaded:null,callback_error:null,callback_finish:null},a=function(t,e){return t.getAttribute("data-"+e)},s=function(t,e,n){var o="data-"+e;null!==n?t.setAttribute(o,n):t.removeAttribute(o)},i=function(t){return"true"===a(t,"was-processed")},c=function(t,e){return s(t,"ll-timeout",e)},l=function(t){return a(t,"ll-timeout")},u=function(t,e){var n,o=new t(e);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:o}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:o})}window.dispatchEvent(n)};var d=function(t,e){t&&t(e)},f=function(t,e){t._loadingCount+=e,0===t._elements.length&&0===t._loadingCount&&d(t._settings.callback_finish)},_=function(t){for(var e,n=[],o=0;e=t.children[o];o+=1)"SOURCE"===e.tagName&&n.push(e);return n},v=function(t,e,n){n&&t.setAttribute(e,n)},
|
2 |
-
//# sourceMappingURL=lazyload
|
1 |
+
function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.LazyLoad=e()}(this,function(){"use strict";var t="undefined"!=typeof window,e=t&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),n=t&&"IntersectionObserver"in window,o=t&&"classList"in document.createElement("p"),r={elements_selector:"img",container:e||t?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,auto_unobserve:!0,callback_enter:null,callback_exit:null,callback_reveal:null,callback_loaded:null,callback_error:null,callback_finish:null},a=function(t,e){return t.getAttribute("data-"+e)},s=function(t,e,n){var o="data-"+e;null!==n?t.setAttribute(o,n):t.removeAttribute(o)},i=function(t){return"true"===a(t,"was-processed")},c=function(t,e){return s(t,"ll-timeout",e)},l=function(t){return a(t,"ll-timeout")},u=function(t,e){var n,o=new t(e);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:o}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:o})}window.dispatchEvent(n)};var d=function(t,e){t&&t(e)},f=function(t,e){t._loadingCount+=e,0===t._elements.length&&0===t._loadingCount&&d(t._settings.callback_finish)},_=function(t){for(var e,n=[],o=0;e=t.children[o];o+=1)"SOURCE"===e.tagName&&n.push(e);return n},v=function(t,e,n){n&&t.setAttribute(e,n)},g=function(t,e){v(t,"sizes",a(t,e.data_sizes)),v(t,"srcset",a(t,e.data_srcset)),v(t,"src",a(t,e.data_src))},b={IMG:function(t,e){var n=t.parentNode;n&&"PICTURE"===n.tagName&&_(n).forEach(function(t){g(t,e)});g(t,e)},IFRAME:function(t,e){v(t,"src",a(t,e.data_src))},VIDEO:function(t,e){_(t).forEach(function(t){v(t,"src",a(t,e.data_src))}),v(t,"src",a(t,e.data_src)),t.load()}},m=function(t,e){var n,o,r=e._settings,s=t.tagName,i=b[s];if(i)return i(t,r),f(e,1),void(e._elements=(n=e._elements,o=t,n.filter(function(t){return t!==o})));!function(t,e){var n=a(t,e.data_src),o=a(t,e.data_bg);n&&(t.style.backgroundImage='url("'.concat(n,'")')),o&&(t.style.backgroundImage=o)}(t,r)},h=function(t,e){o?t.classList.add(e):t.className+=(t.className?" ":"")+e},p=function(t,e,n){t.addEventListener(e,n)},y=function(t,e,n){t.removeEventListener(e,n)},E=function(t,e,n){y(t,"load",e),y(t,"loadeddata",e),y(t,"error",n)},w=function(t,e,n){var r=n._settings,a=e?r.class_loaded:r.class_error,s=e?r.callback_loaded:r.callback_error,i=t.target;!function(t,e){o?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")}(i,r.class_loading),h(i,a),d(s,i),f(n,-1)},k=function(t,e){var n=function n(r){w(r,!0,e),E(t,n,o)},o=function o(r){w(r,!1,e),E(t,n,o)};!function(t,e,n){p(t,"load",e),p(t,"loadeddata",e),p(t,"error",n)}(t,n,o)},I=["IMG","IFRAME","VIDEO"],L=function(t,e){var n=e._observer;z(t,e),n&&e._settings.auto_unobserve&&n.unobserve(t)},x=function(t){var e=l(t);e&&(clearTimeout(e),c(t,null))},A=function(t,e){var n=e._settings.load_delay,o=l(t);o||(o=setTimeout(function(){L(t,e),x(t)},n),c(t,o))},z=function(t,e,n){var o=e._settings;!n&&i(t)||(I.indexOf(t.tagName)>-1&&(k(t,e),h(t,o.class_loading)),m(t,e),function(t){s(t,"was-processed","true")}(t),d(o.callback_reveal,t))},O=function(t){return!!n&&(t._observer=new IntersectionObserver(function(e){e.forEach(function(e){return function(t){return t.isIntersecting||t.intersectionRatio>0}(e)?function(t,e){var n=e._settings;d(n.callback_enter,t),n.load_delay?A(t,e):L(t,e)}(e.target,t):function(t,e){var n=e._settings;d(n.callback_exit,t),n.load_delay&&x(t)}(e.target,t)})},{root:(e=t._settings).container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}),!0);var e},N=function(t,e){this._settings=function(t){return _extends({},r,t)}(t),this._loadingCount=0,O(this),this.update(e)};return N.prototype={update:function(t){var n=this,o=this._settings,r=t||o.container.querySelectorAll(o.elements_selector);this._elements=function(t){return t.filter(function(t){return!i(t)})}(Array.prototype.slice.call(r)),!e&&this._observer?this._elements.forEach(function(t){n._observer.observe(t)}):this.loadAll()},destroy:function(){var t=this;this._observer&&(this._elements.forEach(function(e){t._observer.unobserve(e)}),this._observer=null),this._elements=null,this._settings=null},load:function(t,e){z(t,this,e)},loadAll:function(){var t=this;this._elements.forEach(function(e){L(e,t)})}},t&&function(t,e){if(e)if(e.length)for(var n,o=0;n=e[o];o+=1)u(t,n);else u(t,e)}(N,window.lazyLoadOptions),N});
|
2 |
+
//# sourceMappingURL=lazyload.min.js.map
|
assets/js/11.0.3/lazyload.min.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["lazyload.js"],"names":["global","factory","exports","_typeof","module","define","amd","LazyLoad","this","runningOnBrowser","window","isBot","test","defaultSettings","elements_selector","threshold","thresholds","document","createElement","data_srcset","data_sizes","data_bg","class_loading","class_loaded","class_error","load_delay","auto_unobserve","callback_enter","callback_exit","callback_reveal","callback_loaded","callback_error","callback_finish","getInstanceSettings","getData","element","attribute","value","getAttribute","setData","attrName","setAttribute","processedDataName","removeAttribute","getWasProcessedData","setTimeoutData","getTimeoutData","timeoutDataName","createInstance","elementToPurge","options","event","instance","classObj","createEvent","initCustomEvent","dispatchEvent","callbackIfSet","autoInitialize","callback","argument","updateLoadingCount","plusMinus","_elements","length","_loadingCount","_settings","getSourceTags","parentTag","childTag","sourceTags","i","children","setAttributeIfValue","tagName","settings","data_src","backgroundImage","IMG","parent","parentNode","forEach","sourceTag","setImageAttributes","IFRAME","VIDEO","load","setSources","elements","setSourcesFunctions","setSourcesFunction","setSourcesVideo","filter","srcDataValue","bgDataValue","setSourcesBgImage","addClass","className","addEventListener","eventName","handler","removeEventListener","genericLoadEventName","errorHandler","removeClass","loadHandler","addEventListeners","errorEventName","success","removeEventListeners","target","supportsClassList","remove","replace","RegExp","eventHandler","addOneShotEventListeners","revealAndUnobserve","observer","unobserve","cancelDelayLoad","timeoutId","clearTimeout","loadDelay","revealElement","force","managedTags","indexOf","setTimeout","setObserver","supportsIntersectionObserver","_observer","IntersectionObserver","entries","entry","isIntersecting","intersectionRatio","delayLoad","onEnter","setWasProcessedData","root","container","rootMargin","customSettings","getObserverSettings","trueString","prototype","update","_this","nodeSet","querySelectorAll","purgeProcessedElements","Array","observe","loadAll","_this2","destroy","_this3","optionsItem","lazyLoadOptions"],"mappings":"+cAAC,SAAUA,EAAQC,GACC,YAAnB,oBAAOC,QAAP,YAAAC,QAAOD,WAA0C,oBAAXE,OAAyBA,OAAOF,QAAUD,IAC9D,mBAAXI,QAAyBA,OAAOC,IAAMD,OAAOJ,GACnDD,EAAOO,SAAWN,IAHnB,CAAAO,KAAA,WAAkBP,aAIlB,IAACQ,EAAmB,oBAAAC,OAIfC,EAFNF,KAAsB,aAAGC,SAGvBD,oBADIE,WAKN,gCAAkCC,KACjCH,UAAAA,WAKKI,EACLC,GAAiB,yBADMJ,OAGvBK,EACAC,GAJuB,cAAAC,SAAAC,cAAA,KAMvBC,EAAa,CACbC,kBAAY,MACZC,UAAOV,GARgBF,EAAAQ,SAAA,KASvBK,UAAAA,IACAC,WAAAA,KACAC,SAAAA,MACAC,YAAU,SACVC,WAAAA,QACAC,QAAAA,KACAC,cAAAA,UACAC,aAAAA,SACAC,YAAAA,QACAC,WAAAA,EACAC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8C,EAAAA,EAAAA,EAAPsG,EAAA5G,EAAAqB,GAAAA,GAAA,EAZDvB,EAAAK,EAAAyG,QAUmD9G,EAAjDK,EAAAH,GAkVDQ,CAAenD,EAAUG,OAAOqJ,iBAG1BxJ","file":"lazyload.min.js","sourcesContent":["(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.LazyLoad = factory());\n}(this, (function () { 'use strict';\n\nconst runningOnBrowser = typeof window !== \"undefined\";\n\nconst isBot =\n\t(runningOnBrowser && !(\"onscroll\" in window)) ||\n\t(typeof navigator !== \"undefined\" &&\n\t\t/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent));\n\nconst supportsIntersectionObserver =\n\trunningOnBrowser && \"IntersectionObserver\" in window;\n\nconst supportsClassList =\n\trunningOnBrowser && \"classList\" in document.createElement(\"p\");\n\nconst defaultSettings = {\n\telements_selector: \"img\",\n\tcontainer: isBot || runningOnBrowser ? document : null,\n\tthreshold: 300,\n\tthresholds: null,\n\tdata_src: \"src\",\n\tdata_srcset: \"srcset\",\n\tdata_sizes: \"sizes\",\n\tdata_bg: \"bg\",\n\tclass_loading: \"loading\",\n\tclass_loaded: \"loaded\",\n\tclass_error: \"error\",\n\tload_delay: 0,\n\tauto_unobserve: true,\n\tcallback_enter: null,\n\tcallback_exit: null,\n\tcallback_reveal: null,\n\tcallback_loaded: null,\n\tcallback_error: null,\n\tcallback_finish: null\n};\n\nvar getInstanceSettings = customSettings => {\n\treturn Object.assign({}, defaultSettings, customSettings);\n};\n\nconst dataPrefix = \"data-\";\nconst processedDataName = \"was-processed\";\nconst timeoutDataName = \"ll-timeout\";\nconst trueString = \"true\";\n\nconst getData = (element, attribute) => {\n\treturn element.getAttribute(dataPrefix + attribute);\n};\n\nconst setData = (element, attribute, value) => {\n\tvar attrName = dataPrefix + attribute;\n\tif (value === null) {\n\t\telement.removeAttribute(attrName);\n\t\treturn;\n\t}\n\telement.setAttribute(attrName, value);\n};\n\nconst setWasProcessedData = element =>\n\tsetData(element, processedDataName, trueString);\n\nconst getWasProcessedData = element =>\n\tgetData(element, processedDataName) === trueString;\n\nconst setTimeoutData = (element, value) =>\n\tsetData(element, timeoutDataName, value);\n\nconst getTimeoutData = element => getData(element, timeoutDataName);\n\nconst purgeProcessedElements = elements => {\n\treturn elements.filter(element => !getWasProcessedData(element));\n};\n\nconst purgeOneElement = (elements, elementToPurge) => {\n\treturn elements.filter(element => element !== elementToPurge);\n};\n\n/* Creates instance and notifies it through the window element */\nconst createInstance = function(classObj, options) {\n\tvar event;\n\tlet eventString = \"LazyLoad::Initialized\";\n\tlet instance = new classObj(options);\n\ttry {\n\t\t// Works in modern browsers\n\t\tevent = new CustomEvent(eventString, { detail: { instance } });\n\t} catch (err) {\n\t\t// Works in Internet Explorer (all versions)\n\t\tevent = document.createEvent(\"CustomEvent\");\n\t\tevent.initCustomEvent(eventString, false, false, { instance });\n\t}\n\twindow.dispatchEvent(event);\n};\n\n/* Auto initialization of one or more instances of lazyload, depending on the \n options passed in (plain object or an array) */\nfunction autoInitialize(classObj, options) {\n\tif (!options) {\n\t\treturn;\n\t}\n\tif (!options.length) {\n\t\t// Plain object\n\t\tcreateInstance(classObj, options);\n\t} else {\n\t\t// Array of objects\n\t\tfor (let i = 0, optionsItem; (optionsItem = options[i]); i += 1) {\n\t\t\tcreateInstance(classObj, optionsItem);\n\t\t}\n\t}\n}\n\nconst callbackIfSet = (callback, argument) => {\n\tif (callback) {\n\t\tcallback(argument);\n\t}\n};\n\nconst updateLoadingCount = (instance, plusMinus) => {\n\tinstance._loadingCount += plusMinus;\n\tif (instance._elements.length === 0 && instance._loadingCount === 0) {\n\t\tcallbackIfSet(instance._settings.callback_finish);\n\t}\n};\n\nconst getSourceTags = parentTag => {\n\tlet sourceTags = [];\n\tfor (let i = 0, childTag; (childTag = parentTag.children[i]); i += 1) {\n\t\tif (childTag.tagName === \"SOURCE\") {\n\t\t\tsourceTags.push(childTag);\n\t\t}\n\t}\n\treturn sourceTags;\n};\n\nconst setAttributeIfValue = (element, attrName, value) => {\n\tif (!value) {\n\t\treturn;\n\t}\n\telement.setAttribute(attrName, value);\n};\n\nconst setImageAttributes = (element, settings) => {\n\tsetAttributeIfValue(\n\t\telement,\n\t\t\"sizes\",\n\t\tgetData(element, settings.data_sizes)\n\t);\n\tsetAttributeIfValue(\n\t\telement,\n\t\t\"srcset\",\n\t\tgetData(element, settings.data_srcset)\n\t);\n\tsetAttributeIfValue(element, \"src\", getData(element, settings.data_src));\n};\n\nconst setSourcesImg = (element, settings) => {\n\tconst parent = element.parentNode;\n\n\tif (parent && parent.tagName === \"PICTURE\") {\n\t\tlet sourceTags = getSourceTags(parent);\n\t\tsourceTags.forEach(sourceTag => {\n\t\t\tsetImageAttributes(sourceTag, settings);\n\t\t});\n\t}\n\n\tsetImageAttributes(element, settings);\n};\n\nconst setSourcesIframe = (element, settings) => {\n\tsetAttributeIfValue(element, \"src\", getData(element, settings.data_src));\n};\n\nconst setSourcesVideo = (element, settings) => {\n\tlet sourceTags = getSourceTags(element);\n\tsourceTags.forEach(sourceTag => {\n\t\tsetAttributeIfValue(\n\t\t\tsourceTag,\n\t\t\t\"src\",\n\t\t\tgetData(sourceTag, settings.data_src)\n\t\t);\n\t});\n\tsetAttributeIfValue(element, \"src\", getData(element, settings.data_src));\n\telement.load();\n};\n\nconst setSourcesBgImage = (element, settings) => {\n\tconst srcDataValue = getData(element, settings.data_src);\n\tconst bgDataValue = getData(element, settings.data_bg);\n\n\tif (srcDataValue) {\n\t\telement.style.backgroundImage = `url(\"${srcDataValue}\")`;\n\t}\n\n\tif (bgDataValue) {\n\t\telement.style.backgroundImage = bgDataValue;\n\t}\n};\n\nconst setSourcesFunctions = {\n\tIMG: setSourcesImg,\n\tIFRAME: setSourcesIframe,\n\tVIDEO: setSourcesVideo\n};\n\nconst setSources = (element, instance) => {\n\tconst settings = instance._settings;\n\tconst tagName = element.tagName;\n\tconst setSourcesFunction = setSourcesFunctions[tagName];\n\tif (setSourcesFunction) {\n\t\tsetSourcesFunction(element, settings);\n\t\tupdateLoadingCount(instance, 1);\n\t\tinstance._elements = purgeOneElement(instance._elements, element);\n\t\treturn;\n\t}\n\tsetSourcesBgImage(element, settings);\n};\n\nconst addClass = (element, className) => {\n\tif (supportsClassList) {\n\t\telement.classList.add(className);\n\t\treturn;\n\t}\n\telement.className += (element.className ? \" \" : \"\") + className;\n};\n\nconst removeClass = (element, className) => {\n\tif (supportsClassList) {\n\t\telement.classList.remove(className);\n\t\treturn;\n\t}\n\telement.className = element.className.\n\t\treplace(new RegExp(\"(^|\\\\s+)\" + className + \"(\\\\s+|$)\"), \" \").\n\t\treplace(/^\\s+/, \"\").\n\t\treplace(/\\s+$/, \"\");\n};\n\nconst genericLoadEventName = \"load\";\nconst mediaLoadEventName = \"loadeddata\";\nconst errorEventName = \"error\";\n\nconst addEventListener = (element, eventName, handler) => {\n\telement.addEventListener(eventName, handler);\n};\n\nconst removeEventListener = (element, eventName, handler) => {\n\telement.removeEventListener(eventName, handler);\n};\n\nconst addEventListeners = (element, loadHandler, errorHandler) => {\n\taddEventListener(element, genericLoadEventName, loadHandler);\n\taddEventListener(element, mediaLoadEventName, loadHandler);\n\taddEventListener(element, errorEventName, errorHandler);\n};\n\nconst removeEventListeners = (element, loadHandler, errorHandler) => {\n\tremoveEventListener(element, genericLoadEventName, loadHandler);\n\tremoveEventListener(element, mediaLoadEventName, loadHandler);\n\tremoveEventListener(element, errorEventName, errorHandler);\n};\n\nconst eventHandler = function(event, success, instance) {\n\tvar settings = instance._settings;\n\tconst className = success ? settings.class_loaded : settings.class_error;\n\tconst callback = success\n\t\t? settings.callback_loaded\n\t\t: settings.callback_error;\n\tconst element = event.target;\n\n\tremoveClass(element, settings.class_loading);\n\taddClass(element, className);\n\tcallbackIfSet(callback, element);\n\n\tupdateLoadingCount(instance, -1);\n};\n\nconst addOneShotEventListeners = (element, instance) => {\n\tconst loadHandler = event => {\n\t\teventHandler(event, true, instance);\n\t\tremoveEventListeners(element, loadHandler, errorHandler);\n\t};\n\tconst errorHandler = event => {\n\t\teventHandler(event, false, instance);\n\t\tremoveEventListeners(element, loadHandler, errorHandler);\n\t};\n\taddEventListeners(element, loadHandler, errorHandler);\n};\n\nconst managedTags = [\"IMG\", \"IFRAME\", \"VIDEO\"];\n\nconst onEnter = (element, instance) => {\n\tconst settings = instance._settings;\n\tcallbackIfSet(settings.callback_enter, element);\n\tif (!settings.load_delay) {\n\t\trevealAndUnobserve(element, instance);\n\t\treturn;\n\t}\n\tdelayLoad(element, instance);\n};\n\nconst revealAndUnobserve = (element, instance) => {\n\tvar observer = instance._observer;\n\trevealElement(element, instance);\n\tif (observer && instance._settings.auto_unobserve) {\n\t\tobserver.unobserve(element);\n\t}\n};\n\nconst onExit = (element, instance) => {\n\tconst settings = instance._settings;\n\tcallbackIfSet(settings.callback_exit, element);\n\tif (!settings.load_delay) {\n\t\treturn;\n\t}\n\tcancelDelayLoad(element);\n};\n\nconst cancelDelayLoad = element => {\n\tvar timeoutId = getTimeoutData(element);\n\tif (!timeoutId) {\n\t\treturn; // do nothing if timeout doesn't exist\n\t}\n\tclearTimeout(timeoutId);\n\tsetTimeoutData(element, null);\n};\n\nconst delayLoad = (element, instance) => {\n\tvar loadDelay = instance._settings.load_delay;\n\tvar timeoutId = getTimeoutData(element);\n\tif (timeoutId) {\n\t\treturn; // do nothing if timeout already set\n\t}\n\ttimeoutId = setTimeout(function() {\n\t\trevealAndUnobserve(element, instance);\n\t\tcancelDelayLoad(element);\n\t}, loadDelay);\n\tsetTimeoutData(element, timeoutId);\n};\n\nconst revealElement = (element, instance, force) => {\n\tvar settings = instance._settings;\n\tif (!force && getWasProcessedData(element)) {\n\t\treturn; // element has already been processed and force wasn't true\n\t}\n\tif (managedTags.indexOf(element.tagName) > -1) {\n\t\taddOneShotEventListeners(element, instance);\n\t\taddClass(element, settings.class_loading);\n\t}\n\tsetSources(element, instance);\n\tsetWasProcessedData(element);\n\tcallbackIfSet(settings.callback_reveal, element);\n};\n\nconst isIntersecting = entry =>\n\tentry.isIntersecting || entry.intersectionRatio > 0;\n\nconst getObserverSettings = settings => ({\n\troot: settings.container === document ? null : settings.container,\n\trootMargin: settings.thresholds || settings.threshold + \"px\"\n});\n\nconst setObserver = instance => {\n\tif (!supportsIntersectionObserver) {\n\t\treturn false;\n\t}\n\tinstance._observer = new IntersectionObserver(entries => {\n\t\tentries.forEach(entry =>\n\t\t\tisIntersecting(entry)\n\t\t\t\t? onEnter(entry.target, instance)\n\t\t\t\t: onExit(entry.target, instance)\n\t\t);\n\t}, getObserverSettings(instance._settings));\n\treturn true;\n};\n\nconst LazyLoad = function(customSettings, elements) {\n\tthis._settings = getInstanceSettings(customSettings);\n\tthis._loadingCount = 0;\n\tsetObserver(this);\n\tthis.update(elements);\n};\n\nLazyLoad.prototype = {\n\tupdate: function(elements) {\n\t\tconst settings = this._settings;\n\t\tconst nodeSet =\n\t\t\telements ||\n\t\t\tsettings.container.querySelectorAll(settings.elements_selector);\n\n\t\tthis._elements = purgeProcessedElements(\n\t\t\tArray.prototype.slice.call(nodeSet) // NOTE: nodeset to array for IE compatibility\n\t\t);\n\n\t\tif (isBot || !this._observer) {\n\t\t\tthis.loadAll();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._elements.forEach(element => {\n\t\t\tthis._observer.observe(element);\n\t\t});\n\t},\n\n\tdestroy: function() {\n\t\tif (this._observer) {\n\t\t\tthis._elements.forEach(element => {\n\t\t\t\tthis._observer.unobserve(element);\n\t\t\t});\n\t\t\tthis._observer = null;\n\t\t}\n\t\tthis._elements = null;\n\t\tthis._settings = null;\n\t},\n\n\tload: function(element, force) {\n\t\trevealElement(element, this, force);\n\t},\n\n\tloadAll: function() {\n\t\tvar elements = this._elements;\n\t\telements.forEach(element => {\n\t\t\trevealAndUnobserve(element, this);\n\t\t});\n\t}\n};\n\n/* Automatic instances creation if required (useful for async script loading) */\nif (runningOnBrowser) {\n\tautoInitialize(LazyLoad, window.lazyLoadOptions);\n}\n\nreturn LazyLoad;\n\n})));\n"]}
|
assets/js/lazyload-11.0.2.min.js.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["lazyload.js"],"names":["global","factory","exports","_typeof","module","define","amd","LazyLoad","this","runningOnBrowser","window","isBot","test","defaultSettings","elements_selector","threshold","thresholds","document","createElement","data_srcset","data_sizes","data_bg","class_loading","class_loaded","class_error","load_delay","auto_unobserve","callback_enter","callback_exit","callback_reveal","callback_loaded","callback_error","callback_finish","getInstanceSettings","getData","element","attribute","value","getAttribute","setData","attrName","setAttribute","processedDataName","removeAttribute","getWasProcessedData","setTimeoutData","getTimeoutData","timeoutDataName","createInstance","elementToPurge","options","event","instance","classObj","createEvent","initCustomEvent","dispatchEvent","callbackIfSet","autoInitialize","callback","argument","updateLoadingCount","plusMinus","_elements","length","_loadingCount","_settings","getSourceTags","parentTag","childTag","sourceTags","i","children","setAttributeIfValue","tagName","settings","data_src","backgroundImage","IMG","parent","parentNode","forEach","sourceTag","setImageAttributes","IFRAME","VIDEO","load","setSources","elements","setSourcesFunctions","setSourcesFunction","setSourcesVideo","filter","srcDataValue","bgDataValue","setSourcesBgImage","addClass","className","addEventListener","eventName","handler","removeEventListener","genericLoadEventName","errorHandler","removeClass","loadHandler","addEventListeners","errorEventName","success","removeEventListeners","target","supportsClassList","remove","replace","RegExp","eventHandler","addOneShotEventListeners","revealAndUnobserve","observer","unobserve","cancelDelayLoad","timeoutId","clearTimeout","loadDelay","revealElement","force","managedTags","indexOf","setTimeout","setObserver","supportsIntersectionObserver","entries","entry","intersectionRatio","isIntersecting","delayLoad","onEnter","setWasProcessedData","root","container","rootMargin","customSettings","trueString","getObserverSettings","prototype","update","_this","nodeSet","querySelectorAll","purgeProcessedElements","_observer","call","loadAll","destroy","_this2","_this3","optionsItem","lazyLoadOptions"],"mappings":"+cAAC,SAAUA,EAAQC,GACC,YAAnB,oBAAOC,QAAP,YAAAC,QAAO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L9B,KALA3B,KAAAgJ,WA+BAC,QAAS,WAAW,IAAAC,EAAAlJ,KArBrBD,KAASyI,YACRC,KAAAA,UAAQhE,QAAA,SAAA9C,GAAmBuH,EAAAJ,UAAA/B,UAAApF,KAC1B3B,KAAA8I,UAAc,MAKd9I,KAAAuD,UAAKA,KAAkCvD,KAAvC0D,UAAA,MAKCoB,KAAA,SAAKkE,EAAL3B,GACAD,EAAAzF,EAAA3B,KAAAqH,IAGD2B,QAAA,WAAevE,IAAAA,EAAAA,KACTqE,KAAAA,UADNrE,QAAA,SAAA9C,GAGAkF,EAnBmBlF,EAAAwH,OAwBjBlJ,GA/TmC,SAArC4C,EAAAH,GACA,GAACA,EAGDC,GAAAA,EAAMI,OAEP7C,IAAAA,IAAO8C,EAAAA,EAAAA,EAAPoG,EAAA1G,EAAAqB,GAAAA,GAAA,EAZDvB,EAAAK,EAAAuG,QAUmD5G,EAAjDK,EAAAH,GA4TEQ,CAFDnD,EAAAG,OAAAmJ,iBAIAtJ","file":"lazyload.min.js","sourcesContent":["(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.LazyLoad = factory());\n}(this, (function () { 'use strict';\n\nconst runningOnBrowser = typeof window !== \"undefined\";\n\nconst isBot =\n\t(runningOnBrowser && !(\"onscroll\" in window)) ||\n\t(typeof navigator !== \"undefined\" &&\n\t\t/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent));\n\nconst supportsIntersectionObserver =\n\trunningOnBrowser && \"IntersectionObserver\" in window;\n\nconst supportsClassList =\n\trunningOnBrowser && \"classList\" in document.createElement(\"p\");\n\nconst defaultSettings = {\n\telements_selector: \"img\",\n\tcontainer: isBot || runningOnBrowser ? document : null,\n\tthreshold: 300,\n\tthresholds: null,\n\tdata_src: \"src\",\n\tdata_srcset: \"srcset\",\n\tdata_sizes: \"sizes\",\n\tdata_bg: \"bg\",\n\tclass_loading: \"loading\",\n\tclass_loaded: \"loaded\",\n\tclass_error: \"error\",\n\tload_delay: 0,\n\tauto_unobserve: true,\n\tcallback_enter: null,\n\tcallback_exit: null,\n\tcallback_reveal: null,\n\tcallback_loaded: null,\n\tcallback_error: null,\n\tcallback_finish: null\n};\n\nvar getInstanceSettings = customSettings => {\n\treturn Object.assign({}, defaultSettings, customSettings);\n};\n\nconst dataPrefix = \"data-\";\nconst processedDataName = \"was-processed\";\nconst timeoutDataName = \"ll-timeout\";\nconst trueString = \"true\";\n\nconst getData = (element, attribute) => {\n\treturn element.getAttribute(dataPrefix + attribute);\n};\n\nconst setData = (element, attribute, value) => {\n\tvar attrName = dataPrefix + attribute;\n\tif (value === null) {\n\t\telement.removeAttribute(attrName);\n\t\treturn;\n\t}\n\telement.setAttribute(attrName, value);\n};\n\nconst setWasProcessedData = element =>\n\tsetData(element, processedDataName, trueString);\n\nconst getWasProcessedData = element =>\n\tgetData(element, processedDataName) === trueString;\n\nconst setTimeoutData = (element, value) =>\n\tsetData(element, timeoutDataName, value);\n\nconst getTimeoutData = element => getData(element, timeoutDataName);\n\nconst purgeProcessedElements = elements => {\n\treturn elements.filter(element => !getWasProcessedData(element));\n};\n\nconst purgeOneElement = (elements, elementToPurge) => {\n\treturn elements.filter(element => element !== elementToPurge);\n};\n\n/* Creates instance and notifies it through the window element */\nconst createInstance = function(classObj, options) {\n\tvar event;\n\tlet eventString = \"LazyLoad::Initialized\";\n\tlet instance = new classObj(options);\n\ttry {\n\t\t// Works in modern browsers\n\t\tevent = new CustomEvent(eventString, { detail: { instance } });\n\t} catch (err) {\n\t\t// Works in Internet Explorer (all versions)\n\t\tevent = document.createEvent(\"CustomEvent\");\n\t\tevent.initCustomEvent(eventString, false, false, { instance });\n\t}\n\twindow.dispatchEvent(event);\n};\n\n/* Auto initialization of one or more instances of lazyload, depending on the \n options passed in (plain object or an array) */\nfunction autoInitialize(classObj, options) {\n\tif (!options) {\n\t\treturn;\n\t}\n\tif (!options.length) {\n\t\t// Plain object\n\t\tcreateInstance(classObj, options);\n\t} else {\n\t\t// Array of objects\n\t\tfor (let i = 0, optionsItem; (optionsItem = options[i]); i += 1) {\n\t\t\tcreateInstance(classObj, optionsItem);\n\t\t}\n\t}\n}\n\nconst callbackIfSet = (callback, argument) => {\n\tif (callback) {\n\t\tcallback(argument);\n\t}\n};\n\nconst updateLoadingCount = (instance, plusMinus) => {\n\tinstance._loadingCount += plusMinus;\n\tif (instance._elements.length === 0 && instance._loadingCount === 0) {\n\t\tcallbackIfSet(instance._settings.callback_finish);\n\t}\n};\n\nconst getSourceTags = parentTag => {\n\tlet sourceTags = [];\n\tfor (let i = 0, childTag; (childTag = parentTag.children[i]); i += 1) {\n\t\tif (childTag.tagName === \"SOURCE\") {\n\t\t\tsourceTags.push(childTag);\n\t\t}\n\t}\n\treturn sourceTags;\n};\n\nconst setAttributeIfValue = (element, attrName, value) => {\n\tif (!value) {\n\t\treturn;\n\t}\n\telement.setAttribute(attrName, value);\n};\n\nconst setImageAttributes = (element, settings) => {\n\tsetAttributeIfValue(\n\t\telement,\n\t\t\"sizes\",\n\t\tgetData(element, settings.data_sizes)\n\t);\n\tsetAttributeIfValue(\n\t\telement,\n\t\t\"srcset\",\n\t\tgetData(element, settings.data_srcset)\n\t);\n\tsetAttributeIfValue(element, \"src\", getData(element, settings.data_src));\n};\n\nconst setSourcesImg = (element, settings) => {\n\tconst parent = element.parentNode;\n\n\tif (parent && parent.tagName === \"PICTURE\") {\n\t\tlet sourceTags = getSourceTags(parent);\n\t\tsourceTags.forEach(sourceTag => {\n\t\t\tsetImageAttributes(sourceTag, settings);\n\t\t});\n\t}\n\n\tsetImageAttributes(element, settings);\n};\n\nconst setSourcesIframe = (element, settings) => {\n\tsetAttributeIfValue(element, \"src\", getData(element, settings.data_src));\n};\n\nconst setSourcesVideo = (element, settings) => {\n\tlet sourceTags = getSourceTags(element);\n\tsourceTags.forEach(sourceTag => {\n\t\tsetAttributeIfValue(\n\t\t\tsourceTag,\n\t\t\t\"src\",\n\t\t\tgetData(sourceTag, settings.data_src)\n\t\t);\n\t});\n\tsetAttributeIfValue(element, \"src\", getData(element, settings.data_src));\n\telement.load();\n};\n\nconst setSourcesBgImage = (element, settings) => {\n\tconst srcDataValue = getData(element, settings.data_src);\n\tconst bgDataValue = getData(element, settings.data_bg);\n\n\tif (srcDataValue) {\n\t\telement.style.backgroundImage = `url(\"${srcDataValue}\")`;\n\t}\n\n\tif (bgDataValue) {\n\t\telement.style.backgroundImage = bgDataValue;\n\t}\n};\n\nconst setSourcesFunctions = {\n\tIMG: setSourcesImg,\n\tIFRAME: setSourcesIframe,\n\tVIDEO: setSourcesVideo\n};\n\nconst setSources = (element, instance) => {\n\tconst settings = instance._settings;\n\tconst tagName = element.tagName;\n\tconst setSourcesFunction = setSourcesFunctions[tagName];\n\tif (setSourcesFunction) {\n\t\tsetSourcesFunction(element, settings);\n\t\tupdateLoadingCount(instance, 1);\n\t\tinstance._elements = purgeOneElement(instance._elements, element);\n\t\treturn;\n\t}\n\tsetSourcesBgImage(element, settings);\n};\n\nconst addClass = (element, className) => {\n\tif (supportsClassList) {\n\t\telement.classList.add(className);\n\t\treturn;\n\t}\n\telement.className += (element.className ? \" \" : \"\") + className;\n};\n\nconst removeClass = (element, className) => {\n\tif (supportsClassList) {\n\t\telement.classList.remove(className);\n\t\treturn;\n\t}\n\telement.className = element.className.\n\t\treplace(new RegExp(\"(^|\\\\s+)\" + className + \"(\\\\s+|$)\"), \" \").\n\t\treplace(/^\\s+/, \"\").\n\t\treplace(/\\s+$/, \"\");\n};\n\nconst genericLoadEventName = \"load\";\nconst mediaLoadEventName = \"loadeddata\";\nconst errorEventName = \"error\";\n\nconst addEventListener = (element, eventName, handler) => {\n\telement.addEventListener(eventName, handler);\n};\n\nconst removeEventListener = (element, eventName, handler) => {\n\telement.removeEventListener(eventName, handler);\n};\n\nconst addEventListeners = (element, loadHandler, errorHandler) => {\n\taddEventListener(element, genericLoadEventName, loadHandler);\n\taddEventListener(element, mediaLoadEventName, loadHandler);\n\taddEventListener(element, errorEventName, errorHandler);\n};\n\nconst removeEventListeners = (element, loadHandler, errorHandler) => {\n\tremoveEventListener(element, genericLoadEventName, loadHandler);\n\tremoveEventListener(element, mediaLoadEventName, loadHandler);\n\tremoveEventListener(element, errorEventName, errorHandler);\n};\n\nconst eventHandler = function(event, success, instance) {\n\tvar settings = instance._settings;\n\tconst className = success ? settings.class_loaded : settings.class_error;\n\tconst callback = success\n\t\t? settings.callback_loaded\n\t\t: settings.callback_error;\n\tconst element = event.target;\n\n\tremoveClass(element, settings.class_loading);\n\taddClass(element, className);\n\tcallbackIfSet(callback, element);\n\n\tupdateLoadingCount(instance, -1);\n};\n\nconst addOneShotEventListeners = (element, instance) => {\n\tconst loadHandler = event => {\n\t\teventHandler(event, true, instance);\n\t\tremoveEventListeners(element, loadHandler, errorHandler);\n\t};\n\tconst errorHandler = event => {\n\t\teventHandler(event, false, instance);\n\t\tremoveEventListeners(element, loadHandler, errorHandler);\n\t};\n\taddEventListeners(element, loadHandler, errorHandler);\n};\n\nconst managedTags = [\"IMG\", \"IFRAME\", \"VIDEO\"];\n\nconst onEnter = (element, instance) => {\n\tconst settings = instance._settings;\n\tcallbackIfSet(settings.callback_enter, element);\n\tif (!settings.load_delay) {\n\t\trevealAndUnobserve(element, instance);\n\t\treturn;\n\t}\n\tdelayLoad(element, instance);\n};\n\nconst revealAndUnobserve = (element, instance) => {\n\tvar observer = instance._observer;\n\trevealElement(element, instance);\n\tif (observer && instance._settings.auto_unobserve) {\n\t\tobserver.unobserve(element);\n\t}\n};\n\nconst onExit = (element, instance) => {\n\tconst settings = instance._settings;\n\tcallbackIfSet(settings.callback_exit, element);\n\tif (!settings.load_delay) {\n\t\treturn;\n\t}\n\tcancelDelayLoad(element);\n};\n\nconst cancelDelayLoad = element => {\n\tvar timeoutId = getTimeoutData(element);\n\tif (!timeoutId) {\n\t\treturn; // do nothing if timeout doesn't exist\n\t}\n\tclearTimeout(timeoutId);\n\tsetTimeoutData(element, null);\n};\n\nconst delayLoad = (element, instance) => {\n\tvar loadDelay = instance._settings.load_delay;\n\tvar timeoutId = getTimeoutData(element);\n\tif (timeoutId) {\n\t\treturn; // do nothing if timeout already set\n\t}\n\ttimeoutId = setTimeout(function() {\n\t\trevealAndUnobserve(element, instance);\n\t\tcancelDelayLoad(element);\n\t}, loadDelay);\n\tsetTimeoutData(element, timeoutId);\n};\n\nconst revealElement = (element, instance, force) => {\n\tvar settings = instance._settings;\n\tif (!force && getWasProcessedData(element)) {\n\t\treturn; // element has already been processed and force wasn't true\n\t}\n\tif (managedTags.indexOf(element.tagName) > -1) {\n\t\taddOneShotEventListeners(element, instance);\n\t\taddClass(element, settings.class_loading);\n\t}\n\tsetSources(element, instance);\n\tsetWasProcessedData(element);\n\tcallbackIfSet(settings.callback_reveal, element);\n};\n\nconst isIntersecting = entry => entry.intersectionRatio > 0;\n\nconst getObserverSettings = settings => ({\n\troot: settings.container === document ? null : settings.container,\n\trootMargin: settings.thresholds || settings.threshold + \"px\"\n});\n\nconst setObserver = instance => {\n\tif (!supportsIntersectionObserver) {\n\t\treturn false;\n\t}\n\tinstance._observer = new IntersectionObserver(entries => {\n\t\tentries.forEach(entry =>\n\t\t\tisIntersecting(entry)\n\t\t\t\t? onEnter(entry.target, instance)\n\t\t\t\t: onExit(entry.target, instance)\n\t\t);\n\t}, getObserverSettings(instance._settings));\n\treturn true;\n};\n\nconst LazyLoad = function(customSettings, elements) {\n\tthis._settings = getInstanceSettings(customSettings);\n\tthis._loadingCount = 0;\n\tsetObserver(this);\n\tthis.update(elements);\n};\n\nLazyLoad.prototype = {\n\tupdate: function(elements) {\n\t\tconst settings = this._settings;\n\t\tconst nodeSet =\n\t\t\telements ||\n\t\t\tsettings.container.querySelectorAll(settings.elements_selector);\n\n\t\tthis._elements = purgeProcessedElements(\n\t\t\tArray.prototype.slice.call(nodeSet) // NOTE: nodeset to array for IE compatibility\n\t\t);\n\n\t\tif (isBot || !this._observer) {\n\t\t\tthis.loadAll();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._elements.forEach(element => {\n\t\t\tthis._observer.observe(element);\n\t\t});\n\t},\n\n\tdestroy: function() {\n\t\tif (this._observer) {\n\t\t\tthis._elements.forEach(element => {\n\t\t\t\tthis._observer.unobserve(element);\n\t\t\t});\n\t\t\tthis._observer = null;\n\t\t}\n\t\tthis._elements = null;\n\t\tthis._settings = null;\n\t},\n\n\tload: function(element, force) {\n\t\trevealElement(element, this, force);\n\t},\n\n\tloadAll: function() {\n\t\tvar elements = this._elements;\n\t\telements.forEach(element => {\n\t\t\trevealAndUnobserve(element, this);\n\t\t});\n\t}\n};\n\n/* Automatic instances creation if required (useful for async script loading) */\nif (runningOnBrowser) {\n\tautoInitialize(LazyLoad, window.lazyLoadOptions);\n}\n\nreturn LazyLoad;\n\n})));\n"]}
|
|
composer.lock
CHANGED
@@ -273,16 +273,16 @@
|
|
273 |
},
|
274 |
{
|
275 |
"name": "wp-media/rocket-lazyload-common",
|
276 |
-
"version": "v2.2.
|
277 |
"source": {
|
278 |
"type": "git",
|
279 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
280 |
-
"reference": "
|
281 |
},
|
282 |
"dist": {
|
283 |
"type": "zip",
|
284 |
-
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/
|
285 |
-
"reference": "
|
286 |
"shasum": ""
|
287 |
},
|
288 |
"require": {
|
@@ -317,7 +317,7 @@
|
|
317 |
}
|
318 |
],
|
319 |
"description": "Common Code between WP Rocket and Lazyload by WP Rocket",
|
320 |
-
"time": "2019-
|
321 |
}
|
322 |
],
|
323 |
"packages-dev": [
|
@@ -2080,7 +2080,7 @@
|
|
2080 |
},
|
2081 |
{
|
2082 |
"name": "Gert de Pagter",
|
2083 |
-
"email": "
|
2084 |
}
|
2085 |
],
|
2086 |
"description": "Symfony polyfill for ctype functions",
|
@@ -2095,16 +2095,16 @@
|
|
2095 |
},
|
2096 |
{
|
2097 |
"name": "symfony/yaml",
|
2098 |
-
"version": "v4.2.
|
2099 |
"source": {
|
2100 |
"type": "git",
|
2101 |
"url": "https://github.com/symfony/yaml.git",
|
2102 |
-
"reference": "
|
2103 |
},
|
2104 |
"dist": {
|
2105 |
"type": "zip",
|
2106 |
-
"url": "https://api.github.com/repos/symfony/yaml/zipball/
|
2107 |
-
"reference": "
|
2108 |
"shasum": ""
|
2109 |
},
|
2110 |
"require": {
|
@@ -2150,7 +2150,7 @@
|
|
2150 |
],
|
2151 |
"description": "Symfony Yaml Component",
|
2152 |
"homepage": "https://symfony.com",
|
2153 |
-
"time": "2019-
|
2154 |
},
|
2155 |
{
|
2156 |
"name": "webmozart/assert",
|
273 |
},
|
274 |
{
|
275 |
"name": "wp-media/rocket-lazyload-common",
|
276 |
+
"version": "v2.2.4",
|
277 |
"source": {
|
278 |
"type": "git",
|
279 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
280 |
+
"reference": "53c2b1cf0d36009027690a839cb34cf827c255fe"
|
281 |
},
|
282 |
"dist": {
|
283 |
"type": "zip",
|
284 |
+
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/53c2b1cf0d36009027690a839cb34cf827c255fe",
|
285 |
+
"reference": "53c2b1cf0d36009027690a839cb34cf827c255fe",
|
286 |
"shasum": ""
|
287 |
},
|
288 |
"require": {
|
317 |
}
|
318 |
],
|
319 |
"description": "Common Code between WP Rocket and Lazyload by WP Rocket",
|
320 |
+
"time": "2019-03-05T21:43:32+00:00"
|
321 |
}
|
322 |
],
|
323 |
"packages-dev": [
|
2080 |
},
|
2081 |
{
|
2082 |
"name": "Gert de Pagter",
|
2083 |
+
"email": "backendtea@gmail.com"
|
2084 |
}
|
2085 |
],
|
2086 |
"description": "Symfony polyfill for ctype functions",
|
2095 |
},
|
2096 |
{
|
2097 |
"name": "symfony/yaml",
|
2098 |
+
"version": "v4.2.4",
|
2099 |
"source": {
|
2100 |
"type": "git",
|
2101 |
"url": "https://github.com/symfony/yaml.git",
|
2102 |
+
"reference": "761fa560a937fd7686e5274ff89dcfa87a5047df"
|
2103 |
},
|
2104 |
"dist": {
|
2105 |
"type": "zip",
|
2106 |
+
"url": "https://api.github.com/repos/symfony/yaml/zipball/761fa560a937fd7686e5274ff89dcfa87a5047df",
|
2107 |
+
"reference": "761fa560a937fd7686e5274ff89dcfa87a5047df",
|
2108 |
"shasum": ""
|
2109 |
},
|
2110 |
"require": {
|
2150 |
],
|
2151 |
"description": "Symfony Yaml Component",
|
2152 |
"homepage": "https://symfony.com",
|
2153 |
+
"time": "2019-02-23T15:17:42+00:00"
|
2154 |
},
|
2155 |
{
|
2156 |
"name": "webmozart/assert",
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smili
|
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.1
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 2.1.
|
8 |
|
9 |
Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
|
10 |
|
@@ -85,6 +85,16 @@ You can also apply it manually. The element you want to apply lazyload on must h
|
|
85 |
The element must have the class `rocket-lazyload-bg`, and a `data-bg` attribute, which value is the CSS url for the image.
|
86 |
|
87 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
= 2.1.1 =
|
89 |
* Bugfix: Correctly apply lazyload on `picture` elements
|
90 |
* Bugfix: Prevent double loading of an image when an `img` element inside a `picture` element only has a `srcset` attribute and no `src` attribute
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.1
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 2.1.2
|
8 |
|
9 |
Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
|
10 |
|
85 |
The element must have the class `rocket-lazyload-bg`, and a `data-bg` attribute, which value is the CSS url for the image.
|
86 |
|
87 |
== Changelog ==
|
88 |
+
= 2.1.2 =
|
89 |
+
* Enhancement: Update lazyload script to the latest version
|
90 |
+
* Enhancement: Add a way to lazyload the Youtube thumbnail image
|
91 |
+
* Enhancement: Add width and height attributes to the Youtube thumbnail image depending on the resolution
|
92 |
+
* Enhancement: Disable polyfill for intersectionObserver by default, added a way to activate it instead
|
93 |
+
* Enhancement: Add data-cfasync="false" to the lazyload script tag
|
94 |
+
* Enhancement: Prevent lazyload on the Oxygen Builder page editor
|
95 |
+
* Bugfix: Wrap no JS CSS in noscript tag and remove the no-js identifier
|
96 |
+
|
97 |
+
|
98 |
= 2.1.1 =
|
99 |
* Bugfix: Correctly apply lazyload on `picture` elements
|
100 |
* Bugfix: Prevent double loading of an image when an `img` element inside a `picture` element only has a `srcset` attribute and no `src` attribute
|
rocket-lazy-load.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Lazy Load by WP Rocket
|
4 |
* Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
|
5 |
* Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
|
6 |
-
* Version: 2.1.
|
7 |
* Author: WP Rocket
|
8 |
* Author URI: https://wp-rocket.me
|
9 |
* Text Domain: rocket-lazy-load
|
@@ -29,7 +29,7 @@
|
|
29 |
|
30 |
defined('ABSPATH') || die('Cheatin\' uh?');
|
31 |
|
32 |
-
define('ROCKET_LL_VERSION', '2.1');
|
33 |
define('ROCKET_LL_WP_VERSION', '4.7');
|
34 |
define('ROCKET_LL_PHP_VERSION', '5.4');
|
35 |
define('ROCKET_LL_BASENAME', plugin_basename(__FILE__));
|
3 |
* Plugin Name: Lazy Load by WP Rocket
|
4 |
* Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
|
5 |
* Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
|
6 |
+
* Version: 2.1.2
|
7 |
* Author: WP Rocket
|
8 |
* Author URI: https://wp-rocket.me
|
9 |
* Text Domain: rocket-lazy-load
|
29 |
|
30 |
defined('ABSPATH') || die('Cheatin\' uh?');
|
31 |
|
32 |
+
define('ROCKET_LL_VERSION', '2.1.2');
|
33 |
define('ROCKET_LL_WP_VERSION', '4.7');
|
34 |
define('ROCKET_LL_PHP_VERSION', '5.4');
|
35 |
define('ROCKET_LL_BASENAME', plugin_basename(__FILE__));
|
src/Subscriber/LazyloadSubscriber.php
CHANGED
@@ -92,10 +92,8 @@ class LazyloadSubscriber implements SubscriberInterface
|
|
92 |
[ 'insertLazyloadScript', ROCKET_LL_INT_MAX ],
|
93 |
['insertYoutubeThumbnailScript', ROCKET_LL_INT_MAX ],
|
94 |
],
|
95 |
-
'
|
96 |
-
|
97 |
-
['insertYoutubeThumbnailStyle', ROCKET_LL_INT_MAX],
|
98 |
-
],
|
99 |
'template_redirect' => ['lazyload', ROCKET_LL_INT_MAX],
|
100 |
'rocket_lazyload_html' => 'lazyloadResponsive',
|
101 |
'init' => 'lazyloadSmilies',
|
@@ -130,10 +128,21 @@ class LazyloadSubscriber implements SubscriberInterface
|
|
130 |
*/
|
131 |
$threshold = apply_filters('rocket_lazyload_threshold', 300);
|
132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
$args = [
|
134 |
'base_url' => ROCKET_LL_FRONT_JS_URL,
|
135 |
'threshold' => $threshold,
|
136 |
-
'version' => '11.0.
|
|
|
137 |
];
|
138 |
|
139 |
if ($this->option_array->get('images')) {
|
@@ -189,6 +198,7 @@ class LazyloadSubscriber implements SubscriberInterface
|
|
189 |
$this->assets->insertYoutubeThumbnailScript(
|
190 |
[
|
191 |
'resolution' => $thumbnail_resolution,
|
|
|
192 |
]
|
193 |
);
|
194 |
}
|
@@ -249,14 +259,17 @@ class LazyloadSubscriber implements SubscriberInterface
|
|
249 |
return false;
|
250 |
}
|
251 |
|
252 |
-
//
|
253 |
-
|
254 |
-
|
255 |
-
|
|
|
|
|
256 |
|
257 |
-
|
258 |
-
|
259 |
-
|
|
|
260 |
}
|
261 |
|
262 |
/**
|
@@ -267,7 +280,7 @@ class LazyloadSubscriber implements SubscriberInterface
|
|
267 |
*
|
268 |
* @param bool $do_rocket_lazyload True to apply lazyload, false otherwise.
|
269 |
*/
|
270 |
-
if (! apply_filters('do_rocket_lazyload', true)) {
|
271 |
return false;
|
272 |
}
|
273 |
|
92 |
[ 'insertLazyloadScript', ROCKET_LL_INT_MAX ],
|
93 |
['insertYoutubeThumbnailScript', ROCKET_LL_INT_MAX ],
|
94 |
],
|
95 |
+
'wp_head' => ['insertNoJSStyle', ROCKET_LL_INT_MAX ],
|
96 |
+
'wp_enqueue_scripts' => ['insertYoutubeThumbnailStyle', ROCKET_LL_INT_MAX],
|
|
|
|
|
97 |
'template_redirect' => ['lazyload', ROCKET_LL_INT_MAX],
|
98 |
'rocket_lazyload_html' => 'lazyloadResponsive',
|
99 |
'init' => 'lazyloadSmilies',
|
128 |
*/
|
129 |
$threshold = apply_filters('rocket_lazyload_threshold', 300);
|
130 |
|
131 |
+
/**
|
132 |
+
* Filters the use of the polyfill for intersectionObserver
|
133 |
+
*
|
134 |
+
* @since 3.3
|
135 |
+
* @author Remy Perona
|
136 |
+
*
|
137 |
+
* @param bool $polyfill True to use the polyfill, false otherwise.
|
138 |
+
*/
|
139 |
+
$polyfill = apply_filters('rocket_lazyload_polyfill', false);
|
140 |
+
|
141 |
$args = [
|
142 |
'base_url' => ROCKET_LL_FRONT_JS_URL,
|
143 |
'threshold' => $threshold,
|
144 |
+
'version' => '11.0.3',
|
145 |
+
'polyfill' => $polyfill,
|
146 |
];
|
147 |
|
148 |
if ($this->option_array->get('images')) {
|
198 |
$this->assets->insertYoutubeThumbnailScript(
|
199 |
[
|
200 |
'resolution' => $thumbnail_resolution,
|
201 |
+
'lazy_image' => (bool) $this->option_array->get('images'),
|
202 |
]
|
203 |
);
|
204 |
}
|
259 |
return false;
|
260 |
}
|
261 |
|
262 |
+
// Exclude Page Builders editors.
|
263 |
+
$excluded_parameters = [
|
264 |
+
'fl_builder',
|
265 |
+
'et_fb',
|
266 |
+
'ct_builder',
|
267 |
+
];
|
268 |
|
269 |
+
foreach ($excluded_parameters as $excluded) {
|
270 |
+
if (isset($_GET[ $excluded ])) {
|
271 |
+
return false;
|
272 |
+
}
|
273 |
}
|
274 |
|
275 |
/**
|
280 |
*
|
281 |
* @param bool $do_rocket_lazyload True to apply lazyload, false otherwise.
|
282 |
*/
|
283 |
+
if (! apply_filters('do_rocket_lazyload', true)) { // WPCS: prefix ok.
|
284 |
return false;
|
285 |
}
|
286 |
|
vendor/composer/installed.json
CHANGED
@@ -274,17 +274,17 @@
|
|
274 |
},
|
275 |
{
|
276 |
"name": "wp-media/rocket-lazyload-common",
|
277 |
-
"version": "v2.2.
|
278 |
-
"version_normalized": "2.2.
|
279 |
"source": {
|
280 |
"type": "git",
|
281 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
282 |
-
"reference": "
|
283 |
},
|
284 |
"dist": {
|
285 |
"type": "zip",
|
286 |
-
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/
|
287 |
-
"reference": "
|
288 |
"shasum": ""
|
289 |
},
|
290 |
"require": {
|
@@ -302,7 +302,7 @@
|
|
302 |
"symfony/yaml": "2.8.*",
|
303 |
"wp-coding-standards/wpcs": "^2.0.0"
|
304 |
},
|
305 |
-
"time": "2019-
|
306 |
"type": "library",
|
307 |
"installation-source": "dist",
|
308 |
"autoload": {
|
274 |
},
|
275 |
{
|
276 |
"name": "wp-media/rocket-lazyload-common",
|
277 |
+
"version": "v2.2.4",
|
278 |
+
"version_normalized": "2.2.4.0",
|
279 |
"source": {
|
280 |
"type": "git",
|
281 |
"url": "https://github.com/wp-media/rocket-lazyload-common.git",
|
282 |
+
"reference": "53c2b1cf0d36009027690a839cb34cf827c255fe"
|
283 |
},
|
284 |
"dist": {
|
285 |
"type": "zip",
|
286 |
+
"url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/53c2b1cf0d36009027690a839cb34cf827c255fe",
|
287 |
+
"reference": "53c2b1cf0d36009027690a839cb34cf827c255fe",
|
288 |
"shasum": ""
|
289 |
},
|
290 |
"require": {
|
302 |
"symfony/yaml": "2.8.*",
|
303 |
"wp-coding-standards/wpcs": "^2.0.0"
|
304 |
},
|
305 |
+
"time": "2019-03-05T21:43:32+00:00",
|
306 |
"type": "library",
|
307 |
"installation-source": "dist",
|
308 |
"autoload": {
|
vendor/wp-media/rocket-lazyload-common/src/Assets.php
CHANGED
@@ -39,13 +39,18 @@ class Assets
|
|
39 |
],
|
40 |
'threshold' => 300,
|
41 |
'version' => '',
|
|
|
42 |
];
|
43 |
|
44 |
-
$args
|
45 |
-
$min
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
-
|
48 |
-
<script>
|
49 |
window.lazyLoadOptions = {
|
50 |
elements_selector: "' . esc_attr(implode(',', $args['elements'])) . '",
|
51 |
data_src: "lazy-src",
|
@@ -87,7 +92,9 @@ class Assets
|
|
87 |
}
|
88 |
}, false);
|
89 |
</script>
|
90 |
-
<script async src="' . $args['base_url'] .
|
|
|
|
|
91 |
}
|
92 |
|
93 |
/**
|
@@ -111,21 +118,44 @@ class Assets
|
|
111 |
{
|
112 |
$defaults = [
|
113 |
'resolution' => 'hqdefault',
|
|
|
114 |
];
|
115 |
|
116 |
$allowed_resolutions = [
|
117 |
-
'default' =>
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
];
|
123 |
|
124 |
$args['resolution'] = ( isset($args['resolution']) && isset($allowed_resolutions[ $args['resolution'] ]) ) ? $args['resolution'] : 'hqdefault';
|
125 |
|
126 |
$args = wp_parse_args($args, $defaults);
|
127 |
|
128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
|
131 |
/**
|
@@ -163,9 +193,7 @@ class Assets
|
|
163 |
*/
|
164 |
public function insertNoJSCSS()
|
165 |
{
|
166 |
-
|
167 |
-
wp_enqueue_style('rocket-lazyload');
|
168 |
-
wp_add_inline_style('rocket-lazyload', $this->getNoJSCSS());
|
169 |
}
|
170 |
|
171 |
/**
|
@@ -175,6 +203,6 @@ class Assets
|
|
175 |
*/
|
176 |
public function getNoJSCSS()
|
177 |
{
|
178 |
-
return '
|
179 |
}
|
180 |
}
|
39 |
],
|
40 |
'threshold' => 300,
|
41 |
'version' => '',
|
42 |
+
'polyfill' => false,
|
43 |
];
|
44 |
|
45 |
+
$args = wp_parse_args($args, $defaults);
|
46 |
+
$min = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min';
|
47 |
+
$script = '';
|
48 |
+
|
49 |
+
if (isset($args['polyfill']) && $args['polyfill']) {
|
50 |
+
$script .= '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry"></script>';
|
51 |
+
}
|
52 |
|
53 |
+
$script .= '<script>
|
|
|
54 |
window.lazyLoadOptions = {
|
55 |
elements_selector: "' . esc_attr(implode(',', $args['elements'])) . '",
|
56 |
data_src: "lazy-src",
|
92 |
}
|
93 |
}, false);
|
94 |
</script>
|
95 |
+
<script data-cfasync="false" async src="' . $args['base_url'] . $args['version'] . '/lazyload' . $min . '.js"></script>';
|
96 |
+
|
97 |
+
return $script;
|
98 |
}
|
99 |
|
100 |
/**
|
118 |
{
|
119 |
$defaults = [
|
120 |
'resolution' => 'hqdefault',
|
121 |
+
'lazy_image' => false,
|
122 |
];
|
123 |
|
124 |
$allowed_resolutions = [
|
125 |
+
'default' => [
|
126 |
+
'width' => 120,
|
127 |
+
'height' => 90,
|
128 |
+
],
|
129 |
+
'mqdefault' => [
|
130 |
+
'width' => 320,
|
131 |
+
'height' => 180,
|
132 |
+
],
|
133 |
+
'hqdefault' => [
|
134 |
+
'width' => 480,
|
135 |
+
'height' => 360,
|
136 |
+
],
|
137 |
+
'sddefault' => [
|
138 |
+
'width' => 640,
|
139 |
+
'height' => 480,
|
140 |
+
],
|
141 |
+
|
142 |
+
'maxresdefault' => [
|
143 |
+
'width' => 1280,
|
144 |
+
'height' => 720,
|
145 |
+
],
|
146 |
];
|
147 |
|
148 |
$args['resolution'] = ( isset($args['resolution']) && isset($allowed_resolutions[ $args['resolution'] ]) ) ? $args['resolution'] : 'hqdefault';
|
149 |
|
150 |
$args = wp_parse_args($args, $defaults);
|
151 |
|
152 |
+
$image = '<img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '">';
|
153 |
+
|
154 |
+
if (isset($args['lazy_image']) && $args['lazy_image']) {
|
155 |
+
$image = '<img data-lazy-src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"><noscript><img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"></noscript>';
|
156 |
+
}
|
157 |
+
|
158 |
+
return "<script>function lazyLoadThumb(e){var t='{$image}',a='<div class=\"play\"></div>';return t.replace(\"ID\",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement(\"iframe\"),t=\"https://www.youtube.com/embed/ID?autoplay=1\";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute(\"src\",t.replace(\"ID\",this.dataset.id)),e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"allowfullscreen\",\"1\"),this.parentNode.replaceChild(e,this)}document.addEventListener(\"DOMContentLoaded\",function(){var e,t,a=document.getElementsByClassName(\"rll-youtube-player\");for(t=0;t<a.length;t++)e=document.createElement(\"div\"),e.setAttribute(\"data-id\",a[t].dataset.id),e.setAttribute(\"data-query\", a[t].dataset.query),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});</script>";
|
159 |
}
|
160 |
|
161 |
/**
|
193 |
*/
|
194 |
public function insertNoJSCSS()
|
195 |
{
|
196 |
+
echo $this->getNoJSCSS();
|
|
|
|
|
197 |
}
|
198 |
|
199 |
/**
|
203 |
*/
|
204 |
public function getNoJSCSS()
|
205 |
{
|
206 |
+
return '<noscript><style id="rocket-lazyload-nojs-css">.rll-youtube-player, [data-lazy-src]{display:none !important;}</style></noscript>';
|
207 |
}
|
208 |
}
|