Navigation Menu

Skip to content

Commit

Permalink
Merge branch 't/9541'
Browse files Browse the repository at this point in the history
  • Loading branch information
fredck committed Dec 19, 2012
2 parents 8ae6b55 + c551fd8 commit da498c3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 18 deletions.
3 changes: 3 additions & 0 deletions core/creators/themedui.js
Expand Up @@ -152,6 +152,9 @@ CKEDITOR.replaceClass = 'ckeditor';
// Detach the current editable.
editor.editable( 0 );

// Clear up the mode space.
editor.ui.space( 'contents' ).setHtml( '' );

editor.mode = '';
}

Expand Down
46 changes: 38 additions & 8 deletions core/editable.js
Expand Up @@ -466,6 +466,14 @@
});
}

// Apply tab index on demand, with original direction saved.
if ( this.isInline() ) {

// tabIndex of the editable is different than editor's one.
// Update the attribute of the editable.
this.changeAttr( 'tabindex', editor.tabIndex );
}

// The above is all we'll be doing for a <textarea> editable.
if ( this.is( 'textarea' ) )
return;
Expand All @@ -483,14 +491,6 @@
if ( this.getDirection( 1 ) != dir )
this.changeAttr( 'dir', dir );

// Apply tab index on demand, with original direction saved.
if ( editor.document.equals( CKEDITOR.document ) ) {

// tabIndex of the editable is different than editor's one.
// Update the attribute of the editable.
this.changeAttr( 'tabindex', editor.tabIndex );
}

// Create the content stylesheet for this document.
var styles = CKEDITOR.getCss();
if ( styles ) {
Expand Down Expand Up @@ -913,7 +913,37 @@
!isDirty && editor.resetDirty();
}
});
});


CKEDITOR.on( 'instanceCreated', function( evt ) {
var editor = evt.editor;

editor.on( 'mode', function() {

var editable = editor.editable();

// Setup proper ARIA roles and properties for inline editable, framed
// editable is instead handled by plugin.
if ( editable.isInline() ) {

var ariaLabel = [ this.lang.editor, this.name ].join( ',' );

editable.changeAttr( 'role', 'textbox' );
editable.changeAttr( 'aria-label', ariaLabel );
editable.changeAttr( 'title', ariaLabel );

// Put the voice label in different spaces, depending on element mode, so
// the DOM element get auto detached on mode reload or editor destroy.
var ct = this.ui.space( this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? 'top' : 'contents' );
if ( ct ) {
var ariaDescId = CKEDITOR.tools.getNextId(),
desc = CKEDITOR.dom.element.createFromHtml( '<span id="' + ariaDescId + '" class="cke_voice_label">' + this.lang.common.editorHelp + '</span>' );
ct.append( desc );
editable.changeAttr( 'aria-describedby', ariaDescId );
}
}
});
});

// #9222: Show text cursor in Gecko.
Expand Down
11 changes: 1 addition & 10 deletions plugins/sourcearea/plugin.js
Expand Up @@ -34,15 +34,6 @@
},
CKEDITOR.tools.cssVendorPrefix( 'tab-size', editor.config.sourceAreaTabSize || 4 ) ) );

var ariaLabel = [ editor.lang.editor, editor.name ].join( ',' );

textarea.setAttributes({
dir: 'ltr',
tabIndex: CKEDITOR.env.webkit ? -1 : editor.tabIndex,
'role': 'textbox',
'aria-label': ariaLabel
});

textarea.addClass( 'cke_source cke_reset cke_enable_context_menu' );

editor.ui.space( 'contents' ).append( textarea );
Expand Down Expand Up @@ -155,4 +146,4 @@ CKEDITOR.plugins.sourcearea = {
* @cfg {Number} [sourceAreaTabSize=4]
* @member CKEDITOR.config
* @see CKEDITOR.config#dataIndentationChars
*/
*/

0 comments on commit da498c3

Please sign in to comment.