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