mediawiki-extensions-Visual.../modules/ve-mw/ui/tools/ve.ui.MWLinkInspectorTool.js
Ed Sanders ac9f1a0919 MobileArticleTarget: Give toolbar split focused/unfocused modes
Split the toolbar into two modes depending on if the surface is focused:
* When unfocused, show a hamburger containing back and source switch
* When focused, show editing tools, and a check button to unfocus

For the editing toolbar, space the tools out using table-cell layout
and hide labels below 480px.

Depends on I06813e3ff in core (surface blur method).

Bug: T93325
Change-Id: Ibf09cb29019d7a71e1e144b326710b1f6506cd0c
2015-08-06 15:43:36 -07:00

44 lines
1.2 KiB
JavaScript

/*!
* VisualEditor UserInterface MediaWiki LinkInspectorTool classes.
*
* @copyright 2011-2015 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 );
};
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
] );
ve.ui.MWLinkInspectorTool.static.associatedWindows = [ 'link', 'linkNode' ];
ve.ui.toolFactory.register( ve.ui.MWLinkInspectorTool );
ve.ui.commandRegistry.register(
new ve.ui.Command(
'link', 'mwlink', 'open', { supportedSelections: [ 'linear' ] }
)
);