r84730 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84729‎ | r84730 | r84731 >
Date:06:27, 25 March 2011
Author:neilk
Status:deferred
Tags:
Comment:
removing spurious debugger calls, taking thumbnailing out of main API success callback chain
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -128,7 +128,6 @@
129129 _this.extractUploadInfo( result.upload );
130130 var success = function( imageinfo ) {
131131 if ( imageinfo === null ) {
132 - debugger;
133132 _this.setError( 'noimageinfo' );
134133 } else {
135134 result.upload.stashimageinfo = imageinfo;
@@ -172,7 +171,6 @@
173172 if ( result.upload.imageinfo ) {
174173 _this.setSuccess( result );
175174 } else {
176 - debugger;
177175 _this.setError( 'noimageinfo' );
178176 }
179177 } else {
@@ -204,20 +202,19 @@
205203 _this.ui.setStatus( 'mwe-upwiz-getting-metadata' );
206204 if ( result.upload ) {
207205 _this.extractUploadInfo( result.upload );
208 - // use blocking preload for thumbnail, no loading spinner.
209206 _this.getThumbnail(
210207 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 );
216210 },
217211 mw.UploadWizard.config[ 'iconThumbnailWidth' ],
218212 mw.UploadWizard.config[ 'iconThumbnailMaxHeight' ]
219213 );
 214+ _this.deedPreview.setup();
 215+ _this.details.populate();
 216+ _this.state = 'stashed';
 217+ _this.ui.showStashed();
220218 } else {
221 - debugger;
222219 _this.setError( 'noimageinfo' );
223220 }
224221
@@ -247,9 +244,7 @@
248245 extractUploadInfo: function( resultUpload ) {
249246 if ( resultUpload.sessionkey ) {
250247 this.sessionKey = resultUpload.sessionkey;
251 - } else {
252 - debugger;
253 - }
 248+ }
254249 if ( resultUpload.imageinfo ) {
255250 this.extractImageInfo( resultUpload.imageinfo );
256251 } else if ( resultUpload.stashimageinfo ) {
@@ -372,8 +367,8 @@
373368 } else {
374369 for ( var i = 0; i < thumbnails.length; i++ ) {
375370 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" );
378373 callback( null );
379374 return;
380375 }

Status & tagging log