rem: this.refresh();  
add: this.refresh();  
context: 	this.Import = function(table)	{		function processEvent(evt)		{			if (typeof evt == "undefined" || evt == null) return null;			var f = evt + "";			f = f.substring(f.indexOf("{") + 1);			if (f.charAt(f.length - 1) == "\n") f = f.substring(0, f.length - 2);			else f = f.substring(0, f.length - 1);			var res = "";			for (i=0;i<f.length;i++)				if (f.charAt(i) == "\n") res += "";				else if (f.charAt(i) == '"') res += "'";					 else res += f.charAt(i);			var startSpaces = new RegExp("^[ ]+", "gim");			var endSpaces = new RegExp("[ ]+$", "gim");			res = res.replace(startSpaces, "");			res = res.replace(endSpaces, "");			return res;		}		function getExtra(obj)		{			var res = "";			if (obj.className != "")							res += ' class="' + obj.className + '"';			if (obj.title != "")								res += ' title="' + obj.title + '"';			if ((evt = processEvent(obj.onclick)) != null)		res += ' onclick="' + evt + '"';			if ((evt = processEvent(obj.ondblclick)) != null)	res += ' ondblclick="' + evt + '"';			if ((evt = processEvent(obj.onmousedown)) != null)	res += ' onmousedown="' + evt + '"';			if ((evt = processEvent(obj.onmouseup)) != null)	res += ' onmouseup="' + evt + '"';			if ((evt = processEvent(obj.onmouseover)) != null)	res += ' onmouseover="' + evt + '"';			if ((evt = processEvent(obj.onmousemove)) != null)	res += ' onmousemove="' + evt + '"';			if ((evt = processEvent(obj.onmouseout)) != null)	res += ' onmouseout="' + evt + '"';			if ((evt = processEvent(obj.onkeypress)) != null)	res += ' onkeypress="' + evt + '"';			if ((evt = processEvent(obj.onkeydown)) != null)	res += ' onkeydown="' + evt + '"';			if ((evt = processEvent(obj.onkeyup)) != null)		res += ' onkeyup="' + evt + '"';			return res;		}		function getStyle(table)		{			var res = "";			if (table.style.position != "")			res += "position: " + table.style.position + ";";			if (table.style.display != "")			res += "display: " + table.style.display + ";";			if (table.style.left != "")				res += "left: " + table.style.left + ";";			if (table.style.right != "")			res += "right: " + table.style.right + ";";			if (table.style.top != "")				res += "top: " + table.style.top + ";";			if (table.style.bottom != "")			res += "bottom: " + table.style.bottom + ";";			if (table.style.clear != "")			res += "clear: " + table.style.clear + ";";			if (table.style.clip != "")				res += "clip: " + table.style.clip + ";";			if (table.style.color != "")			res += "color: " + table.style.color + ";";			if (table.style.cursor != "")			res += "cursor: " + table.style.cursor + ";";			if (table.style.font != "")				res += "font: " + table.style.font + ";";			if (table.style.width != "" && table.tagName != "TABLE")													res += "width: " + table.style.width + ";";			if (table.style.height != "")			res += "height: " + table.style.height + ";";			if (table.style.margin != "")			res += "margin: " + table.style.margin + ";";			if (table.style.padding != "")			res += "padding: " + table.style.padding + ";";			if (table.style.overflow != "")			res += "overflow: " + table.style.overflow + ";";			if (table.style.textAlign != "")		res += "text-align: " + table.style.textAlign + ";";			if (table.style.textDecoration != "")	res += "text-decoration: " + table.style.textDecoration + ";";			if (table.style.textIndent != "")		res += "text-indent: " + table.style.textIndent + ";";			if (table.style.verticalAlign != "")	res += "vertical-align: " + table.style.verticalAlign + ";";			if (table.style.visibility != "")		res += "visibility: " + table.style.visibility + ";";			if (table.style.MozOpacity != "" && table.style.MozOpacity + "" != "undefined")													res += "-moz-opacity: " + table.style.MozOpacity + ";";			if (table.style.opacity != "" && table.style.opacity + "" != "undefined")													res += "opacity: " + table.style.opacity + ";";			return res;		}		var div = document.createElement("DIV");		div.innerHTML = table;		table = div.getElementsByTagName("TABLE")[0];		this.id			= table.id;		this.summary	= table.summary;		this.border		= (table.border == "")?0:table.border;		this.frame		= table.frame;		this.rules		= table.rules;		this.cellspacing= (table.cellSpacing == "")?2:table.cellSpacing;		this.cellpadding= (table.cellPadding == "")?2:table.cellPadding;		if (table.style.width != "") this.width = table.style.width;		this.extra = getExtra(table);		this.style = "";		if (table.style.background != "")		this.style += "background: " + table.style.background + ";";		if (table.style.border != "")			this.style += "border: " + table.style.border + ";";		this.style += getStyle(table);		this.rows = table.rows.length;		this.cols = 0;		for (i=0;i<table.rows.length;i++)			if (this.cols < table.rows[i].cells.length) this.cols = table.rows[i].cells.length;		this.matrix = Array();		for (r = 0;r<this.rows;r++) {			var temp = new TRow(this, r);			var row = table.rows[r];			temp.align = (row.align == "")?"left":row.align;			temp.valign = (row.valign + "" == "undefined")?"middle":row.valign;			temp.extra = getExtra(row);			temp.style = getStyle(row);			temp.bg = (row.style.backgroundColor == "")?null:row.style.backgroundColor;			for (c = 0;c<this.cols;c++) {				var Cell = new TCell(temp);				if (c<row.cells.length) {					var cell = row.cells[c];					Cell.content	= cell.innerHTML;					Cell.th = (cell.tagName == "TH");					Cell.align		= (cell.align == "")?"left":cell.align;					Cell.valign		= (cell.valign + "" == "undefined")?"middle":cell.valign;					Cell.colspan	= cell.colSpan;					Cell.rowspan	= cell.rowSpan;					Cell.abbr		= cell.abbr;					Cell.axis		= cell.axis;					Cell.scope		= cell.scope;					Cell.extra		= getExtra(cell);					Cell.style		= getStyle(cell);					Cell.bg			= (cell.style.backgroundColor == "")?null:cell.style.backgroundColor;					Cell.borderColor= (cell.style.borderColor == "")?null:cell.style.borderColor;					if (Cell.borderColor != null && Cell.borderColor.indexOf(")") > 0) Cell.borderColor = Cell.borderColor.substring(0,Cell.borderColor.indexOf(")") + 1)					var headers	= cell.headers;					if (headers != "") {						headers += " ";						for (i = 0;i<table.rows.length;i++) {							for (j = 0;j<table.rows[i].cells.length;j++) {								if (headers.indexOf(table.rows[i].cells[j].id) > -1) {									Cell.headers.push(new THeader(i, j));								}							}						}					}				} else {					Cell.visible	= false;				}				temp.cells.push(Cell);			}			this.matrix.push(temp);		}		try {			this.caption = table.caption.innerHTML;		}		catch(e) {			this.caption = null;		}		document.getElementById("tid").value = this.id;		document.getElementById("caption").value = this.caption;		document.getElementById("cellspacing").value = this.cellspacing;		document.getElementById("cellpadding").value = this.cellpadding;		document.getElementById("summary").value = this.summary;		if (this.width.indexOf("%") > -1) {			document.getElementById("width").value = this.width.substring(0, this.width.length - 1);			document.getElementById("widthtype").value = "%";		} else {			document.getElementById("width").value = this.width.substring(0, this.width.length - 2);			document.getElementById("widthtype").value = this.width.substring(this.width.length - 2);		}		//document.getElementById("width").value = this.width; //TODO		document.getElementById("frame").value = this.frame;		document.getElementById("rules").value = this.rules;		this.refresh();		//alert(this.rows + "|" + this.cols);		//for(var prop in table.rows[0]) document.getElementById("test").value += prop + "=>" + table.rows[0][prop] + "\n";	}
meta: 5635	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5635/527cf5457da0bbcd901319db3fb78a7f3c74d57b/table-editor.js/clean/fudge/wysiwyg/plugins/table_editing/table-editor.js