Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.UploadHandler.js |
— | — | @@ -222,7 +222,6 @@ |
223 | 223 | // formDirectSubmit is needed to actualy do the upload via a form "submit" |
224 | 224 | if ( this.formDirectSubmit ) { |
225 | 225 | mw.log("direct submit: "); |
226 | | - |
227 | 226 | return true; |
228 | 227 | } |
229 | 228 | |
— | — | @@ -456,10 +455,16 @@ |
457 | 456 | $j( '#' + _this.iframeId ).load( function() { |
458 | 457 | _this.processIframeResult( $j( this ).get( 0 ) ); |
459 | 458 | }); |
| 459 | + |
| 460 | + // Do normal post upload override |
| 461 | + _this.formDirectSubmit = true; |
460 | 462 | |
461 | | - // Do normal post upload override |
462 | | - _this.formDirectSubmit = true; |
| 463 | + // Update the wpDescription |
| 464 | + $form.find("[name='comment']").val( _this.getUploadDescription() ); |
| 465 | + |
| 466 | + |
463 | 467 | mw.log('About to submit:'); |
| 468 | + |
464 | 469 | $form.find('input').each( function(){ |
465 | 470 | mw.log( $j(this).attr( 'name' ) + ' :: ' + $j(this).val() ); |
466 | 471 | }) |
— | — | @@ -502,7 +507,7 @@ |
503 | 508 | mw.log( 'getUploadDescription:: base:' + comment_value + ' ucr:' + this.rewriteDescriptionText ); |
504 | 509 | // Set license, copyStatus, source if available ( generally not available SpecialUpload needs some refactoring ) |
505 | 510 | if ( this.rewriteDescriptionText ) { |
506 | | - var license = ( $j("[name='wpLicense']").length ) ? $j("[name='wpLicense']").val() : ''; |
| 511 | + var license = ( $j("[name='wpLicense']").length ) ? $j("[name='wpLicense']").val() : ''; |
507 | 512 | var copyStatus = ( $j("[name='wpUploadCopyStatus']" ).length ) ? $j("[name='wpUploadCopyStatus']" ).val() : ''; |
508 | 513 | var source = ( $j("[name='wpSource']").length ) ? $j("[name='wpSource']").val() : ''; |
509 | 514 | |
— | — | @@ -523,19 +528,17 @@ |
524 | 529 | * @param {String} copyStatus the copyright status field |
525 | 530 | * @param {String} source The source filed |
526 | 531 | */ |
527 | | - getCommentText: function( comment, license, copyStatus, source ) { |
528 | | - var licensetxt = ''; |
529 | | - if ( license != '' ) { |
530 | | - licensetxt = '== ' + gM( 'license-header' ) + " ==\n" + '{{' + license + '}}' + "\n"; |
531 | | - } |
532 | | - pageText = '== ' + gM( 'filedesc' ) + " ==\n" + comment + "\n"; |
| 532 | + getCommentText: function( comment, license, copyStatus, source ) { |
| 533 | + var pageText = '== ' + gM( 'filedesc' ) + " ==\n" + comment + "\n"; |
533 | 534 | if( copyStatus ){ |
534 | | - pageText += '== ' + gM( 'filestatus' ) + " ==\n" + copyStatus + "\n" + |
535 | | - licensetxt; |
| 535 | + pageText += '== ' + gM( 'filestatus' ) + " ==\n" + copyStatus + "\n"; |
536 | 536 | } |
537 | 537 | if( source ){ |
538 | | - pageText += '== ' + gM( 'filesource' ) + " ==\n" + source ; |
| 538 | + pageText += '== ' + gM( 'filesource' ) + " ==\n" + source + "\n"; |
539 | 539 | } |
| 540 | + if ( license ) { |
| 541 | + pageText += '== ' + gM( 'license-header' ) + " ==\n" + '{{' + license + '}}' + "\n"; |
| 542 | + } |
540 | 543 | return pageText; |
541 | 544 | }, |
542 | 545 | |
— | — | @@ -792,13 +795,11 @@ |
793 | 796 | 'sessionkey': _this.warnings_sessionkey, |
794 | 797 | 'ignorewarnings': 1, |
795 | 798 | 'token' : _this.getToken(), |
796 | | - 'filename' : _this.getFileName() |
| 799 | + 'filename' : _this.getFileName(), |
| 800 | + 'comment' : $j( this.form ).find( "[name='comment']" ).val() |
797 | 801 | }; |
798 | | - // presently we don't let the user update desc at ignoreWarningsSubmit |
799 | | - /* |
800 | | - 'comment' : _this.getUploadDescription() |
801 | | - */ |
802 | 802 | |
| 803 | + |
803 | 804 | //run the upload from stash request |
804 | 805 | mw.getJSON(_this.apiUrl, request, function( data ) { |
805 | 806 | _this.processApiResult( data ); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.Firefogg.js |
— | — | @@ -962,8 +962,9 @@ |
963 | 963 | } ); |
964 | 964 | |
965 | 965 | } |
| 966 | + // Update the formData 'comment' per the upload description |
| 967 | + $j(this.form).find("[name='comment']").val( _this.getUploadDescription() ); |
966 | 968 | |
967 | | - |
968 | 969 | // Get the input form data into an array |
969 | 970 | mw.log( 'get this.formData ::' ); |
970 | 971 | var data = $j( this.form ).serializeArray(); |
— | — | @@ -977,8 +978,10 @@ |
978 | 979 | this.formData[ data[i]['name'] ] = data[i]['value']; |
979 | 980 | } |
980 | 981 | } |
981 | | - } |
| 982 | + } |
| 983 | + |
982 | 984 | |
| 985 | + |
983 | 986 | // Get the edit token from formData if it's not set already |
984 | 987 | if ( !_this.editToken && _this.formData['token'] ) { |
985 | 988 | _this.editToken = _this.formData['token']; |
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | */ |
6 | 6 | var urlparts = getRemoteEmbedPath(); |
7 | 7 | var mwEmbedHostPath = urlparts[0]; |
8 | | -var mwRemoteVersion = 'r112'; |
| 8 | +var mwRemoteVersion = 'r113'; |
9 | 9 | |
10 | 10 | // Log the mwRemote version ( will determine what version of js we get ) |
11 | 11 | if( window.console ){ |