mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 16:44:51 +00:00
d3a2fab2c4
Objectives: * Rename just about every use of "template" to "transclusion" * Make a proper data structure for transclusions * Abstract away template data * Use more template data in the user interface * Allow adding parameters * Allow removing templates, parameters and content Changes: ve.ui.Dialog.css * Add rule to place add param controls on a single line ve.ui.MWTemplateDialogs.js * Move template spec loading into transclusion class * Add remove button for parts and parameters * Add parameter adding form * Use template data for labels and descriptions ve.dm.* * Add new transclusion data structures *.php * Add links to new files *.* * Rename all things "template" to "transclusion" Bug: 39598 Bug: 49403 Change-Id: I3bcf924a3e179cb65f19e833277a39dfd3dad8bd
51 lines
1.1 KiB
JavaScript
51 lines
1.1 KiB
JavaScript
/*!
|
|
* VisualEditor DataModel MWTransclusionContentModel class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* MediaWiki transclusion content model.
|
|
*
|
|
* @class
|
|
* @extends ve.dm.MWTransclusionPartModel
|
|
*
|
|
* @constructor
|
|
* @param {ve.dm.MWTransclusionModel} transclusion Transclusion
|
|
* @param {string} [value] Content value
|
|
*/
|
|
ve.dm.MWTransclusionContentModel = function VeDmMWTransclusionContentModel( transclusion, value ) {
|
|
// Parent constructor
|
|
ve.dm.MWTransclusionPartModel.call( this, transclusion );
|
|
|
|
// Properties
|
|
this.value = value || '';
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.dm.MWTransclusionContentModel, ve.dm.MWTransclusionPartModel );
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Get content value.
|
|
*
|
|
* @method
|
|
* @returns {string} Content value
|
|
*/
|
|
ve.dm.MWTransclusionContentModel.prototype.getValue = function () {
|
|
return this.value;
|
|
};
|
|
|
|
/**
|
|
* Set content value.
|
|
*
|
|
* @method
|
|
* @param {string} value Content value
|
|
*/
|
|
ve.dm.MWTransclusionContentModel.prototype.setValue = function ( value ) {
|
|
this.value = value;
|
|
};
|