includes/clientside/tinymce/plugins/table/js/table.js
changeset 778 57ce13805b6f
parent 588 20484deb89cd
child 1193 e3b94bd055dc
--- a/includes/clientside/tinymce/plugins/table/js/table.js	Sun Dec 21 15:35:46 2008 -0500
+++ b/includes/clientside/tinymce/plugins/table/js/table.js	Sun Dec 21 16:28:00 2008 -0500
@@ -12,7 +12,7 @@
 	tinyMCEPopup.restoreSelection();
 
 	if (!AutoValidator.validate(formObj)) {
-		alert(inst.getLang('invalid_data'));
+		tinyMCEPopup.alert(inst.getLang('invalid_data'));
 		return false;
 	}
 
@@ -46,13 +46,13 @@
 
 	// Validate table size
 	if (colLimit && cols > colLimit) {
-		inst.windowManager.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));
+		tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));
 		return false;
 	} else if (rowLimit && rows > rowLimit) {
-		inst.windowManager.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));
+		tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));
 		return false;
 	} else if (cellLimit && cols * rows > cellLimit) {
-		inst.windowManager.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));
+		tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));
 		return false;
 	}
 
@@ -87,7 +87,7 @@
 			elm.insertBefore(capEl, elm.firstChild);
 		}
 
-		if (width && /(pt|em|cm)$/.test(width)) {
+		if (width && inst.settings.inline_styles) {
 			dom.setStyle(elm, 'width', width);
 			dom.setAttrib(elm, 'width', '');
 		} else {
@@ -100,10 +100,13 @@
 		dom.setAttrib(elm, 'bgColor', '');
 		dom.setAttrib(elm, 'background', '');
 
-		if (height) {
+		if (height && inst.settings.inline_styles) {
 			dom.setStyle(elm, 'height', height);
 			dom.setAttrib(elm, 'height', '');
-		}
+		} else {
+			dom.setAttrib(elm, 'height', height, true);
+			dom.setStyle(elm, 'height', '');
+ 		}
 
 		if (background != '')
 			elm.style.backgroundImage = "url('" + background + "')";
@@ -149,7 +152,7 @@
 	html += makeAttrib('cellpadding', cellpadding);
 	html += makeAttrib('cellspacing', cellspacing);
 
-	if (width && /(pt|em|cm)$/.test(width)) {
+	if (width && inst.settings.inline_styles) {
 		if (style)
 			style += '; ';