r90052 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90051‎ | r90052 | r90053 >
Date:14:57, 14 June 2011
Author:aaron
Status:ok
Tags:
Comment:
Tweaked r90033: Improved API param names. Also decreased deadvertiseReviewing() JS timeout a bit.
Modified paths:
  • /trunk/extensions/FlaggedRevs/api/actions/ApiReviewActivity.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/modules/review.js (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/api/actions/ApiReviewActivity.php
@@ -43,7 +43,7 @@
4444 $this->dieUsageMsg( array( 'blockedtext' ) );
4545 }
4646
47 - $newRev = Revision::newFromId( $params['newid'] );
 47+ $newRev = Revision::newFromId( $params['oldid'] );
4848 if ( !$newRev || !$newRev->getTitle() ) {
4949 $this->dieUsage( "Cannot find a revision with the specified ID.", 'notarget' );
5050 }
@@ -55,19 +55,19 @@
5656 }
5757
5858 $status = false;
59 - if ( $params['oldid'] ) { // changes
60 - $oldRev = Revision::newFromId( $params['oldid'] );
 59+ if ( $params['previd'] ) { // changes
 60+ $oldRev = Revision::newFromId( $params['previd'] );
6161 if ( !$oldRev || $oldRev->getPage() != $newRev->getPage() ) {
6262 $this->dieUsage( "Revisions do not belong to the same page.", 'notarget' );
6363 }
6464 // Mark as reviewing...
6565 if ( $params['reviewing'] ) {
6666 $status = FRUserActivity::setUserReviewingDiff(
67 - $wgUser, $params['oldid'], $params['newid'] );
 67+ $wgUser, $params['previd'], $params['oldid'] );
6868 // Unmark as reviewing...
6969 } else {
7070 $status = FRUserActivity::clearUserReviewingDiff(
71 - $wgUser, $params['oldid'], $params['newid'] );
 71+ $wgUser, $params['previd'], $params['oldid'] );
7272 }
7373 } else {
7474 // Mark as reviewing...
@@ -100,16 +100,16 @@
101101
102102 public function getAllowedParams() {
103103 return array(
104 - 'oldid' => null,
105 - 'newid' => null,
 104+ 'previd' => null,
 105+ 'oldid' => null,
106106 'reviewing' => array( ApiBase::PARAM_TYPE => array( 0, 1 ) )
107107 );
108108 }
109109
110110 public function getParamDescription() {
111111 return array(
112 - 'oldid' => 'The old revision ID (for reviewing changes or pages)',
113 - 'newid' => 'The new revision ID (for reviewing changes only)',
 112+ 'previd' => 'The prior revision ID (for reviewing changes only)',
 113+ 'oldid' => 'The ID of the revision being reviewed',
114114 'reviewing' => 'Whether to advertising as reviewing or no longer reviewing',
115115 );
116116 }
Index: trunk/extensions/FlaggedRevs/presentation/modules/review.js
@@ -336,13 +336,13 @@
337337 url : wgScriptPath + '/api.php',
338338 data : {
339339 action : 'reviewactivity',
340 - oldid : oRevId,
341 - newid : nRevId,
 340+ previd : oRevId,
 341+ oldid : nRevId,
342342 reviewing : 0
343343 },
344344 type : "POST",
345345 dataType: "html", // response type
346 - timeout : 2500, // don't delay user exiting
 346+ timeout : 2000, // don't delay user exiting
347347 async : false
348348 });
349349 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90033*Added API to set "currently reviewing" flag for pages and diffs...aaron03:41, 14 June 2011

Status & tagging log