2014-10-22 02:44:27 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MediaWiki LinkInspectorTool classes.
|
|
|
|
*
|
2015-01-08 23:54:03 +00:00
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
2014-10-22 02:44:27 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* UserInterface link tool. Overrides link tool from core.
|
|
|
|
*
|
|
|
|
* Works for both link annotations and link nodes, and fires the 'link' command
|
|
|
|
* which works for both as well.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.LinkInspectorTool
|
2015-08-06 14:22:15 +00:00
|
|
|
*
|
2014-10-22 02:44:27 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2015-08-06 14:22:15 +00:00
|
|
|
ve.ui.MWLinkInspectorTool = function VeUiMwLinkInspectorTool() {
|
|
|
|
ve.ui.MWLinkInspectorTool.super.apply( this, arguments );
|
2014-10-22 02:44:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWLinkInspectorTool, ve.ui.LinkInspectorTool );
|
|
|
|
|
|
|
|
// FIXME should eventually vary title based on link type
|
|
|
|
// Use message visualeditor-annotationbutton-linknode-tooltip
|
|
|
|
|
|
|
|
ve.ui.MWLinkInspectorTool.static.modelClasses =
|
|
|
|
ve.ui.MWLinkInspectorTool.super.static.modelClasses.concat( [
|
|
|
|
ve.dm.MWNumberedExternalLinkNode
|
|
|
|
] );
|
|
|
|
|
2015-06-26 18:51:13 +00:00
|
|
|
ve.ui.MWLinkInspectorTool.static.associatedWindows = [ 'link', 'linkNode' ];
|
|
|
|
|
2014-10-22 02:44:27 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWLinkInspectorTool );
|
2015-08-02 11:24:15 +00:00
|
|
|
|
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
2015-08-12 20:55:31 +00:00
|
|
|
'link', 'link', 'open', { supportedSelections: [ 'linear' ] }
|
2015-08-02 11:24:15 +00:00
|
|
|
)
|
|
|
|
);
|