thomascube
2008-02-11 b85bf8b3f46b9927117777baa149eb4ac818693f
commit | author | age
a0109c 1 function saveContent() {
S 2     tinyMCE.setContent(document.getElementById('htmlSource').value);
3     tinyMCE.closeWindow(window);
4 }
5
6 function onLoadInit() {
7     tinyMCEPopup.resizeToInnerSize();
8
f0ea59 9     // Remove Gecko spellchecking
S 10     if (tinyMCE.isGecko)
11         document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");
12
13     document.getElementById('htmlSource').value = tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'));
14
a0109c 15     resizeInputs();
S 16
17     if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
18         setWrap('soft');
f0ea59 19         document.getElementById('wraped').checked = true;
a0109c 20     }
S 21 }
22
23 function setWrap(val) {
f0ea59 24     var s = document.getElementById('htmlSource');
a0109c 25
S 26     s.wrap = val;
27
87e2fd 28     if (tinyMCE.isGecko || tinyMCE.isOpera) {
a0109c 29         var v = s.value;
S 30         var n = s.cloneNode(false);
31         n.setAttribute("wrap", val);
32         s.parentNode.replaceChild(n, s);
33         n.value = v;
34     }
35 }
36
37 function toggleWordWrap(elm) {
38     if (elm.checked)
39         setWrap('soft');
40     else
41         setWrap('off');
42 }
43
44 var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
45
46 function resizeInputs() {
f0ea59 47     var el = document.getElementById('htmlSource');
S 48
a0109c 49     if (!tinyMCE.isMSIE) {
87e2fd 50          wHeight = self.innerHeight - 60;
S 51          wWidth = self.innerWidth - 16;
a0109c 52     } else {
87e2fd 53          wHeight = document.body.clientHeight - 60;
a0109c 54          wWidth = document.body.clientWidth - 16;
S 55     }
56
f0ea59 57     el.style.height = Math.abs(wHeight) + 'px';
S 58     el.style.width  = Math.abs(wWidth) + 'px';
a0109c 59 }