mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
34da7d56b8
New changes: 04a5947 Localisation updates from https://translatewiki.net. dd4691b Update OOjs to v1.1.5 2e1a0bb Context refactor Local changes: Add context item support for references, citations, templates and links Change-Id: I5d488ecbf9768dc63de6e545505dbfd5eb84cc61
59 lines
1.6 KiB
JavaScript
59 lines
1.6 KiB
JavaScript
/*!
|
|
* VisualEditor MWReferencesListContextItem class.
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see http://ve.mit-license.org
|
|
*/
|
|
|
|
/**
|
|
* Context item for a MWReferencesList.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.ContextItem
|
|
*
|
|
* @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 VeMWReferencesListContextItem( context, model, config ) {
|
|
// Parent constructor
|
|
ve.ui.MWReferencesListContextItem.super.call( this, context, model, config );
|
|
|
|
// Initialization
|
|
this.$element.addClass( 've-ui-mwReferencesListContextItem' );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWReferencesListContextItem, ve.ui.ContextItem );
|
|
|
|
/* 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 );
|