Browse Source

Fix les bugs d'affichage recurrents sur la methose srcset en supprimant le intrinsic qui posait probleme + adaptation nom des modeles image a SPIP 3.3 + a partir de SPIP 3.3 la seule methode disponible est srcset (on a plus le choix dans la config)

master v2.1.0
Cerdic 4 months ago
parent
commit
78514b3d10
  1. 11
      adaptive_images_options.php
  2. 3
      formulaires/configurer_adaptive_images.html
  3. 2
      paquet.xml

11
adaptive_images_options.php

@ -90,9 +90,11 @@ if ($settings){
if (isset($settings['min_filesize']) AND $v=intval($settings['min_filesize']))
$AdaptiveImages->minFileSize = $v*1024;
// Experimental
if (isset($settings['markup_method']) and $settings['markup_method'] === 'srcset') {
// Srscet et la methode recommandee, et a partir de SPIP 3.3 on ignore le reglage et on l'impose
if (intval(_SPIP_VERSION_ID)<=30300
or (isset($settings['markup_method']) and $settings['markup_method'] === 'srcset')) {
$AdaptiveImages->markupMethod = "srcset";
$AdaptiveImages->alwaysIntrinsic = false;
}
// Pour generer chaque variante d'image uniquement quand elle est demandee pour la premiere fois
@ -378,8 +380,9 @@ function adaptive_images_affiche_milieu($flux){
function adaptive_images_recuperer_fond($flux){
if (
strncmp($flux['args']['fond'],"modeles/img", 11) === 0
OR strncmp($flux['args']['fond'],"modeles/doc", 11) === 0
OR strncmp($flux['args']['fond'],"modeles/emb", 11) === 0
or strncmp($flux['args']['fond'],"modeles/image", 13) === 0
or strncmp($flux['args']['fond'],"modeles/doc", 11) === 0
or strncmp($flux['args']['fond'],"modeles/emb", 11) === 0
) {
if (
isset($flux['args']['contexte']['id_document'])

3
formulaires/configurer_adaptive_images.html

@ -9,6 +9,7 @@
#SET{fl,adaptive_images}
<div class="editer-groupe">
#SET{name,markup_method}#SET{obli,''}#SET{defaut,'3layers'}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
[(#CONST{_SPIP_VERSION_ID}|intval|<{30300}|oui)
<div class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
<label>[(#GET{fl}|concat{':label_',#GET{name}}|_T)]</label>[
<span class='erreur_message'>(#GET{erreurs})</span>
@ -23,7 +24,7 @@
<input type="radio" name="#GET{name}" class="radio" id="#GET{name}_#GET{val}" value="#GET{val}" aria-describedby="#GET{name}_explication" [(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)checked="checked"] />
<label for="#GET{name}_#GET{val}">[(#GET{fl}|concat{':label_',#GET{name},'_',#GET{val}}|_T)]</label>
</div>
</div>
</div>]
#SET{name,lowsrc_jpg_bg_color}#SET{obli,''}#SET{defaut,'#ffffff'}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
<div class="editer long_label editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">

2
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="adaptive_images"
categorie="multimedia"
version="2.0.1"
version="2.1.0"
etat="stable"
compatibilite="[3.0.0;3.3.*]"
logo="prive/themes/spip/images/adaptive_images-32.png"

Loading…
Cancel
Save