add:  if (!AutoValidator.validate(formObj)) { alert(tinyMCE.getLang('lang_invalid_data')); return false; } 
context: function insertTable() {	var formObj = document.forms[0];	var inst = tinyMCE.selectedInstance;	var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className;	var html = '';	var elm = tinyMCE.tableElm;	var cellLimit, rowLimit, colLimit;	tinyMCEPopup.restoreSelection();	// Get form data	cols = formObj.elements['cols'].value;	rows = formObj.elements['rows'].value;	border = formObj.elements['border'].value != "" ? formObj.elements['border'].value  : 0;	cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";	cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";	align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;	width = formObj.elements['width'].value;	height = formObj.elements['height'].value;	bordercolor = formObj.elements['bordercolor'].value;	bgcolor = formObj.elements['bgcolor'].value;	className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;	id = formObj.elements['id'].value;	summary = formObj.elements['summary'].value;	style = formObj.elements['style'].value;	dir = formObj.elements['dir'].value;	lang = formObj.elements['lang'].value;	background = formObj.elements['backgroundimage'].value;	cellLimit = tinyMCE.getParam('table_cell_limit', false);	rowLimit = tinyMCE.getParam('table_row_limit', false);	colLimit = tinyMCE.getParam('table_col_limit', false);	// Validate table size	if (colLimit && cols > colLimit) {		alert(tinyMCE.getLang('lang_table_col_limit', '', true, {cols : colLimit}));		return false;	} else if (rowLimit && rows > rowLimit) {		alert(tinyMCE.getLang('lang_table_row_limit', '', true, {rows : rowLimit}));		return false;	} else if (cellLimit && cols * rows > cellLimit) {		alert(tinyMCE.getLang('lang_table_cell_limit', '', true, {cells : cellLimit}));		return false;	}	// Update table	if (action == "update") {		inst.execCommand('mceBeginUndoLevel');		tinyMCE.setAttrib(elm, 'cellPadding', cellpadding, true);		tinyMCE.setAttrib(elm, 'cellSpacing', cellspacing, true);		tinyMCE.setAttrib(elm, 'border', border, true);		tinyMCE.setAttrib(elm, 'align', align);		tinyMCE.setAttrib(elm, 'class', className);		tinyMCE.setAttrib(elm, 'style', style);		tinyMCE.setAttrib(elm, 'id', id);		tinyMCE.setAttrib(elm, 'summary', summary);		tinyMCE.setAttrib(elm, 'dir', dir);		tinyMCE.setAttrib(elm, 'lang', lang);		// Not inline styles		if (!tinyMCE.getParam("inline_styles"))			tinyMCE.setAttrib(elm, 'width', width, true);		// Remove these since they are not valid XHTML		tinyMCE.setAttrib(elm, 'borderColor', '');		tinyMCE.setAttrib(elm, 'bgColor', '');		tinyMCE.setAttrib(elm, 'background', '');		tinyMCE.setAttrib(elm, 'height', '');		if (background != '')			elm.style.backgroundImage = "url('" + background + "')";		else			elm.style.backgroundImage = '';		if (tinyMCE.getParam("inline_styles"))			elm.style.borderWidth = border + "px";		if (tinyMCE.getParam("inline_styles")) {			if (width != '')				elm.style.width = getCSSSize(width);		}		if (bordercolor != "") {			elm.style.borderColor = bordercolor;			elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;			elm.style.borderWidth = border == "" ? "1px" : border;		} else			elm.style.borderColor = '';		elm.style.backgroundColor = bgcolor;		elm.style.height = getCSSSize(height);		tinyMCE.handleVisualAid(tinyMCE.tableElm, false, inst.visualAid, inst);		// Fix for stange MSIE align bug		tinyMCE.tableElm.outerHTML = tinyMCE.tableElm.outerHTML;		tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);		tinyMCE.triggerNodeChange();		inst.execCommand('mceEndUndoLevel');		// Repaint if dimensions changed		if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)			inst.repaint();		tinyMCEPopup.close();		return true;	}	// Create new table	html += '<table';	html += makeAttrib('id', id);	html += makeAttrib('border', border);	html += makeAttrib('cellpadding', cellpadding);	html += makeAttrib('cellspacing', cellspacing);	html += makeAttrib('width', width);	//html += makeAttrib('height', height);	//html += makeAttrib('bordercolor', bordercolor);	//html += makeAttrib('bgcolor', bgcolor);	html += makeAttrib('align', align);	html += makeAttrib('class', tinyMCE.getVisualAidClass(className, border == 0));	html += makeAttrib('style', style);	html += makeAttrib('summary', summary);	html += makeAttrib('dir', dir);	html += makeAttrib('lang', lang);	html += '>';	for (var y=0; y<rows; y++) {		html += "<tr>";		for (var x=0; x<cols; x++)			html += '<td>&nbsp;</td>';		html += "</tr>";	}	html += "</table>";	inst.execCommand('mceBeginUndoLevel');	inst.execCommand('mceInsertContent', false, html);	tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual']);	inst.execCommand('mceEndUndoLevel');	tinyMCEPopup.close();}
meta: 10343	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10343/524e24acf79702622c51dba4bb678337072e34b9/table.js/clean/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/jscripts/table.js