mediawiki-extensions-Visual.../modules/ve-mw/ui/contextitems/ve.ui.MWSignatureContextItem.js
Bartosz Dziewoński e6a524d761 ve.ui.MWSignatureContextItem: Remove useless 'command'
The 'mwSignature' command replaces the selected content with your
signature. So basically, if you double-click this node, it gets
deleted and an identical one is inserted. This is useless.

I think I added this when this class was inheriting from
ve.ui.MWTransclusionContextItem, to override the command that would
open the transclusion dialog, but even then this should have instead
been `null`.

Change-Id: Id4492e36e9d89001df655e48b528d07eb608289e
2020-09-02 22:09:21 +00:00

56 lines
1.3 KiB
JavaScript

/*!
* VisualEditor MWSignatureContextItem class.
*
* @copyright 2011-2020 VisualEditor Team and others; see http://ve.mit-license.org
*/
/**
* Context item for a MWSignature.
*
* @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.MWSignatureContextItem = function VeUiMWSignatureContextItem() {
// Parent constructor
ve.ui.MWSignatureContextItem.super.apply( this, arguments );
// Initialization
this.$element.addClass( 've-ui-mwSignatureContextItem' );
this.$actions.remove();
};
/* Inheritance */
OO.inheritClass( ve.ui.MWSignatureContextItem, ve.ui.LinearContextItem );
/* Static Properties */
ve.ui.MWSignatureContextItem.static.editable = false;
ve.ui.MWSignatureContextItem.static.name = 'mwSignature';
ve.ui.MWSignatureContextItem.static.icon = 'signature';
ve.ui.MWSignatureContextItem.static.label =
OO.ui.deferMsg( 'visualeditor-mwsignature-tool' );
ve.ui.MWSignatureContextItem.static.modelClasses = [ ve.dm.MWSignatureNode ];
/* Methods */
/**
* @inheritdoc
*/
ve.ui.MWSignatureContextItem.prototype.getDescription = function () {
return '';
};
/* Registration */
ve.ui.contextItemFactory.register( ve.ui.MWSignatureContextItem );