Index: trunk/extensions/FlaggedRevs/client/review.js |
— | — | @@ -195,20 +195,19 @@ |
196 | 196 | if( wgAjaxReview.timeoutID ) { |
197 | 197 | window.clearTimeout(wgAjaxReview.timeoutID); |
198 | 198 | } |
| 199 | + var tier = 0; // review tier |
199 | 200 | var response = request.responseText; |
200 | 201 | 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]; |
203 | 205 | msg = msg.substr(5); // remove <t#x> |
204 | 206 | } |
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 ) { |
209 | 209 | jsMsg( msg, 'review' ); // success/failure notice |
210 | 210 | window.scroll(0,0); // scroll up to notice |
211 | 211 | } |
212 | | - */ |
213 | 212 | var rsubmit = document.getElementById("mw-fr-submitreview"); |
214 | 213 | var usubmit = document.getElementById("mw-fr-submitunreview"); |
215 | 214 | var legend = document.getElementById("mw-fr-reviewformlegend"); |