X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Flistblock%2Fplugin.js;h=fc11e5709142b6b789590c29b8116f3cf6188fe6;hb=614511639979907ceb0da3614122a4d8eb963ad4;hp=9a7c6e2db7763f3be510b6d8d686df455b446dbb;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_source/plugins/listblock/plugin.js b/_source/plugins/listblock/plugin.js index 9a7c6e2..fc11e57 100644 --- a/_source/plugins/listblock/plugin.js +++ b/_source/plugins/listblock/plugin.js @@ -9,21 +9,27 @@ CKEDITOR.plugins.add( 'listblock', onLoad : function() { - CKEDITOR.ui.panel.prototype.addListBlock = function( name, multiSelect ) + CKEDITOR.ui.panel.prototype.addListBlock = function( name, definition ) { - return this.addBlock( name, new CKEDITOR.ui.listBlock( this.getHolderElement(), multiSelect ) ); + return this.addBlock( name, new CKEDITOR.ui.listBlock( this.getHolderElement(), definition ) ); }; CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass( { base : CKEDITOR.ui.panel.block, - $ : function( blockHolder, multiSelect ) + $ : function( blockHolder, blockDefinition ) { - // Call the base contructor. - this.base( blockHolder ); + blockDefinition = blockDefinition || {}; + + var attribs = blockDefinition.attributes || ( blockDefinition.attributes = {} ); + ( this.multiSelect = !!blockDefinition.multiSelect ) && + ( attribs[ 'aria-multiselectable' ] = true ); + // Provide default role of 'listbox'. + !attribs.role && ( attribs.role = 'listbox' ); - this.multiSelect = !!multiSelect; + // Call the base contructor. + this.base.apply( this, arguments ); var keys = this.keys; keys[ 40 ] = 'next'; // ARROW-DOWN @@ -75,22 +81,25 @@ CKEDITOR.plugins.add( 'listblock', add : function( value, html, title ) { var pendingHtml = this._.pendingHtml, - id = 'cke_' + CKEDITOR.tools.getNextNumber(); + id = CKEDITOR.tools.getNextId(); if ( !this._.started ) { - pendingHtml.push( '