Ticket #3041: 3041.patch

File 3041.patch, 1.7 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/colorbutton/plugin.js

     
    6868                        var output = [],
    6969                                colors = CKEDITOR.config.colorButton_colors.split( ',' );
    7070
    71                         if ( !clickFn )
    72                         {
    73                                 clickFn = CKEDITOR.tools.addFunction( function( color, type )
     71                        clickFn = CKEDITOR.tools.addFunction( function( color, type )
     72                                {
     73                                        if ( color == '?' )
    7474                                        {
    75                                                 if ( color == '?' )
    76                                                 {
    77                                                         // TODO : Implement the colors dialog.
    78                                                         // editor.openDialog( '' );
    79                                                         return;
    80                                                 }
     75                                                // TODO : Implement the colors dialog.
     76                                                // editor.openDialog( '' );
     77                                                return;
     78                                        }
    8179
    82                                                 editor.focus();
     80                                        editor.focus();
    8381
    84                                                 if ( saveRanges )
    85                                                 {
    86                                                         editor.getSelection().selectRanges( saveRanges );
    87                                                         saveRanges = false;
    88                                                 }
     82                                        if ( saveRanges )
     83                                        {
     84                                                editor.getSelection().selectRanges( saveRanges );
     85                                                saveRanges = false;
     86                                        }
    8987
    90                                                 panel.hide();
     88                                        panel.hide();
    9189
    92                                                 var style = new CKEDITOR.style( config['colorButton_' + type + 'Style'], { color : color || '#000' } );
     90                                        var style = new CKEDITOR.style( config['colorButton_' + type + 'Style'], { color : color || '#000' } );
    9391
    94                                                 if ( color )
    95                                                         style.apply( editor.document );
    96                                                 else
    97                                                         style.remove( editor.document );
    98                                         });
    99                         }
     92                                        if ( color )
     93                                                style.apply( editor.document );
     94                                        else
     95                                                style.remove( editor.document );
     96                                });
    10097
    10198                        // Render the "Automatic" button.
    10299                        output.push(
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy