2013-11-15 20:36:53 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor DataModel MWIndexForceMetaItem class.
|
|
|
|
*
|
2016-01-03 22:56:59 +00:00
|
|
|
* @copyright 2011-2016 VisualEditor Team and others; see AUTHORS.txt
|
2013-11-15 20:36:53 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DataModel force index meta item (for __INDEX__).
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.dm.MetaItem
|
|
|
|
* @constructor
|
|
|
|
* @param {Object} element Reference to element in meta-linmod
|
|
|
|
*/
|
|
|
|
ve.dm.MWIndexForceMetaItem = function VeDmMWIndexForceMetaItem( element ) {
|
|
|
|
// Parent constructor
|
|
|
|
ve.dm.MetaItem.call( this, element );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.dm.MWIndexForceMetaItem, ve.dm.MetaItem );
|
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
|
|
|
ve.dm.MWIndexForceMetaItem.static.name = 'mwIndexForce';
|
|
|
|
|
|
|
|
ve.dm.MWIndexForceMetaItem.static.group = 'mwIndex';
|
|
|
|
|
|
|
|
ve.dm.MWIndexForceMetaItem.static.matchTagNames = [ 'meta' ];
|
|
|
|
|
|
|
|
ve.dm.MWIndexForceMetaItem.static.matchRdfaTypes = [ 'mw:PageProp/index' ];
|
|
|
|
|
|
|
|
ve.dm.MWIndexForceMetaItem.static.toDataElement = function ( ) {
|
2014-08-22 20:50:48 +00:00
|
|
|
return { type: this.name };
|
2013-11-15 20:36:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ve.dm.MWIndexForceMetaItem.static.toDomElements = function ( dataElement, doc ) {
|
|
|
|
var meta = doc.createElement( 'meta' );
|
|
|
|
meta.setAttribute( 'property', 'mw:PageProp/index' );
|
|
|
|
return [ meta ];
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.dm.modelRegistry.register( ve.dm.MWIndexForceMetaItem );
|