1 function saveContent() {
\r
2 tinyMCE.setContent(document.getElementById('htmlSource').value);
\r
3 tinyMCE.closeWindow(window);
\r
6 // Fixes some charcode issues
\r
7 function fixContent(html) {
\r
8 /* html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1');
\r
9 html = html.replace(new RegExp('<\/(p|ol|ul|li|table|tr|td|blockquote|object)>', 'gi'),'</$1>\n');
\r
10 html = tinyMCE.regexpReplace(html, '<br />','<br />\n','gi');
\r
11 html = tinyMCE.regexpReplace(html, '\n\n','\n','gi');*/
\r
15 function onLoadInit() {
\r
16 tinyMCEPopup.resizeToInnerSize();
\r
18 document.forms[0].htmlSource.value = fixContent(tinyMCE.getContent(tinyMCE.getWindowArg('editor_id')));
\r
21 if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
\r
23 document.forms[0].wraped.checked = true;
\r
27 function setWrap(val) {
\r
28 var s = document.forms[0].htmlSource;
\r
32 if (tinyMCE.isGecko) {
\r
34 var n = s.cloneNode(false);
\r
35 n.setAttribute("wrap", val);
\r
36 s.parentNode.replaceChild(n, s);
\r
41 function toggleWordWrap(elm) {
\r
48 var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
\r
50 function resizeInputs() {
\r
51 if (!tinyMCE.isMSIE) {
\r
52 wHeight = self.innerHeight-80;
\r
53 wWidth = self.innerWidth-16;
\r
55 wHeight = document.body.clientHeight - 80;
\r
56 wWidth = document.body.clientWidth - 16;
\r
59 document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
\r
60 document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
\r
63 function renderWordWrap() {
\r
64 if (tinyMCE.isMSIE || tinyMCE.isGecko)
\r
65 document.write('<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{$lang_theme_code_wordwrap}</label>');
\r