Ticket #3073: 3073_2.patch

File 3073_2.patch, 5.0 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/richcombo/plugin.js

     
    8282                render : function( editor, output )
    8383                {
    8484                        var id = 'cke_' + this.id;
    85 
    8685                        var clickFn = CKEDITOR.tools.addFunction( function( $element )
    8786                                {
    8887                                        var _ = this._;
     
    110109                                        _.panel.showBlock( this.id, new CKEDITOR.dom.element( $element ).getFirst(), 4 );
    111110                                },
    112111                                this );
     112                               
     113                        var instance = {
     114                                id : id,
     115                                combo : this,
     116                                focus : function()
     117                                {
     118                                        var element = CKEDITOR.document.getById( id ).getChild( 1 );
     119                                        element.focus();
     120                                },
     121                                execute : clickFn
     122                        };
     123                       
     124                        var keyDownFn = CKEDITOR.tools.addFunction( function( ev, element ){
     125                               
     126                                ev = new CKEDITOR.dom.event( ev );
     127                                var keystroke = ev.getKeystroke();
     128                                switch ( keystroke )
     129                                {
     130                                        case 13 :                                       // ENTER
     131                                        case 32 :                                       // SPACE
     132                                                // Show panel 
     133                                                CKEDITOR.tools.callFunction( clickFn, element );
     134                                                break;
     135                                        default :
     136                                                // Delegate the default behavior to toolbar button key handling.
     137                                                instance.onkey( instance,  keystroke );
     138                                }
     139                               
     140                                // Avoid subsequent focus grab on editor document.
     141                                ev.preventDefault();
     142                        });
    113143                       
    114144                        output.push(
    115145                                '<span id=', id, ' class="cke_rcombo' );
     
    118148                                output.push( ' ', this.className);
    119149
    120150                        output.push(
    121                                  '">' +
     151                                '">' +
    122152                                        '<span class=cke_label>', this.label, '</span>' +
    123153                                        '<a hidefocus=true title="', this.title, '" tabindex="-1" href="javascript:void(\'', this.label, '\')"' );
    124154
     
    140170                        }
    141171
    142172                        output.push(
    143 //                                      ' onkeydown="return CKEDITOR.ui.button._.keydown(', id, ', event);"' +
     173                                        ' onkeydown="CKEDITOR.tools.callFunction( ', keyDownFn, ', event, this );"' +
    144174                                        ' onmousedown="CKEDITOR.tools.callFunction(', clickFn, ', this);">' +
    145175                                                '<span id="', id, '_text" class=cke_text>&nbsp;</span>' +
    146176                                                '<span class=cke_openbutton></span>' +
     
    149179
    150180                        if ( this.onRender )
    151181                                this.onRender();
    152 
    153                         return {
    154                                 id : id,
    155                                 combo : this,
    156                                 focus : function()
    157                                 {
    158                                         var element = CKEDITOR.document.getById( id ).getChild( 1 );
    159                                         element.focus();
    160                                 },
    161                                 execute : clickFn
    162                         };
     182                               
     183                        return instance;
    163184                },
    164185
    165186                createPanel : function()
  • _source/plugins/colorbutton/plugin.js

     
    1515                var saveRanges,
    1616                        clickFn;
    1717
    18                 addButton( 'TextColor', 'fore' );
    19                 addButton( 'BGColor', 'back' );
     18                addButton( 'TextColor', 'fore', lang.textColorTitle );
     19                addButton( 'BGColor', 'back', lang.bgColorTitle );
    2020
    21                 function addButton( name, type )
     21                function addButton( name, type, title )
    2222                {
    2323                        editor.ui.add( name, CKEDITOR.UI_PANELBUTTON,
    2424                                {
     
    2323                        editor.ui.add( name, CKEDITOR.UI_PANELBUTTON,
    2424                                {
    2525                                        label : lang.label,
    26                                         title : lang.panelTitle,
     26                                        title : title,
    2727                                        className : 'cke_button_' + name.toLowerCase(),
    2828
    2929                                        panel :
  • _source/plugins/panelbutton/plugin.js

     
    9090                                        _.panel.showBlock( this._.id, new CKEDITOR.dom.element( $element ), 4 );
    9191                                },
    9292                                this );
     93                        var keyDownFn = CKEDITOR.tools.addFunction( function( ev, element ){
     94                               
     95                                ev = new CKEDITOR.dom.event( ev );
     96                                var keystroke = ev.getKeystroke();
     97                                switch ( keystroke )
     98                                {
     99                                        case 13 :                                       // ENTER
     100                                        case 32 :                                       // SPACE
     101                                                // Show panel 
     102                                                CKEDITOR.tools.callFunction( clickFn, element );
     103                                                break;
     104                                        default :
     105                                                // Delegate the default behavior to toolbar button key handling.
     106                                                instance.onkey( instance,  keystroke );
     107                                }
     108                                // Avoid subsequent focus grab on editor document.
     109                                ev.preventDefault();
     110                        });
    93111
    94112                        var label = this.label || '';
    95113
     
    126144                        }
    127145
    128146                        output.push(
    129 //                                      ' onkeydown="return CKEDITOR.ui.button._.keydown(', index, ', event);"' +
     147                                        ' onkeydown="CKEDITOR.tools.callFunction( ', keyDownFn, ', event, this );"' +
    130148                                        ' onclick="CKEDITOR.tools.callFunction(', clickFn, ', this);">' +
    131149                                                '<span class="cke_icon"></span>' +
    132150                                                '<span class="cke_label">', label, '</span>' +
  • _source/lang/en.js

     
    535535
    536536        colorButton :
    537537        {
     538                textColorTitle : 'Text Color',
     539                bgColorTitle : 'Background Color',
    538540                auto : 'Automatic',
    539541                more : 'More Colors...'
    540542        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy