mirror of
https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git
synced 2024-11-30 19:16:05 +00:00
6165b06f28
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.
58 lines
1.4 KiB
JavaScript
58 lines
1.4 KiB
JavaScript
/**
|
|
* VisualEditor UserInterface MWTabberDialogTool class.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.FragmentWindowTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWTabberDialogTool = function VeUiMWTabberDialogTool() {
|
|
ve.ui.MWTabberDialogTool.super.apply( this, arguments );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWTabberDialogTool, ve.ui.FragmentWindowTool );
|
|
|
|
/* Static properties */
|
|
|
|
ve.ui.MWTabberDialogTool.static.name = 'mwTabber';
|
|
|
|
ve.ui.MWTabberDialogTool.static.group = 'object';
|
|
|
|
ve.ui.MWTabberDialogTool.static.icon = 'listBullet';
|
|
|
|
ve.ui.MWTabberDialogTool.static.title =
|
|
OO.ui.deferMsg( 'tabberneue-visualeditor-mwtabberdialog-title' );
|
|
|
|
ve.ui.MWTabberDialogTool.static.modelClasses = [ ve.dm.MWTabberNode ];
|
|
|
|
ve.ui.MWTabberDialogTool.static.commandName = 'mwTabber';
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.toolFactory.register( ve.ui.MWTabberDialogTool );
|
|
|
|
/* Commands */
|
|
|
|
ve.ui.commandRegistry.register(
|
|
new ve.ui.Command(
|
|
'mwTabber', 'window', 'open',
|
|
{ args: [ 'mwTabber' ], supportedSelections: [ 'linear' ] }
|
|
)
|
|
);
|
|
|
|
/*
|
|
ve.ui.sequenceRegistry.register(
|
|
new ve.ui.Sequence( 'wikitextTabber', 'tabber', '<tabber', 6 )
|
|
);
|
|
*/
|
|
|
|
/* Only enable when the tool is more helpful
|
|
ve.ui.commandHelpRegistry.register( 'insert', 'mwTabber', {
|
|
sequences: [ 'wikitextTabber' ],
|
|
label: OO.ui.deferMsg( 'tabberneue-visualeditor-mwtabberdialog-title' )
|
|
} );
|
|
*/
|