Ticket #3557: 3557.patch

File 3557.patch, 3.0 KB (added by Martin Kou, 16 years ago)
  • _source/lang/en.js

     
    9292                advancedTab             : 'Advanced',
    9393                validateNumberFailed    : 'This value is not a number.',
    9494                confirmNewPage  : 'Any unsaved changes to this content will be lost. Are you sure you want to load new page?',
    95                 confirmCancel   : 'Some of the options have been changed. Are you sure to close the dialog?'
     95                confirmCancel   : 'Some of the options have been changed. Are you sure to close the dialog?',
     96                unavailable             : 'Unavailable'
    9697        },
    9798
    9899        // Special char dialog.
  • _source/plugins/menu/plugin.js

     
    276276                                state == CKEDITOR.TRISTATE_DISABLED ? 'disabled' :
    277277                                'off' );
    278278
     279                        var suffix = ( state == CKEDITOR.TRISTATE_DISABLED ? ', ' + this.editor.lang.common.unavailable : '' );
     280                        var label = this.label + suffix;
     281
    279282                        if ( this.className )
    280283                                classes += ' ' + this.className;
    281284
    282285                        output.push(
    283286                                '<span class="cke_menuitem">' +
    284287                                '<a id="', id, '"' +
    285                                         ' class="', classes, '" href="javascript:void(\'', ( this.label || '' ).replace( "'", '' ), '\')"' +
    286                                         ' title="', this.label, '"' +
     288                                        ' class="', classes, '" href="javascript:void(\'', ( label || '' ).replace( "'", '' ), '\')"' +
     289                                        ' title="', label + suffix , '"' +
    287290                                        ' tabindex="-1"' +
    288291                                        '_cke_focus=1' +
    289292                                        ' hidefocus="true"' );
     
    325328                        }
    326329
    327330                        output.push(
    328                                                         this.label,
     331                                                        this.label + '<span style="position:absolute;top:-1000000px">' + suffix + '</span>',
    329332                                                '</span>' +
    330333                                '</a>' +
    331334                                '</span>' );
  • _source/plugins/button/plugin.js

     
    7070                var env = CKEDITOR.env;
    7171
    7272                var id = this._.id = 'cke_' + CKEDITOR.tools.getNextNumber();
     73                this._.editor = editor;
    7374
    7475                var instance =
    7576                {
     
    183184                if ( this._.state == state )
    184185                        return;
    185186
    186                 CKEDITOR.document.getById( this._.id ).setState( state );
     187                var element = CKEDITOR.document.getById( this._.id );
     188                element.setState( state );
    187189
     190                var title = element.getAttribute( 'title' ),
     191                        suffix = ', ' + this._.editor.lang.common.unavailable,
     192                        index = title.search( suffix ),
     193                        labelElement = element.getChild( 1 );
     194
     195                if ( state == CKEDITOR.TRISTATE_DISABLED )
     196                {
     197                        if ( index != title.length - suffix.length )
     198                                title = title + suffix;
     199                }
     200                else
     201                {
     202                        if ( index > -1 && index == title.length - suffix.length )
     203                                title = title.substr( 0, index );
     204                }
     205
     206                element.setAttribute( 'title', title );
     207                labelElement.setText( title );
     208
    188209                this._.state = state;
    189210        }
    190211};
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy