--- /dev/null
+function saveContent() {\r
+ tinyMCE.setContent(document.getElementById('htmlSource').value);\r
+ tinyMCE.closeWindow(window);\r
+}\r
+\r
+function onLoadInit() {\r
+ tinyMCEPopup.resizeToInnerSize();\r
+\r
+ // Remove Gecko spellchecking\r
+ if (tinyMCE.isGecko)\r
+ document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");\r
+\r
+ document.getElementById('htmlSource').value = tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'));\r
+\r
+ resizeInputs();\r
+\r
+ if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {\r
+ setWrap('soft');\r
+ document.getElementById('wraped').checked = true;\r
+ }\r
+}\r
+\r
+function setWrap(val) {\r
+ var s = document.getElementById('htmlSource');\r
+\r
+ s.wrap = val;\r
+\r
+ if (tinyMCE.isGecko || tinyMCE.isOpera) {\r
+ var v = s.value;\r
+ var n = s.cloneNode(false);\r
+ n.setAttribute("wrap", val);\r
+ s.parentNode.replaceChild(n, s);\r
+ n.value = v;\r
+ }\r
+}\r
+\r
+function toggleWordWrap(elm) {\r
+ if (elm.checked)\r
+ setWrap('soft');\r
+ else\r
+ 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
+\r
+ if (!tinyMCE.isMSIE) {\r
+ wHeight = self.innerHeight - 60;\r
+ wWidth = self.innerWidth - 16;\r
+ } else {\r
+ wHeight = document.body.clientHeight - 60;\r
+ wWidth = document.body.clientWidth - 16;\r
+ }\r
+\r
+ el.style.height = Math.abs(wHeight) + 'px';\r
+ el.style.width = Math.abs(wWidth) + 'px';\r
+}\r