r84152 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84151‎ | r84152 | r84153 >
Date:05:29, 17 March 2011
Author:neilk
Status:deferred
Tags:
Comment:
removed spurious logging
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.Api.edit.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.ApiUploadHandler.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.DestinationChecker.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.IframeTransport.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.DestinationChecker.js
@@ -146,7 +146,6 @@
147147
148148 if ( data.query.pages[-1] ) {
149149 // No conflict found; this file name is unique
150 - mw.log("mw.DestinationChecker::checkUnique> No pages in checkUnique result");
151150 result = { isUnique: true };
152151
153152 } else {
@@ -157,8 +156,6 @@
158157 }
159158
160159 // Conflict found, this filename is NOT unique
161 - mw.log( "mw.DestinationChecker::checkUnique> conflict! " );
162 -
163160 var ntitle;
164161 if ( data.query.normalized ) {
165162 ntitle = data.query.normalized[0].to;
Index: trunk/extensions/UploadWizard/resources/mw.Api.edit.js
@@ -1,7 +1,5 @@
22 // library to assist with edits
33
4 -// dependencies: [ mw.Api, jQuery ]
5 -
64 ( function( mw, $ ) {
75
86 // cached token so we don't have to keep fetching new ones for every single post
@@ -19,36 +17,27 @@
2018 */
2119 postWithEditToken: function( params, ok, err ) {
2220 var api = this;
23 - var _method = 'mw.api.edit::postWithEditToken> ';
24 - mw.log( 'post with edit token' );
2521 if ( cachedToken === null ) {
26 - mw.log( _method + 'no cached token' );
2722 // We don't have a valid cached token, so get a fresh one and try posting.
2823 // We do not trap any 'badtoken' or 'notoken' errors, because we don't want
2924 // an infinite loop. If this fresh token is bad, something else is very wrong.
3025 var useTokenToPost = function( token ) {
31 - mw.log( _method + 'posting with token = ' + token );
3226 params.token = token;
3327 this.post( params, ok, err );
3428 };
35 - mw.log( _method + 'getting edit token' );
3629 api.getEditToken( useTokenToPost, err );
3730 } else {
3831 // We do have a token, but it might be expired. So if it is 'bad' then
3932 // start over with a new token.
4033 params.token = cachedToken;
41 - mw.log( _method + 'we do have a token = ' + params.token );
4234 var getTokenIfBad = function( code, result ) {
43 - mw.log( _method + "error with posting with token!" );
4435 if ( code === 'badtoken' ) {
45 - mw.log( _method + "bad token; try again" );
4636 cachedToken = null; // force a new token
4737 api.postWidthEditToken( params, ok, err );
4838 } else {
4939 err( code, result );
5040 }
5141 };
52 - mw.log ( _method + "posting with the token that was cached " );
5342 api.post( params, ok, getTokenIfBad );
5443 }
5544 },
Index: trunk/extensions/UploadWizard/resources/mw.ApiUploadHandler.js
@@ -39,7 +39,6 @@
4040 */
4141 configureForm: function() {
4242 var _this = this;
43 - mw.log( "mw.ApiUploadHandler::configureForm> configuring form for Upload API" );
4443
4544 _this.addFormInputIfMissing( 'action', 'upload' );
4645
@@ -51,13 +50,6 @@
5251
5352 // we use JSON in HTML because according to mdale, some browsers cannot handle just JSON
5453 _this.addFormInputIfMissing( 'format', 'jsonfm' );
55 -
56 - // XXX only for testing, so it stops complaining about dupes
57 - /*
58 - if ( mw.UploadWizard.DEBUG ) {
59 - _this.addFormInputIfMissing( 'ignorewarnings', '1' );
60 - }
61 - */
6254 },
6355
6456 /**
@@ -93,7 +85,6 @@
9486 start: function() {
9587 var _this = this;
9688 var ok = function() {
97 - mw.log( "mw.ApiUploadHandler::start> upload start!" );
9889 _this.beginTime = ( new Date() ).getTime();
9990 _this.upload.ui.setStatus( 'mwe-upwiz-transport-started' );
10091 _this.upload.ui.showTransportProgress();
Index: trunk/extensions/UploadWizard/resources/mw.IframeTransport.js
@@ -42,21 +42,20 @@
4343 * Ensure callback on completion of upload
4444 */
4545 configureForm: function() {
46 - mw.log( "mw.IframeTransport::configureForm> configuring form for iframe transport" );
4746 // Set the form target to the iframe
4847 this.$form.attr( 'target', this.iframeId );
4948
5049 // attach an additional handler to the form, so, when submitted, it starts showing the progress
5150 // XXX this is lame .. there should be a generic way to indicate busy status...
5251 this.$form.submit( function() {
53 - mw.log( "mw.IframeTransport::configureForm> submitting to iframe..." );
 52+ //mw.log( "mw.IframeTransport::configureForm> submitting to iframe..." );
5453 return true;
5554 } );
5655
5756 // Set up the completion callback
5857 var _this = this;
5958 $j( '#' + this.iframeId ).load( function() {
60 - mw.log( "mw.IframeTransport::configureForm> received result in iframe" );
 59+ //mw.log( "mw.IframeTransport::configureForm> received result in iframe" );
6160 _this.progressCb( 1.0 );
6261 _this.processIframeResult( $j( this ).get( 0 ) );
6362 } );
@@ -73,13 +72,13 @@
7473 var doc = iframe.contentDocument ? iframe.contentDocument : frames[iframe.id].document;
7574 // Fix for Opera 9.26
7675 if ( doc.readyState && doc.readyState != 'complete' ) {
77 - mw.log( "mw.IframeTransport::processIframeResult> not complete" );
 76+ //mw.log( "mw.IframeTransport::processIframeResult> not complete" );
7877 return;
7978 }
8079
8180 // Fix for Opera 9.64
8281 if ( doc.body && doc.body.innerHTML == "false" ) {
83 - mw.log( "mw.IframeTransport::processIframeResult> innerhtml" );
 82+ //mw.log( "mw.IframeTransport::processIframeResult> innerhtml" );
8483 return;
8584 }
8685 var response;
@@ -92,7 +91,7 @@
9392 // according to mdale we need to do this
9493 // because IE does not load JSON properly in an iframe
9594 json = $j( doc.body ).find( 'pre' ).text();
96 - mw.log( "mw.IframeTransport::processIframeResult> iframe:json::" + json );
 95+ // mw.log( "mw.IframeTransport::processIframeResult> iframe:json::" + json );
9796 // check that the JSON is not an XML error message
9897 // (this happens when user aborts upload, we get the API docs in XML wrapped in HTML)
9998 if ( json && json.substring(0, 5) !== '<?xml' ) {

Status & tagging log