rem: var doc = editor._doc;  var table = doc.createElement("table");  for (var field in param) { 
add: var img = image; if (!img) { var sel   = editor._getSelection(); var range = editor._createRange(sel); if (HTMLArea.is_ie) { editor._doc.execCommand("insertimage", false, param.imageref); img = range.parentElement();  if (img.tagName.toLowerCase() != "img") { img = img.previousSibling; } } else {  img = null ; img = document.createElement("img"); editor.insertNodeAtSelection(img); img.src = param.imageref ;  } } else { img.src = param.imageref; } for (field in param) { 
context: 	this._popupDialog("insert_table.jsp", function(param) {		if (!param) {	// user must have pressed Cancel			return false;		}		var doc = editor._doc;		// create the table element		var table = doc.createElement("table");		// assign the given arguments		for (var field in param) {			var value = param[field];			if (!value) {				continue;			}			switch (field) {			    case "f_width"   : table.style.width = value + param["f_unit"]; break;			    case "f_align"   : table.align	 = value; break;			    case "f_border"  : table.border	 = parseInt(value); break;			    case "f_spacing" : table.cellspacing = parseInt(value); break;			    case "f_padding" : table.cellpadding = parseInt(value); break;			}		}		var tbody = doc.createElement("tbody");		table.appendChild(tbody);		for (var i = 0; i < param["f_rows"]; ++i) {			var tr = doc.createElement("tr");			tbody.appendChild(tr);			for (var j = 0; j < param["f_cols"]; ++j) {				var td = doc.createElement("td");				tr.appendChild(td);				// Mozilla likes to see something inside the cell.				(HTMLArea.is_gecko) && td.appendChild(doc.createElement("br"));			}		}		if (HTMLArea.is_ie) {			range.pasteHTML(table.outerHTML);		} else {			// insert the table			editor.insertNodeAtSelection(table);		}		return true;	}, null);
meta: 6464	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6464/e24e57956b54251f4d7c3fbafdaf11632f94f326/htmlarea.js/buggy/web/imcms/htmlarea/htmlarea.js