mediawiki-extensions-Visual.../modules/ve/ce/nodes/ve.ce.MWTemplateNode.js
Ed Sanders 01eda7f36a Create MWTemplateNode
This node stores the rendered in the index-value store, hashed on
a custom hash of the dm (type + mw) which makes it unique it its
parameters.

Bug: 46571
Change-Id: I0ab4c9f7bca207121d5b42e83c821771b6139da8
2013-04-11 23:58:48 +01:00

43 lines
972 B
JavaScript

/*!
* VisualEditor ContentEditable MWTemplate class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* ContentEditable MediaWiki template node.
*
* @class
* @abstract
* @extends ve.ce.GeneratedContentNode
* @constructor
* @param {ve.dm.MWTemplateNode} model Model to observe
*/
ve.ce.MWTemplateNode = function VeCeMWTemplateNode( model ) {
// Parent constructor
ve.ce.GeneratedContentNode.call( this, model );
// DOM Changes
this.$.addClass( 've-ce-MWTemplateNode' );
};
/* Inheritance */
ve.inheritClass( ve.ce.MWTemplateNode, ve.ce.GeneratedContentNode );
/* Static Properties */
ve.ce.MWTemplateNode.static.name = 'MWtemplate';
/* Methods */
ve.ce.MWTemplateNode.prototype.generateContents = function () {
// TODO: return $.ajax( api call to get new contents )
return new $.Deferred();
};
/* Registration */
ve.ce.nodeFactory.register( ve.ce.MWTemplateNode );