mediawiki-extensions-Visual.../modules/ve-mw/dm/nodes/ve.dm.MWAlienExtensionNode.js
Ed Sanders 9ab79330c7 Round trip alien extensions correctly when edited
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
2013-08-30 16:43:50 -07:00

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 );