Ticket #3951: 3951.patch

File 3951.patch, 4.1 KB (added by Tobiasz Cudnik, 14 years ago)
  • _source/plugins/image/dialogs/image.js

     
    346346                        {
    347347                                if ( dialogType != 'image' )
    348348                                        this.hidePage( 'Link' );                //Hide Link tab.
     349                                var doc = this._.element.getDocument();
     350                                this.addFocusable( doc.getById( 'btnLockSizes' ), 5 );
     351                                this.addFocusable( doc.getById( 'btnResetSize' ), 5 );
    349352                        },
    350353                        onHide : function()
    351354                        {
     
    614617                                                                                                                                }, this.getDialog() );
    615618                                                                                                                        resetButton.on( 'mouseover', function()
    616619                                                                                                                                {
    617                                                                                                                                         this.addClass( 'BtnOver' );
     620                                                                                                                                        this.addClass( 'cke_btn_over' );
    618621                                                                                                                                }, resetButton );
    619622                                                                                                                        resetButton.on( 'mouseout', function()
    620623                                                                                                                                {
    621                                                                                                                                         this.removeClass( 'BtnOver' );
     624                                                                                                                                        this.removeClass( 'cke_btn_over' );
    622625                                                                                                                                }, resetButton );
    623626                                                                                                                }
    624627                                                                                                                // Activate (Un)LockRatio button
     
    642645                                                                                                                                }, this.getDialog() );
    643646                                                                                                                        ratioButton.on( 'mouseover', function()
    644647                                                                                                                                {
    645                                                                                                                                         this.addClass( 'BtnOver' );
     648                                                                                                                                        this.addClass( 'cke_btn_over' );
    646649                                                                                                                                }, ratioButton );
    647650                                                                                                                        ratioButton.on( 'mouseout', function()
    648651                                                                                                                                {
    649                                                                                                                                         this.removeClass( 'BtnOver' );
     652                                                                                                                                        this.removeClass( 'cke_btn_over' );
    650653                                                                                                                                }, ratioButton );
    651654                                                                                                                }
    652655                                                                                                        },
    653656                                                                                                        html : '<div>'+
    654                                                                                                                 '<div title="' + editor.lang.image.lockRatio +
    655                                                                                                                 '" class="cke_btn_locked" id="btnLockSizes"></div>' +
    656                                                                                                                 '<div title="' + editor.lang.image.resetSize +
    657                                                                                                                 '" class="cke_btn_reset" id="btnResetSize"></div>'+
     657                                                                                                                '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.lockRatio +
     658                                                                                                                '" class="cke_btn_locked" id="btnLockSizes"></a>' +
     659                                                                                                                '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.resetSize +
     660                                                                                                                '" class="cke_btn_reset" id="btnResetSize"></a>'+
    658661                                                                                                                '</div>'
    659662                                                                                                }
    660663                                                                                        ]
  • _source/plugins/dialog/plugin.js

     
    988988                getSelectedElement : function()
    989989                {
    990990                        return this.getParentEditor().getSelection().getSelectedElement();
    991                 }
    992         };
     991                },
     992
     993                /**
     994                 * Adds element to dialog's focusable list.
     995                 *
     996                 * @param {CKEDITOR.dom.element} element
     997                 * @param {Number} [index]
     998                 */
     999                addFocusable: (function() {
     1000                        var dialog;
     1001                        var Focusable = function( element, index ) {
     1002                                this.element = element;
     1003                                this.focusIndex = index;
     1004                                this.isFocusable = function()
     1005                                {
     1006                                        return true;
     1007                                };
     1008                                this.focus = function()
     1009                                {
     1010                                        dialog._.currentFocusIndex = this.focusIndex;
     1011                                        this.element.focus();
     1012                                };
     1013                                // Bind events
     1014                                this.element.on( 'keydown', function( e )
     1015                                {
     1016                                        if ( e.data.getKeystroke() in { 32:1, 13:1 }  )
     1017                                                this.fire( 'click' );
     1018                                });
     1019                                this.element.on( 'focus', function()
     1020                                {
     1021                                        this.fire( 'mouseover' );
     1022                                });
     1023                                this.element.on( 'blur', function()
     1024                                {
     1025                                        this.fire( 'mouseout' );
     1026                                });
     1027                        };
     1028                        return function( element, index ) {
     1029                                // Update reference.
     1030                                if ( !dialog )
     1031                                        dialog = this;
     1032                                if ( typeof index == 'undefined' )
     1033                                {
     1034                                        index = this._.focusList.length;
     1035                                        focusList.push( new Focusable( element, index ) );
     1036                                }
     1037                                else
     1038                                {
     1039                                        this._.focusList.splice( index, 0, new Focusable( element, index ) );
     1040                                        for ( var i = index + 1 ; i < this._.focusList.length ; i++ )
     1041                                                this._.focusList[ i ].focusIndex++;
     1042                                }
     1043                        };
     1044                })()
     1045        };
    9931046
    9941047        CKEDITOR.tools.extend( CKEDITOR.dialog,
    9951048                /**
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy