mediawiki-extensions-Visual.../modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js
Bartosz Dziewoński 39208b7d40 Update VE core submodule to master (2859146e5)
New changes:
fa5d35054 Only re-use session token if docname matches
58d7cd280 Localisation updates from https://translatewiki.net.
d0716d8e7 Update files generated with new l10n language 'my'
2cc7a4423 Create unit tests for sequences
873fdd01e Upstream horizontalRule sequence and fix command

Local changes:
* Register unit test file for sequences
* Remove duplicate horizontal rule sequence

Change-Id: Ibc65cf5c086428bb0d13c8e2f2de5819e1e23d43
2018-08-14 09:20:07 +02:00

60 lines
2.1 KiB
JavaScript

/*!
* VisualEditor MediaWiki SequenceRegistry registrations.
*
* @copyright 2011-2018 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextItalic', 'mwWikitextWarning', '\'\'' )
);
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextNowiki', 'mwWikitextWarning', '<nowiki' )
);
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextHeading', 'heading2', [ { type: 'paragraph' }, '=', '=' ], 2 )
);
( function () {
var level;
for ( level = 3; level <= 6; level++ ) {
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence(
'wikitextHeadingLevel' + level, 'heading' + level,
[ { type: 'mwHeading', attributes: { level: level - 1 } }, '=' ], 1
)
);
}
}() );
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'numberHash', 'numberWrapOnce', [ { type: 'paragraph' }, '#', ' ' ], 2 )
);
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextDefinition', 'mwWikitextWarning', [ { type: 'paragraph' }, ';' ] )
);
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextDescription', 'blockquote', [ { type: 'paragraph' }, ':' ], 1 )
);
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextTable', 'insertTable', '{|', 2 )
);
ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextComment', 'comment', '<!--', 4 )
);
/* Help registrations */
ve.ui.commandHelpRegistry.register( 'formatting', 'heading2', {
sequences: [ 'wikitextHeading' ],
label: OO.ui.deferMsg( 'visualeditor-formatdropdown-format-heading2' )
} );
ve.ui.commandHelpRegistry.register( 'formatting', 'listNumber', { sequences: [ 'numberHash' ] } );
ve.ui.commandHelpRegistry.register( 'formatting', 'blockquote', { sequences: [ 'wikitextDescription' ] } );
ve.ui.commandHelpRegistry.register( 'insert', 'table', {
sequences: [ 'wikitextTable' ],
label: OO.ui.deferMsg( 'visualeditor-table-insert-table' )
} );
ve.ui.commandHelpRegistry.register( 'insert', 'comment', {
sequences: [ 'wikitextComment' ],
label: OO.ui.deferMsg( 'visualeditor-commentinspector-title' )
} );