Déplacement pour eggification.
[Plinn.git] / Products / Plinn / skins / ajax_scripts / epoz_plinn.js
diff --git a/Products/Plinn/skins/ajax_scripts/epoz_plinn.js b/Products/Plinn/skins/ajax_scripts/epoz_plinn.js
new file mode 100644 (file)
index 0000000..0dcc93d
--- /dev/null
@@ -0,0 +1,37 @@
+// (c) Benoît PIN 2006-2007
+// http://plinn.org
+// Licence GPL
+// 
+// 
+
+function _resetEpoz() {
+       form_path = absolute_url() + '/';
+       EpozElement = null;
+       EpozTextArea = null;
+}
+
+function initEpozWidget(iframe) {
+       var toolBar = iframe.parentNode;
+       var ta = toolBar.nextSibling; // ta -> textarea
+       var name = ta.name;
+       
+       // change ids
+       iframe.id = IFramePrefix + name;
+       iframe.contentWindow.document.id = DocPrefix + name;
+       toolBar.id = ToolBarPrefix + name;
+       var checkbox = ta.nextSibling.childNodes[0];
+       checkbox.id = CheckBoxPrefix + name;
+       
+    // populate iframe's document
+    iframe.contentWindow.document.body.innerHTML = ta.value;
+       addListener(iframe, "click", HandleEpozRedirect);
+
+       if (browser.isGecko) {
+               scriptExpr = 'EnableDesignMode("' + iframe.id + '");';
+               window.setTimeout(scriptExpr, 10);
+       }
+       
+       toolBar.style.display = "inline";
+       checkbox.parentNode.style.display = "inline";
+       changeBorderStyle(iframe, "dashed");
+}