2013-08-07 05:21:10 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor DataModel MWAlienExtensionNode class.
|
|
|
|
*
|
2020-01-08 17:13:04 +00:00
|
|
|
* @copyright 2011-2020 VisualEditor Team and others; see AUTHORS.txt
|
2013-08-07 05:21:10 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-02-07 17:28:54 +00:00
|
|
|
* DataModel MediaWiki alien extension node.
|
2013-08-07 05:21:10 +00:00
|
|
|
*
|
|
|
|
* @class
|
2015-03-23 15:49:38 +00:00
|
|
|
* @abstract
|
2013-08-07 05:21:10 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
*/
|
2015-03-23 15:49:38 +00:00
|
|
|
ve.dm.MWAlienExtensionNode = function VeDmMWAlienExtensionNode() {};
|
2013-08-07 05:21:10 +00:00
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2015-03-23 15:49:38 +00:00
|
|
|
OO.initClass( ve.dm.MWAlienExtensionNode );
|
2013-08-07 05:21:10 +00:00
|
|
|
|
|
|
|
/* Static members */
|
|
|
|
|
|
|
|
ve.dm.MWAlienExtensionNode.static.getMatchRdfaTypes = function () {
|
|
|
|
return [
|
|
|
|
/^mw:Extension/
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2020-09-29 22:29:43 +00:00
|
|
|
// Similar to transclusions, extension encapsulation nodes can be of various types
|
|
|
|
ve.dm.MWAlienExtensionNode.static.allowedRdfaTypes = null;
|
|
|
|
|
2015-03-23 15:49:38 +00:00
|
|
|
ve.dm.MWAlienExtensionNode.static.toDataElement = function ( domElements, converter ) {
|
|
|
|
// 'Parent' method
|
2016-04-01 09:50:13 +00:00
|
|
|
var element = ve.dm.MWExtensionNode.static.toDataElement.call( this, domElements, converter ),
|
2015-03-23 15:49:38 +00:00
|
|
|
isInline = this.isHybridInline( domElements, converter );
|
|
|
|
|
|
|
|
element.type = isInline ? 'mwAlienInlineExtension' : 'mwAlienBlockExtension';
|
|
|
|
return element;
|
|
|
|
};
|
2013-08-07 05:21:10 +00:00
|
|
|
|
2015-03-23 15:49:38 +00:00
|
|
|
/**
|
|
|
|
* @inheritdoc ve.dm.MWExtensionNode
|
|
|
|
*/
|
2013-08-30 23:23:18 +00:00
|
|
|
ve.dm.MWAlienExtensionNode.static.getExtensionName = function ( dataElement ) {
|
|
|
|
return dataElement.attributes.mw.name;
|
2013-08-15 09:40:58 +00:00
|
|
|
};
|