includes/clientside/tinymce/plugins/advhr/js/rule.js
changeset 543 dffcbfbc4e59
parent 335 67bd3121a12e
--- a/includes/clientside/tinymce/plugins/advhr/js/rule.js	Mon May 05 20:06:37 2008 -0400
+++ b/includes/clientside/tinymce/plugins/advhr/js/rule.js	Mon May 05 20:08:44 2008 -0400
@@ -3,25 +3,34 @@
 		var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
 
 		w = dom.getAttrib(n, 'width');
-		f.width.value = w ? parseInt(w) : '';
-		f.size.value = dom.getAttrib(n, 'size');
-		f.noshade.checked = !!dom.getAttrib(n, 'noshade');
+		f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
+		f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
+		f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
 		selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
 	},
 
 	update : function() {
-		var ed = tinyMCEPopup.editor, h, f = document.forms[0];
+		var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
 
 		h = '<hr';
 
-		if (f.size.value)
+		if (f.size.value) {
 			h += ' size="' + f.size.value + '"';
+			st += ' height:' + f.size.value + 'px;';
+		}
 
-		if (f.width.value)
+		if (f.width.value) {
 			h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
+			st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
+		}
 
-		if (f.noshade.checked)
+		if (f.noshade.checked) {
 			h += ' noshade="noshade"';
+			st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
+		}
+
+		if (ed.settings.inline_styles)
+			h += ' style="' + tinymce.trim(st) + '"';
 
 		h += ' />';