]> code.citadel.org Git - citadel.git/blob - webcit/tiny_mce/plugins/advhr/editor_plugin_src.js
re-added binary
[citadel.git] / webcit / tiny_mce / plugins / advhr / editor_plugin_src.js
1 /* Import plugin specific language pack */\r
2 tinyMCE.importPluginLanguagePack('advhr', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,no,hu');\r
3 \r
4 function TinyMCE_advhr_getInfo() {\r
5         return {\r
6                 longname : 'Advanced HR',\r
7                 author : 'Moxiecode Systems',\r
8                 authorurl : 'http://tinymce.moxiecode.com',\r
9                 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html',\r
10                 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
11         };\r
12 };\r
13 \r
14 function TinyMCE_advhr_getControlHTML(control_name) {\r
15     switch (control_name) {\r
16         case "advhr":\r
17             return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvancedHr\');" target="_self" onmousedown="return false;"><img id="{$editor_id}_advhr" src="{$pluginurl}/images/advhr.gif" title="{$lang_insert_advhr_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';\r
18     }\r
19 \r
20     return "";\r
21 }\r
22 \r
23 /**\r
24  * Executes the mceAdvanceHr command.\r
25  */\r
26 function TinyMCE_advhr_execCommand(editor_id, element, command, user_interface, value) {\r
27     // Handle commands\r
28     switch (command) {\r
29         case "mceAdvancedHr":\r
30             var template = new Array();\r
31 \r
32             template['file']   = '../../plugins/advhr/rule.htm'; // Relative to theme\r
33             template['width']  = 270;\r
34             template['height'] = 180;\r
35 \r
36                         template['width']  += tinyMCE.getLang('lang_advhr_delta_width', 0);\r
37                         template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);\r
38 \r
39             var size = "", width = "", noshade = "";\r
40             if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr"){\r
41                 tinyMCE.hrElement = tinyMCE.selectedElement;\r
42                 if (tinyMCE.hrElement) {\r
43                     size    = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";\r
44                     width   = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";\r
45                     noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";\r
46                 }\r
47                 tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});\r
48             } else {\r
49                 if (tinyMCE.isMSIE) {\r
50                     tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');\r
51                 } else {\r
52                     tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});\r
53                 }\r
54             }\r
55                     \r
56        return true;\r
57    }\r
58    // Pass to next handler in chain\r
59    return false;\r
60 }\r
61 \r
62 function TinyMCE_advhr_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {\r
63         tinyMCE.switchClassSticky(editor_id + '_advhr', 'mceButtonNormal');\r
64 \r
65         if (node == null)\r
66                 return;\r
67 \r
68         do {\r
69                 if (node.nodeName.toLowerCase() == "hr")\r
70                         tinyMCE.switchClassSticky(editor_id + '_advhr', 'mceButtonSelected');\r
71         } while ((node = node.parentNode));\r
72 \r
73         return true;\r
74 }