Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.UploadHandler.js |
— | — | @@ -231,7 +231,10 @@ |
232 | 232 | }) |
233 | 233 | ) |
234 | 234 | } |
235 | | - $form.find("[name='comment']").val( _this.getUploadDescription() ); |
| 235 | + var uploadDesc = _this.getUploadDescription(); |
| 236 | + if( uploadDesc ) { |
| 237 | + $form.find("[name='comment']").val( uploadDesc ); |
| 238 | + } |
236 | 239 | |
237 | 240 | // Check for post action |
238 | 241 | // formDirectSubmit is needed to actually do the upload via a form "submit" |
— | — | @@ -506,6 +509,7 @@ |
507 | 510 | * |
508 | 511 | * NOTE: wpUploadDescription should be a configuration option. |
509 | 512 | * |
| 513 | + * @param {Boolean} useCache If the upload description cache can be used. |
510 | 514 | * @return {String} |
511 | 515 | * value of wpUploadDescription |
512 | 516 | */ |
— | — | @@ -516,6 +520,9 @@ |
517 | 521 | // Else try with the form name: |
518 | 522 | comment_value = $j( "[name='comment']").val(); |
519 | 523 | } |
| 524 | + if( !comment_value){ |
| 525 | + comment_value = $j( this.form ).find( "[name='comment']" ).val(); |
| 526 | + } |
520 | 527 | mw.log( 'getUploadDescription:: base:' + comment_value + ' ucr:' + this.rewriteDescriptionText ); |
521 | 528 | // Set license, copyStatus, source if available ( generally not available SpecialUpload needs some refactoring ) |
522 | 529 | if ( this.rewriteDescriptionText ) { |
— | — | @@ -527,6 +534,7 @@ |
528 | 535 | comment_value = this.getCommentText( comment_value, license, copyStatus, source ); |
529 | 536 | } |
530 | 537 | mw.log( 'getCommentText:: new val:' + comment_value ); |
| 538 | + this.uploadDescription = comment_value; |
531 | 539 | return comment_value; |
532 | 540 | }, |
533 | 541 | |
— | — | @@ -810,8 +818,8 @@ |
811 | 819 | 'ignorewarnings': 1, |
812 | 820 | 'token' : _this.getToken(), |
813 | 821 | 'filename' : _this.getFileName(), |
814 | | - 'comment' : _this.getUploadDescription() |
815 | | - }; |
| 822 | + 'comment' : _this.getUploadDescription( ) |
| 823 | + }; |
816 | 824 | |
817 | 825 | //run the upload from stash request |
818 | 826 | mw.getJSON(_this.apiUrl, request, function( data ) { |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/mediaWikiSearch.js |
— | — | @@ -49,26 +49,9 @@ |
50 | 50 | 'redirects' : true |
51 | 51 | } |
52 | 52 | mw.getJSON(this.provider.apiUrl, request, function( data ) { |
53 | | - // check for redirect |
54 | | - for ( var i in data.query.pages ) { |
55 | | - var page = data.query.pages[i]; |
56 | | - if ( page.revisions[0]['*'] ) { |
57 | | - var re = new RegExp( /[^\[]*\[\[([^\]]*)/ ); |
58 | | - var pt = page.revisions[0]['*'].match( re ); |
59 | | - if ( pt[1] ) { |
60 | | - _this.addByTitle( pt[1], callback, redirect_count++ ); |
61 | | - return ; |
62 | | - } else { |
63 | | - mw.log( 'Error: addByTitle could not proccess redirect' ); |
64 | | - callback( false ); |
65 | | - return false; |
66 | | - } |
67 | | - } |
68 | | - } |
69 | | - // if not a redirect do the callback directly: |
70 | | - callback( _this.addSingleResult( data ) ); |
71 | | - } |
72 | | - ); |
| 53 | + // call addSingleResult |
| 54 | + callback( _this.addSingleResult( data ) ); |
| 55 | + }); |
73 | 56 | }, |
74 | 57 | |
75 | 58 | /** |
Index: branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.ApiProxy.js |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | |
73 | 73 | // Generate a new context object: (its oky that optional arguments are null ) |
74 | 74 | var context = createContext({ |
75 | | - 'apiUrl' : apiUrl,// currentServerApiUrl |
| 75 | + 'apiUrl' : apiUrl, // currentServerApiUrl |
76 | 76 | 'apiReq' : requestQuery, |
77 | 77 | 'callback' : callback, |
78 | 78 | 'timeoutCb' : callbackTimeout |
— | — | @@ -587,6 +587,7 @@ |
588 | 588 | ) |
589 | 589 | // Add the security note as well: |
590 | 590 | $dialogMsg.append( |
| 591 | + $j('<br />'), |
591 | 592 | gM( 'mwe-remember-loging' ) |
592 | 593 | ) |
593 | 594 | |
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 = 'r115'; |
| 8 | +var mwRemoteVersion = 'r116'; |
9 | 9 | |
10 | 10 | // Log the mwRemote version ( will determine what version of js we get ) |
11 | 11 | if( window.console ){ |