a or input if (replace_element.nodeName != "TEXTAREA" && replace_element.nodeName != "INPUT") { this.oldTargetElement = replace_element; // Debug mode if (tinyMCE.settings['debug']) { hc = ''; } else { hc = ''; this.oldTargetElement.style.display = "none"; } html += ''; if (tinyMCE.isGecko) html = hc + html; else html += hc; // Output HTML and set editable if (tinyMCE.isGecko) { var rng = replace_element.ownerDocument.createRange(); rng.setStartBefore(replace_element); var fragment = rng.createContextualFragment(html); tinyMCE.insertAfter(fragment, replace_element); } else replace_element.insertAdjacentHTML("beforeBegin", html); } else { html += ''; // Just hide the textarea element this.oldTargetElement = replace_element; if (!tinyMCE.settings['debug']) this.oldTargetElement.style.display = "none"; // Output HTML and set editable if (tinyMCE.isGecko) { var rng = replace_element.ownerDocument.createRange(); rng.setStartBefore(replace_element); var fragment = rng.createContextualFragment(html); tinyMCE.insertAfter(fragment, replace_element); } else replace_element.insertAdjacentHTML("beforeBegin", html); } // Setup iframe var dynamicIFrame = false; var tElm = targetDoc.getElementById(this.editorId); if (!tinyMCE.isMSIE) { if (tElm && tElm.nodeName.toLowerCase() == "span") { tElm = tinyMCE._createIFrame(tElm); dynamicIFrame = true; } this.targetElement = tElm; this.iframeElement = tElm; this.contentDocument = tElm.contentDocument; this.contentWindow = tElm.contentWindow; //this.getDoc().designMode = "on"; } else { if (tElm && tElm.nodeName.toLowerCase() == "span") tElm = tinyMCE._createIFrame(tElm); else tElm = targetDoc.frames[this.editorId]; this.targetElement = tElm; this.iframeElement = targetDoc.getElementById(this.editorId); if (tinyMCE.isOpera) { this.contentDocument = this.iframeElement.contentDocument; this.contentWindow = this.iframeElement.contentWindow; dynamicIFrame = true; } else { this.contentDocument = tElm.window.document; this.contentWindow = tElm.window; } this.getDoc().designMode = "on"; } // Setup base HTML var doc = this.contentDocument; if (dynamicIFrame) { var html = tinyMCE.getParam('doctype') + 'blank_page'; try { if (!this.isHidden()) this.getDoc().designMode = "on"; doc.open(); doc.write(html); doc.close(); } catch (e) { // Failed Mozilla 1.3 this.getDoc().location.href = tinyMCE.baseURL + "/blank.htm"; } } // This timeout is needed in MSIE 5.5 for some odd reason // it seems that the document.frames isn't initialized yet? if (tinyMCE.isMSIE) window.setTimeout("TinyMCE_Engine.prototype.addEventHandlers('" + this.editorId + "');", 1); tinyMCE.setupContent(this.editorId, true); return true; }, setBaseHREF : function(u) { var h, b, d, nl; d = this.getDoc(); nl = d.getElementsByTagName("base"); b = nl.length > 0 ? nl[0] : null; if (!b) { nl = d.getElementsByTagName("head"); h = nl.length > 0 ? nl[0] : null; b = d.createElement("base"); b.setAttribute('href', u); h.appendChild(b); } else { if (u == "" || u == null) b.parentNode.removeChild(b); else b.setAttribute('href', u); } }, getFocusElement : function() { return this.selection.getFocusElement(); }, getSel : function() { return this.selection.getSel(); }, getRng : function() { return this.selection.getRng(); } }; /* file:jscripts/tiny_mce/classes/TinyMCE_Cleanup.class.js */ /* Some of the contents of this file will be wrapped in a class later on it will also be replaced with the new cleanup logic */ TinyMCE_Engine.prototype.cleanupHTMLCode = function(s) { s = s.replace(/

/gi, '

 

'); s = s.replace(/

\s*<\/p>/gi, '

 

'); // Open closed tags like to // tinyMCE.debug("f:" + s); s = s.replace(/<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\|>]*?)\/>/gi, '<$1$2$3>'); // tinyMCE.debug("e:" + s); // Remove trailing space to s = s.replace(new RegExp('\\s+> to s = s.replace(/<(img|br|hr)(.*?)><\/(img|br|hr)>/gi, '<$1$2 />'); // Weird MSIE bug,


breaks runtime? if (tinyMCE.isMSIE) s = s.replace(/


<\/p>/gi, "
"); // Convert relative anchors to absolute URLs ex: #something to file.htm#something if (tinyMCE.getParam('convert_urls')) s = s.replace(new RegExp('(href=\"?)(\\s*?#)', 'gi'), '$1' + tinyMCE.settings['document_base_url'] + "#"); return s; }; TinyMCE_Engine.prototype.parseStyle = function(str) { var ar = new Array(); if (str == null) return ar; var st = str.split(';'); tinyMCE.clearArray(ar); for (var i=0; i 1) val = "url('" + eval(tinyMCE.getParam('urlconverter_callback') + "(m[1], null, true);") + "')"; } // Force HEX colors if (tinyMCE.getParam("force_hex_style_colors")) val = tinyMCE.convertRGBToHex(val, t