Ticket #5150: 5150_2.patch

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

Revised patch

  • _source/plugins/colorbutton/plugin.js

     
    122122                                if ( ( i % 8 ) === 0 )
    123123                                        output.push( '</tr><tr>' );
    124124
    125                                 var colorCode = colors[ i ];
     125                                var parts = colors[ i ].split( '/' ),
     126                                        colorName = parts[ 0 ],
     127                                        colorCode = parts[ 1 ] || colorName;
     128                                if (!parts[1])
     129                                        colorName = '#' + colorName;
     130
    126131                                var colorLabel = editor.lang.colors[ colorCode ] || colorCode;
    127132                                output.push(
    128133                                        '<td>' +
    129134                                                '<a class="cke_colorbox" _cke_focus=1 hidefocus=true' +
    130135                                                        ' title="', colorLabel, '"' +
    131                                                         ' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'#', colorCode, '\',\'', type, '\'); return false;"' +
     136                                                        ' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'', colorName, '\',\'', type, '\'); return false;"' +
    132137                                                        ' href="javascript:void(\'', colorLabel, '\')"' +
    133138                                                        ' role="option" aria-posinset="', ( i + 2 ), '" aria-setsize="', total, '">' +
    134139                                                        '<span class="cke_colorbox" style="background-color:#', colorCode, '"></span>' +
     
    172177/**
    173178 * Defines the colors to be displayed in the color selectors. It's a string
    174179 * containing the hexadecimal notation for HTML colors, without the "#" prefix.
     180 *
     181 * Since 3.3: A name may be optionally defined by prefixing the entries with the
     182 * name and the slash character. For example, "FontColor1/FF9900" will be
     183 * displayed as the color #FF9900 in the selector, but will be outputted as "FontColor1".
    175184 * @type String
    176185 * @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'
    177186 * @example
    178187 * // Brazil colors only.
    179188 * config.colorButton_colors = '00923E,F8C100,28166F';
     189 * @example
     190 * config.colorButton_colors = 'FontColor1/FF9900,FontColor2/0066CC,FontColor3/F00'
    180191 */
    181192CKEDITOR.config.colorButton_colors =
    182193        '000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,' +
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy