X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fcolorbutton%2Fplugin.js;h=c87d068c38d8ee74cb33d39b68b43c42caf244a7;hp=f35ed2cc068fd0cd4623c7b037fa9ede3e49795a;hb=059b4c2fef02528bf1af189f7996e80652faddfb;hpb=c6e377a02b54abc07129d72b632763c727476a15 diff --git a/_source/plugins/colorbutton/plugin.js b/_source/plugins/colorbutton/plugin.js index f35ed2c..c87d068 100644 --- a/_source/plugins/colorbutton/plugin.js +++ b/_source/plugins/colorbutton/plugin.js @@ -31,20 +31,22 @@ CKEDITOR.plugins.add( 'colorbutton', panel : { - css : editor.skin.editor.css + css : editor.skin.editor.css, + attributes : { role : 'listbox', 'aria-label' : lang.panelTitle } }, - onBlock : function( panel, blockName ) + onBlock : function( panel, block ) { - var block = panel.addBlock( blockName ); block.autoSize = true; block.element.addClass( 'cke_colorblock' ); block.element.setHtml( renderColors( panel, type ) ); var keys = block.keys; keys[ 39 ] = 'next'; // ARROW-RIGHT + keys[ 40 ] = 'next'; // ARROW-DOWN keys[ 9 ] = 'next'; // TAB keys[ 37 ] = 'prev'; // ARROW-LEFT + keys[ 38 ] = 'prev'; // ARROW-UP keys[ CKEDITOR.SHIFT + 9 ] = 'prev'; // SHIFT + TAB keys[ 32 ] = 'click'; // SPACE } @@ -55,7 +57,8 @@ CKEDITOR.plugins.add( 'colorbutton', function renderColors( panel, type ) { var output = [], - colors = config.colorButton_colors.split( ',' ); + colors = config.colorButton_colors.split( ',' ), + total = colors.length + ( config.colorButton_enableMore ? 2 : 1 ); var clickFn = CKEDITOR.tools.addFunction( function( color, type ) { @@ -98,8 +101,9 @@ CKEDITOR.plugins.add( 'colorbutton', '' + - '' + + ' href="javascript:void(\'', lang.auto, '\')"' + + ' role="option" aria-posinset="1" aria-setsize="', total, '">' + + '
' + '' + '' + '
' + '' + @@ -110,7 +114,7 @@ CKEDITOR.plugins.add( 'colorbutton', '
' + '
' + - '' ); + '
' ); // Render the color boxes. for ( var i = 0 ; i < colors.length ; i++ ) @@ -125,7 +129,8 @@ CKEDITOR.plugins.add( 'colorbutton', '' + + ' href="javascript:void(\'', colorLabel, '\')"' + + ' role="option" aria-posinset="', ( i + 2 ), '" aria-setsize="', total, '">' + '' + '' + '' ); @@ -141,7 +146,8 @@ CKEDITOR.plugins.add( 'colorbutton', '', + ' href="javascript:void(\'', lang.more, '\')"', + ' role="option" aria-posinset="', total, '" aria-setsize="', total, '">', lang.more, '' + '' ); // It is later in the code.