context: function TinyMCE_cleanupNode(node) {	var output = "";	switch (node.nodeType) {		case 1: // Element			var elementData = tinyMCE._cleanupElementName(node.nodeName, node);			var elementName = elementData ? elementData.element_name : null;			var elementValidAttribs = elementData ? elementData.valid_attribs : null;			var elementAttribs = "";			// Element not valid (only render children)			if (!elementName) {				if (node.hasChildNodes()) {					for (var i=0; i<node.childNodes.length; i++)						output += this.cleanupNode(node.childNodes[i]);				}				return output;			}			// Has mso/microsuck crap or empty attrib			if (node.style && (node.style.cssText.indexOf('mso-') != -1 && tinyMCE.settings['auto_cleanup_word']) || node.style.cssText == "") {				node.style.cssText = "";				node.removeAttribute("style");			}			// Handle inline styles			if (tinyMCE.cleanup_inline_styles)				tinyMCE._fixInlineStyles(node);			// Set attrib data			if (elementValidAttribs) {				for (var a=1; a<elementValidAttribs.length; a++) {					var attribName, attribDefaultValue, attribForceValue, attribValue;					attribName = elementValidAttribs[a][0];					attribDefaultValue = elementValidAttribs[a][1];					attribForceValue = elementValidAttribs[a][2];					if (attribDefaultValue || attribForceValue) {						var attribValue = node.getAttribute(attribName);						if (node.getAttribute(attribName) == "")							attribValue = attribDefaultValue;						attribValue = attribForceValue ? attribForceValue : attribValue;						// Is to generate id						if (attribValue == "{$uid}")							attribValue = "uid_" + (tinyMCE.cleanup_idCount++);						node.setAttribute(attribName, attribValue);					}				}			}			// Remove non needed span elements			if (elementName == "span" && tinyMCE.cleanup_trim_span_elements) {				var re = new RegExp('^[ \t]+', 'g');				var onlyWhiteSpace = true;				for (var a=0; a<node.childNodes.length; a++) {					var tmpNode = node.childNodes[a];					if ((tmpNode.nodeType == 3 && !tmpNode.nodeValue.match(re)) || tmpNode.nodeName.toLowerCase() != "span") {						onlyWhiteSpace = false;						break;					}				}				// Count attributes				tinyMCE._verifyClass(node);				var numAttribs = 0;				for (var i=0; i<node.attributes.length; i++) {					if (node.attributes[i].specified)						numAttribs++;				}				// Is not a valid span, remove it				if (onlyWhiteSpace || numAttribs == 0) {					if (node.hasChildNodes()) {						for (var i=0; i<node.childNodes.length; i++)							output += this.cleanupNode(node.childNodes[i]);					}					return output;				}			}			// Add some visual aids			if (elementName == "table" || elementName == "td") {				// Handle visual aid				if (tinyMCE.cleanup_visual_table_style != "") {					// Find parent table					var tableElement = node;					if (elementName == "td")						tableElement = tinyMCE.getParentElement(tableElement, "table");					if (tableElement && tableElement.getAttribute("border") == 0) {						if (tinyMCE.cleanup_visual_aid)							elementAttribs += " style=" + '"' + tinyMCE.cleanup_visual_table_style + '"';					}				}			}			// Handle element attributes			if (node.attributes.length > 0) {				for (var i=0; i<node.attributes.length; i++) {					if (node.attributes[i].specified) {						var attrib = tinyMCE._cleanupAttribute(elementValidAttribs, elementName, node.attributes[i], node);						if (attrib)							elementAttribs += " " + attrib.name + "=" + '"' + attrib.value + '"';					}				}			}			// Add nbsp to some elements			if ((elementName == "p" || elementName == "td") && (node.innerHTML == "" || node.innerHTML == "&nbsp;"))				return "<" + elementName + elementAttribs + ">&nbsp;</" + elementName + ">";			// Is MSIE script element			if (tinyMCE.isMSIE && elementName == "script")				return "<" + elementName + elementAttribs + ">" + node.text + "</" + elementName + ">";			// Clean up children			if (node.hasChildNodes()) {				// Force BR				if (elementName == "p" && tinyMCE.cleanup_force_br_newlines)					output += "<div" + elementAttribs + ">";				else					output += "<" + elementName + elementAttribs + ">";				for (var i=0; i<node.childNodes.length; i++)					output += this.cleanupNode(node.childNodes[i]);				// Force BR				if (elementName == "p" && tinyMCE.cleanup_force_br_newlines)					output += "</div><br />";				else					output += "</" + elementName + ">";			} else // No children				output += "<" + elementName + elementAttribs + " />";			return output;		case 3: // Text			// Do not convert script elements			if (node.parentNode.nodeName.toLowerCase() == "script")				return node.nodeValue;			return this.convertStringToXML(node.nodeValue);		case 8: // Comment			return "<!--" + node.nodeValue + "-->";		default: // Unknown			return "[UNKNOWN NODETYPE " + node.nodeType + "]";	}}
meta: 5314	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5314/873ce1c62e52365d732f67421272ae1302559b15/tiny_mce_src.js/buggy/www/extras/tinymce/jscripts/tiny_mce/tiny_mce_src.js