includes/clientside/tinymce/utils/form_utils.js
changeset 543 dffcbfbc4e59
parent 459 31c23016ab62
child 1193 e3b94bd055dc
--- a/includes/clientside/tinymce/utils/form_utils.js	Mon May 05 20:06:37 2008 -0400
+++ b/includes/clientside/tinymce/utils/form_utils.js	Mon May 05 20:08:44 2008 -0400
@@ -1,5 +1,5 @@
 /**
- * $Id: form_utils.js 614 2008-02-20 17:57:57Z spocke $
+ * $Id: form_utils.js 673 2008-03-06 13:26:20Z spocke $
  *
  * Various form utilitiy functions.
  *
@@ -170,7 +170,7 @@
 }
 
 function trimSize(size) {
-	return size.replace(new RegExp('[^0-9%]', 'gi'), '');
+	return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');
 }
 
 function getCSSSize(size) {
@@ -179,7 +179,11 @@
 	if (size == "")
 		return "";
 
-	return size.indexOf('%') != -1 ? size : size + "px";
+	// Add px
+	if (/^[0-9]+$/.test(size))
+		size += 'px';
+
+	return size;
 }
 
 function getStyle(elm, attrib, style) {