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