X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/a66f9e26487c560245ef9cd17d7e87c0cbb650af:/wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js..177fd6fefd2e3d5a0ea6591c71d660cabdb3c1a4:/wp-includes/js/tinymce/themes/advanced/js/source_editor.js diff --git a/wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js b/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 83648be4..a6235a38 100644 --- a/wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js +++ b/wp-includes/js/tinymce/themes/advanced/js/source_editor.js @@ -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; }