Revert "serv_rssclient.c: style update"
[citadel.git] / webcit / tiny_mce / plugins / paste / js / pasteword.js
1 tinyMCEPopup.requireLangPack();\r
2 \r
3 var PasteWordDialog = {\r
4         init : function() {\r
5                 var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = '';\r
6 \r
7                 // Create iframe\r
8                 el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>';\r
9                 ifr = document.getElementById('iframe');\r
10                 doc = ifr.contentWindow.document;\r
11 \r
12                 // Force absolute CSS urls\r
13                 css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];\r
14                 css = css.concat(tinymce.explode(ed.settings.content_css) || []);\r
15                 tinymce.each(css, function(u) {\r
16                         cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />';\r
17                 });\r
18 \r
19                 // Write content into iframe\r
20                 doc.open();\r
21                 doc.write('<html><head>' + cssHTML + '</head><body class="mceContentBody" spellcheck="false"></body></html>');\r
22                 doc.close();\r
23 \r
24                 doc.designMode = 'on';\r
25                 this.resize();\r
26 \r
27                 window.setTimeout(function() {\r
28                         ifr.contentWindow.focus();\r
29                 }, 10);\r
30         },\r
31 \r
32         insert : function() {\r
33                 var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;\r
34 \r
35                 tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true});\r
36                 tinyMCEPopup.close();\r
37         },\r
38 \r
39         resize : function() {\r
40                 var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
41 \r
42                 el = document.getElementById('iframe');\r
43 \r
44                 if (el) {\r
45                         el.style.width  = (vp.w - 20) + 'px';\r
46                         el.style.height = (vp.h - 90) + 'px';\r
47                 }\r
48         }\r
49 };\r
50 \r
51 tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog);\r