mediawiki-extensions-Visual.../modules/ve-mw/ui/tools/ve.ui.MWLinkInspectorTool.js
Ed Sanders af8e23ec6e Remove code for varying MWLinkInspectorTool title
The title is visibly varied in the context menu separately, and
we don't usually change the link tool's title - so this is just
a performance drain (updateState happens a lot).

Change-Id: I9cf2aa509a6aac3a2914fa52167cb4463843cd72
2016-02-11 02:22:16 +00:00

59 lines
1.7 KiB
JavaScript

/*!
* VisualEditor UserInterface MediaWiki LinkInspectorTool classes.
*
* @copyright 2011-2016 VisualEditor Team and others; see AUTHORS.txt
* @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
*
* @constructor
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
ve.ui.MWLinkInspectorTool = function VeUiMwLinkInspectorTool() {
ve.ui.MWLinkInspectorTool.super.apply( this, arguments );
ve.ui.MWEducationPopupTool.call( this, {
title: ve.msg( 'visualeditor-linkinspector-educationpopup-title' ),
text: ve.msg( 'visualeditor-linkinspector-educationpopup-text' )
} );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWLinkInspectorTool, ve.ui.LinkInspectorTool );
OO.mixinClass( ve.ui.MWLinkInspectorTool, ve.ui.MWEducationPopupTool );
/* Static Properties */
ve.ui.MWLinkInspectorTool.static.modelClasses =
ve.ui.MWLinkInspectorTool.super.static.modelClasses.concat( [
ve.dm.MWNumberedExternalLinkNode,
ve.dm.MWMagicLinkNode
] );
ve.ui.MWLinkInspectorTool.static.associatedWindows = [ 'link', 'linkNode', 'linkMagicNode' ];
/* Registration */
ve.ui.toolFactory.register( ve.ui.MWLinkInspectorTool );
ve.ui.commandRegistry.register(
new ve.ui.Command(
'link', 'link', 'open', { supportedSelections: [ 'linear' ] }
)
);
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextLink', 'link', '[[', 2 )
);
ve.ui.commandHelpRegistry.register( 'textStyle', 'link', { sequences: [ 'wikitextLink' ] } );