r52127 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52126‎ | r52127 | r52128 >
Date:17:13, 18 June 2009
Author:aaron
Status:ok
Tags:
Comment:
JS refactoring/cleanup (always unlock form)
Modified paths:
  • /trunk/extensions/FlaggedRevs/flaggedrevs.js (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/flaggedrevs.js
@@ -337,29 +337,23 @@
338338 return;
339339 }
340340 var response = request.responseText;
341 - var success = false;
342341 if( msg = response.substr(6) ) {
343342 jsMsg( msg, 'review' );
344343 window.scroll(0,0);
345 - success = true;
346344 }
347345 wgAjaxReview.inprogress = false;
348346 if( wgAjaxReview.timeoutID ) {
349347 window.clearTimeout(wgAjaxReview.timeoutID);
350348 }
351349 var submit = document.getElementById("submitreview");
352 - if( submit ) {
353 - if( success )
354 - submit.value = wgAjaxReview.sentMsgOk;
355 - else
356 - submit.value = wgAjaxReview.sentMsgBad;
357 - }
358350 if( response.indexOf('<suc#>') == 0 ) {
359 - wgAjaxReview.unlockForm();
360351 document.title = wgAjaxReview.actioncomplete;
 352+ if( submit ) submit.value = wgAjaxReview.sentMsgOk;
361353 } else {
362354 document.title = wgAjaxReview.actionfailed;
 355+ if( submit ) submit.value = wgAjaxReview.sentMsgBad;
363356 }
 357+ wgAjaxReview.unlockForm();
364358 };
365359
366360 wgAjaxReview.onLoad = function() {

Status & tagging log