From 5cd2d71ea363e642c0a60235817b25fa55433518 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 7 Jan 2020 10:15:16 +0100 Subject: [PATCH] [10.0.024.dev] lazy loading --- core/core.js.php | 5 +++++ core/core.php | 5 ++--- core/vendor/lazysimon/inc.json | 3 --- core/vendor/lazysimon/lazy_simon.min.js | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 core/vendor/lazysimon/inc.json delete mode 100644 core/vendor/lazysimon/lazy_simon.min.js diff --git a/core/core.js.php b/core/core.js.php index 64bef0b9..7b6d94c7 100755 --- a/core/core.js.php +++ b/core/core.js.php @@ -399,6 +399,11 @@ $(document).ready(function(){ $("#navfixedconnected .navLevel2").css({ 'pointer-events' : 'none' }); }); + /** + * Chargement paresseux des images et des iframes + */ + $("img,picture,iframe").attr("loading","lazy"); + /** * Effet accordéon */ diff --git a/core/core.php b/core/core.php index f29cd6af..46b8e333 100644 --- a/core/core.php +++ b/core/core.php @@ -34,7 +34,7 @@ class common { const TEMP_DIR = 'site/tmp/'; // Numéro de version - const ZWII_VERSION = '10.0.023.dev'; + const ZWII_VERSION = '10.0.024.dev'; public static $actions = []; public static $coreModuleIds = [ @@ -99,8 +99,7 @@ class common { 'tippy', 'zwiico', 'imagemap', - 'simplelightbox', - 'lazysimon' + 'simplelightbox' ], 'view' => '' ]; diff --git a/core/vendor/lazysimon/inc.json b/core/vendor/lazysimon/inc.json deleted file mode 100644 index be43d22f..00000000 --- a/core/vendor/lazysimon/inc.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "lazy_simon.min.js" -] \ No newline at end of file diff --git a/core/vendor/lazysimon/lazy_simon.min.js b/core/vendor/lazysimon/lazy_simon.min.js deleted file mode 100644 index c60a6e3f..00000000 --- a/core/vendor/lazysimon/lazy_simon.min.js +++ /dev/null @@ -1 +0,0 @@ -for(o=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&(e.target.src=e.target.dataset.l,t.unobserve(e.target))})}),d=document.querySelectorAll("img"),i=d.length-1;i>=0;i--)e=d[i],e.dataset.l=e.src,e.src="data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22/%3E",o.observe(e); \ No newline at end of file