From 3f3319a4a0d5cf88efb97a62bb34432ffa6d1545 Mon Sep 17 00:00:00 2001 From: Jacques Pyrat <jacques@pyrat.net> Date: Tue, 4 Aug 2020 12:08:08 +0200 Subject: [PATCH] Maintenant que iframe supporte le lazy loading (https://web.dev/iframe-lazy-loading/), autant l'utiliser --- base/soyezcreateurs.php | 2 +- inc/sc_article.php | 2 +- modeles/emb_pdf.html | 2 +- noisettes/sommaire_modeportailcognac_zoomsur.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/soyezcreateurs.php b/base/soyezcreateurs.php index 036d5b00..1561b57c 100644 --- a/base/soyezcreateurs.php +++ b/base/soyezcreateurs.php @@ -1065,7 +1065,7 @@ function soyezcreateurs_config_motsclefs() { <p><a class=\"button triadeC texte-blanc float-center avec-margin\" href=\"/$id_article\"><span class=\"icon-envelope icon-lg avec-padding-right05\"></span>Nous écrire</a></p> </div> <div id=\"carte\" class=\"avec-padding\"> - <html><!-- Begin Exclude NewsLetter --></html><iframe src=\"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d365312.326488903!2d-1.5056982671874777!3d44.33045219999999!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd5380bbec6fa8d3%3A0x2cd88d7991f88ca4!2sPerdu..!5e0!3m2!1sfr!2sfr!4v1508413717844\" width=\"600\" height=\"450\" frameborder=\"0\" style=\"border:0\" allowfullscreen=\"true\"></iframe><html><!-- End Exclude NewsLetter --></html> + <html><!-- Begin Exclude NewsLetter --></html><iframe src=\"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d365312.326488903!2d-1.5056982671874777!3d44.33045219999999!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd5380bbec6fa8d3%3A0x2cd88d7991f88ca4!2sPerdu..!5e0!3m2!1sfr!2sfr!4v1508413717844\" width=\"600\" height=\"450\" frameborder=\"0\" style=\"border:0\" allowfullscreen=\"true\" loading=\"lazy\"></iframe><html><!-- End Exclude NewsLetter --></html> </div> </div>"); } diff --git a/inc/sc_article.php b/inc/sc_article.php index c73a6706..f20ba6b6 100755 --- a/inc/sc_article.php +++ b/inc/sc_article.php @@ -690,7 +690,7 @@ EOF; if ($article == "Un sourire peut changer une vie") { $contenu['titre'] = "Un sourire peut changer une vie"; $contenu['chapo'] = <<<EOF -<iframe width="344" height="260" src="//www.youtube-nocookie.com/embed/Cbk980jV7Ao?rel=0" allowfullscreen></iframe> +<iframe width="344" height="260" src="//www.youtube-nocookie.com/embed/Cbk980jV7Ao?rel=0" allowfullscreen="true" loading="lazy"></iframe> EOF; } diff --git a/modeles/emb_pdf.html b/modeles/emb_pdf.html index aaf58e63..ec91a0da 100644 --- a/modeles/emb_pdf.html +++ b/modeles/emb_pdf.html @@ -7,7 +7,7 @@ #SET{hauteur,#ENV{hauteur,600px}} <div class='spip_document_#ID_DOCUMENT spip_document_video spip_documents[ spip_documents_(#ENV{align})]' style='[(#ENV{align}|match{^(left|right)$}|oui)float:#ENV{align};][width:(#GET{largeur})]'> - <iframe title="[(#TITRE|sinon{[(#FICHIER|basename)]}|texte_backend)]" src="#FICHIER" width="#GET{largeur}" height="#GET{hauteur}" allowfullscreen="true"> + <iframe title="[(#TITRE|sinon{[(#FICHIER|basename)]}|texte_backend)]" src="#FICHIER" width="#GET{largeur}" height="#GET{hauteur}" allowfullscreen="true" loading="lazy"> [<div class='#EDIT{titre} spip_doc_titre'><a href="#URL_DOCUMENT">(#TITRE)</a></div>] </iframe> [<div class='#EDIT{titre} spip_doc_titre'><strong>(#TITRE|sinon{[(#FICHIER|basename)]})</strong></div>] diff --git a/noisettes/sommaire_modeportailcognac_zoomsur.html b/noisettes/sommaire_modeportailcognac_zoomsur.html index 0c8d484d..abd185ee 100644 --- a/noisettes/sommaire_modeportailcognac_zoomsur.html +++ b/noisettes/sommaire_modeportailcognac_zoomsur.html @@ -37,7 +37,7 @@ [(#MIME_TYPE|=={text/oembed}|oui) <div style="position: relative; padding-bottom: [(#CONFIG{soyezcreateurs/hauteur_slider,580}|div{1920}|mult{100})%]"> <div class="mbYTP_wrapper" id="wrapper_mbYTP_bgndVideo" style="position: absolute; z-index: -1; min-width: 100%; min-height: 100%; left: 0; top: 0; overflow: hidden; opacity: 1; -webkit-backface-visibility: hidden;"> - <iframe id="mbYTP_bgndVideo#ID_DOCUMENT" class="playerBox" style="position: absolute; z-index: -1; width: 2380.8px; height: 1080px; top: 0px; left: 0px; overflow: hidden; opacity: 1; margin-top: -199.5px; margin-left: -230.4px;" frameborder="0" allowfullscreen="1" width="[(#INCLURE{#FICHIER}|extraire_attribut{width})]" height="[(#INCLURE{#FICHIER}|extraire_attribut{height})]" src="[(#INCLURE{#FICHIER}|extraire_attribut{src})]&autoplay=1&loop=1&modestbranding=1&controls=0&showinfo=0&rel=0&enablejsapi=1&version=3&playerapiid=mbYTP_bgndVideo&allowfullscreen=true&wmode=transparent&iv_load_policy=3&html5=1&mute=1[&playlist=(#INCLURE{#FICHIER}|extraire_attribut{src}|replace{'https:\/\/www\.youtube\.com\/embed\/\(\[^\?]*\).*','$1'}|replace{'\?feature=oembed',''})]"></iframe> + <iframe id="mbYTP_bgndVideo#ID_DOCUMENT" class="playerBox" style="position: absolute; z-index: -1; width: 2380.8px; height: 1080px; top: 0px; left: 0px; overflow: hidden; opacity: 1; margin-top: -199.5px; margin-left: -230.4px;" frameborder="0" allowfullscreen="1" width="[(#INCLURE{#FICHIER}|extraire_attribut{width})]" height="[(#INCLURE{#FICHIER}|extraire_attribut{height})]" src="[(#INCLURE{#FICHIER}|extraire_attribut{src})]&autoplay=1&loop=1&modestbranding=1&controls=0&showinfo=0&rel=0&enablejsapi=1&version=3&playerapiid=mbYTP_bgndVideo&allowfullscreen=true&wmode=transparent&iv_load_policy=3&html5=1&mute=1[&playlist=(#INCLURE{#FICHIER}|extraire_attribut{src}|replace{'https:\/\/www\.youtube\.com\/embed\/\(\[^\?]*\).*','$1'}|replace{'\?feature=oembed',''})]" loading="lazy"></iframe> </div> </div>] </a>] -- GitLab