mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
9ab79330c7
ce.MWExtensionNode * Build up the wikitext for round-tripping using jQuery, and pass through the attributes from data-mw dm.MWExtensionNode * Use a static getExtensionName to correctly get the extension name from the dataElement (as the getMatchRdfaTypes hack won't work for MWAlienExtensionNode's) dm.MWAlienExtensionNode * Implement new static getExtensionName function Bug: 53543 Change-Id: Id4e83c14ec68c3b3970d05317477f19aaf31abe4
45 lines
996 B
JavaScript
45 lines
996 B
JavaScript
/*!
|
|
* VisualEditor DataModel MWAlienExtensionNode class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* DataModel MediaWiki math node.
|
|
*
|
|
* @class
|
|
* @extends ve.dm.MWExtensionNode
|
|
*
|
|
* @constructor
|
|
*/
|
|
ve.dm.MWAlienExtensionNode = function VeDmMWAlienExtensionNode( length, element ) {
|
|
// Parent constructor
|
|
ve.dm.MWExtensionNode.call( this, 0, element );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.dm.MWAlienExtensionNode, ve.dm.MWExtensionNode );
|
|
|
|
/* Static members */
|
|
|
|
ve.dm.MWAlienExtensionNode.static.name = 'mwAlienExtension';
|
|
|
|
ve.dm.MWAlienExtensionNode.static.getMatchRdfaTypes = function () {
|
|
return [
|
|
/^mw:Extension/
|
|
];
|
|
};
|
|
|
|
ve.dm.MWAlienExtensionNode.static.tagName = 'div';
|
|
|
|
/** */
|
|
ve.dm.MWAlienExtensionNode.static.getExtensionName = function ( dataElement ) {
|
|
return dataElement.attributes.mw.name;
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.dm.modelRegistry.register( ve.dm.MWAlienExtensionNode );
|