From e60c357cfa9cbf47d48da706a85910fadda048d1 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Fri, 28 Jun 2013 14:38:40 -0700 Subject: [PATCH] ve.dm.MWTemplateSpecModel: Implement getParameterOrigin Change-Id: I5970cbefd8eba9afcf37dff90d0f2a72b4bd7627 --- modules/ve/dm/models/ve.dm.MWTemplateSpecModel.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/ve/dm/models/ve.dm.MWTemplateSpecModel.js b/modules/ve/dm/models/ve.dm.MWTemplateSpecModel.js index 9823a92692..07e31b3c09 100644 --- a/modules/ve/dm/models/ve.dm.MWTemplateSpecModel.js +++ b/modules/ve/dm/models/ve.dm.MWTemplateSpecModel.js @@ -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. *