mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
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:
parent
6cf45cfc83
commit
30f1ed4c75
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue