]> code.citadel.org Git - citadel.git/blob - webcit/tiny_mce/plugins/advhr/jscripts/rule.js
* Removed the Kevin Roth rich text editor and replaced it with TinyMCE.
[citadel.git] / webcit / tiny_mce / plugins / advhr / jscripts / rule.js
1 function init() {
2         var formObj = document.forms[0];
3         formObj.width.value  = tinyMCE.getWindowArg('width');
4         formObj.size.value   = tinyMCE.getWindowArg('size');
5         formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('mceDo'));
6         if (tinyMCE.getWindowArg('noshade')) {
7                 formObj.noshade.checked = true;
8         }
9         if (tinyMCE.getWindowArg('width').lastIndexOf('%')!=-1) {
10                 formObj.width2.value = "%";
11                 formObj.width.value  = formObj.width.value.substring(0,formObj.width.value.length-1);
12         }
13 }
14
15 function insertHR() {
16         var formObj = document.forms[0];
17         var width   = formObj.width.value;
18         var size    = formObj.size.value;
19         var html = '<hr';
20         if (size!='' && size!=0) {
21                 html += ' size="' + size + '"';
22         }
23         if (width!='' && width!=0) {
24                 html += ' width="' + width;
25                 if (formObj.width2.value=='%') {
26                         html += '%';
27                 }
28                 html += '"';
29         }
30         if (formObj.noshade.checked==true) {
31                 html += ' noshade';
32         }
33         html += ' />';
34
35         tinyMCEPopup.execCommand("mceInsertContent", true, html);
36         tinyMCEPopup.close();
37 }
38
39 function cancelAction() {
40         tinyMCEPopup.close();
41 }