source: trunk/www.guidonia.net/wp/wp-includes/js/tinymce/themes/advanced/js/source_editor.js@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 1.4 KB
Line 
1tinyMCEPopup.requireLangPack();
2tinyMCEPopup.onInit.add(onLoadInit);
3
4function saveContent() {
5 tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});
6 tinyMCEPopup.close();
7}
8
9function onLoadInit() {
10 tinyMCEPopup.resizeToInnerSize();
11
12 // Remove Gecko spellchecking
13 if (tinymce.isGecko)
14 document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
15
16 document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});
17
18 if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
19 setWrap('soft');
20 document.getElementById('wraped').checked = true;
21 }
22
23 resizeInputs();
24}
25
26function setWrap(val) {
27 var v, n, s = document.getElementById('htmlSource');
28
29 s.wrap = val;
30
31 if (!tinymce.isIE) {
32 v = s.value;
33 n = s.cloneNode(false);
34 n.setAttribute("wrap", val);
35 s.parentNode.replaceChild(n, s);
36 n.value = v;
37 }
38}
39
40function toggleWordWrap(elm) {
41 if (elm.checked)
42 setWrap('soft');
43 else
44 setWrap('off');
45}
46
47var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
48
49function resizeInputs() {
50 var el = document.getElementById('htmlSource');
51
52 if (!tinymce.isIE) {
53 wHeight = self.innerHeight - 65;
54 wWidth = self.innerWidth - 16;
55 } else {
56 wHeight = document.body.clientHeight - 70;
57 wWidth = document.body.clientWidth - 16;
58 }
59
60 el.style.height = Math.abs(wHeight) + 'px';
61 el.style.width = Math.abs(wWidth) + 'px';
62}
Note: See TracBrowser for help on using the repository browser.