nouveau style menu_top
[mtweb] / mw / libs / tiny_mce / plugins / advhr / editor_plugin_src.js
1 /**\r
2  * editor_plugin_src.js\r
3  *\r
4  * Copyright 2009, Moxiecode Systems AB\r
5  * Released under LGPL License.\r
6  *\r
7  * License: http://tinymce.moxiecode.com/license\r
8  * Contributing: http://tinymce.moxiecode.com/contributing\r
9  */\r
10 \r
11 (function() {\r
12         tinymce.create('tinymce.plugins.AdvancedHRPlugin', {\r
13                 init : function(ed, url) {\r
14                         // Register commands\r
15                         ed.addCommand('mceAdvancedHr', function() {\r
16                                 ed.windowManager.open({\r
17                                         file : url + '/rule.htm',\r
18                                         width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),\r
19                                         height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),\r
20                                         inline : 1\r
21                                 }, {\r
22                                         plugin_url : url\r
23                                 });\r
24                         });\r
25 \r
26                         // Register buttons\r
27                         ed.addButton('advhr', {\r
28                                 title : 'advhr.advhr_desc',\r
29                                 cmd : 'mceAdvancedHr'\r
30                         });\r
31 \r
32                         ed.onNodeChange.add(function(ed, cm, n) {\r
33                                 cm.setActive('advhr', n.nodeName == 'HR');\r
34                         });\r
35 \r
36                         ed.onClick.add(function(ed, e) {\r
37                                 e = e.target;\r
38 \r
39                                 if (e.nodeName === 'HR')\r
40                                         ed.selection.select(e);\r
41                         });\r
42                 },\r
43 \r
44                 getInfo : function() {\r
45                         return {\r
46                                 longname : 'Advanced HR',\r
47                                 author : 'Moxiecode Systems AB',\r
48                                 authorurl : 'http://tinymce.moxiecode.com',\r
49                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',\r
50                                 version : tinymce.majorVersion + "." + tinymce.minorVersion\r
51                         };\r
52                 }\r
53         });\r
54 \r
55         // Register plugin\r
56         tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);\r
57 })();