From cb28669a94d383c50715d61c3debe835ff54b373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?"J.=20Rene=CC=81e=20Beach"?= Date: Sun, 3 Mar 2013 15:19:14 -0500 Subject: [PATCH] rerolled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: J. ReneĢe Beach --- core/modules/ckeditor/ckeditor.admin.inc | 4 ---- core/modules/ckeditor/js/ckeditor.admin.js | 16 +++++----------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/core/modules/ckeditor/ckeditor.admin.inc b/core/modules/ckeditor/ckeditor.admin.inc index 0dff9f5..595eb45 100644 --- a/core/modules/ckeditor/ckeditor.admin.inc +++ b/core/modules/ckeditor/ckeditor.admin.inc @@ -116,10 +116,6 @@ function theme_ckeditor_settings_toolbar($variables) { $output .= '' . t('Toolbar configuration') . ''; $output .= '
'; - // aria-live region for outputing aural information about the state of the - // configuration. - $output .= '
'; - $output .= '
' . t('Move a button into the Active toolbar to enable it, or into the list of Available buttons to disable it. Use dividers to create button groups. Buttons may be moved with the mouse or keyboard arrow keys.') . '
'; $output .= '
'; diff --git a/core/modules/ckeditor/js/ckeditor.admin.js b/core/modules/ckeditor/js/ckeditor.admin.js index 7abf327..ad1c8b4 100644 --- a/core/modules/ckeditor/js/ckeditor.admin.js +++ b/core/modules/ckeditor/js/ckeditor.admin.js @@ -4,9 +4,6 @@ Drupal.ckeditor = Drupal.ckeditor || {}; -// Aria-live element for speaking application state. -var $messages; - Drupal.behaviors.ckeditorAdmin = { attach: function (context) { var $context = $(context); @@ -58,7 +55,7 @@ Drupal.behaviors.ckeditorAdmin = { $destinationRow.append($button); } // Post the update to the aria-live message element. - $messages.text(Drupal.t('moved to @row, position @position of @totalPositions', { + Drupal.announce(Drupal.t('moved to @row, position @position of @totalPositions', { '@row': getRowInfo($destinationRow), '@position': (destinationPosition + 1), '@totalPositions': $destinationRow.children().length @@ -111,7 +108,7 @@ Drupal.behaviors.ckeditorAdmin = { message = Drupal.t('The @name button is currently disabled.', { '@name': $link.attr('aria-label') }) + "\n\n" + Drupal.t('Drag the button or use the up arrow key to move this button into the active toolbar.'); } } - $messages.text(message); + Drupal.announce(message); $link.focus(); event.preventDefault(); } @@ -128,7 +125,7 @@ Drupal.behaviors.ckeditorAdmin = { $this.siblings('a').show(); redrawToolbarGradient(); // Post the update to the aria-live message element. - $messages.text(Drupal.t('row number @count added.', {'@count': ($rows.length + 1)})); + Drupal.announce(Drupal.t('row number @count added.', {'@count': ($rows.length + 1)})); event.preventDefault(); } @@ -150,7 +147,7 @@ Drupal.behaviors.ckeditorAdmin = { redrawToolbarGradient(); } // Post the update to the aria-live message element. - $messages.text(Drupal.t('row removed. @count row@plural remaining.', {'@count': ($rows.length - 1), '@plural': ((($rows.length - 1) === 1 ) ? '' : 's')})); + Drupal.announce(Drupal.t('row removed. @count row@plural remaining.', {'@count': ($rows.length - 1), '@plural': ((($rows.length - 1) === 1 ) ? '' : 's')})); event.preventDefault(); } @@ -240,9 +237,6 @@ Drupal.behaviors.ckeditorAdmin = { // Add aural UI focus updates when for individual toolbars. $toolbarAdmin.on('focus.ckeditor', '.ckeditor-buttons', grantRowFocus); - // Identify the aria-live element for interaction updates for screen - // readers. - $messages = $('#ckeditor-button-configuration-aria-live'); } } }; @@ -289,7 +283,7 @@ function grantRowFocus (event) { if (!$row.hasClass('focused')) { // Indicate that the current row has focus. $row.addClass('focused'); - $messages.text(Drupal.t('@row', {'@row': getRowInfo($row)})); + Drupal.announce(Drupal.t('@row', {'@row': getRowInfo($row)})); } } -- 1.7.10.4