0)
// var_dump(isset($GLOBALS["spip_pipeline"]["insert_js"]));
if(!isset($GLOBALS["spip_pipeline"]["insert_js"]))
$flux = ThickBox1_header_prive($flux);
return $flux;
}
function ThickBox1_header_prive($flux) {
$flux .=
'
';
return $flux;
}
function ThickBox1_insert_js($flux){
// on ajoute la class thickbox aux liens de type="image/xxx"
// TODO: ne charger thickbox.js et thickbox.css que si
// $("a.thickbox,a[@type='image/jpeg'],...").size() > 0)
if($flux['type']=='inline')
$flux["data"]["ThickBox1"] =
'
';
return $flux;
}
function ThickBox1_verifie_js_necessaire($flux) {
//var_dump($flux["page"]);
$page = $flux["page"]["texte"];
$necessaire = preg_match(",]+type\s*=\s*['\"]image/(?:jpeg|png|gif)['\"],iUs",$page) ||
preg_match(",]+class\s*=\s*['\"].*\bthickbox\b.*['\"],iUs",$page);
$flux["data"]["ThickBox1"] = $necessaire;
return $flux;
}
?>