mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-18 19:55:55 +00:00
84d548e7b1
A @method annotation is only necessary when the docblock is not directly followed by a function declaration (in which case JSDuck assumes it documents a property), e.g. when defining an abstract function or referencing a function from another library. I verified that JSDuck generates exactly the same output before and after this change (docs/data-<hash>.js files are identical). Change-Id: I7edf51a8560ab9978b42800ab1026f0b5555c3bf
89 lines
1.8 KiB
JavaScript
89 lines
1.8 KiB
JavaScript
/*!
|
|
* VisualEditor DataModel MWTransclusionPartModel class.
|
|
*
|
|
* @copyright 2011-2019 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* MediaWiki transclusion part model.
|
|
*
|
|
* @class
|
|
* @mixins OO.EventEmitter
|
|
*
|
|
* @constructor
|
|
* @param {ve.dm.MWTransclusionModel} transclusion Transclusion
|
|
*/
|
|
ve.dm.MWTransclusionPartModel = function VeDmMWTransclusionPartModel( transclusion ) {
|
|
// Mixin constructors
|
|
OO.EventEmitter.call( this );
|
|
|
|
// Properties
|
|
this.transclusion = transclusion;
|
|
this.id = 'part_' + this.transclusion.getUniquePartId();
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.mixinClass( ve.dm.MWTransclusionPartModel, OO.EventEmitter );
|
|
|
|
/* Events */
|
|
|
|
/**
|
|
* @event change
|
|
*/
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Get transclusion part is in.
|
|
*
|
|
* @return {ve.dm.MWTransclusionModel} Transclusion
|
|
*/
|
|
ve.dm.MWTransclusionPartModel.prototype.getTransclusion = function () {
|
|
return this.transclusion;
|
|
};
|
|
|
|
/**
|
|
* Get a unique part ID within the transclusion.
|
|
*
|
|
* @return {string} Unique ID
|
|
*/
|
|
ve.dm.MWTransclusionPartModel.prototype.getId = function () {
|
|
return this.id;
|
|
};
|
|
|
|
/**
|
|
* Remove part from transclusion.
|
|
*/
|
|
ve.dm.MWTransclusionPartModel.prototype.remove = function () {
|
|
this.transclusion.removePart( this );
|
|
};
|
|
|
|
/**
|
|
* Get serialized representation of transclusion part.
|
|
*
|
|
* @return {Mixed} Serialized representation, or undefined if empty
|
|
*/
|
|
ve.dm.MWTransclusionPartModel.prototype.serialize = function () {
|
|
return undefined;
|
|
};
|
|
|
|
/**
|
|
* Get the wikitext for this part.
|
|
*
|
|
* @return {string} Wikitext
|
|
*/
|
|
ve.dm.MWTransclusionPartModel.prototype.getWikitext = function () {
|
|
return '';
|
|
};
|
|
|
|
/**
|
|
* Add all non-existing required and suggested parameters, if any.
|
|
*
|
|
* @return {number} Number of parameters added
|
|
*/
|
|
ve.dm.MWTransclusionPartModel.prototype.addPromptedParameters = function () {
|
|
return 0;
|
|
};
|