mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
Merge "ve.dm.MWTemplateSpecModel: Implement getParameterOrigin"
This commit is contained in:
commit
6e447ce45c
|
@ -126,6 +126,7 @@ ve.dm.MWTemplateSpecModel.prototype.getDefaultParameterSpec = function ( name )
|
|||
'default': '',
|
||||
'type': 'string',
|
||||
'aliases': [],
|
||||
'origin': name,
|
||||
'required': false,
|
||||
'deprecated': false
|
||||
};
|
||||
|
@ -224,6 +225,19 @@ ve.dm.MWTemplateSpecModel.prototype.getParameterAliases = function ( name ) {
|
|||
return this.params[name].aliases;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the parameter origin, which is the parameter this is an alias of.
|
||||
*
|
||||
* If a parameter is not an alias of another, its origin and name will be the same.
|
||||
*
|
||||
* @method
|
||||
* @param {string} name Parameter name
|
||||
* @returns {string} Origin parameter name
|
||||
*/
|
||||
ve.dm.MWTemplateSpecModel.prototype.getParameterOrigin = function ( name ) {
|
||||
return this.params[name].origin;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if parameter is required.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue