Skip to content
Permalink
Browse files

Merge branch 't/12097'

  • Loading branch information...
Reinmar committed Sep 5, 2014
2 parents b46bd06 + 7cc0c18 commit f7198e086b3d2ac66442296f3c0398ea3b49544f
Showing with 12 additions and 5 deletions.
  1. +1 −0 CHANGES.md
  2. +11 −5 plugins/colorbutton/plugin.js
@@ -19,6 +19,7 @@ Fixed Issues:
* [#12261](http://dev.ckeditor.com/ticket/12261): Fixed: Filter has to be destroyed and removed from [`CKEDITOR.filter.instances`](http://docs.ckeditor.com/#!/api/CKEDITOR.filter-static-property-instances) on editor destroy.
* [#12163](http://dev.ckeditor.com/ticket/12163): Fixed: Maximize plugin should abort its initialization if the [Shared Spaces plugin](http://ckeditor.com/addon/sharedspace) is initialized.
* [#12398](http://dev.ckeditor.com/ticket/12398): Fixed: Maximize does not work on instance without a [title](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-title).
* [#12097](http://dev.ckeditor.com/ticket/12097): Fixed: JAWS not reading number of list options correctly in colors list box.

## CKEditor 4.4.4

@@ -101,7 +101,13 @@ CKEDITOR.plugins.add( 'colorbutton', {

function renderColors( panel, type, colorBoxId ) {
var output = [],
colors = config.colorButton_colors.split( ',' );
colors = config.colorButton_colors.split( ',' ),
// Tells if we should include "More Colors..." button.
moreColorsEnabled = editor.plugins.colordialog &&
( config.colorButton_enableMore === undefined || config.colorButton_enableMore ),
// aria-setsize and aria-posinset attributes are used to indicate size of options, because
// screen readers doesn't play nice with table, based layouts (#12097).
total = colors.length + ( moreColorsEnabled ? 2 : 1 );

var clickFn = CKEDITOR.tools.addFunction( function( color, type ) {
if ( color == '?' ) {
@@ -155,7 +161,7 @@ CKEDITOR.plugins.add( 'colorbutton', {
' title="', lang.auto, '"' +
' onclick="CKEDITOR.tools.callFunction(', clickFn, ',null,\'', type, '\');return false;"' +
' href="javascript:void(\'', lang.auto, '\')"' +
' role="option">' +
' role="option" aria-posinset="1" aria-setsize="', total, '">' +
'<table role="presentation" cellspacing=0 cellpadding=0 width="100%">' +
'<tr>' +
'<td>' +
@@ -188,21 +194,21 @@ CKEDITOR.plugins.add( 'colorbutton', {
' title="', colorLabel, '"' +
' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'', colorName, '\',\'', type, '\'); return false;"' +
' href="javascript:void(\'', colorLabel, '\')"' +
' role="option">' +
' role="option" aria-posinset="', ( i + 2 ), '" aria-setsize="', total, '">' +
'<span class="cke_colorbox" style="background-color:#', colorCode, '"></span>' +
'</a>' +
'</td>' );
}

// Render the "More Colors" button.
if ( editor.plugins.colordialog && config.colorButton_enableMore === undefined || config.colorButton_enableMore ) {
if ( moreColorsEnabled ) {
output.push( '</tr>' +
'<tr>' +
'<td colspan=8 align=center>' +
'<a class="cke_colormore" _cke_focus=1 hidefocus=true' +
' title="', lang.more, '"' +
' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'?\',\'', type, '\');return false;"' +
' href="javascript:void(\'', lang.more, '\')"', ' role="option">', lang.more, '</a>' +
' href="javascript:void(\'', lang.more, '\')"', ' role="option" aria-posinset="', total, '" aria-setsize="', total, '">', lang.more, '</a>' +
'</td>' ); // tr is later in the code.
}

0 comments on commit f7198e0

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.