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