rem: this.contentWindow.document.designMode = "on"; 
add: this.getDoc().designMode = "on"; 
context: function TinyMCEControl_onAdd(replace_element, form_element_name) {	tinyMCE.themeURL = tinyMCE.baseURL + "/themes/" + this.settings['theme'];	this.settings['themeurl'] = tinyMCE.themeURL;	if (!replace_element) {		alert("Error: Could not find the target element.");		return false;	}	var templateFunction = tinyMCE._getThemeFunction('_getInsertLinkTemplate');	if (eval("typeof(" + templateFunction + ")") != 'undefined')		this.insertLinkTemplate = eval(templateFunction + '(this.settings);');	var templateFunction = tinyMCE._getThemeFunction('_getInsertImageTemplate');	if (eval("typeof(" + templateFunction + ")") != 'undefined')		this.insertImageTemplate = eval(templateFunction + '(this.settings);');	var templateFunction = tinyMCE._getThemeFunction('_getEditorTemplate');	if (eval("typeof(" + templateFunction + ")") == 'undefined') {		alert("Error: Could not find the template function: " + templateFunction);		return false;	}	var editorTemplate = eval(templateFunction + '(this.settings, this.editorId);');	var deltaWidth = editorTemplate['delta_width'] ? editorTemplate['delta_width'] : 0;	var deltaHeight = editorTemplate['delta_height'] ? editorTemplate['delta_height'] : 0;	var html = '<span id="' + this.editorId + '_parent">' + editorTemplate['html'];	var templateFunction = tinyMCE._getThemeFunction('_handleNodeChange', true);	if (eval("typeof(" + templateFunction + ")") != 'undefined')		this.settings['handleNodeChangeCallback'] = templateFunction;	html = tinyMCE.replaceVar(html, "editor_id", this.editorId);	html = tinyMCE.replaceVar(html, "default_document", tinyMCE.baseURL + "/blank.htm");	this.settings['default_document'] = tinyMCE.baseURL + "/blank.htm";	this.settings['old_width'] = this.settings['width'];	this.settings['old_height'] = this.settings['height'];	// Set default width, height	if (this.settings['width'] == -1)		this.settings['width'] = replace_element.offsetWidth;	if (this.settings['height'] == -1)		this.settings['height'] = replace_element.offsetHeight;	this.settings['area_width'] = this.settings['width'];	this.settings['area_height'] = this.settings['height'];	this.settings['area_width'] += deltaWidth;	this.settings['area_height'] += deltaHeight;	// Special % handling	if (("" + this.settings['width']).indexOf('%') != -1)		this.settings['area_width'] = "100%";	if (("" + this.settings['height']).indexOf('%') != -1)		this.settings['area_height'] = "100%";	if (("" + replace_element.style.width).indexOf('%') != -1) {		this.settings['width'] = replace_element.style.width;		this.settings['area_width'] = "100%";	}	if (("" + replace_element.style.height).indexOf('%') != -1) {		this.settings['height'] = replace_element.style.height;		this.settings['area_height'] = "100%";	}	html = tinyMCE.applyTemplate(html);	this.settings['width'] = this.settings['old_width'];	this.settings['height'] = this.settings['old_height'];	this.visualAid = this.settings['visual'];	this.formTargetElementId = form_element_name;	// Get replace_element contents	if (replace_element.nodeName.toLowerCase() == "textarea")		this.startContent = replace_element.value;	else		this.startContent = replace_element.innerHTML;	// If not text area	if (replace_element.nodeName.toLowerCase() != "textarea") {		this.oldTargetElement = replace_element.cloneNode(true);		// Debug mode		if (tinyMCE.settings['debug'])			html += '<textarea wrap="off" id="' + form_element_name + '" name="' + form_element_name + '" cols="100" rows="15"></textarea>';		else			html += '<input type="hidden" type="text" id="' + form_element_name + '" name="' + form_element_name + '" />';		html += '</span>';		// Output HTML and set editable		if (!tinyMCE.isMSIE) {			var rng = replace_element.ownerDocument.createRange();			rng.setStartBefore(replace_element);			var fragment = rng.createContextualFragment(html);			replace_element.parentNode.replaceChild(fragment, replace_element);		} else			replace_element.outerHTML = html;	} else {		html += '</span>';		// 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.isMSIE) {			var rng = replace_element.ownerDocument.createRange();			rng.setStartBefore(replace_element);			var fragment = rng.createContextualFragment(html);			replace_element.parentNode.insertBefore(fragment, replace_element);		} else			replace_element.insertAdjacentHTML("beforeBegin", html);	}	// Setup iframe	var dynamicIFrame = false;	var tElm = document.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.contentWindow.document.designMode = "on";	} else {		if (tElm && tElm.nodeName.toLowerCase() == "span")			tElm = tinyMCE._createIFrame(tElm);		else			tElm = document.frames[this.editorId];		this.targetElement = tElm;		this.iframeElement = document.getElementById(this.editorId);		this.contentDocument = tElm.window.document;		this.contentWindow = tElm.window;		this.contentDocument.designMode = "on";	}	// Setup base HTML	var doc = this.contentDocument;	if (dynamicIFrame) {        var html = ""            + '<!doctype html public "-//w3c//dtd html 4.0 transitional//en">'            + '<html>'            + '<head>'            + '<title>blank_page</title>'            + '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'            + '</head>'            + '<body>'            + '</body>'            + '</html>';		try {			this.contentWindow.document.designMode = "on";			doc.open();			doc.write(html);			doc.close();		} catch (e) {			// Failed Mozilla 1.3			this.contentWindow.document.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_addEventHandlers('" + this.editorId + "');", 1);	//window.setTimeout("tinyMCE.setupContent('" + this.editorId + "');", (tinyMCE.isMSIE ? 1 : 1000));	tinyMCE.setupContent(this.editorId);	return true;}
meta: 5314	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5314/914f29b169169eaf678616905b5062afd73de30a/tiny_mce_src.js/buggy/www/extras/tinymce/jscripts/tiny_mce/tiny_mce_src.js