summaryrefslogtreecommitdiff
path: root/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-02-17 21:54:39 +0100
committerhukl <contact@smyck.org>2009-02-17 21:54:39 +0100
commitf61b5b0597e0c25f084ee67d402f12a43a7a9947 (patch)
tree3b4c3f9f38637f1a7ecf703ece4fd3bc4c6e2934 /public/javascripts/tiny_mce/plugins/paste/js/pasteword.js
parent3d3b786cc43266f6292f5edd25733dbb9bd6ed06 (diff)
added tinymce editor for body area of pages
Diffstat (limited to 'public/javascripts/tiny_mce/plugins/paste/js/pasteword.js')
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/js/pasteword.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js b/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js
new file mode 100755
index 0000000..6701b99
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js
@@ -0,0 +1,56 @@
1tinyMCEPopup.requireLangPack();
2
3function 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
15function onLoadInit() {
16 tinyMCEPopup.resizeToInnerSize();
17
18 // Fix for endless reloading in FF
19 window.setTimeout(createIFrame, 10);
20}
21
22function 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
26var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
27
28function 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
40function 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
56tinyMCEPopup.onInit.add(onLoadInit);