* upgraded new version of tiny_mce
[citadel.git] / webcit / tiny_mce / plugins / paste / js / pasteword.js
1 tinyMCEPopup.requireLangPack();\r
2 \r
3 function saveContent() {\r
4         var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;\r
5 \r
6         if (html == ''){\r
7                 tinyMCEPopup.close();\r
8                 return false;\r
9         }\r
10 \r
11         tinyMCEPopup.execCommand('mcePasteWord', false, html);\r
12         tinyMCEPopup.close();\r
13 }\r
14 \r
15 function onLoadInit() {\r
16         tinyMCEPopup.resizeToInnerSize();\r
17 \r
18         // Fix for endless reloading in FF\r
19         window.setTimeout(createIFrame, 10);\r
20 }\r
21 \r
22 function createIFrame() {\r
23         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
24 }\r
25 \r
26 var wHeight=0, wWidth=0, owHeight=0, owWidth=0;\r
27 \r
28 function initIframe(doc) {\r
29         var dir = tinyMCEPopup.editor.settings.directionality;\r
30 \r
31         doc.body.dir = dir;\r
32 \r
33         // Remove Gecko spellchecking\r
34         if (tinymce.isGecko)\r
35                 doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");\r
36 \r
37         resizeInputs();\r
38 }\r
39 \r
40 function resizeInputs() {\r
41         if (!tinymce.isIE) {\r
42                 wHeight = self.innerHeight - 80;\r
43                 wWidth = self.innerWidth - 18;\r
44         } else {\r
45                 wHeight = document.body.clientHeight - 80;\r
46                 wWidth = document.body.clientWidth - 18;\r
47         }\r
48 \r
49         var elm = document.getElementById('frmData');\r
50         if (elm) {\r
51                 elm.style.height = Math.abs(wHeight) + 'px';\r
52                 elm.style.width  = Math.abs(wWidth) + 'px';\r
53         }\r
54 }\r
55 \r
56 tinyMCEPopup.onInit.add(onLoadInit);\r