mediawiki-extensions-Visual.../modules/ve-mw/ui/contextitems/ve.ui.MWReferencesListContextItem.js
James D. Forrester ada58df361 build: Bump file copyright notices for 2016
Change-Id: I3c618c196e504a80ca297a4132a17f1977a24fb7
2016-01-03 14:57:25 -08:00

59 lines
1.6 KiB
JavaScript

/*!
* VisualEditor MWReferencesListContextItem class.
*
* @copyright 2011-2016 VisualEditor Team and others; see http://ve.mit-license.org
*/
/**
* Context item for a MWReferencesList.
*
* @class
* @extends ve.ui.LinearContextItem
*
* @constructor
* @param {ve.ui.Context} context Context item is in
* @param {ve.dm.Model} model Model item is related to
* @param {Object} config Configuration options
*/
ve.ui.MWReferencesListContextItem = function VeUiMWReferencesListContextItem() {
// Parent constructor
ve.ui.MWReferencesListContextItem.super.apply( this, arguments );
// Initialization
this.$element.addClass( 've-ui-mwReferencesListContextItem' );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWReferencesListContextItem, ve.ui.LinearContextItem );
/* Static Properties */
ve.ui.MWReferencesListContextItem.static.name = 'referencesList';
ve.ui.MWReferencesListContextItem.static.icon = 'references';
ve.ui.MWReferencesListContextItem.static.label =
OO.ui.deferMsg( 'visualeditor-dialogbutton-referenceslist-tooltip' );
ve.ui.MWReferencesListContextItem.static.modelClasses = [ ve.dm.MWReferencesListNode ];
ve.ui.MWReferencesListContextItem.static.commandName = 'referencesList';
/* Methods */
/**
* @inheritdoc
*/
ve.ui.MWReferencesListContextItem.prototype.getDescription = function () {
var group = this.model.getAttribute( 'refGroup' );
return group ?
ve.msg( 'visualeditor-dialog-referenceslist-contextitem-description-named', group ) :
ve.msg( 'visualeditor-dialog-referenceslist-contextitem-description-general' );
};
/* Registration */
ve.ui.contextItemFactory.register( ve.ui.MWReferencesListContextItem );