nouveau style menu_top
[mtweb] / mw / libs / tiny_mce / plugins / nonbreaking / 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.Nonbreaking', {\r
13                 init : function(ed, url) {\r
14                         var t = this;\r
15 \r
16                         t.editor = ed;\r
17 \r
18                         // Register commands\r
19                         ed.addCommand('mceNonBreaking', function() {\r
20                                 ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span _mce_bogus="1" class="mceItemHidden mceItemNbsp">&nbsp;</span>' : '&nbsp;');\r
21                         });\r
22 \r
23                         // Register buttons\r
24                         ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});\r
25 \r
26                         if (ed.getParam('nonbreaking_force_tab')) {\r
27                                 ed.onKeyDown.add(function(ed, e) {\r
28                                         if (tinymce.isIE && e.keyCode == 9) {\r
29                                                 ed.execCommand('mceNonBreaking');\r
30                                                 ed.execCommand('mceNonBreaking');\r
31                                                 ed.execCommand('mceNonBreaking');\r
32                                                 tinymce.dom.Event.cancel(e);\r
33                                         }\r
34                                 });\r
35                         }\r
36                 },\r
37 \r
38                 getInfo : function() {\r
39                         return {\r
40                                 longname : 'Nonbreaking space',\r
41                                 author : 'Moxiecode Systems AB',\r
42                                 authorurl : 'http://tinymce.moxiecode.com',\r
43                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',\r
44                                 version : tinymce.majorVersion + "." + tinymce.minorVersion\r
45                         };\r
46                 }\r
47 \r
48                 // Private methods\r
49         });\r
50 \r
51         // Register plugin\r
52         tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);\r
53 })();