]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/js/tiny_mce/plugins/paste/js/pasteword.js
Imported Upstream version 0.2~alpha
[roundcube.git] / program / js / tiny_mce / plugins / paste / js / pasteword.js
diff --git a/program/js/tiny_mce/plugins/paste/js/pasteword.js b/program/js/tiny_mce/plugins/paste/js/pasteword.js
new file mode 100644 (file)
index 0000000..6701b99
--- /dev/null
@@ -0,0 +1,56 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+function saveContent() {\r
+       var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;\r
+\r
+       if (html == ''){\r
+               tinyMCEPopup.close();\r
+               return false;\r
+       }\r
+\r
+       tinyMCEPopup.execCommand('mcePasteWord', false, html);\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function onLoadInit() {\r
+       tinyMCEPopup.resizeToInnerSize();\r
+\r
+       // Fix for endless reloading in FF\r
+       window.setTimeout(createIFrame, 10);\r
+}\r
+\r
+function createIFrame() {\r
+       document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>';\r
+}\r
+\r
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;\r
+\r
+function initIframe(doc) {\r
+       var dir = tinyMCEPopup.editor.settings.directionality;\r
+\r
+       doc.body.dir = dir;\r
+\r
+       // Remove Gecko spellchecking\r
+       if (tinymce.isGecko)\r
+               doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");\r
+\r
+       resizeInputs();\r
+}\r
+\r
+function resizeInputs() {\r
+       if (!tinymce.isIE) {\r
+               wHeight = self.innerHeight - 80;\r
+               wWidth = self.innerWidth - 18;\r
+       } else {\r
+               wHeight = document.body.clientHeight - 80;\r
+               wWidth = document.body.clientWidth - 18;\r
+       }\r
+\r
+       var elm = document.getElementById('frmData');\r
+       if (elm) {\r
+               elm.style.height = Math.abs(wHeight) + 'px';\r
+               elm.style.width  = Math.abs(wWidth) + 'px';\r
+       }\r
+}\r
+\r
+tinyMCEPopup.onInit.add(onLoadInit);\r