mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 03:08:42 +00:00
Merge "Synchronizer: Fix defaultName config"
This commit is contained in:
commit
1ed01e0a05
|
@ -60,6 +60,8 @@
|
|||
|
||||
modulePromise.done( function () {
|
||||
var dummySurface, surfaceModel,
|
||||
isNewAuthor = !ve.init.platform.sessionStorage.get( 've-collab-author' ),
|
||||
username = mw.user.getName(),
|
||||
progressDeferred = $.Deferred();
|
||||
|
||||
target = ve.init.mw.targetFactory.create( 'collab', title, conf.rebaserUrl, { importTitle: importTitle } );
|
||||
|
@ -84,7 +86,7 @@
|
|||
// TODO: server could communicate with MW (via oauth?) to know the
|
||||
// current-user's name. Disable changing name if logged in?
|
||||
// Communicate an I-am-a-valid-user flag to other clients?
|
||||
defaultName: mw.user.isAnon() ? mw.user.getName() : undefined
|
||||
defaultName: username
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -103,6 +105,10 @@
|
|||
target.once( 'surfaceReady', function () {
|
||||
initPromise.then( function () {
|
||||
surfaceModel.selectFirstContentOffset();
|
||||
// For new anon users, open the author list so they can set their name
|
||||
if ( isNewAuthor && !username ) {
|
||||
target.actionsToolbar.tools.authorList.onSelect();
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
|
|
Loading…
Reference in a new issue