No more configuration overrides

In various places in the UI code, certain properties of config objects
were overridden and in some cases the configurations were documented as
private as a strange hack to prevent them from being advertised in the
docs.

I, Trevor, have been convinced of the error of my ways, and gladly
reverse this situation, allowing all configurations to always be
overridden when desired, while still allowing default values.

Change-Id: I242e3b1902dec8e09eeea38fa64381e69ee04215
This commit is contained in:
Erick Guan 2013-09-20 07:09:06 +00:00 committed by Trevor Parscal
parent 6cf45cfc83
commit 30f1ed4c75
10 changed files with 14 additions and 29 deletions

View file

@ -17,7 +17,7 @@
*/
ve.ui.MWBetaWelcomeDialog = function VeUiMWBetaWelcomeDialog( surface, config ) {
// Configuration initialization
config = ve.extendObject( {}, config, { 'small': true, 'footless': false } );
config = ve.extendObject( { 'small': true, 'footless': false }, config );
// Parent constructor
ve.ui.MWDialog.call( this, surface, config );

View file

@ -17,7 +17,7 @@
*/
ve.ui.MWMediaInsertDialog = function VeUiMWMediaInsertDialog( surface, config ) {
// Configuration initialization
config = ve.extendObject( {}, config, { 'footless': true } );
config = ve.extendObject( { 'footless': true }, config );
// Parent constructor
ve.ui.MWDialog.call( this, surface, config );

View file

@ -21,7 +21,7 @@
*/
ve.ui.MWTransclusionDialog = function VeUiMWTransclusionDialog( surface, config ) {
// Configuration initialization
config = ve.extendObject( {}, config, {
config = ve.extendObject( {
'editable': true,
'adders': [
{
@ -35,7 +35,7 @@ ve.ui.MWTransclusionDialog = function VeUiMWTransclusionDialog( surface, config
'title': ve.msg( 'visualeditor-dialog-transclusion-add-content' )
}
]
} );
}, config );
// Parent constructor
ve.ui.MWDialog.call( this, surface, config );

View file

@ -16,7 +16,7 @@
*/
ve.ui.MWCategoryPopupWidget = function VeUiMWCategoryPopupWidget ( config ) {
// Configuration initialization
config = ve.extendObject( {}, config, { 'autoClose': true } );
config = ve.extendObject( { 'autoClose': true }, config );
// Parent constructor
ve.ui.PopupWidget.call( this, config );
@ -56,11 +56,6 @@ ve.ui.MWCategoryPopupWidget = function VeUiMWCategoryPopupWidget ( config ) {
config.$overlay.append( this.$ );
};
/**
* @private
* @cfg {boolean} [autoClose=true] Overridden in this subclass
*/
/* Inheritance */
ve.inheritClass( ve.ui.MWCategoryPopupWidget, ve.ui.PopupWidget );

View file

@ -19,10 +19,10 @@
*/
ve.ui.MWMediaSearchWidget = function VeUiMWMediaSearchWidget( config ) {
// Configuration intialization
config = ve.extendObject( {}, config, {
config = ve.extendObject( {
'placeholder': ve.msg( 'visualeditor-media-input-placeholder' ),
'value': mw.config.get( 'wgTitle' )
} );
}, config );
// Parent constructor
ve.ui.SearchWidget.call( this, config );

View file

@ -17,7 +17,7 @@
*/
ve.ui.MWParameterResultWidget = function VeUiMWParameterResultWidget( data, config ) {
// Configuration initialization
config = ve.extendObject( {}, config, { 'icon': 'parameter' } );
config = ve.extendObject( { 'icon': 'parameter' }, config );
// Parent constructor
ve.ui.OptionWidget.call( this, data, config );
@ -27,11 +27,6 @@ ve.ui.MWParameterResultWidget = function VeUiMWParameterResultWidget( data, conf
this.setLabel( this.buildLabel() );
};
/**
* @private
* @cfg {string} icon
*/
/* Inheritance */
ve.inheritClass( ve.ui.MWParameterResultWidget, ve.ui.OptionWidget );

View file

@ -16,9 +16,9 @@
*/
ve.ui.MWParameterSearchWidget = function VeUiMWParameterSearchWidget( template, config ) {
// Configuration intialization
config = ve.extendObject( {}, config, {
config = ve.extendObject( {
'placeholder': ve.msg( 'visualeditor-parameter-input-placeholder' )
} );
}, config );
// Parent constructor
ve.ui.SearchWidget.call( this, config );

View file

@ -17,9 +17,9 @@
*/
ve.ui.MWReferenceSearchWidget = function VeUiMWReferenceSearchWidget( surface, config ) {
// Configuration intialization
config = ve.extendObject( {}, config, {
config = ve.extendObject( {
'placeholder': ve.msg( 'visualeditor-reference-input-placeholder' )
} );
}, config );
// Parent constructor
ve.ui.SearchWidget.call( this, config );

View file

@ -18,7 +18,7 @@
*/
ve.ui.StackPanelLayout = function VeUiStackPanelLayout( config ) {
// Config initialization
config = ve.extendObject( config, { 'scrollable': true } );
config = ve.extendObject( { 'scrollable': true }, config );
// Parent constructor
ve.ui.PanelLayout.call( this, config );

View file

@ -17,7 +17,7 @@
*/
ve.ui.MenuItemWidget = function VeUiMenuItemWidget( data, config ) {
// Configuration initialization
config = ve.extendObject( {}, config, { 'icon': 'check' } );
config = ve.extendObject( { 'icon': 'check' }, config );
// Parent constructor
ve.ui.OptionWidget.call( this, data, config );
@ -26,11 +26,6 @@ ve.ui.MenuItemWidget = function VeUiMenuItemWidget( data, config ) {
this.$.addClass( 've-ui-menuItemWidget' );
};
/**
* @private
* @cfg {string} icon
*/
/* Inheritance */
ve.inheritClass( ve.ui.MenuItemWidget, ve.ui.OptionWidget );