MobileCollabTarget: Cleanup toolbar

Change-Id: I4b2e21ce61cb647ca6a74bdbdd8def614ed41341
This commit is contained in:
Ed Sanders 2019-02-01 10:24:20 -08:00
parent 3285b7dbe5
commit 47af04b8d9
3 changed files with 57 additions and 2 deletions

View file

@ -136,10 +136,15 @@ ve.init.mw.targetFactory.register( ve.init.mw.CollabTarget );
ve.ui.MWExportTool = function VeUiMWExportTool() {
// Parent constructor
ve.ui.MWExportTool.super.apply( this, arguments );
if ( OO.ui.isMobile() ) {
this.setIcon( 'upload' );
this.setTitle( null );
}
};
OO.inheritClass( ve.ui.MWExportTool, ve.ui.Tool );
ve.ui.MWExportTool.static.name = 'export';
ve.ui.MWExportTool.static.displayBothIconAndLabel = true;
ve.ui.MWExportTool.static.displayBothIconAndLabel = !OO.ui.isMobile();
ve.ui.MWExportTool.static.group = 'export';
ve.ui.MWExportTool.static.autoAddToCatchall = false;
ve.ui.MWExportTool.static.flags = [ 'progressive', 'primary' ];

View file

@ -33,10 +33,59 @@ OO.inheritClass( ve.init.mw.MobileCollabTarget, ve.init.mw.CollabTarget );
/* Static Properties */
ve.init.mw.MobileCollabTarget.static.toolbarGroups = [
// History
{
name: 'history',
include: [ 'undo' ]
},
// Style
{
name: 'style',
classes: [ 've-test-toolbar-style' ],
type: 'list',
icon: 'textStyle',
title: OO.ui.deferMsg( 'visualeditor-toolbar-style-tooltip' ),
include: [ { group: 'textStyle' }, 'language', 'clear' ],
forceExpand: [ 'bold', 'italic', 'clear' ],
promote: [ 'bold', 'italic' ],
demote: [ 'strikethrough', 'code', 'underline', 'language', 'clear' ]
},
// Link
{
name: 'link',
include: [ 'link' ]
},
{
name: 'commentAnnotation',
include: [ 'commentAnnotation' ]
},
// Placeholder for reference tools (e.g. Cite and/or Citoid)
{
name: 'reference'
},
{
name: 'insert',
header: OO.ui.deferMsg( 'visualeditor-toolbar-insert' ),
title: OO.ui.deferMsg( 'visualeditor-toolbar-insert' ),
type: 'list',
icon: 'add',
label: '',
include: '*',
exclude: [ 'comment', 'indent', 'outdent', { group: 'format' } ]
}
// "Done" tool is added in setupToolbar as it not part of the
// standard config (i.e. shouldn't be inhertied by TargetWidget)
];
ve.init.mw.MobileCollabTarget.static.actionGroups = [
{
name: 'authorList',
include: [ 'authorList' ]
},
{
name: 'export',
include: [ 'export' ]
}
];

View file

@ -49,7 +49,8 @@ ve.init.mw.MobileArticleTarget.static.toolbarGroups = [
// History
{
name: 'history',
include: [ 'undo' ] },
include: [ 'undo' ]
},
// Style
{
name: 'style',