mediawiki-extensions-Tabber.../modules/ve-tabberNeue/ve.ui.MWTabberTranscludeContextItem.js
alistair3149 5df6a0f772
feat: add link to documentation in VE context item
Also make the text label for tabbertransclude different so that it does not get mixed up with regular tabber
2022-04-22 22:22:44 -04:00

52 lines
1.5 KiB
JavaScript

/**
* VisualEditor MWTabberTranscludeContextItem class.
*
* @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.MWTabberTranscludeContextItem = function VeUiMWTabberTranscludeContextItem() {
// Parent constructor
ve.ui.MWTabberTranscludeContextItem.super.apply( this, arguments );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWTabberTranscludeContextItem, ve.ui.LinearContextItem );
/* Static Properties */
ve.ui.MWTabberTranscludeContextItem.static.name = 'mwTabberTransclude';
ve.ui.MWTabberTranscludeContextItem.static.icon = 'tabber';
ve.ui.MWTabberTranscludeContextItem.static.label = OO.ui.deferMsg( 'tabberneue-visualeditor-mwtabbertranscludeinspector-title' );
ve.ui.MWTabberTranscludeContextItem.static.modelClasses = [ ve.dm.MWTabberTranscludeNode ];
ve.ui.MWTabberTranscludeContextItem.static.commandName = 'mwTabberTransclude';
/* Methods */
/**
* @inheritdoc
*/
ve.ui.MWTabberTranscludeContextItem.prototype.getDescription = function () {
return mw.message( 'tabberneue-visualeditor-mwtabbertranscludeinspector-desc' ).parse();
};
/**
* @inheritdoc
*/
ve.ui.MWTabberTranscludeContextItem.prototype.renderBody = function () {
this.$body.empty().append( this.getDescription() );
};
/* Registration */
ve.ui.contextItemFactory.register( ve.ui.MWTabberTranscludeContextItem );