bgneal@45
|
1 /**
|
bgneal@183
|
2 * editor_plugin_src.js
|
bgneal@45
|
3 *
|
bgneal@183
|
4 * Copyright 2009, Moxiecode Systems AB
|
bgneal@183
|
5 * Released under LGPL License.
|
bgneal@183
|
6 *
|
bgneal@183
|
7 * License: http://tinymce.moxiecode.com/license
|
bgneal@183
|
8 * Contributing: http://tinymce.moxiecode.com/contributing
|
bgneal@45
|
9 */
|
bgneal@45
|
10
|
bgneal@45
|
11 (function() {
|
bgneal@45
|
12 tinymce.create('tinymce.plugins.Nonbreaking', {
|
bgneal@45
|
13 init : function(ed, url) {
|
bgneal@45
|
14 var t = this;
|
bgneal@45
|
15
|
bgneal@45
|
16 t.editor = ed;
|
bgneal@45
|
17
|
bgneal@45
|
18 // Register commands
|
bgneal@45
|
19 ed.addCommand('mceNonBreaking', function() {
|
bgneal@247
|
20 ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span _mce_bogus="1" class="mceItemHidden mceItemNbsp"> </span>' : ' ');
|
bgneal@45
|
21 });
|
bgneal@45
|
22
|
bgneal@45
|
23 // Register buttons
|
bgneal@45
|
24 ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});
|
bgneal@45
|
25
|
bgneal@45
|
26 if (ed.getParam('nonbreaking_force_tab')) {
|
bgneal@45
|
27 ed.onKeyDown.add(function(ed, e) {
|
bgneal@45
|
28 if (tinymce.isIE && e.keyCode == 9) {
|
bgneal@45
|
29 ed.execCommand('mceNonBreaking');
|
bgneal@45
|
30 ed.execCommand('mceNonBreaking');
|
bgneal@45
|
31 ed.execCommand('mceNonBreaking');
|
bgneal@45
|
32 tinymce.dom.Event.cancel(e);
|
bgneal@45
|
33 }
|
bgneal@45
|
34 });
|
bgneal@45
|
35 }
|
bgneal@45
|
36 },
|
bgneal@45
|
37
|
bgneal@45
|
38 getInfo : function() {
|
bgneal@45
|
39 return {
|
bgneal@45
|
40 longname : 'Nonbreaking space',
|
bgneal@45
|
41 author : 'Moxiecode Systems AB',
|
bgneal@45
|
42 authorurl : 'http://tinymce.moxiecode.com',
|
bgneal@45
|
43 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
|
bgneal@45
|
44 version : tinymce.majorVersion + "." + tinymce.minorVersion
|
bgneal@45
|
45 };
|
bgneal@45
|
46 }
|
bgneal@45
|
47
|
bgneal@45
|
48 // Private methods
|
bgneal@45
|
49 });
|
bgneal@45
|
50
|
bgneal@45
|
51 // Register plugin
|
bgneal@45
|
52 tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);
|
bgneal@45
|
53 })(); |