r101594 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101593‎ | r101594 | r101595 >
Date:09:32, 2 November 2011
Author:neilk
Status:ok
Tags:
Comment:
stop being spammy, simplified logging of uploadhandler
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardUpload.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUpload.js
@@ -586,21 +586,23 @@
587587
588588 /**
589589 * Get the upload handler per browser capabilities
 590+ * @return upload handler object
590591 */
591592 getUploadHandler: function(){
592 - if( !this.uploadHandler ){
 593+ if( !this.uploadHandler ) {
 594+ var constructor; // must be the name of a function in 'mw' namespace
593595 if( mw.UploadWizard.config[ 'enableFirefogg' ] && typeof( Firefogg ) != 'undefined' ) {
594 - mw.log("mw.UploadWizard::getUploadHandler> FirefoggHandler");
595 - this.uploadHandler = new mw.FirefoggHandler( this, this.api );
 596+ constructor = 'FirefoggHandler';
596597 } else if( mw.UploadWizard.config[ 'enableFormData' ] && mw.fileApi.isSliceAvailable()) {
597 - mw.log("mw.UploadWizard::getUploadHandler> ApiUploadFormDataHandler");
598 - this.uploadHandler = new mw.ApiUploadFormDataHandler( this, this.api );
 598+ constructor = 'ApiUploadFormDataHandler';
599599 } else {
600 - // By default use the apiUploadHandler
601 - mw.log("mw.UploadWizard::getUploadHandler> ApiUploadHandler");
602 - this.uploadHandler = new mw.ApiUploadHandler( this, this.api );
 600+ constructor = 'ApiUploadHandler';
603601 }
604 - }
 602+ this.uploadHandler = new mw[constructor]( this, this.api );
 603+ if ( mw.UploadWizard.config.debug ) {
 604+ mw.log( 'mw.UploadWizard::getUploadHandler> ' + constructor );
 605+ }
 606+ }
605607 return this.uploadHandler;
606608 },
607609

Status & tagging log