mediawiki-extensions-Tabber.../modules/ve-tabberNeue/ve.ui.MWTabberContextItem.js
alistair3149 6165b06f28
feat: add basic VisualEditor support for tabber tags
Adding some basic support for visual editing in VisualEditor. Currently it is nothing fancy, just the ability to recognize <tabber/> tags and a simple dialog with code editor to edit the Tabber code. It would be iterated upon in the future.
2022-04-21 15:14:52 -04:00

44 lines
1.1 KiB
JavaScript

/**
* VisualEditor MWTabberContextItem 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.MWTabberContextItem = function VeUiMWTabberContextItem() {
// Parent constructor
ve.ui.MWTabberContextItem.super.apply( this, arguments );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWTabberContextItem, ve.ui.LinearContextItem );
/* Static Properties */
ve.ui.MWTabberContextItem.static.name = 'mwTabber';
ve.ui.MWTabberContextItem.static.icon = 'listBullet';
ve.ui.MWTabberContextItem.static.label = OO.ui.deferMsg( 'tabberneue-visualeditor-mwtabberdialog-title' );
ve.ui.MWTabberContextItem.static.modelClasses = [ ve.dm.MWInlineMapsNode, ve.dm.MWTabberNode ];
ve.ui.MWTabberContextItem.static.commandName = 'mwTabber';
/* Methods */
/**
* @inheritdoc
*/
ve.ui.MWTabberContextItem.prototype.getDescription = function () {
return '';
};
/* Registration */
ve.ui.contextItemFactory.register( ve.ui.MWTabberContextItem );