mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-30 00:55:00 +00:00
051c3498ae
Add a trinary option to the page settings pane of the meta dialog that lets users set the page to have __INDEX__, __NOINDEX__ or neither (and so have the default behaviour). Bug: 57167 Change-Id: I30d483b5b6c3df7ee56a52c744bbdc610a01873d
48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
/*!
|
|
* VisualEditor DataModel MWIndexForceMetaItem class.
|
|
*
|
|
* @copyright 2011-2013 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( 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 ( ) {
|
|
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 );
|