From e4585d520b1bd81277d918660e69653acad8a1ca Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Thu, 7 Sep 2017 22:32:16 +0100 Subject: [PATCH] CollabTarget: Minimise dependencies, and make toolbar tweaks Change-Id: I37cccd5760b8e65fc4232ca4572147f3b031255d --- extension.json | 17 ++++++++++++++++- modules/ve-mw-collab/ve.init.mw.CollabTarget.js | 13 ++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/extension.json b/extension.json index fa3cc7781a..8a7c93e77a 100644 --- a/extension.json +++ b/extension.json @@ -431,12 +431,27 @@ "scripts": [ "modules/ve-mw-collab/ve.init.mw.CollabTarget.js" ], + "styles": [ + "modules/ve-mw/init/styles/ve.init.mw.ArticleTarget.css", + "modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css" + ], + "skinStyles": { + "vector": [ + "modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget-vector.css" + ], + "apex": [ + "modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget-apex.css" + ], + "monobook": [ + "modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget-monobook.css" + ] + }, "dependencies": [ "ext.visualEditor.base", "ext.visualEditor.mediawiki", "ext.visualEditor.core.desktop", "ext.visualEditor.mwextensions.desktop", - "ext.visualEditor.desktopArticleTarget" + "ext.visualEditor.desktopTarget" ] }, "ext.visualEditor.collabTarget.init": { diff --git a/modules/ve-mw-collab/ve.init.mw.CollabTarget.js b/modules/ve-mw-collab/ve.init.mw.CollabTarget.js index 327bed5e72..7d785a8cae 100644 --- a/modules/ve-mw-collab/ve.init.mw.CollabTarget.js +++ b/modules/ve-mw-collab/ve.init.mw.CollabTarget.js @@ -48,6 +48,14 @@ ve.init.mw.CollabTarget.static.name = 'collab'; ve.init.mw.CollabTarget.static.trackingName = 'collab'; ve.init.mw.CollabTarget.static.actionGroups = [ + { include: [ 'help' ] }, + { + type: 'list', + icon: 'menu', + indicator: null, + title: ve.msg( 'visualeditor-pagemenu-tooltip' ), + include: [ 'changeDirectionality', 'findAndReplace' ] + }, { include: [ 'authorList' ] } ]; @@ -85,19 +93,19 @@ ve.init.mw.CollabTarget.prototype.attachToolbar = function () { 've-init-mw-desktopArticleTarget-toolbar ve-init-mw-desktopArticleTarget-toolbar-open ve-init-mw-desktopArticleTarget-toolbar-opened' ); this.$element.prepend( this.toolbar.$element ); + this.toolbar.initialize(); }; /** * @inheritdoc */ ve.init.mw.CollabTarget.prototype.setSurface = function ( surface ) { - var synchronizer, surfaceView, toolbar; + var synchronizer, surfaceView; if ( surface !== this.surface ) { this.$editableContent.after( surface.$element ); surfaceView = surface.getView(); - toolbar = this.getToolbar(); synchronizer = new ve.dm.SurfaceSynchronizer( surface.getModel(), @@ -105,7 +113,6 @@ ve.init.mw.CollabTarget.prototype.setSurface = function ( surface ) { { server: this.rebaserUrl } ); - toolbar.initialize(); surfaceView.setSynchronizer( synchronizer ); }