Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -128,7 +128,6 @@ |
129 | 129 | _this.extractUploadInfo( result.upload ); |
130 | 130 | var success = function( imageinfo ) { |
131 | 131 | if ( imageinfo === null ) { |
132 | | - debugger; |
133 | 132 | _this.setError( 'noimageinfo' ); |
134 | 133 | } else { |
135 | 134 | result.upload.stashimageinfo = imageinfo; |
— | — | @@ -172,7 +171,6 @@ |
173 | 172 | if ( result.upload.imageinfo ) { |
174 | 173 | _this.setSuccess( result ); |
175 | 174 | } else { |
176 | | - debugger; |
177 | 175 | _this.setError( 'noimageinfo' ); |
178 | 176 | } |
179 | 177 | } else { |
— | — | @@ -204,20 +202,19 @@ |
205 | 203 | _this.ui.setStatus( 'mwe-upwiz-getting-metadata' ); |
206 | 204 | if ( result.upload ) { |
207 | 205 | _this.extractUploadInfo( result.upload ); |
208 | | - // use blocking preload for thumbnail, no loading spinner. |
209 | 206 | _this.getThumbnail( |
210 | 207 | function( image ) { |
211 | | - _this.ui.setPreview( image ); |
212 | | - _this.deedPreview.setup(); |
213 | | - _this.details.populate(); |
214 | | - _this.state = 'stashed'; |
215 | | - _this.ui.showStashed(); |
| 208 | + // n.b. if server returns a URL, which is a 404, we do NOT get broken image |
| 209 | + _this.ui.setPreview( image ); |
216 | 210 | }, |
217 | 211 | mw.UploadWizard.config[ 'iconThumbnailWidth' ], |
218 | 212 | mw.UploadWizard.config[ 'iconThumbnailMaxHeight' ] |
219 | 213 | ); |
| 214 | + _this.deedPreview.setup(); |
| 215 | + _this.details.populate(); |
| 216 | + _this.state = 'stashed'; |
| 217 | + _this.ui.showStashed(); |
220 | 218 | } else { |
221 | | - debugger; |
222 | 219 | _this.setError( 'noimageinfo' ); |
223 | 220 | } |
224 | 221 | |
— | — | @@ -247,9 +244,7 @@ |
248 | 245 | extractUploadInfo: function( resultUpload ) { |
249 | 246 | if ( resultUpload.sessionkey ) { |
250 | 247 | this.sessionKey = resultUpload.sessionkey; |
251 | | - } else { |
252 | | - debugger; |
253 | | - } |
| 248 | + } |
254 | 249 | if ( resultUpload.imageinfo ) { |
255 | 250 | this.extractImageInfo( resultUpload.imageinfo ); |
256 | 251 | } else if ( resultUpload.stashimageinfo ) { |
— | — | @@ -372,8 +367,8 @@ |
373 | 368 | } else { |
374 | 369 | for ( var i = 0; i < thumbnails.length; i++ ) { |
375 | 370 | var thumb = thumbnails[i]; |
376 | | - if ( ! ( thumb.thumburl && thumb.thumbwidth && thumb.thumbheight ) ) { |
377 | | - mw.log( "mw.UploadWizardUpload::getThumbnail> thumbnail missing information" ); |
| 371 | + if ( thumb.thumberror || ( ! ( thumb.thumburl && thumb.thumbwidth && thumb.thumbheight ) ) ) { |
| 372 | + mw.log( "mw.UploadWizardUpload::getThumbnail> thumbnail error or missing information" ); |
378 | 373 | callback( null ); |
379 | 374 | return; |
380 | 375 | } |