]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/themes/advanced/js/source_editor.js
Wordpress 2.5.1
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / themes / advanced / js / source_editor.js
similarity index 53%
rename from wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js
rename to wp-includes/js/tinymce/themes/advanced/js/source_editor.js
index 83648be49c273411cad7bc0c9d89e6613bacbb02..a6235a38155612fcb9b2d4a3bd3fa547f265cdc6 100644 (file)
@@ -1,33 +1,36 @@
+tinyMCEPopup.requireLangPack();
+tinyMCEPopup.onInit.add(onLoadInit);
+
 function saveContent() {
-       tinyMCE.setContent(document.getElementById('htmlSource').value);
-       tinyMCE.closeWindow(window);
+       tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value);
+       tinyMCEPopup.close();
 }
 
 function onLoadInit() {
        tinyMCEPopup.resizeToInnerSize();
 
        // Remove Gecko spellchecking
-       if (tinyMCE.isGecko)
-               document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");
-
-       document.getElementById('htmlSource').value = tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'));
+       if (tinymce.isGecko)
+               document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
 
-       resizeInputs();
+       document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent();
 
-       if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
+       if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
                setWrap('soft');
                document.getElementById('wraped').checked = true;
        }
+
+       resizeInputs();
 }
 
 function setWrap(val) {
-       var s = document.getElementById('htmlSource');
+       var v, n, s = document.getElementById('htmlSource');
 
        s.wrap = val;
 
-       if (tinyMCE.isGecko || tinyMCE.isOpera) {
-               var v = s.value;
-               var n = s.cloneNode(false);
+       if (!tinymce.isIE) {
+               v = s.value;
+               n = s.cloneNode(false);
                n.setAttribute("wrap", val);
                s.parentNode.replaceChild(n, s);
                n.value = v;
@@ -46,11 +49,11 @@ var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
 function resizeInputs() {
        var el = document.getElementById('htmlSource');
 
-       if (!tinyMCE.isMSIE) {
-                wHeight = self.innerHeight - 60;
+       if (!tinymce.isIE) {
+                wHeight = self.innerHeight - 65;
                 wWidth = self.innerWidth - 16;
        } else {
-                wHeight = document.body.clientHeight - 60;
+                wHeight = document.body.clientHeight - 70;
                 wWidth = document.body.clientWidth - 16;
        }