mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 03:08:42 +00:00
Merge "New wikitext editor: unwrap lists when changing style"
This commit is contained in:
commit
1321452197
|
@ -120,18 +120,6 @@ ve.ui.wikitextCommandRegistry.register(
|
|||
{ args: [ '<sup>', '</sup>', OO.ui.deferMsg( 'visualeditor-annotationbutton-superscript-tooltip' ) ], supportedSelections: [ 'linear' ] }
|
||||
)
|
||||
);
|
||||
ve.ui.wikitextCommandRegistry.register(
|
||||
new ve.ui.Command(
|
||||
'number', 'mwWikitext', 'wrapLine',
|
||||
{ args: [ '# ', '', OO.ui.deferMsg( 'visualeditor-listbutton-number-tooltip' ) ], supportedSelections: [ 'linear' ] }
|
||||
)
|
||||
);
|
||||
ve.ui.wikitextCommandRegistry.register(
|
||||
new ve.ui.Command(
|
||||
'bullet', 'mwWikitext', 'wrapLine',
|
||||
{ args: [ '* ', '', OO.ui.deferMsg( 'visualeditor-listbutton-bullet-tooltip' ) ], supportedSelections: [ 'linear' ] }
|
||||
)
|
||||
);
|
||||
|
||||
( function () {
|
||||
var i, heading = '';
|
||||
|
@ -186,6 +174,27 @@ ve.ui.wikitextCommandRegistry.register(
|
|||
{ args: [ '<blockquote>', '</blockquote>', OO.ui.deferMsg( 'visualeditor-formatdropdown-format-blockquote' ), unformat ], supportedSelections: [ 'linear' ] }
|
||||
)
|
||||
);
|
||||
|
||||
function unlist( keepType, text ) {
|
||||
var matches;
|
||||
if ( ( matches = text.match( /^[*#] */ ) ) && text.slice( 0, 1 ) !== keepType ) {
|
||||
return [ matches[ 0 ].length, 0 ];
|
||||
}
|
||||
}
|
||||
|
||||
ve.ui.wikitextCommandRegistry.register(
|
||||
new ve.ui.Command(
|
||||
'number', 'mwWikitext', 'wrapLine',
|
||||
{ args: [ '# ', '', OO.ui.deferMsg( 'visualeditor-listbutton-number-tooltip' ), unlist.bind( this, '#' ) ], supportedSelections: [ 'linear' ] }
|
||||
)
|
||||
);
|
||||
ve.ui.wikitextCommandRegistry.register(
|
||||
new ve.ui.Command(
|
||||
'bullet', 'mwWikitext', 'wrapLine',
|
||||
{ args: [ '* ', '', OO.ui.deferMsg( 'visualeditor-listbutton-bullet-tooltip' ), unlist.bind( this, '*' ) ], supportedSelections: [ 'linear' ] }
|
||||
)
|
||||
);
|
||||
|
||||
} )();
|
||||
|
||||
ve.ui.wikitextCommandRegistry.register(
|
||||
|
|
Loading…
Reference in a new issue