Вход Регистрация
Файл: mailist/wys/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js
Строк: 132
<?php
/**
 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
 *
 * @author Moxiecode
 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
 */

/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('nonbreaking');

var 
TinyMCE_NonBreakingPlugin = {
    
getInfo : function() {
        return {
            
longname 'Nonbreaking space',
            
author 'Moxiecode Systems AB',
            
authorurl 'http://tinymce.moxiecode.com',
            
infourl 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
            
version tinyMCE.majorVersion "." tinyMCE.minorVersion
        
};
    },

    
getControlHTML : function(cn) {
        switch (
cn) {
            case 
"nonbreaking":
                return 
tinyMCE.getButtonHTML(cn'lang_nonbreaking_desc''{$pluginurl}/images/nonbreaking.gif''mceNonBreaking'false);
        }

        return 
"";
    },


    
execCommand : function(editor_idelementcommanduser_interfacevalue) {
        var 
inst tinyMCE.getInstanceById(editor_id), h;

        switch (
command) {
            case 
"mceNonBreaking":
                
= (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">&middot;</span>' '&nbsp;';
                
tinyMCE.execInstanceCommand(editor_id'mceInsertContent'falseh);
                return 
true;
        }

        return 
false;
    },

    
handleEvent : function(e) {
        var 
insth;

        if (!
tinyMCE.isOpera && e.type == 'keydown' && e.keyCode == && tinyMCE.getParam('nonbreaking_force_tab'false)) {
            
inst tinyMCE.selectedInstance;

            
= (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">&middot;&middot;&middot;</span>' '&nbsp;&nbsp;&nbsp;';
            
tinyMCE.execInstanceCommand(inst.editorId'mceInsertContent'falseh);

            
tinyMCE.cancelEvent(e);
            return 
false;
        }

        return 
true;
    }
};

tinyMCE.addPlugin("nonbreaking"TinyMCE_NonBreakingPlugin);
?>
Онлайн: 0
Реклама