mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
44e47a6e8f
If a references list node is selected, open the dialog to edit it. Otherwise just insert the references list for the default group, since this is what the user wants to do in 99% of cases. * Replaced the simple 'referencesList' command (which opened the dialog) with a custom implementation in ve.ui.MWReferencesListCommand, which inserts the references list or opens the dialog like before. * Removed the ability to insert a references list from ve.ui.MWReferencesListDialog, since it should now never open without a references list selected. If it does, throw an error. I considered the behavior of always showing the dialog if there is at least one references list already in the document, but I think it would be confusing if the tool behaved differently depending on the state of the document (rather than merely current selection). Bug: T71727 Change-Id: Ifbbfa28548de9c0435c5174fb7762079f59bac54
131 lines
3.1 KiB
JavaScript
131 lines
3.1 KiB
JavaScript
/*!
|
|
* VisualEditor MediaWiki CommandRegistry registrations.
|
|
*
|
|
* @copyright 2011-2015 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(
|
|
'reference', 'window', 'open',
|
|
{ args: ['reference'], 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']
|
|
}
|
|
)
|
|
);
|