X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Flistblock%2Fplugin.js;h=fc11e5709142b6b789590c29b8116f3cf6188fe6;hb=614511639979907ceb0da3614122a4d8eb963ad4;hp=946a54f19c9ef5c2c6d9909930f92f216f7d2172;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/listblock/plugin.js b/_source/plugins/listblock/plugin.js index 946a54f..fc11e57 100644 --- a/_source/plugins/listblock/plugin.js +++ b/_source/plugins/listblock/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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( '