r64104 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64103‎ | r64104 | r64105 >
Date:03:08, 24 March 2010
Author:aaron
Status:ok
Tags:
Comment:
Follow-up r63589: Do show the error message when AJAX review fails
Modified paths:
  • /trunk/extensions/FlaggedRevs/client/review.js (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/client/review.js
@@ -195,20 +195,19 @@
196196 if( wgAjaxReview.timeoutID ) {
197197 window.clearTimeout(wgAjaxReview.timeoutID);
198198 }
 199+ var tier = 0; // review tier
199200 var response = request.responseText;
200201 var msg = response.substr(6); // remove <err#> or <suc#>
201 - var regm = msg.match(/^<t#(\d)>/);
202 - if( regm ) {
 202+ var tierMatch = msg.match(/^<t#(\d)>/);
 203+ if( tierMatch ) {
 204+ tier = tierMatch[1];
203205 msg = msg.substr(5); // remove <t#x>
204206 }
205 - var tier = regm ? regm[1] : 0; // review tier
206 - /*
207 - // Output any response message
208 - if( msg.length ) {
 207+ // Output any error response message
 208+ if( response.indexOf('<err#>') == 0 ) {
209209 jsMsg( msg, 'review' ); // success/failure notice
210210 window.scroll(0,0); // scroll up to notice
211211 }
212 - */
213212 var rsubmit = document.getElementById("mw-fr-submitreview");
214213 var usubmit = document.getElementById("mw-fr-submitunreview");
215214 var legend = document.getElementById("mw-fr-reviewformlegend");

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63589* Improved rating toggles (use + and -)...aaron09:45, 11 March 2010

Status & tagging log