mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
5ce4885529
Uses the generic sequence detection now available in core instead of a custom hack that had to been manually bound and unbound to every surface and surface widget. As the sequence detection looks at just-typed characters the behaviour has reverted to showing a auto-hide message. This resolves an issue with the previous system whereby typing in the same paragraph as existing wikitext patterns triggered the warning. Depends on I6a4d71d in core. Bug: T53751 Change-Id: I7d914b1b60a1cf8c79a724e5f634e1e666c9562d
137 lines
3.3 KiB
JavaScript
137 lines
3.3 KiB
JavaScript
/*!
|
|
* VisualEditor MediaWiki CommandRegistry registrations.
|
|
*
|
|
* @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(
|
|
'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']
|
|
}
|
|
)
|
|
);
|