Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.js |
— | — | @@ -168,21 +168,11 @@ |
169 | 169 | mb.showSuccess(); |
170 | 170 | } |
171 | 171 | |
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] ); |
174 | 174 | setTimeout( function() { |
175 | 175 | mb.ui.overlay.fadeOut(); |
176 | 176 | }, 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 ); |
187 | 177 | } else { |
188 | 178 | mb.swapContent( mb.tpl.error ); |
189 | 179 | } |