2014-11-23 18:04:00 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MediaWiki SequenceRegistry registrations.
|
|
|
|
*
|
2023-12-01 16:06:11 +00:00
|
|
|
* @copyright See AUTHORS.txt
|
2014-11-23 18:04:00 +00:00
|
|
|
* @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(
|
2014-11-26 01:42:37 +00:00
|
|
|
new ve.ui.Sequence( 'wikitextHeading', 'heading2', [ { type: 'paragraph' }, '=', '=' ], 2 )
|
2014-11-23 18:04:00 +00:00
|
|
|
);
|
2016-09-28 18:59:55 +00:00
|
|
|
( function () {
|
2022-03-11 17:12:54 +00:00
|
|
|
// As the user keeps pressing '=', reduce the heading level
|
2022-02-21 18:07:07 +00:00
|
|
|
for ( var level = 3; level <= 6; level++ ) {
|
2016-09-28 18:59:55 +00:00
|
|
|
ve.ui.sequenceRegistry.register(
|
|
|
|
new ve.ui.Sequence(
|
|
|
|
'wikitextHeadingLevel' + level, 'heading' + level,
|
|
|
|
[ { type: 'mwHeading', attributes: { level: level - 1 } }, '=' ], 1
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2016-11-12 14:43:43 +00:00
|
|
|
}() );
|
2014-11-23 18:04:00 +00:00
|
|
|
ve.ui.sequenceRegistry.register(
|
2014-11-23 18:07:15 +00:00
|
|
|
new ve.ui.Sequence( 'numberHash', 'numberWrapOnce', [ { type: 'paragraph' }, '#', ' ' ], 2 )
|
2014-11-23 18:04:00 +00:00
|
|
|
);
|
2014-11-26 00:47:29 +00:00
|
|
|
ve.ui.sequenceRegistry.register(
|
2016-10-28 00:22:30 +00:00
|
|
|
new ve.ui.Sequence( 'wikitextDefinition', 'mwWikitextWarning', [ { type: 'paragraph' }, ';' ] )
|
2014-11-26 00:47:29 +00:00
|
|
|
);
|
|
|
|
ve.ui.sequenceRegistry.register(
|
2019-04-19 22:13:45 +00:00
|
|
|
new ve.ui.Sequence( 'wikitextDescription', 'blockquoteWrap', [ { type: 'paragraph' }, ':' ], 1 )
|
2014-11-26 00:47:29 +00:00
|
|
|
);
|
2015-10-22 14:18:45 +00:00
|
|
|
ve.ui.sequenceRegistry.register(
|
2016-10-28 00:22:30 +00:00
|
|
|
new ve.ui.Sequence( 'wikitextTable', 'insertTable', '{|', 2 )
|
2015-10-22 14:18:45 +00:00
|
|
|
);
|
|
|
|
ve.ui.sequenceRegistry.register(
|
2016-10-28 00:22:30 +00:00
|
|
|
new ve.ui.Sequence( 'wikitextComment', 'comment', '<!--', 4 )
|
2015-10-22 14:18:45 +00:00
|
|
|
);
|
2015-11-03 11:22:42 +00:00
|
|
|
|
|
|
|
/* Help registrations */
|
|
|
|
|
|
|
|
ve.ui.commandHelpRegistry.register( 'formatting', 'heading2', {
|
2015-11-05 10:11:35 +00:00
|
|
|
sequences: [ 'wikitextHeading' ],
|
|
|
|
label: OO.ui.deferMsg( 'visualeditor-formatdropdown-format-heading2' )
|
2015-11-03 11:22:42 +00:00
|
|
|
} );
|
2015-11-05 10:11:35 +00:00
|
|
|
ve.ui.commandHelpRegistry.register( 'formatting', 'listNumber', { sequences: [ 'numberHash' ] } );
|
|
|
|
ve.ui.commandHelpRegistry.register( 'formatting', 'blockquote', { sequences: [ 'wikitextDescription' ] } );
|
2015-11-03 11:22:42 +00:00
|
|
|
ve.ui.commandHelpRegistry.register( 'insert', 'table', {
|
2015-11-05 10:11:35 +00:00
|
|
|
sequences: [ 'wikitextTable' ],
|
|
|
|
label: OO.ui.deferMsg( 'visualeditor-table-insert-table' )
|
2015-11-03 11:22:42 +00:00
|
|
|
} );
|
|
|
|
ve.ui.commandHelpRegistry.register( 'insert', 'comment', {
|
2015-11-05 10:11:35 +00:00
|
|
|
sequences: [ 'wikitextComment' ],
|
|
|
|
label: OO.ui.deferMsg( 'visualeditor-commentinspector-title' )
|
2015-11-03 11:22:42 +00:00
|
|
|
} );
|