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