Began removing $Id$ tags. This will be an ongoing process.
[citadel.git] / webcit / tiny_mce / plugins / nonbreaking / editor_plugin_src.js
1 /*\r
2  * Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.\r
3  */\r
4 \r
5 (function() {\r
6         tinymce.create('tinymce.plugins.Nonbreaking', {\r
7                 init : function(ed, url) {\r
8                         var t = this;\r
9 \r
10                         t.editor = ed;\r
11 \r
12                         // Register commands\r
13                         ed.addCommand('mceNonBreaking', function() {\r
14                                 ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span class="mceItemHidden mceVisualNbsp">&middot;</span>' : '&nbsp;');\r
15                         });\r
16 \r
17                         // Register buttons\r
18                         ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});\r
19 \r
20                         if (ed.getParam('nonbreaking_force_tab')) {\r
21                                 ed.onKeyDown.add(function(ed, e) {\r
22                                         if (tinymce.isIE && e.keyCode == 9) {\r
23                                                 ed.execCommand('mceNonBreaking');\r
24                                                 ed.execCommand('mceNonBreaking');\r
25                                                 ed.execCommand('mceNonBreaking');\r
26                                                 tinymce.dom.Event.cancel(e);\r
27                                         }\r
28                                 });\r
29                         }\r
30                 },\r
31 \r
32                 getInfo : function() {\r
33                         return {\r
34                                 longname : 'Nonbreaking space',\r
35                                 author : 'Moxiecode Systems AB',\r
36                                 authorurl : 'http://tinymce.moxiecode.com',\r
37                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',\r
38                                 version : tinymce.majorVersion + "." + tinymce.minorVersion\r
39                         };\r
40                 }\r
41 \r
42                 // Private methods\r
43         });\r
44 \r
45         // Register plugin\r
46         tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);\r
47 })();\r