Merge "CollabTarget: Minimise dependencies, and make toolbar tweaks"

This commit is contained in:
jenkins-bot 2017-09-08 15:52:55 +00:00 committed by Gerrit Code Review
commit 2bc46f93d3
2 changed files with 26 additions and 4 deletions

View file

@ -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": {

View file

@ -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 );
}