applied my changes - initial import
[boxroom-stian.git] / public / javascripts / tiny_mce / plugins / nonbreaking / editor_plugin_src.js
blob72da2cc9382deaf8ed66e3ef894c1afda35ce6f3
1 /**
2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
6 */
8 /* Import plugin specific language pack */
9 tinyMCE.importPluginLanguagePack('nonbreaking');
11 var TinyMCE_NonBreakingPlugin = {
12 getInfo : function() {
13 return {
14 longname : 'Nonbreaking space',
15 author : 'Moxiecode Systems AB',
16 authorurl : 'http://tinymce.moxiecode.com',
17 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_nonbreaking.html',
18 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
22 getControlHTML : function(cn) {
23 switch (cn) {
24 case "nonbreaking":
25 return tinyMCE.getButtonHTML(cn, 'lang_nonbreaking_desc', '{$pluginurl}/images/nonbreaking.gif', 'mceNonBreaking', false);
28 return "";
32 execCommand : function(editor_id, element, command, user_interface, value) {
33 var inst = tinyMCE.getInstanceById(editor_id), h;
35 switch (command) {
36 case "mceNonBreaking":
37 h = (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">&middot;</span>' : '&nbsp;';
38 tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, h);
39 return true;
42 return false;
45 handleEvent : function(e) {
46 var inst, h;
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">&middot;&middot;&middot;</span>' : '&nbsp;&nbsp;&nbsp;';
52 tinyMCE.execInstanceCommand(inst.editorId, 'mceInsertContent', false, h);
54 tinyMCE.cancelEvent(e);
55 return false;
58 return true;
62 tinyMCE.addPlugin("nonbreaking", TinyMCE_NonBreakingPlugin);