diff options
| author | hukl <contact@smyck.org> | 2009-02-17 21:54:39 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-17 21:54:39 +0100 |
| commit | f61b5b0597e0c25f084ee67d402f12a43a7a9947 (patch) | |
| tree | 3b4c3f9f38637f1a7ecf703ece4fd3bc4c6e2934 /public/javascripts/tiny_mce/plugins/paste/js | |
| parent | 3d3b786cc43266f6292f5edd25733dbb9bd6ed06 (diff) | |
added tinymce editor for body area of pages
Diffstat (limited to 'public/javascripts/tiny_mce/plugins/paste/js')
| -rwxr-xr-x | public/javascripts/tiny_mce/plugins/paste/js/pastetext.js | 42 | ||||
| -rwxr-xr-x | public/javascripts/tiny_mce/plugins/paste/js/pasteword.js | 56 |
2 files changed, 98 insertions, 0 deletions
diff --git a/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js b/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js new file mode 100755 index 0000000..326bb16 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | function saveContent() { | ||
| 4 | if (document.forms[0].htmlSource.value == '') { | ||
| 5 | tinyMCEPopup.close(); | ||
| 6 | return false; | ||
| 7 | } | ||
| 8 | |||
| 9 | tinyMCEPopup.execCommand('mcePasteText', false, { | ||
| 10 | html : document.forms[0].htmlSource.value, | ||
| 11 | linebreaks : document.forms[0].linebreaks.checked | ||
| 12 | }); | ||
| 13 | |||
| 14 | tinyMCEPopup.close(); | ||
| 15 | } | ||
| 16 | |||
| 17 | function onLoadInit() { | ||
| 18 | tinyMCEPopup.resizeToInnerSize(); | ||
| 19 | |||
| 20 | // Remove Gecko spellchecking | ||
| 21 | if (tinymce.isGecko) | ||
| 22 | document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck"); | ||
| 23 | |||
| 24 | resizeInputs(); | ||
| 25 | } | ||
| 26 | |||
| 27 | var wHeight=0, wWidth=0, owHeight=0, owWidth=0; | ||
| 28 | |||
| 29 | function resizeInputs() { | ||
| 30 | if (!tinymce.isIE) { | ||
| 31 | wHeight = self.innerHeight-80; | ||
| 32 | wWidth = self.innerWidth-17; | ||
| 33 | } else { | ||
| 34 | wHeight = document.body.clientHeight-80; | ||
| 35 | wWidth = document.body.clientWidth-17; | ||
| 36 | } | ||
| 37 | |||
| 38 | document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px'; | ||
| 39 | document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px'; | ||
| 40 | } | ||
| 41 | |||
| 42 | tinyMCEPopup.onInit.add(onLoadInit); \ No newline at end of file | ||
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 @@ | |||
| 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); | ||
