Author: renato@rezo.net
Date: 2007-05-21 21:51:18 +0200 (lun, 21 mai 2007)
New Revision: 9348
Log:
remove the pipeline insert_js from the template jquery.js.html;
revert the order of addition of jquery.js.html of the previous change. jquery.js.html will be always at the beginning of #INSERT_HEAD;
add a new pipeline verifie_js_necessaire que prends le corp de la page et donnee un boolean pour signaler si ajouter les script ou pas;
Ex du insert_js:
{{{
if($flux['type']=='fichier')
$flux["data"]["ThickBox1"] = "thickbox";
if($flux['type']=='inline')
$flux["data"]["ThickBox1"] = "<script>...</script>"
}}}
ou
{{{
if($flux['type']=='fichier') {
$flux["data"]["ThickBox1"][] = "thickbox1";
$flux["data"]["ThickBox1"][] = "thickbox2";
}
}}}
ou
{{{
if($flux['type']=='fichier') {
$flux["data"][] = "thickbox1";
}
}}}
quand on a pas de pipeline verifie_js_necessaire
Ex du verifie_js_necessaire
{{{
if(est_necessaire($flux['page'])) $flux["data"]["ThickBox1"] = false;
return $flux;
}}}
Modified:
spip/dist/jquery.js.html
spip/ecrire/inc/filtres.php
spip/ecrire/inc_version.php
spip/ecrire/public.php
spip/ecrire/public/assembler.php