mediawiki-extensions-Visual.../modules/ve-mw/ui/tools/ve.ui.MWReferenceDialogTool.js
Ed Sanders 216d0ea7a7 Update CommandHelpRegistry calls for breaking change in core
New changes:
281b543 Slugs: Remove vertical alignment hack
d6ddbe4 Localisation updates from https://translatewiki.net.
94bb263 Follow-up d6ddbe4: Fix build for added language 'sd'
bc8579d [BREAKING CHANGE] CommandHelp: Cleanup registry API

Change-Id: I65e2bfc299fbd60d6bdc7a57a030980b6cb8ab18
2015-11-05 07:29:44 -08:00

93 lines
3.6 KiB
JavaScript

/*!
* VisualEditor MediaWiki Reference dialog tool classes.
*
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* MediaWiki UserInterface reference tool.
*
* @class
* @extends ve.ui.DialogTool
* @constructor
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
ve.ui.MWReferenceDialogTool = function VeUiMWReferenceDialogTool( toolGroup, config ) {
ve.ui.DialogTool.call( this, toolGroup, config );
};
OO.inheritClass( ve.ui.MWReferenceDialogTool, ve.ui.DialogTool );
ve.ui.MWReferenceDialogTool.static.name = 'reference';
ve.ui.MWReferenceDialogTool.static.group = 'object';
ve.ui.MWReferenceDialogTool.static.icon = 'reference';
ve.ui.MWReferenceDialogTool.static.title =
OO.ui.deferMsg( 'visualeditor-dialogbutton-reference-tooltip' );
ve.ui.MWReferenceDialogTool.static.modelClasses = [ ve.dm.MWReferenceNode ];
ve.ui.MWReferenceDialogTool.static.commandName = 'reference';
ve.ui.MWReferenceDialogTool.static.autoAddToCatchall = false;
ve.ui.toolFactory.register( ve.ui.MWReferenceDialogTool );
/**
* MediaWiki UserInterface use existing reference tool.
*
* @class
* @extends ve.ui.DialogTool
* @constructor
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
ve.ui.MWUseExistingReferenceDialogTool = function VeUiMWUseExistingReferenceDialogTool( toolGroup, config ) {
ve.ui.DialogTool.call( this, toolGroup, config );
};
OO.inheritClass( ve.ui.MWUseExistingReferenceDialogTool, ve.ui.DialogTool );
ve.ui.MWUseExistingReferenceDialogTool.static.name = 'reference/existing';
ve.ui.MWUseExistingReferenceDialogTool.static.group = 'object';
ve.ui.MWUseExistingReferenceDialogTool.static.icon = 'reference-existing';
ve.ui.MWUseExistingReferenceDialogTool.static.title =
OO.ui.deferMsg( 'visualeditor-dialog-reference-useexisting-tool' );
ve.ui.MWUseExistingReferenceDialogTool.static.modelClasses = [];
ve.ui.MWUseExistingReferenceDialogTool.static.commandName = 'reference/existing';
ve.ui.MWUseExistingReferenceDialogTool.static.autoAddToGroup = false;
ve.ui.MWUseExistingReferenceDialogTool.static.autoAddToCatchall = false;
ve.ui.toolFactory.register( ve.ui.MWUseExistingReferenceDialogTool );
ve.ui.commandRegistry.register(
new ve.ui.Command(
'reference', 'window', 'open',
{ args: [ 'reference' ], supportedSelections: [ 'linear' ] }
)
);
/* If Citoid is installed these will be overridden */
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextRef', 'reference', '<ref', 4 )
);
ve.ui.commandHelpRegistry.register( 'insert', 'ref', {
sequences: [ 'wikitextRef' ],
label: OO.ui.deferMsg( 'visualeditor-dialog-reference-title' )
} );
/**
* MediaWiki UserInterface references list tool.
*
* @class
* @extends ve.ui.DialogTool
* @constructor
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
ve.ui.MWReferencesListDialogTool = function VeUiMWReferencesListDialogTool( toolGroup, config ) {
ve.ui.DialogTool.call( this, toolGroup, config );
};
OO.inheritClass( ve.ui.MWReferencesListDialogTool, ve.ui.DialogTool );
ve.ui.MWReferencesListDialogTool.static.name = 'referencesList';
ve.ui.MWReferencesListDialogTool.static.group = 'object';
ve.ui.MWReferencesListDialogTool.static.icon = 'references';
ve.ui.MWReferencesListDialogTool.static.title =
OO.ui.deferMsg( 'visualeditor-dialogbutton-referenceslist-tooltip' );
ve.ui.MWReferencesListDialogTool.static.modelClasses = [ ve.dm.MWReferencesListNode ];
ve.ui.MWReferencesListDialogTool.static.commandName = 'referencesList';
ve.ui.toolFactory.register( ve.ui.MWReferencesListDialogTool );