Initial revision with basic functionability
[bcms.git] / media / tinymce / plugins / nonbreaking / editor_plugin_src.js
blobb72375660c317531a795b8c070c86a9c6516b4fa
1 /**\r
2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $\r
3  *\r
4  * @author Moxiecode\r
5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.\r
6  */\r
7 \r
8 (function() {\r
9         tinymce.create('tinymce.plugins.Nonbreaking', {\r
10                 init : function(ed, url) {\r
11                         var t = this;\r
13                         t.editor = ed;\r
15                         // Register commands\r
16                         ed.addCommand('mceNonBreaking', function() {\r
17                                 ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span class="mceItemHidden mceVisualNbsp">&middot;</span>' : '&nbsp;');\r
18                         });\r
20                         // Register buttons\r
21                         ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});\r
23                         if (ed.getParam('nonbreaking_force_tab')) {\r
24                                 ed.onKeyDown.add(function(ed, e) {\r
25                                         if (tinymce.isIE && e.keyCode == 9) {\r
26                                                 ed.execCommand('mceNonBreaking');\r
27                                                 ed.execCommand('mceNonBreaking');\r
28                                                 ed.execCommand('mceNonBreaking');\r
29                                                 tinymce.dom.Event.cancel(e);\r
30                                         }\r
31                                 });\r
32                         }\r
33                 },\r
35                 getInfo : function() {\r
36                         return {\r
37                                 longname : 'Nonbreaking space',\r
38                                 author : 'Moxiecode Systems AB',\r
39                                 authorurl : 'http://tinymce.moxiecode.com',\r
40                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',\r
41                                 version : tinymce.majorVersion + "." + tinymce.minorVersion\r
42                         };\r
43                 }\r
45                 // Private methods\r
46         });\r
48         // Register plugin\r
49         tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);\r
50 })();