aboutsummaryrefslogtreecommitdiffstats
path: root/library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-28 21:11:52 -0700
committerFriendika <info@friendika.com>2011-06-28 21:11:52 -0700
commit0b221e8945ae785dc706d8ea9a9e8e25532c0096 (patch)
tree52d4978006b028c24ee1feb3cf6ba2907a48c88f /library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js
parent60caa0349416dad1a3a891e3c0e00d33d25d7a91 (diff)
downloadvolse-hubzilla-0b221e8945ae785dc706d8ea9a9e8e25532c0096.tar.gz
volse-hubzilla-0b221e8945ae785dc706d8ea9a9e8e25532c0096.tar.bz2
volse-hubzilla-0b221e8945ae785dc706d8ea9a9e8e25532c0096.zip
bug #96 move libraries to library - better alignment of like rotator
Diffstat (limited to 'library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js')
-rw-r--r--library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js b/library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js
new file mode 100644
index 000000000..b6cbd66c7
--- /dev/null
+++ b/library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js
@@ -0,0 +1,43 @@
+var AdvHRDialog = {
+ init : function(ed) {
+ var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
+
+ w = dom.getAttrib(n, 'width');
+ 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], st = '';
+
+ h = '<hr';
+
+ if (f.size.value) {
+ h += ' size="' + f.size.value + '"';
+ st += ' height:' + f.size.value + 'px;';
+ }
+
+ 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) {
+ 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 += ' />';
+
+ ed.execCommand("mceInsertContent", false, h);
+ tinyMCEPopup.close();
+ }
+};
+
+tinyMCEPopup.requireLangPack();
+tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);