Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.2.2
[ckeditor.git]
/
_source
/
plugins
/
templates
/
dialogs
/
templates.js
diff --git
a/_source/plugins/templates/dialogs/templates.js
b/_source/plugins/templates/dialogs/templates.js
index
98c8feb
..
d3d78c6
100644
(file)
--- a/
_source/plugins/templates/dialogs/templates.js
+++ b/
_source/plugins/templates/dialogs/templates.js
@@
-41,10
+41,10
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
'</a>' );
\r
\r
// Build the inner HTML of our new item DIV.
\r
'</a>' );
\r
\r
// Build the inner HTML of our new item DIV.
\r
- var html = '<table style="width:350px;" class="cke_tpl_preview"><tr>';
\r
+ var html = '<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>';
\r
\r
if ( template.image && imagesPath )
\r
\r
if ( template.image && imagesPath )
\r
- html += '<td class="cke_tpl_preview_img"><img src="' + CKEDITOR.getUrl( imagesPath + template.image ) + '"></td>';
\r
+ html += '<td class="cke_tpl_preview_img"><img src="' + CKEDITOR.getUrl( imagesPath + template.image ) + '"' + ( CKEDITOR.env.ie6Compat? ' onload="this.width=this.width"' : '' ) + ' alt="" title=""></td>';
\r
\r
html += '<td style="white-space:normal;"><span class="cke_tpl_title">' + template.title + '</span><br/>';
\r
\r
\r
html += '<td style="white-space:normal;"><span class="cke_tpl_title">' + template.title + '</span><br/>';
\r
\r
@@
-100,10
+100,10
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
function keyNavigation( evt )
\r
{
\r
var target = evt.data.getTarget(),
\r
function keyNavigation( evt )
\r
{
\r
var target = evt.data.getTarget(),
\r
- position = listContainer.getPosition( target );
\r
+ onList = listContainer.equals( target );
\r
\r
// Keyboard navigation for template list.
\r
\r
// Keyboard navigation for template list.
\r
- if ( position > CKEDITOR.POSITION_CONTAINS )
\r
+ if ( onList || listContainer.contains( target ) )
\r
{
\r
var keystroke = evt.data.getKeystroke(),
\r
items = listContainer.getElementsByTag( 'a' ),
\r
{
\r
var keystroke = evt.data.getKeystroke(),
\r
items = listContainer.getElementsByTag( 'a' ),
\r
@@
-111,19
+111,25
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
if ( items )
\r
{
\r
\r
if ( items )
\r
{
\r
- switch ( keystroke )
\r
+ // Focus not yet onto list items?
\r
+ if ( onList )
\r
+ focusItem = items.getItem( 0 );
\r
+ else
\r
{
\r
{
\r
- case 40 : // ARROW-DOWN
\r
- focusItem = target.getNext();
\r
- break;
\r
+ switch ( keystroke )
\r
+ {
\r
+ case 40 : // ARROW-DOWN
\r
+ focusItem = target.getNext();
\r
+ break;
\r
\r
\r
- case 38 : // ARROW-UP
\r
- focusItem = target.getPrevious();
\r
- break;
\r
+ case 38 : // ARROW-UP
\r
+ focusItem = target.getPrevious();
\r
+ break;
\r
\r
\r
- case 13 : // ENTER
\r
- case 32 : // SPACE
\r
- target.fire( 'click' );
\r
+ case 13 : // ENTER
\r
+ case 32 : // SPACE
\r
+ target.fire( 'click' );
\r
+ }
\r
}
\r
\r
if ( focusItem )
\r
}
\r
\r
if ( focusItem )
\r
@@
-140,6
+146,7
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
var listContainer;
\r
\r
\r
var listContainer;
\r
\r
+ var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber();
\r
return {
\r
title :editor.lang.templates.title,
\r
\r
return {
\r
title :editor.lang.templates.title,
\r
\r
@@
-168,17
+175,12
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
{
\r
id : "templatesList",
\r
type : 'html',
\r
{
\r
id : "templatesList",
\r
type : 'html',
\r
- focus: function()
\r
- {
\r
- // Move focus to the first list item if available.
\r
- try { this.getElement().getElementsByTag( 'a' ).getItem( 0 ).focus(); }
\r
- catch( er ){}
\r
- },
\r
+ focus: true,
\r
html :
\r
html :
\r
- '<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="cke_tpl_list_label">' +
\r
+ '<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="' + templateListLabelId+ '">' +
\r
'<div class="cke_tpl_loading"><span></span></div>' +
\r
'</div>' +
\r
'<div class="cke_tpl_loading"><span></span></div>' +
\r
'</div>' +
\r
- '<span class="cke_voice_label" id="cke_tpl_list_label">' + editor.lang.common.options+ '</span>'
\r
+ '<span class="cke_voice_label" id="' + templateListLabelId + '">' + editor.lang.templates.options+ '</span>'
\r
},
\r
{
\r
id : 'chkInsertOpt',
\r
},
\r
{
\r
id : 'chkInsertOpt',
\r