2013-06-11 19:16:04 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor DataModel MWTemplateSpecModel class.
|
|
|
|
*
|
2020-01-08 17:13:04 +00:00
|
|
|
* @copyright 2011-2020 VisualEditor Team and others; see AUTHORS.txt
|
2013-06-11 19:16:04 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2021-06-03 16:25:15 +00:00
|
|
|
* Holds a mixture of:
|
|
|
|
* - A copy of a template's specification as it is documented via TemplateData.
|
|
|
|
* - Undocumented parameters that appear in a template invocation, {@see fillFromTemplate}.
|
2021-06-25 14:46:59 +00:00
|
|
|
* - Documented aliases are also considered valid, known parameter names. Use
|
|
|
|
* {@see isParameterAlias} to differentiate between the two.
|
2021-06-03 16:25:15 +00:00
|
|
|
* Therefore this is not the original specification but an accessor to the documentation for an
|
|
|
|
* individual template invocation. It's possible different for every invocation.
|
|
|
|
*
|
|
|
|
* Meant to be in a 1:1 relationship to {@see ve.dm.MWTemplateModel}.
|
|
|
|
*
|
|
|
|
* The actual, unmodified specification can be found in {@see specCache} in
|
|
|
|
* {@see ve.dm.MWTransclusionModel}.
|
2013-06-11 19:16:04 +00:00
|
|
|
*
|
2020-12-10 15:47:48 +00:00
|
|
|
* See https://github.com/wikimedia/mediawiki-extensions-TemplateData/blob/master/Specification.md
|
2013-06-19 20:00:11 +00:00
|
|
|
* for the latest version of the TemplateData specification.
|
|
|
|
*
|
2013-06-11 19:16:04 +00:00
|
|
|
* @class
|
|
|
|
*
|
|
|
|
* @constructor
|
2021-06-04 11:58:18 +00:00
|
|
|
* @param {ve.dm.MWTemplateModel} template
|
2021-07-01 08:24:23 +00:00
|
|
|
* @property {Object.<string,boolean>} seenParameterNames Keeps track of any parameter from any
|
|
|
|
* source and in which order they have been seen first. Includes parameters that have been removed
|
|
|
|
* during the lifetime of this object, i.e. {@see fillFromTemplate} doesn't remove parameters that
|
|
|
|
* have been seen before. The order is typically but not necessarily the original order in which
|
|
|
|
* the parameters appear in the template. Aliases are resolved and don't appear on their original
|
|
|
|
* position any more.
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel = function VeDmMWTemplateSpecModel( template ) {
|
|
|
|
// Properties
|
|
|
|
this.template = template;
|
2021-07-01 08:24:23 +00:00
|
|
|
this.seenParameterNames = {};
|
2021-07-01 08:45:56 +00:00
|
|
|
this.templateData = { params: {} };
|
2021-06-24 14:24:04 +00:00
|
|
|
this.aliases = {};
|
2013-06-11 19:16:04 +00:00
|
|
|
|
|
|
|
// Initialization
|
2018-11-21 12:33:32 +00:00
|
|
|
this.fillFromTemplate();
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
2018-09-23 16:36:05 +00:00
|
|
|
OO.initClass( ve.dm.MWTemplateSpecModel );
|
|
|
|
|
|
|
|
/* Static methods */
|
|
|
|
|
2021-06-24 12:44:10 +00:00
|
|
|
/**
|
|
|
|
* @private
|
|
|
|
* @param {string|Object.<string,string>} stringOrObject
|
2021-06-24 15:44:07 +00:00
|
|
|
* @param {string} [languageCode]
|
2021-06-24 12:44:10 +00:00
|
|
|
* @return {string|undefined}
|
|
|
|
*/
|
2021-06-24 15:44:07 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.static.getLocalValue = function ( stringOrObject, languageCode ) {
|
2018-09-23 16:36:05 +00:00
|
|
|
return stringOrObject && typeof stringOrObject === 'object' ?
|
2021-06-24 15:44:07 +00:00
|
|
|
OO.ui.getLocalValue( stringOrObject, languageCode ) :
|
2018-09-23 16:36:05 +00:00
|
|
|
stringOrObject;
|
|
|
|
};
|
|
|
|
|
2013-06-11 19:16:04 +00:00
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
2021-07-01 08:45:56 +00:00
|
|
|
* Template spec data is available from the TemplateData extension's API.
|
2013-06-11 19:16:04 +00:00
|
|
|
*
|
|
|
|
* @param {Object} data Template spec data
|
|
|
|
* @param {string} [data.description] Template description
|
2021-06-28 09:14:18 +00:00
|
|
|
* @param {string[]} [data.paramOrder] Preferred parameter order as documented via TemplateData. If
|
|
|
|
* given, the TemplateData API makes sure this contains the same parameters as `params`.
|
2013-06-11 19:16:04 +00:00
|
|
|
* @param {Object} [data.params] Template param specs keyed by param name
|
2016-10-28 19:02:36 +00:00
|
|
|
* @param {Array} [data.sets] Lists of param sets
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.extend = function ( data ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
this.templateData = data;
|
|
|
|
// Better be safe even if the `params` element isn't optional in the TemplateData API
|
|
|
|
if ( !this.templateData.params ) {
|
|
|
|
this.templateData.params = {};
|
2013-06-11 19:16:04 +00:00
|
|
|
}
|
2021-06-23 14:31:07 +00:00
|
|
|
|
2021-07-01 08:45:56 +00:00
|
|
|
for ( var primaryName in this.templateData.params ) {
|
|
|
|
this.seenParameterNames[ primaryName ] = true;
|
2021-07-01 08:24:23 +00:00
|
|
|
|
2021-07-01 08:45:56 +00:00
|
|
|
var aliases = this.getParameterAliases( primaryName );
|
|
|
|
for ( var i = 0; i < aliases.length; i++ ) {
|
|
|
|
var alias = aliases[ i ];
|
|
|
|
this.aliases[ alias ] = primaryName;
|
|
|
|
delete this.seenParameterNames[ alias ];
|
2013-06-11 19:16:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2015-12-09 16:47:13 +00:00
|
|
|
* Filling is passive, so existing information is never overwritten. The spec should be re-filled
|
2013-06-11 19:16:04 +00:00
|
|
|
* after a parameter is added to ensure it's still complete, and this is safe because existing data
|
|
|
|
* is never overwritten.
|
|
|
|
*/
|
2018-11-21 12:33:32 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.prototype.fillFromTemplate = function () {
|
2021-06-21 08:10:27 +00:00
|
|
|
for ( var key in this.template.getParameters() ) {
|
2021-06-24 14:24:04 +00:00
|
|
|
// Ignore placeholder parameters with no name
|
2021-06-30 10:07:20 +00:00
|
|
|
if ( key && !this.isKnownParameterOrAlias( key ) ) {
|
2021-06-24 14:24:04 +00:00
|
|
|
// There is no information other than the names of the parameters, that they exist, and
|
|
|
|
// in which order
|
2021-07-01 08:24:23 +00:00
|
|
|
this.seenParameterNames[ key ] = true;
|
2013-06-11 19:16:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2015-08-19 18:09:34 +00:00
|
|
|
* @return {string} Template label
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getLabel = function () {
|
2021-06-21 08:10:27 +00:00
|
|
|
var title = this.template.getTitle(),
|
2013-06-18 19:42:10 +00:00
|
|
|
target = this.template.getTarget();
|
|
|
|
|
|
|
|
if ( title ) {
|
|
|
|
try {
|
2013-06-19 00:04:16 +00:00
|
|
|
// Normalize and remove namespace prefix if in the Template: namespace
|
2021-06-21 08:10:27 +00:00
|
|
|
title = new mw.Title( title )
|
|
|
|
.getRelativeText( mw.config.get( 'wgNamespaceIds' ).template );
|
2013-06-18 19:42:10 +00:00
|
|
|
} catch ( e ) { }
|
|
|
|
}
|
|
|
|
|
2013-06-11 19:16:04 +00:00
|
|
|
return title || target.wt;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2021-06-24 15:44:07 +00:00
|
|
|
* @param {string} [languageCode]
|
2015-08-19 18:09:34 +00:00
|
|
|
* @return {string|null} Template description or null if not available
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
2021-06-24 15:44:07 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getDescription = function ( languageCode ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
return this.constructor.static.getLocalValue( this.templateData.description || null, languageCode );
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
2014-01-14 20:15:29 +00:00
|
|
|
/**
|
2021-06-28 09:14:18 +00:00
|
|
|
* Empty if the template is not documented. Otherwise the explicit `paramOrder` if given, or the
|
|
|
|
* order of parameters as they appear in TemplateData. Returns a copy, i.e. it's safe to manipulate
|
|
|
|
* the array.
|
2014-01-14 20:15:29 +00:00
|
|
|
*
|
2021-06-28 09:14:18 +00:00
|
|
|
* @return {string[]} Preferred order of parameters via TemplateData, if given
|
2014-01-14 20:15:29 +00:00
|
|
|
*/
|
2021-06-28 09:14:18 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getDocumentedParameterOrder = function () {
|
2021-07-01 08:45:56 +00:00
|
|
|
return Array.isArray( this.templateData.paramOrder ) ?
|
|
|
|
this.templateData.paramOrder.slice() :
|
|
|
|
Object.keys( this.templateData.params );
|
2014-01-14 20:15:29 +00:00
|
|
|
};
|
|
|
|
|
2013-07-10 19:04:11 +00:00
|
|
|
/**
|
2021-06-28 10:53:45 +00:00
|
|
|
* Check if a parameter name or alias was seen before. This includes parameters and aliases
|
|
|
|
* documented via TemplateData as well as undocumented parameters, e.g. from the original template
|
|
|
|
* invocation. When undocumented parameters are removed from the linked {@see ve.dm.MWTemplateModel}
|
|
|
|
* they are still known and will still be offered via {@see getKnownParameterNames} for the lifetime
|
|
|
|
* of this object.
|
|
|
|
*
|
2021-06-24 12:53:39 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
|
|
|
* @return {boolean}
|
2013-07-10 19:04:11 +00:00
|
|
|
*/
|
2021-06-24 12:53:39 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.prototype.isKnownParameterOrAlias = function ( name ) {
|
2021-07-01 08:24:23 +00:00
|
|
|
return name in this.seenParameterNames || name in this.aliases;
|
2013-07-10 19:04:11 +00:00
|
|
|
};
|
|
|
|
|
2013-07-11 00:33:21 +00:00
|
|
|
/**
|
|
|
|
* Check if a parameter name is an alias.
|
|
|
|
*
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {boolean}
|
2013-07-11 00:33:21 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.isParameterAlias = function ( name ) {
|
2021-06-24 14:24:04 +00:00
|
|
|
return name in this.aliases;
|
2013-07-11 00:33:21 +00:00
|
|
|
};
|
|
|
|
|
2013-06-11 19:16:04 +00:00
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:44:07 +00:00
|
|
|
* @param {string} [languageCode]
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {string}
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
2021-06-24 15:44:07 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterLabel = function ( name, languageCode ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:44:07 +00:00
|
|
|
return this.constructor.static.getLocalValue( param && param.label || name, languageCode );
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:44:07 +00:00
|
|
|
* @param {string} [languageCode]
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {string|null}
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
2021-06-24 15:44:07 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterDescription = function ( name, languageCode ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:44:07 +00:00
|
|
|
return this.constructor.static.getLocalValue( param && param.description || null, languageCode );
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
2021-03-11 16:12:45 +00:00
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {string[]}
|
2021-03-11 16:12:45 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterSuggestedValues = function ( name ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:38:24 +00:00
|
|
|
return param && param.suggestedvalues || [];
|
2021-03-11 16:12:45 +00:00
|
|
|
};
|
|
|
|
|
2013-06-11 19:16:04 +00:00
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {string}
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterDefaultValue = function ( name ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 13:43:17 +00:00
|
|
|
return param && param.default || '';
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
2015-03-04 23:31:05 +00:00
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:44:07 +00:00
|
|
|
* @param {string} [languageCode]
|
2021-06-24 13:43:17 +00:00
|
|
|
* @return {string|null}
|
2015-03-04 23:31:05 +00:00
|
|
|
*/
|
2021-06-24 15:44:07 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterExampleValue = function ( name, languageCode ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:44:07 +00:00
|
|
|
return this.constructor.static.getLocalValue( param && param.example || null, languageCode );
|
2015-03-04 23:31:05 +00:00
|
|
|
};
|
|
|
|
|
2014-07-15 07:08:09 +00:00
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {string}
|
2014-07-15 07:08:09 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterAutoValue = function ( name ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 13:43:17 +00:00
|
|
|
return param && param.autovalue || '';
|
2014-07-15 07:08:09 +00:00
|
|
|
};
|
|
|
|
|
2013-06-11 19:16:04 +00:00
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {string} e.g. "string"
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterType = function ( name ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:38:24 +00:00
|
|
|
return param && param.type || 'string';
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2015-08-19 18:09:34 +00:00
|
|
|
* @return {string[]} Alternate parameter names
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterAliases = function ( name ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:38:24 +00:00
|
|
|
return param && param.aliases || [];
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
2013-06-28 21:38:40 +00:00
|
|
|
/**
|
2013-07-11 00:33:21 +00:00
|
|
|
* Get the parameter name, resolving an alias.
|
2013-06-28 21:38:40 +00:00
|
|
|
*
|
2013-07-11 00:33:21 +00:00
|
|
|
* If a parameter is not an alias of another, the output will be the same as the input.
|
2013-06-28 21:38:40 +00:00
|
|
|
*
|
2021-06-24 12:48:29 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
|
|
|
* @return {string}
|
2013-06-28 21:38:40 +00:00
|
|
|
*/
|
2021-06-24 12:48:29 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getPrimaryParameterName = function ( name ) {
|
2021-06-24 14:24:04 +00:00
|
|
|
return this.aliases[ name ] || name;
|
2013-06-28 21:38:40 +00:00
|
|
|
};
|
|
|
|
|
2013-06-11 19:16:04 +00:00
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {boolean}
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.isParameterRequired = function ( name ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:38:24 +00:00
|
|
|
return !!( param && param.required );
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
2014-04-28 19:10:31 +00:00
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {boolean}
|
2014-04-28 19:10:31 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.isParameterSuggested = function ( name ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:38:24 +00:00
|
|
|
return !!( param && param.suggested );
|
2014-04-28 19:10:31 +00:00
|
|
|
};
|
|
|
|
|
2013-06-11 19:16:04 +00:00
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2021-06-24 15:41:23 +00:00
|
|
|
* @return {boolean}
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.isParameterDeprecated = function ( name ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:38:24 +00:00
|
|
|
return !!( param && ( param.deprecated || typeof param.deprecated === 'string' ) );
|
2013-06-19 20:00:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2021-06-24 14:24:04 +00:00
|
|
|
* @param {string} name Parameter name or alias
|
2015-08-19 18:09:34 +00:00
|
|
|
* @return {string} Explaining of why parameter is deprecated, empty if parameter is either not
|
2014-04-25 23:50:21 +00:00
|
|
|
* deprecated or no description has been specified
|
2013-06-19 20:00:11 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterDeprecationDescription = function ( name ) {
|
2021-07-01 08:45:56 +00:00
|
|
|
var param = this.templateData.params[ this.getPrimaryParameterName( name ) ];
|
2021-06-24 15:38:24 +00:00
|
|
|
return param && typeof param.deprecated === 'string' ? param.deprecated : '';
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2021-06-28 10:53:45 +00:00
|
|
|
* Get all known primary parameter names, without aliases, in their original order as they became
|
|
|
|
* known (usually but not necessarily the order in which they appear in the template). This still
|
|
|
|
* includes undocumented parameters that have been part of the template at some point during the
|
|
|
|
* lifetime of this object, but have been removed from the linked {@see ve.dm.MWTemplateModel} in
|
|
|
|
* the meantime.
|
2013-06-11 19:16:04 +00:00
|
|
|
*
|
2021-06-28 10:53:45 +00:00
|
|
|
* @return {string[]} Primary parameter names
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
2021-06-28 10:53:45 +00:00
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getKnownParameterNames = function () {
|
2021-07-01 08:24:23 +00:00
|
|
|
return Object.keys( this.seenParameterNames );
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2015-08-19 18:09:34 +00:00
|
|
|
* @return {Object[]} Lists of parameter set descriptors
|
2013-06-11 19:16:04 +00:00
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getParameterSets = function () {
|
2021-07-01 08:45:56 +00:00
|
|
|
return this.templateData.sets || [];
|
2013-06-11 19:16:04 +00:00
|
|
|
};
|
2014-10-21 10:45:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get map describing relationship between another content type and the parameters.
|
|
|
|
*
|
|
|
|
* @return {Object} Object with application property maps to parameters keyed to application name.
|
|
|
|
*/
|
|
|
|
ve.dm.MWTemplateSpecModel.prototype.getMaps = function () {
|
2021-07-01 08:45:56 +00:00
|
|
|
return this.templateData.maps || {};
|
2014-10-21 10:45:03 +00:00
|
|
|
};
|