1 function saveContent() {
2 tinyMCE.setContent(document.getElementById('htmlSource').value);
3 tinyMCE.closeWindow(window);
6 // Fixes some charcode issues
7 function fixContent(html) {
11 html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1');
12 html = html.replace(new RegExp('<\/(p|ol|ul|li|table|tr|td|blockquote|object)>', 'gi'),'</$1>\n');
13 html = tinyMCE.regexpReplace(html, '<br />','<br />\n','gi');
14 html = tinyMCE.regexpReplace(html, '\n\n','\n','gi');
18 function onLoadInit() {
19 tinyMCEPopup.resizeToInnerSize();
21 document.forms[0].htmlSource.value = fixContent(tinyMCE.getContent(tinyMCE.getWindowArg('editor_id')));
26 function setWrap(val) {
28 document.forms[0].htmlSource.wrap = val;
31 function toggleWordWrap(elm) {
38 var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
40 function resizeInputs() {
41 if (!tinyMCE.isMSIE) {
42 wHeight = self.innerHeight-80;
43 wWidth = self.innerWidth-16;
45 wHeight = document.body.clientHeight - 80;
46 wWidth = document.body.clientWidth - 16;
49 document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
50 document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
53 function renderWordWrap() {
55 document.write('<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{$lang_theme_code_wordwrap}</label>');