Ticket #3417: 3417_4.patch
File 3417_4.patch, 2.9 KB (added by , 14 years ago) |
---|
-
_source/plugins/screenreader/plugin.js
1 /* 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 */ 5 6 /** 7 * @fileOverview Interface to announce voice messages to screenreaders for ARIA- 8 * compliant browsers. 9 */ 10 11 CKEDITOR.plugins.add( 'screenreader', 12 { 13 init : function( editor ) 14 { 15 editor.on( 'themeSpace', function( evt ) 16 { 17 if ( evt.data.space != 'top' ) 18 return; 19 20 evt.data.html += '<ul style="position:absolute;left:-10000px;list-style-type:none;"' + 21 ' role="log" aria-live="rude" aria-relevant="additions" aria-atomic="false"' + 22 ' id="cke_screenreader_' + editor.name + '"></ul>'; 23 } ); 24 } 25 } ); 26 27 CKEDITOR.editor.prototype.announce = function( text ) 28 { 29 var item = CKEDITOR.dom.element.createFromHtml( '<li>' + CKEDITOR.tools.htmlEncode( text ) + '</li>' ); 30 CKEDITOR.document.getById( 'cke_screenreader_' + this.name ).append( item ); 31 }; -
_source/plugins/button/plugin.js
130 130 ' class="', classes, '" href="javascript:void(\'', ( this.title || '' ).replace( "'", '' ), '\')"' + 131 131 ' title="', this.title, '"' + 132 132 ' tabindex="-1"' + 133 ' role="button"' + 133 134 ' hidefocus="true"' ); 134 135 135 136 // Some browsers don't cancel key events in the keydown but in the -
_source/plugins/toolbar/plugin.js
10 10 11 11 (function() 12 12 { 13 var toolbox = function( )13 var toolbox = function( editor ) 14 14 { 15 this.editor = editor; 15 16 this.toolbars = []; 16 17 this.focusCommandExecuted = false; 17 18 }; … … 24 25 { 25 26 if ( item.focus ) 26 27 { 28 // If Firefox, announce the item's text separately. (#3417) 29 if ( CKEDITOR.env.gecko ) 30 this.editor.announce( item.button.label ); 31 27 32 item.focus(); 28 33 return; 29 34 } … … 55 60 56 61 CKEDITOR.plugins.add( 'toolbar', 57 62 { 63 requires : [ 'screenreader' ], 64 58 65 init : function( editor ) 59 66 { 60 67 var itemKeystroke = function( item, keystroke ) … … 110 117 { 111 118 if ( event.data.space == editor.config.toolbarLocation ) 112 119 { 113 editor.toolbox = new toolbox( );120 editor.toolbox = new toolbox( editor ); 114 121 115 122 var output = [ '<div class="cke_toolbox"' ], 116 123 expanded = editor.config.toolbarStartupExpanded,