mediawiki-extensions-Visual.../modules/ve-mw/dm/metaitems/ve.dm.MWIndexForceMetaItem.js
James D. Forrester 36befda61c build: Replace jscs and jshint with eslint
It's new, it's fresh, it's amazing, it's here.

Change-Id: I5dc784411f704685ed5cc763a2b2b1c5d3e5a610
2016-10-28 18:33:15 +00:00

48 lines
1.2 KiB
JavaScript

/*!
* VisualEditor DataModel MWIndexForceMetaItem class.
*
* @copyright 2011-2016 VisualEditor Team and others; see AUTHORS.txt
* @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() {
// Parent constructor
ve.dm.MWIndexForceMetaItem.super.apply( this, arguments );
};
/* 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 () {
return { type: this.name };
};
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 );