r90100 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90099‎ | r90100 | r90101 >
Date:23:46, 14 June 2011
Author:aaron
Status:ok
Tags:
Comment:
* Reduce the amount of reviewactivity API hits
* Removed useless hidden action input
* Added some newlines to the html
Modified paths:
  • /trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormUI.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/modules/review.js (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormUI.php
@@ -168,12 +168,15 @@
169169 $form .= "<span id='mw-fr-commentbox' style='clear:both'>" .
170170 Xml::inputLabel( wfMsg( 'revreview-log' ), 'wpReason', 'wpReason', 40, '',
171171 array( 'maxlength' => 255, 'class' => 'fr-comment-box' ) ) .
172 - "&#160;&#160;&#160;</span>";
 172+ "&#160;&#160;&#160;</span>\n";
173173 }
174174 # Determine if there will be reject button
175175 $rejectId = $this->rejectRefRevId();
176176 # Add the submit buttons
177177 $form .= self::submitButtons( $rejectId, $frev, (bool)$disabled, $reviewIncludes );
 178+ # Untoggle "reviewing" status on exit
 179+ $form .= '<script type="text/javascript">var jsReviewingStatus = ' .
 180+ (int)( $u == $this->user->getName() ) . "</script>\n";
178181 # Show stability log if there is anything interesting...
179182 if ( $article->isPageLocked() ) {
180183 $form .= ' ' . FlaggedRevsXML::logToggle( 'revreview-log-toggle-show' );
@@ -190,7 +193,6 @@
191194 $form .= Html::hidden( 'target', $article->getTitle()->getPrefixedDBKey() ) . "\n";
192195 $form .= Html::hidden( 'refid', $priorRevId, array( 'id' => 'mw-fr-input-refid' ) ) . "\n";
193196 $form .= Html::hidden( 'oldid', $revId, array( 'id' => 'mw-fr-input-oldid' ) ) . "\n";
194 - $form .= Html::hidden( 'action', 'submit' ) . "\n";
195197 $form .= Html::hidden( 'wpEditToken', $this->user->editToken() ) . "\n";
196198 $form .= Html::hidden( 'changetime', $reviewTime,
197199 array( 'id' => 'mw-fr-input-changetime' ) ) . "\n";; // id for JS
@@ -385,10 +387,10 @@
386388 'title' => wfMsg( 'revreview-tt-unflag' ),
387389 'style' => $frev ? '' : 'display:none'
388390 ) + ( $disabled ? $disAttrib : array() )
389 - );
 391+ ) . "\n";
390392 // Disable buttons unless state changes in some cases (non-JS compatible)
391 - $s .= "<script type=\"text/javascript\">
392 - var jsReviewNeedsChange = " . (int)$needsChange . "</script>";
 393+ $s .= '<script type="text/javascript">var jsReviewNeedsChange = ' .
 394+ (int)$needsChange . "</script>\n";
393395 return $s;
394396 }
395397
Index: trunk/extensions/FlaggedRevs/presentation/modules/review.js
@@ -323,7 +323,7 @@
324324 */
325325 'deadvertiseReviewing': function() {
326326 var form = document.getElementById('mw-fr-reviewform');
327 - if( form ) {
 327+ if( form && jsReviewingStatus ) {
328328 var oRevId = document.getElementById('mw-fr-input-refid').value;
329329 var nRevId = document.getElementById('mw-fr-input-oldid').value;
330330 } else if( location.href.indexOf('&reviewing=1') != -1 ) {

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