X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fplugins%2Fauto%2Fthickbox2%2Fhead.php;fp=www%2Fplugins%2Fauto%2Fthickbox2%2Fhead.php;h=1521308ca08fac375feb9ae14038241024c1c082;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hp=0000000000000000000000000000000000000000;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c;p=velocampus%2Fweb%2Fwww.git
diff --git a/www/plugins/auto/thickbox2/head.php b/www/plugins/auto/thickbox2/head.php
new file mode 100644
index 0000000..1521308
--- /dev/null
+++ b/www/plugins/auto/thickbox2/head.php
@@ -0,0 +1,118 @@
+ 0)
+ if(!$GLOBALS["spip_pipeline"]["insert_js"])
+ $flux .= ThickBox_call_js();
+
+ return $flux;
+}
+
+function ThickBox1_header_prive($flux) {
+include_spip("inc/filtres");
+
+$flux .= ThickBox_call_css();
+$flux .= ThickBox_call_js();
+
+return $flux;
+
+}
+
+function ThickBox1_insert_js($flux){
+include_spip("inc/filtres");
+
+// on ajoute la class thickbox aux liens de type="image/xxx"
+
+// TODO: ne charger thickbox.js et thickbox.css que si
+// jQuery("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"];
+//cherche avec un type image ou une class thickbox
+$necessaire = preg_match(",]+(?:(type)|class)\s*=\s*['\"](?(1)image/(?:jpeg|png|gif)|[^>'\"]*\bthickbox\b[^>'\"]*)['\"],iUs",$page);
+$flux["data"]["ThickBox1"] = $necessaire;
+
+return $flux;
+
+}
+
+function ThickBox_call_js() {
+ $flux = '';
+ $flux .= '';
+ return $flux;
+}
+
+function ThickBox_call_css() {
+ $flux = '';
+ return $flux;
+}
+?>