Update 'wgCurRevisionId' after successful save

Also updates the EventLogging code to use a computed property for
'wgCurRevisionId'.

Change-Id: Ida648c77f56c0e455d6fb49a779a831734f6776b
This commit is contained in:
Ori Livneh 2013-06-13 12:59:40 -07:00
parent ec8d7e4c06
commit 1780b4e39c
2 changed files with 5 additions and 2 deletions

View file

@ -844,11 +844,13 @@ ve.init.mw.ViewPageTarget.prototype.setUpEventLogging = function () {
mw.eventLog.setDefaults( 'Edit', {
version: 0,
editor: 'visualeditor',
pageId: +mw.config.get( 'wgArticleId' ),
pageId: mw.config.get( 'wgArticleId' ),
pageNs: mw.config.get( 'wgNamespaceNumber' ),
pageName: mw.config.get( 'wgPageName' ),
pageViewSessionId: +new Date(),
revId: +mw.config.get( 'wgCurRevisionId' )
revId: function () {
return mw.config.get( 'wgCurRevisionId' );
}
} );
} );
};

View file

@ -329,6 +329,7 @@ ve.init.mw.Target.onSave = function ( response ) {
this, null, 'Invalid HTML content in response from server', null
);
} else {
mw.config.set( 'wgCurRevisionId', data.newrevid );
this.emit( 'save', data.content, data.newrevid );
}
};