source: trunk/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js @ 1

Last change on this file since 1 was 1, checked in by dj3c1t, 12 years ago

import initial

File size: 887 bytes
Line 
1var AdvHRDialog = {
2        init : function(ed) {
3                var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
4
5                w = dom.getAttrib(n, 'width');
6                f.width.value = w ? parseInt(w) : '';
7                f.size.value = dom.getAttrib(n, 'size');
8                f.noshade.checked = !!dom.getAttrib(n, 'noshade');
9                selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
10        },
11
12        update : function() {
13                var ed = tinyMCEPopup.editor, h, f = document.forms[0];
14
15                h = '<hr';
16
17                if (f.size.value)
18                        h += ' size="' + f.size.value + '"';
19
20                if (f.width.value)
21                        h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
22
23                if (f.noshade.checked)
24                        h += ' noshade="noshade"';
25
26                h += ' />';
27
28                ed.execCommand("mceInsertContent", false, h);
29                tinyMCEPopup.close();
30        }
31};
32
33tinyMCEPopup.requireLangPack();
34tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
Note: See TracBrowser for help on using the repository browser.