2
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
5
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
8
/* Import plugin specific language pack */
9
tinyMCE.importPluginLanguagePack('nonbreaking');
11
var TinyMCE_NonBreakingPlugin = {
12
getInfo : function() {
14
longname : 'Nonbreaking space',
15
author : 'Moxiecode Systems AB',
16
authorurl : 'http://tinymce.moxiecode.com',
17
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
18
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
22
getControlHTML : function(cn) {
25
return tinyMCE.getButtonHTML(cn, 'lang_nonbreaking_desc', '{$pluginurl}/images/nonbreaking.gif', 'mceNonBreaking', false);
32
execCommand : function(editor_id, element, command, user_interface, value) {
33
var inst = tinyMCE.getInstanceById(editor_id), h;
36
case "mceNonBreaking":
37
h = (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">·</span>' : ' ';
38
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, h);
45
handleEvent : function(e) {
48
if (!tinyMCE.isOpera && e.type == 'keydown' && e.keyCode == 9 && tinyMCE.getParam('nonbreaking_force_tab', false)) {
49
inst = tinyMCE.selectedInstance;
51
h = (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">···</span>' : ' ';
52
tinyMCE.execInstanceCommand(inst.editorId, 'mceInsertContent', false, h);
54
tinyMCE.cancelEvent(e);
62
tinyMCE.addPlugin("nonbreaking", TinyMCE_NonBreakingPlugin);