inital git commit
[phpns.git] / inc / js / tinymce / themes / advanced / jscripts / source_editor.js
blobd0d517d454b4fdd05d00e48bb60535f77c7703c6
1 function saveContent() {\r
2         tinyMCE.setContent(document.getElementById('htmlSource').value);\r
3         tinyMCE.closeWindow(window);\r
4 }\r
5 \r
6 function onLoadInit() {\r
7         tinyMCEPopup.resizeToInnerSize();\r
8 \r
9         // Remove Gecko spellchecking\r
10         if (tinyMCE.isGecko)\r
11                 document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");\r
13         document.getElementById('htmlSource').value = tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'));\r
15         resizeInputs();\r
17         if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {\r
18                 setWrap('soft');\r
19                 document.getElementById('wraped').checked = true;\r
20         }\r
21 }\r
23 function setWrap(val) {\r
24         var s = document.getElementById('htmlSource');\r
26         s.wrap = val;\r
28         if (tinyMCE.isGecko || tinyMCE.isOpera) {\r
29                 var v = s.value;\r
30                 var n = s.cloneNode(false);\r
31                 n.setAttribute("wrap", val);\r
32                 s.parentNode.replaceChild(n, s);\r
33                 n.value = v;\r
34         }\r
35 }\r
37 function toggleWordWrap(elm) {\r
38         if (elm.checked)\r
39                 setWrap('soft');\r
40         else\r
41                 setWrap('off');\r
42 }\r
44 var wHeight=0, wWidth=0, owHeight=0, owWidth=0;\r
46 function resizeInputs() {\r
47         var el = document.getElementById('htmlSource');\r
49         if (!tinyMCE.isMSIE) {\r
50                  wHeight = self.innerHeight - 60;\r
51                  wWidth = self.innerWidth - 16;\r
52         } else {\r
53                  wHeight = document.body.clientHeight - 60;\r
54                  wWidth = document.body.clientWidth - 16;\r
55         }\r
57         el.style.height = Math.abs(wHeight) + 'px';\r
58         el.style.width  = Math.abs(wWidth) + 'px';\r
59 }\r