mediawiki-extensions-Visual.../modules/ve-mw/ui/ve.ui.MWCommandRegistry.js
Ed Sanders dedc107507 MWCommandRegistry: Move commands' registrations to their code
By moving the registration to the code which introduce the commands, if any
module such as 'media' is omitted from an integration, we don't register a
command which is never used.

MWCommandRegistry.js remains to be used for over-rides of core tools' exact
commands, such as insertTable.

Change-Id: I84b4351b980a764d3c72a564f605821ae1c761f9
2015-08-02 17:55:09 -07:00

24 lines
509 B
JavaScript

/*!
* VisualEditor MediaWiki CommandRegistry registrations.
*
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/* MW-specific over-rides of core command registrations */
ve.ui.commandRegistry.register(
new ve.ui.Command( 'insertTable', 'table', 'create',
{
args: [ {
header: true,
rows: 3,
cols: 4,
type: 'mwTable',
attributes: { wikitable: true }
} ],
supportedSelections: [ 'linear' ]
}
)
);