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') + '
'); 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>$1$2>'); // tinyMCE.debug("e:" + s); // Remove trailing space to s = s.replace(new RegExp('\\s+>', 'gi'), '>'); // Close tags to s = s.replace(/<(img|br|hr)(.*?)><\/(img|br|hr)>/gi, '<$1$2 />'); // Weird MSIE bug,