bgneal@312: /** bgneal@312: * editor_plugin_src.js bgneal@312: * bgneal@312: * Copyright 2009, Moxiecode Systems AB bgneal@312: * Released under LGPL License. bgneal@312: * bgneal@312: * License: http://tinymce.moxiecode.com/license bgneal@312: * Contributing: http://tinymce.moxiecode.com/contributing bgneal@312: */ bgneal@312: bgneal@312: (function() { bgneal@312: tinymce.create('tinymce.plugins.Nonbreaking', { bgneal@312: init : function(ed, url) { bgneal@312: var t = this; bgneal@312: bgneal@312: t.editor = ed; bgneal@312: bgneal@312: // Register commands bgneal@312: ed.addCommand('mceNonBreaking', function() { bgneal@312: ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); bgneal@312: }); bgneal@312: bgneal@312: // Register buttons bgneal@312: ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); bgneal@312: bgneal@312: if (ed.getParam('nonbreaking_force_tab')) { bgneal@312: ed.onKeyDown.add(function(ed, e) { bgneal@312: if (tinymce.isIE && e.keyCode == 9) { bgneal@312: ed.execCommand('mceNonBreaking'); bgneal@312: ed.execCommand('mceNonBreaking'); bgneal@312: ed.execCommand('mceNonBreaking'); bgneal@312: tinymce.dom.Event.cancel(e); bgneal@312: } bgneal@312: }); bgneal@312: } bgneal@312: }, bgneal@312: bgneal@312: getInfo : function() { bgneal@312: return { bgneal@312: longname : 'Nonbreaking space', bgneal@312: author : 'Moxiecode Systems AB', bgneal@312: authorurl : 'http://tinymce.moxiecode.com', bgneal@312: infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', bgneal@312: version : tinymce.majorVersion + "." + tinymce.minorVersion bgneal@312: }; bgneal@312: } bgneal@312: bgneal@312: // Private methods bgneal@312: }); bgneal@312: bgneal@312: // Register plugin bgneal@312: tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); bgneal@312: })();