X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fdialogui%2Fplugin.js;h=1567c945bae7f5ebde5da2220b047d555054d610;hp=b6cd10c1b690f4d5f35f349db639cdd2e16ee816;hb=059b4c2fef02528bf1af189f7996e80652faddfb;hpb=c6e377a02b54abc07129d72b632763c727476a15 diff --git a/_source/plugins/dialogui/plugin.js b/_source/plugins/dialogui/plugin.js index b6cd10c..1567c94 100644 --- a/_source/plugins/dialogui/plugin.js +++ b/_source/plugins/dialogui/plugin.js @@ -13,6 +13,7 @@ CKEDITOR.plugins.add( 'dialogui' ); { this._ || ( this._ = {} ); this._['default'] = this._.initValue = elementDefinition['default'] || ''; + this._.required = elementDefinition[ 'required' ] || false; var args = [ this._ ]; for ( var i = 1 ; i < arguments.length ; i++ ) args.push( arguments[i] ); @@ -34,6 +35,23 @@ CKEDITOR.plugins.add( 'dialogui' ); return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, elementDefinition, output ); } }, + containerBuilder = + { + build : function( dialog, elementDefinition, output ) + { + var children = elementDefinition.children, + child, + childHtmlList = [], + childObjList = []; + for ( var i = 0 ; ( i < children.length && ( child = children[i] ) ) ; i++ ) + { + var childHtml = []; + childHtmlList.push( childHtml ); + childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) ); + } + return new CKEDITOR.ui.dialog[ elementDefinition.type ]( dialog, childObjList, childHtmlList, output, elementDefinition ); + } + }, commonPrototype = { isChanged : function() @@ -129,13 +147,14 @@ CKEDITOR.plugins.add( 'dialogui' ); { var html = []; if ( elementDefinition.labelLayout != 'horizontal' ) - html.push( '
', + html.push( '
', - '
', - contentHtml( dialog, elementDefinition ), + '', + '' ); else { @@ -147,14 +166,17 @@ CKEDITOR.plugins.add( 'dialogui' ); [ { type : 'html', - html : '' + CKEDITOR.tools.htmlEncode( elementDefinition.label ) + + html : '' }, { type : 'html', html : '' + - contentHtml( dialog, elementDefinition ) + + contentHtml.call( this, dialog, elementDefinition ) + '' } ] @@ -163,7 +185,7 @@ CKEDITOR.plugins.add( 'dialogui' ); } return html.join( '' ); }; - CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'div', null, null, innerHTML ); + CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'div', null, { role : 'presentation' }, innerHTML ); }, /** @@ -236,12 +258,15 @@ CKEDITOR.plugins.add( 'dialogui' ); { // IE BUG: Text input fields in IE at 100% would exceed a or inline // container's width, so need to wrap it inside a
. - var html = [ '' ); @@ -290,7 +315,9 @@ CKEDITOR.plugins.add( 'dialogui' ); /** @ignore */ var innerHTML = function() { - var html = [ '
' ); @@ -334,13 +361,15 @@ CKEDITOR.plugins.add( 'dialogui' ); { id : elementDefinition.id ? elementDefinition.id + '_checkbox' : CKEDITOR.tools.getNextNumber() + '_checkbox' }, true ), - html = [], - attributes = { 'class' : 'cke_dialog_ui_checkbox_input', type : 'checkbox' }; + html = []; + + var labelId = CKEDITOR.tools.getNextNumber() + '_label'; + var attributes = { 'class' : 'cke_dialog_ui_checkbox_input', type : 'checkbox', 'aria-labelledby' : labelId }; cleanInnerDefinition( myDefinition ); if ( elementDefinition[ 'default' ] ) attributes.checked = 'checked'; _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes ); - html.push( '