mediawiki-extensions-Visual.../modules/ve-mw/ui/ve.ui.MWCommandRegistry.js
James D. Forrester 31bafa183d Update VE core submodule to master (a942301)
New changes:
2cc219a Update OOjs UI to v0.1.0-pre (571f26d0ab)
3543cb7 Protect against offset=-1 in insertContent()
7a3d456 [BREAKING CHANGE] Move selection restrictions from tools to commands
3d847bb Disable desktop context on table selections
41282dd Missed function rename from RangeFix change
dd6c8b8 Support toDomElements returning an empty array
9be6464 Placholder -> placeholder
9bdd0a8 Restore basic styling to toolbar in core target (only)

Local changes:
Move selection restrictions from tools to commands

Change-Id: I88f3d04946bd1d03ed001d747475a8b495a0f64c
2014-11-04 14:11:04 -08:00

143 lines
3.5 KiB
JavaScript

/*!
* VisualEditor CommandRegistry class.
*
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/* MW Command Registrations */
ve.ui.commandRegistry.register(
new ve.ui.Command(
'link', 'mwlink', 'open', { supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'gallery', 'window', 'open',
{ args: ['gallery'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'media', 'window', 'open',
{ args: ['media'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'referencesList', 'window', 'open',
{ args: ['referencesList'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'reference', 'window', 'open',
{ args: ['reference'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'reference/existing', 'window', 'open',
{ args: [ 'reference', { useExisting: true } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'transclusion', 'window', 'open',
{ args: ['transclusion'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'alienExtension', 'window', 'open',
{ args: ['alienExtension'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'meta', 'window', 'open',
{ args: ['meta'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'meta/settings', 'window', 'open',
{ args: [ 'meta', { page: 'settings' } ] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'meta/advanced', 'window', 'open',
{ args: [ 'meta', { page: 'advancedSettings' } ] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'meta/categories', 'window', 'open',
{ args: [ 'meta', { page: 'categories' } ] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'meta/languages', 'window', 'open',
{ args: [ 'meta', { page: 'languages' } ] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'heading1', 'format', 'convert',
{ args: [ 'mwHeading', { level: 1 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'heading2', 'format', 'convert',
{ args: [ 'mwHeading', { level: 2 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'heading3', 'format', 'convert',
{ args: [ 'mwHeading', { level: 3 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'heading4', 'format', 'convert',
{ args: [ 'mwHeading', { level: 4 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'heading5', 'format', 'convert',
{ args: [ 'mwHeading', { level: 5 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'heading6', 'format', 'convert',
{ args: [ 'mwHeading', { level: 6 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command(
'preformatted', 'format', 'convert',
{ args: [ 'mwPreformatted' ], supportedSelections: ['linear'] }
)
);
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']
}
)
);