From 47af04b8d9a34b9445d5ff61367833ea7202565a Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Fri, 1 Feb 2019 10:24:20 -0800 Subject: [PATCH] MobileCollabTarget: Cleanup toolbar Change-Id: I4b2e21ce61cb647ca6a74bdbdd8def614ed41341 --- .../ve-mw-collab/ve.init.mw.CollabTarget.js | 7 ++- .../ve.init.mw.MobileCollabTarget.js | 49 +++++++++++++++++++ .../targets/ve.init.mw.MobileArticleTarget.js | 3 +- 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw-collab/ve.init.mw.CollabTarget.js b/modules/ve-mw-collab/ve.init.mw.CollabTarget.js index 649ce42960..0c1e1f11c6 100644 --- a/modules/ve-mw-collab/ve.init.mw.CollabTarget.js +++ b/modules/ve-mw-collab/ve.init.mw.CollabTarget.js @@ -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' ]; diff --git a/modules/ve-mw-collab/ve.init.mw.MobileCollabTarget.js b/modules/ve-mw-collab/ve.init.mw.MobileCollabTarget.js index 626e3c8153..71352d4027 100644 --- a/modules/ve-mw-collab/ve.init.mw.MobileCollabTarget.js +++ b/modules/ve-mw-collab/ve.init.mw.MobileCollabTarget.js @@ -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' ] } ]; diff --git a/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js index 8e9126347d..568c5bd578 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js @@ -49,7 +49,8 @@ ve.init.mw.MobileArticleTarget.static.toolbarGroups = [ // History { name: 'history', - include: [ 'undo' ] }, + include: [ 'undo' ] + }, // Style { name: 'style',