yllar
2006-12-16 77c28206a14b5bee3f3091f10cffd531bce5649c
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
28     if (tinyMCE.isGecko) {
29         var v = s.value;
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) {
S 50          wHeight = self.innerHeight-80;
51          wWidth = self.innerWidth-16;
52     } else {
53          wHeight = document.body.clientHeight - 80;
54          wWidth = document.body.clientWidth - 16;
55     }
56
f0ea59 57     el.style.height = Math.abs(wHeight) + 'px';
S 58     el.style.width  = Math.abs(wWidth) + 'px';
a0109c 59 }
S 60