Ticket #5150: 5150_1.patch

File 5150_1.patch, 3.0 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Revised patch

  • _source/plugins/colorbutton/plugin.js

     
    118118                                if ( ( i % 8 ) === 0 )
    119119                                        output.push( '</tr><tr>' );
    120120
    121                                 var colorCode = colors[ i ];
     121                                var parts = colors[ i ].split( '/' ),
     122                                        colorName = parts[ 0 ],
     123                                        colorCode = parts[ 1 ] || colorName;
     124
    122125                                var colorLabel = editor.lang.colors[ colorCode ] || colorCode;
    123126                                output.push(
    124127                                        '<td>' +
    125128                                                '<a class="cke_colorbox" _cke_focus=1 hidefocus=true' +
    126129                                                        ' title="', colorLabel, '"' +
    127                                                         ' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'#', colorCode, '\',\'', type, '\'); return false;"' +
     130                                                        ' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'', colorName, '\',\'', type, '\'); return false;"' +
    128131                                                        ' href="javascript:void(\'', colorLabel, '\')">' +
    129132                                                        '<span class="cke_colorbox" style="background-color:#', colorCode, '"></span>' +
    130133                                                '</a>' +
     
    166169/**
    167170 * Defines the colors to be displayed in the color selectors. It's a string
    168171 * containing the hexadecimal notation for HTML colors, without the "#" prefix.
     172 *
     173 * Since 3.3: A name may be optionally defined by prefixing the entries with the
     174 * name and the slash character. For example, "FontColor1/FF9900" will be
     175 * displayed as the color #FF9900 in the selector, but will be outputted as "FontColor1".
    169176 * @type String
    170177 * @default '000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF'
    171178 * @example
    172179 * // Brazil colors only.
    173180 * config.colorButton_colors = '00923E,F8C100,28166F';
     181 * @example
     182 * config.colorButton_colors = 'FontColor1/FF9900,FontColor2/0066CC,FontColor3/F00'
    174183 */
    175184CKEDITOR.config.colorButton_colors =
    176185        '000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,' +
     
    187196 * config.colorButton_foreStyle =
    188197 *     {
    189198 *         element : 'span',
    190  *         styles : { 'color' : '#(color)' }
     199 *         styles : { 'color' : '##(color)' }
    191200 *     };
    192201 */
    193202CKEDITOR.config.colorButton_foreStyle =
    194203        {
    195204                element         : 'span',
    196                 styles          : { 'color' : '#(color)' },
     205                styles          : { 'color' : '##(color)' },
    197206                overrides       : [ { element : 'font', attributes : { 'color' : null } } ],
    198207
    199208                // Fore color style must be applied inside links instead of around it.
     
    211220 * config.colorButton_backStyle =
    212221 *     {
    213222 *         element : 'span',
    214  *         styles : { 'background-color' : '#(color)' }
     223 *         styles : { 'background-color' : '##(color)' }
    215224 *     };
    216225 */
    217226CKEDITOR.config.colorButton_backStyle =
    218227        {
    219228                element         : 'span',
    220                 styles          : { 'background-color' : '#(color)' }
     229                styles          : { 'background-color' : '##(color)' }
    221230        };
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy