Added lozad v1.14.0

This commit is contained in:
nobody42 2020-03-24 07:48:45 +01:00
parent 8c64497659
commit 7007aee18a
No known key found for this signature in database
GPG Key ID: AB5145CF05BFE119
6 changed files with 32 additions and 5 deletions

View File

@ -68,6 +68,9 @@ var files = {
// jQuery UI
'resources/jqueryui/1.11.4/jquery-ui.min.jsm': true,
// lozad.js
'resources/lozad.js/1.14.0/lozad': true,
// Modernizr
'resources/modernizr/2.8.3/modernizr.min.jsm': true,

View File

@ -123,6 +123,7 @@ var mappings = {
'jquery-ui@{version}/jquery-ui.min.js': resources.jQueryUI,
'jquery-ui-dist@{version}/jquery-ui.js': resources.jQueryUI,
'jquery-ui-dist@{version}/jquery-ui.min.js': resources.jQueryUI,
'lozad': resources.lozad,
'npm-modernizr@{version}/modernizr.': resources.modernizr,
'npm-modernizr@{version}/modernizr.min.': resources.modernizr,
'moment@{version}/moment.': resources.moment,

View File

@ -95,6 +95,11 @@ var resources = {
'path': 'resources/jqueryui/{version}/jquery-ui.min.jsm',
'type': 'application/javascript'
},
// lozad.js
'lozad': {
'path': 'resources/lozad.js/{version}/lozad',
'type': 'application/javascript'
},
// Modernizr
'modernizr': {
'path': 'resources/modernizr/{version}/modernizr.min.jsm',

View File

@ -218,6 +218,8 @@ helpers.determineResourceName = function (filename) {
return 'jQuery';
case 'jquery-ui.min.jsm':
return 'jQuery UI';
case 'lozad':
return 'lozad.js';
case 'modernizr.min.jsm':
return 'Modernizr';
case 'mootools-yui-compressed.jsm':
@ -277,9 +279,9 @@ helpers.formatVersion = function (version) {
helpers.setLastVersion = function (type, versionNumber) {
let version, requestVersion;
requestVersion = versionNumber.toString();
if(versionNumber != null && versionNumber != undefined) {
requestVersion = versionNumber.toString();
}
if (type.includes('/angularjs/1.')) {
version = '1.7.9';
} else if (type.includes('/backbone.js/0.')) {
@ -318,6 +320,8 @@ helpers.setLastVersion = function (type, versionNumber) {
version = '3.4.1';
} else if (type.includes('/jqueryui/1.')) {
version = '1.11.4';
} else if (type.includes('lozad')) {
version = '1.14.0';
} else if (type.includes('/modernizr/2.')) {
version = '2.8.3';
} else if (type.includes('/moment.js/2.')) {

View File

@ -23,8 +23,7 @@
New in LocalCDN:
</div>
<ul>
<li>URL of testing utility updated</li>
<li>Fixed: <a href="https://gitlab.com/nobody42/localcdn/-/issues/21">"Search on serienjunkies.org not working"</a></li>
<li>Added lozad v1.14.0</li>
</ul>
<div class="topic-label">
Please update your uBlock/uMatrix rules
@ -41,6 +40,11 @@
<input id="button-copy-rule-set" type="button" value="Copy">
<hr/>
<h2>History</h2>
<p>2020-03-22 (v2.1.6)</p><br/>
<ul>
<li>URL of testing utility updated</li>
<li>Fixed: <a href="https://gitlab.com/nobody42/localcdn/-/issues/21">"Search on serienjunkies.org not working"</a></li>
</ul>
<p>2020-03-17 (v2.1.5)</p><br/>
<ul>
<li>Simple enable/disable button replaced with toggle switch</li>

View File

@ -0,0 +1,10 @@
/*! lozad.js - v1.14.0 - 2019-10-19
* https://github.com/ApoorvSaxena/lozad.js
* Copyright (c) 2019 Apoorv Saxena; Licensed MIT */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).lozad=e()}(this,function(){"use strict";
/**
* Detect IE browser
* @const {boolean}
* @private
*/var d="undefined"!=typeof document&&document.documentMode,c={rootMargin:"0px",threshold:0,load:function(t){if("picture"===t.nodeName.toLowerCase()){var e=document.createElement("img");d&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),t.append(e)}if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var r=t.children,a=void 0,o=0;o<=r.length-1;o++)(a=r[o].getAttribute("data-src"))&&(r[o].src=a);t.load()}if(t.getAttribute("data-src")&&(t.src=t.getAttribute("data-src")),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(",").join("'),url('")+"')";else if(t.getAttribute("data-background-image-set")){var i=t.getAttribute("data-background-image-set").split(","),n=i[0].substr(0,i[0].indexOf(" "))||i[0];// Substring before ... 1x
n=-1===n.indexOf("url(")?"url("+n+")":n,1===i.length?t.style.backgroundImage=n:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+n+"; background-image: -webkit-image-set("+i+"); background-image: image-set("+i+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function l(t){t.setAttribute("data-loaded",!0)}var b=function(t){return"true"===t.getAttribute("data-loaded")};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},c,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,s=e.loaded,g=void 0;return"undefined"!=typeof window&&window.IntersectionObserver&&(g=new IntersectionObserver((r=u,a=s,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),b(t.target)||(r(t.target),l(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d})),{observe:function(){for(var t=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)}(o,i),e=0;e<t.length;e++)b(t[e])||(g?g.observe(t[e]):(u(t[e]),l(t[e]),s(t[e])))},triggerLoad:function(t){b(t)||(u(t),l(t),s(t))},observer:g}}});