jenkins-bot has submitted this change and it was merged. Change subject: Use the standard VE toolbar in Flow as much as possible ......................................................................
Use the standard VE toolbar in Flow as much as possible Changes: * Add mention * Remove h1 and h2 * Remove more/fewer expansion in insert menu (3 tools when collapsed, 4 when expanded) Bug: T93243 Change-Id: I3815ae32f641d5457bb15ead871dd4b8d1139537 --- M modules/editor/editors/visualeditor/mw.flow.ve.Target.js 1 file changed, 19 insertions(+), 14 deletions(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/editor/editors/visualeditor/mw.flow.ve.Target.js b/modules/editor/editors/visualeditor/mw.flow.ve.Target.js index 6701025..79a85f8 100644 --- a/modules/editor/editors/visualeditor/mw.flow.ve.Target.js +++ b/modules/editor/editors/visualeditor/mw.flow.ve.Target.js @@ -26,20 +26,25 @@ mw.flow.ve.Target.static.name = 'flow'; - mw.flow.ve.Target.static.toolbarGroups = [ - { - type: 'list', - icon: 'textStyle', - indicator: 'down', - title: OO.ui.deferMsg( 'visualeditor-toolbar-style-tooltip' ), - include: [ 'bold', 'italic' ], - forceExpand: [ 'bold', 'italic' ] - }, - - { include: [ 'link' ] }, - - { include: [ 'flowMention' ] } - ]; + mw.flow.ve.Target.static.toolbarGroups = ve.copy( mw.flow.ve.Target.static.toolbarGroups ); + // Exclude heading1 and heading2 from the format dropdown + mw.flow.ve.Target.static.toolbarGroups[ 1 ].exclude = + ( mw.flow.ve.Target.static.toolbarGroups[ 1 ].exclude || [] ) + .concat( [ 'heading1', 'heading2' ] ); + // Also remove heading1 and heading2 from the demote list + mw.flow.ve.Target.static.toolbarGroups[ 1 ].demote = + mw.flow.ve.Target.static.toolbarGroups[ 1 ].demote && + mw.flow.ve.Target.static.toolbarGroups[ 1 ].demote.filter( function ( tool ) { + return tool !== 'heading1' && tool !== 'heading2'; + } ); + // Exclude heading1, heading2 and flowSwitchEditor from the catch-all insert menu + mw.flow.ve.Target.static.toolbarGroups[ 5 ].exclude = + ( mw.flow.ve.Target.static.toolbarGroups[ 5 ].exclude || [] ) + .concat( [ 'heading1', 'heading2', 'flowSwitchEditor' ] ); + // Remove the more/fewer functionality in the insert menu + delete mw.flow.ve.Target.static.toolbarGroups[ 5 ].forceExpand; + // Add flowMention after link + mw.flow.ve.Target.static.toolbarGroups.splice( 3, 0, { include: [ 'flowMention' ] } ); // Allow pasting links mw.flow.ve.Target.static.importRules = ve.copy( mw.flow.ve.Target.static.importRules ); -- To view, visit https://gerrit.wikimedia.org/r/291364 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3815ae32f641d5457bb15ead871dd4b8d1139537 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits