r113955 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113954‎ | r113955 | r113956 >
Date:20:53, 15 March 2012
Author:bsitu
Status:resolved (Comments)
Tags:
Comment:
followup to -r113953 - clean up javascript code
Modified paths:
  • /trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.js
@@ -168,21 +168,11 @@
169169 mb.showSuccess();
170170 }
171171
172 - } else if (data && data.error && data.error.code === 'blocked') {
173 - mb.swapContent( mb.tpl.blocked );
 172+ } else if (data && data.error && jQuery.inArray( data.error.code, ['blocked', 'ratelimited', 'abuse'] ) ) {
 173+ mb.swapContent( mb.tpl[data.error.code] );
174174 setTimeout( function() {
175175 mb.ui.overlay.fadeOut();
176176 }, 3000 );
177 - } else if (data && data.error && data.error.code === 'ratelimited') {
178 - mb.swapContent( mb.tpl.ratelimited );
179 - setTimeout( function() {
180 - mb.ui.overlay.fadeOut();
181 - }, 3000 );
182 - } else if (data && data.error && data.error.code === 'abuse') {
183 - mb.swapContent( mb.tpl.abuse );
184 - setTimeout( function() {
185 - mb.ui.overlay.fadeOut();
186 - }, 3000 );
187177 } else {
188178 mb.swapContent( mb.tpl.error );
189179 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r114018followup to -r113955 - use > -1 to check if a value is in array for JQuery in...bsitu15:29, 16 March 2012
r114030MFT r113953, r113955, r113984, r114018reedy19:51, 16 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113953fix for bug 35245 - add rate limiter and spam filter checkbsitu20:39, 15 March 2012

Comments

#Comment by Nikerabbit (talk | contribs)   11:27, 16 March 2012

inArray doesn't return boolean, it returns the position which may be zero.

#Comment by Robmoen (talk | contribs)   23:33, 20 March 2012

fixed in r114018, marking ok

Status & tagging log