r60706 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60705‎ | r60706 | r60707 >
Date:00:29, 6 January 2010
Author:dale
Status:deferred
Tags:
Comment:
* fix for bug 22026 ( work around for commons upload form processing ( removes and appends the wpUploadDescription )
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.BaseUploadInterface.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.Firefogg.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.Firefogg.js
@@ -906,7 +906,7 @@
907907 */
908908 doChunkUploadWithFormData: function() {
909909 var _this = this;
910 - mw.log( "firefogg::doChunkUploadWithFormData" + _this.editToken );
 910+ mw.log( "firefogg::doChunkUploadWithFormData: " + _this.editToken );
911911 // Build the API URL
912912 var aReq = {
913913 'action': 'upload',
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.BaseUploadInterface.js
@@ -90,7 +90,7 @@
9191 if ( typeof( this.orig_onsubmit ) == 'undefined' && this.form.onsubmit ) {
9292 this.orig_onsubmit = this.form.onsubmit;
9393 }
94 -
 94+
9595 // Set up the submit action:
9696 $j( this.form ).submit( function() {
9797 return _this.onSubmit();
@@ -121,9 +121,16 @@
122122 var data = $j( this.form ).serializeArray();
123123 this.formData = {};
124124 for ( var i = 0; i < data.length; i++ ) {
125 - if ( data[i]['name'] )
126 - this.formData[ data[i]['name'] ] = data[i]['value'];
127 - }
 125+ if ( data[i]['name'] ){
 126+ // Special case of upload.js commons hack:
 127+ if( data[i]['name'] == 'wpUploadDescription' ){
 128+ this.formData[ 'comment' ] = data[i]['value'];
 129+ }else{
 130+ this.formData[ data[i]['name'] ] = data[i]['value'];
 131+ }
 132+ }
 133+ }
 134+
128135 // Put into a try catch so we are sure to return false:
129136 try {
130137
@@ -319,10 +326,17 @@
320327 doApiCopyUpload: function() {
321328 mw.log( 'mvBaseUploadInterface.doApiCopyUpload' );
322329 mw.log( 'doHttpUpload (no form submit) ' );
 330+
 331+ //Special case of upload.js commons hack:
 332+ var comment_value = $j( '#wpUploadDescription' ).val();
 333+ if( comment_value == '' ){
 334+ comment_value = $j( "[name='wpUploadDescription']").val();
 335+ }
 336+
323337 var httpUpConf = {
324338 'url' : $j( '#wpUploadFileURL' ).val(),
325339 'filename' : $j( '#wpDestFile' ).val(),
326 - 'comment' : $j( '#wpUploadDescription' ).val(),
 340+ 'comment' : comment_value,
327341 'watch' : ( $j( '#wpWatchthis' ).is( ':checked' ) ) ? 'true' : 'false',
328342 'ignorewarnings': ($j('#wpIgnoreWarning' ).is( ':checked' ) ) ? 'true' : 'false'
329343 }
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js
@@ -4,7 +4,7 @@
55 */
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
8 -var mwRemoteVersion = 'r73';
 8+var mwRemoteVersion = 'r74';
99 var mwUseScriptLoader = true;
1010
1111 // Setup up request Params:
@@ -115,7 +115,7 @@
116116 }
117117 }
118118 if ( vidIdList.length > 0 ) {
119 - // Reverse order the array so videos at the "top" get swaped first:
 119+ // Reverse order the array so videos at the "top" get swapped first:
120120 vidIdList = vidIdList.reverse();
121121 mwLoadPlayer(function(){
122122 //Load the "EmbedPlayer" module:

Status & tagging log