mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-09-24 02:48:18 +00:00
Merge "Remove somewhat useless ReplyWidget.prototype.getParsoidCommentData"
This commit is contained in:
commit
a8de849a4e
|
@ -213,13 +213,13 @@ function getPageData( pageName, oldId ) {
|
|||
/**
|
||||
* Get the Parsoid document DOM, parse comments and threads, and find a specific comment in it.
|
||||
*
|
||||
* @param {string} pageName Page title
|
||||
* @param {number} oldId Revision ID
|
||||
* @param {string} commentId Comment ID, from a comment parsed in the local document
|
||||
* @return {jQuery.Promise}
|
||||
*/
|
||||
function getParsoidCommentData( pageName, oldId, commentId ) {
|
||||
var parsoidPageData, parsoidDoc, parsoidComments, parsoidCommentsById;
|
||||
function getParsoidCommentData( commentId ) {
|
||||
var parsoidPageData, parsoidDoc, parsoidComments, parsoidCommentsById,
|
||||
pageName = mw.config.get( 'wgRelevantPageName' ),
|
||||
oldId = mw.config.get( 'wgCurRevisionId' );
|
||||
|
||||
return getPageData( pageName, oldId )
|
||||
.then( function ( response ) {
|
||||
|
@ -230,11 +230,11 @@ function getParsoidCommentData( pageName, oldId, commentId ) {
|
|||
|
||||
parsoidPageData = {
|
||||
pageName: pageName,
|
||||
oldId: oldId
|
||||
oldId: oldId,
|
||||
baseTimeStamp: data.basetimestamp,
|
||||
startTimeStamp: data.starttimestamp,
|
||||
etag: data.etag
|
||||
};
|
||||
parsoidPageData.baseTimeStamp = data.basetimestamp;
|
||||
parsoidPageData.startTimeStamp = data.starttimestamp;
|
||||
parsoidPageData.etag = data.etag;
|
||||
|
||||
// getThreads build the tree structure, currently only
|
||||
// used to set 'replies'
|
||||
|
|
|
@ -271,14 +271,6 @@ ReplyWidget.prototype.onUnload = function () {
|
|||
} );
|
||||
};
|
||||
|
||||
ReplyWidget.prototype.getParsoidCommentData = function () {
|
||||
return controller.getParsoidCommentData(
|
||||
mw.config.get( 'wgRelevantPageName' ),
|
||||
mw.config.get( 'wgCurRevisionId' ),
|
||||
this.comment.id
|
||||
);
|
||||
};
|
||||
|
||||
ReplyWidget.prototype.onReplyClick = function () {
|
||||
var widget = this;
|
||||
|
||||
|
@ -291,7 +283,7 @@ ReplyWidget.prototype.onReplyClick = function () {
|
|||
logger( { action: 'saveIntent' } );
|
||||
|
||||
// We must get a new copy of the document every time, otherwise any unsaved replies will pile up
|
||||
this.getParsoidCommentData().then( function ( parsoidData ) {
|
||||
controller.getParsoidCommentData( this.comment.id ).then( function ( parsoidData ) {
|
||||
logger( { action: 'saveAttempt' } );
|
||||
|
||||
return controller.postReply( widget, parsoidData );
|
||||
|
@ -313,7 +305,7 @@ ReplyWidget.prototype.onReplyClick = function () {
|
|||
wgCurRevisionId: latestRevId,
|
||||
wgRevisionId: latestRevId
|
||||
} );
|
||||
return widget.getParsoidCommentData().then( function ( parsoidData ) {
|
||||
return controller.getParsoidCommentData( widget.comment.id ).then( function ( parsoidData ) {
|
||||
return controller.postReply( widget, parsoidData );
|
||||
} );
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue