Ticket #3104: 3104.patch

File 3104.patch, 3.0 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/sourcearea/plugin.js

     
    7474                                                        // Set the <textarea> value.
    7575                                                        this.loadData( data );
    7676
     77                                                        // Adds handlers for tab and shift-tab.
     78                                                        textarea.on( 'keydown', function( evt )
     79                                                                {
     80                                                                        if ( evt.data.$.keyCode != 9 )
     81                                                                                return;
     82
     83                                                                        if ( evt.data.$.metaKey || evt.data.$.ctrlKey || evt.data.$.altKey )
     84                                                                                return;
     85
     86                                                                        if ( evt.data.$.shiftKey )
     87                                                                        {
     88                                                                                if ( !editor.config.shiftTabFocus )
     89                                                                                        return;
     90
     91                                                                                CKEDITOR.document.getById( editor.config.shiftTabFocus ).focus();
     92                                                                        }
     93                                                                        else
     94                                                                        {
     95                                                                                if ( !editor.config.tabFocus )
     96                                                                                        return;
     97
     98                                                                                CKEDITOR.document.getById( editor.config.tabFocus ).focus();
     99                                                                        }
     100
     101                                                                        evt.data.preventDefault();
     102                                                                } );
     103
    77104                                                        editor.mode = 'source';
    78105                                                        editor.fire( 'mode' );
    79106                                                },
  • _source/plugins/wysiwygarea/plugin.js

     
    259259
    260260                                                isLoadingData = false;
    261261
     262                                                // Adds handlers for tab and shift-tab.
     263                                                domDocument.on( 'keydown', function( evt )
     264                                                        {
     265                                                                if ( evt.data.$.keyCode != 9 )
     266                                                                        return;
     267
     268                                                                if ( evt.data.$.metaKey || evt.data.$.ctrlKey || evt.data.$.altKey )
     269                                                                        return;
     270
     271                                                                if ( evt.data.$.shiftKey )
     272                                                                {
     273                                                                        if ( !editor.config.shiftTabFocus )
     274                                                                                return;
     275
     276                                                                        CKEDITOR.document.getById( editor.config.shiftTabFocus ).focus();
     277                                                                }
     278                                                                else
     279                                                                {
     280                                                                        if ( !editor.config.tabFocus )
     281                                                                                return;
     282
     283                                                                        CKEDITOR.document.getById( editor.config.tabFocus ).focus();
     284                                                                }
     285
     286                                                                evt.data.preventDefault();
     287                                                        } );
     288
    262289                                                if ( isPendingFocus )
    263290                                                        editor.focus();
    264291                                        };
  • _source/core/config.js

     
    185185         * @type Number
    186186         * @default 10000
    187187         * @example
    188          * config.baseFloatZIndex = 2000
     188         * config.baseFloatZIndex = 2000;
    189189         */
    190         baseFloatZIndex : 10000
     190        baseFloatZIndex : 10000,
    191191
     192        /**
     193         * The id of the element to put focus on after user pressed Tab in editing
     194         * area.
     195         * @type String
     196         * @default null
     197         * @example
     198         * config.tabFocus = "nextInput";
     199         */
     200        tabFocus : null,
     201       
     202        /**
     203         * The id of the element to put focus on after user pressed Shift-Tab in
     204         * editing area.
     205         * @type String
     206         * @default null
     207         * @example
     208         * config.tabFocus = "previousInput";
     209         */
     210        shiftTabFocus : null
    192211};
    193212
    194213// PACKAGER_RENAME( CKEDITOR.config )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy