Upgrade TinyMCE to v3.4.5
[citadel.git] / webcit / tiny_mce / themes / advanced / js / source_editor.js
index af2231cad57d78dacbeb616c231e58a4669ecadb..84546ad52ebc461ccdebb02e1762e8c9ea760744 100644 (file)
@@ -2,7 +2,7 @@ tinyMCEPopup.requireLangPack();
 tinyMCEPopup.onInit.add(onLoadInit);\r
 \r
 function saveContent() {\r
-       tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value);\r
+       tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});\r
        tinyMCEPopup.close();\r
 }\r
 \r
@@ -13,7 +13,7 @@ function onLoadInit() {
        if (tinymce.isGecko)\r
                document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");\r
 \r
-       document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent();\r
+       document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});\r
 \r
        if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {\r
                setWrap('soft');\r
@@ -44,19 +44,13 @@ function toggleWordWrap(elm) {
                setWrap('off');\r
 }\r
 \r
-var wHeight=0, wWidth=0, owHeight=0, owWidth=0;\r
-\r
 function resizeInputs() {\r
-       var el = document.getElementById('htmlSource');\r
+       var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
 \r
-       if (!tinymce.isIE) {\r
-                wHeight = self.innerHeight - 65;\r
-                wWidth = self.innerWidth - 16;\r
-       } else {\r
-                wHeight = document.body.clientHeight - 70;\r
-                wWidth = document.body.clientWidth - 16;\r
-       }\r
+       el = document.getElementById('htmlSource');\r
 \r
-       el.style.height = Math.abs(wHeight) + 'px';\r
-       el.style.width  = Math.abs(wWidth) + 'px';\r
+       if (el) {\r
+               el.style.width = (vp.w - 20) + 'px';\r
+               el.style.height = (vp.h - 65) + 'px';\r
+       }\r
 }\r