annotate static/js/tiny_mce/plugins/nonbreaking/editor_plugin_src.js @ 738:df2799f725d8

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