2014-02-27 15:17:00 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MediaWiki Reference dialog tool classes.
|
|
|
|
*
|
2015-01-08 23:54:03 +00:00
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
2014-02-27 15:17:00 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface reference tool.
|
|
|
|
*
|
|
|
|
* @class
|
2015-12-08 13:18:51 +00:00
|
|
|
* @extends ve.ui.FragmentWindowTool
|
2014-02-27 15:17:00 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2015-12-08 13:18:51 +00:00
|
|
|
ve.ui.MWReferenceDialogTool = function VeUiMWReferenceDialogTool() {
|
|
|
|
ve.ui.MWReferenceDialogTool.super.apply( this, arguments );
|
2014-02-27 15:17:00 +00:00
|
|
|
};
|
2015-12-08 13:18:51 +00:00
|
|
|
OO.inheritClass( ve.ui.MWReferenceDialogTool, ve.ui.FragmentWindowTool );
|
2014-02-27 15:17:00 +00:00
|
|
|
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 ];
|
2014-04-02 23:29:04 +00:00
|
|
|
ve.ui.MWReferenceDialogTool.static.commandName = 'reference';
|
2015-06-29 18:42:00 +00:00
|
|
|
ve.ui.MWReferenceDialogTool.static.autoAddToCatchall = false;
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWReferenceDialogTool );
|
|
|
|
|
2014-05-30 21:28:41 +00:00
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface use existing reference tool.
|
|
|
|
*
|
|
|
|
* @class
|
2015-12-08 13:18:51 +00:00
|
|
|
* @extends ve.ui.WindowTool
|
2014-05-30 21:28:41 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2015-12-08 13:18:51 +00:00
|
|
|
ve.ui.MWUseExistingReferenceDialogTool = function VeUiMWUseExistingReferenceDialogTool() {
|
|
|
|
ve.ui.MWUseExistingReferenceDialogTool.super.apply( this, arguments );
|
2014-05-30 21:28:41 +00:00
|
|
|
};
|
2015-12-08 13:18:51 +00:00
|
|
|
OO.inheritClass( ve.ui.MWUseExistingReferenceDialogTool, ve.ui.WindowTool );
|
2014-05-30 21:28:41 +00:00
|
|
|
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 =
|
2014-07-03 20:42:54 +00:00
|
|
|
OO.ui.deferMsg( 'visualeditor-dialog-reference-useexisting-tool' );
|
2014-05-30 21:28:41 +00:00
|
|
|
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 );
|
|
|
|
|
2015-08-02 11:24:15 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'reference', 'window', 'open',
|
|
|
|
{ args: [ 'reference' ], supportedSelections: [ 'linear' ] }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2015-11-03 11:22:42 +00:00
|
|
|
/* If Citoid is installed these will be overridden */
|
2015-10-22 10:21:20 +00:00
|
|
|
ve.ui.sequenceRegistry.register(
|
|
|
|
new ve.ui.Sequence( 'wikitextRef', 'reference', '<ref', 4 )
|
|
|
|
);
|
|
|
|
|
2015-11-03 11:22:42 +00:00
|
|
|
ve.ui.commandHelpRegistry.register( 'insert', 'ref', {
|
2015-11-05 10:11:35 +00:00
|
|
|
sequences: [ 'wikitextRef' ],
|
|
|
|
label: OO.ui.deferMsg( 'visualeditor-dialog-reference-title' )
|
2015-11-03 11:22:42 +00:00
|
|
|
} );
|
|
|
|
|
2014-02-27 15:17:00 +00:00
|
|
|
/**
|
2014-08-19 18:32:46 +00:00
|
|
|
* MediaWiki UserInterface references list tool.
|
2014-02-27 15:17:00 +00:00
|
|
|
*
|
|
|
|
* @class
|
2015-12-08 13:18:51 +00:00
|
|
|
* @extends ve.ui.FragmentWindowTool
|
2014-02-27 15:17:00 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2015-12-08 13:18:51 +00:00
|
|
|
ve.ui.MWReferencesListDialogTool = function VeUiMWReferencesListDialogTool() {
|
|
|
|
ve.ui.MWReferencesListDialogTool.super.apply( this, arguments );
|
2014-02-27 15:17:00 +00:00
|
|
|
};
|
2015-12-08 13:18:51 +00:00
|
|
|
OO.inheritClass( ve.ui.MWReferencesListDialogTool, ve.ui.FragmentWindowTool );
|
2014-08-19 18:32:46 +00:00
|
|
|
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 );
|