X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki%2Fmediawiki.Upload.js;h=23b0900e06f6549385e008d76558a388ffffaedd;hb=cc28eaeb0930c2d876ee6205de035a12e142d38f;hp=8a74ffc6abb3b870b9d92f296481b8f00c152d21;hpb=77a8bbd406de8194432bbc92ce0b781ba44b43bc;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki/mediawiki.Upload.js b/resources/src/mediawiki/mediawiki.Upload.js index 8a74ffc6ab..23b0900e06 100644 --- a/resources/src/mediawiki/mediawiki.Upload.js +++ b/resources/src/mediawiki/mediawiki.Upload.js @@ -91,6 +91,20 @@ this.filename = filename; }; + /** + * Set the stashed file to finish uploading. + * + * @param {string} filekey + */ + UP.setFilekey = function ( filekey ) { + var upload = this; + + this.setState( Upload.State.STASHED ); + this.stashPromise = $.Deferred().resolve( function ( data ) { + return upload.api.uploadFromStash( filekey, data ); + } ); + }; + /** * Sets the filename based on the filename as it was on the upload. */ @@ -114,7 +128,7 @@ /** * Set the file to be uploaded. * - * @param {HTMLInputElement|File} file + * @param {HTMLInputElement|File|Blob} file */ UP.setFile = function ( file ) { this.file = file; @@ -159,7 +173,7 @@ /** * Get the file being uploaded. * - * @return {HTMLInputElement|File} + * @return {HTMLInputElement|File|Blob} */ UP.getFile = function () { return this.file; @@ -332,7 +346,6 @@ upload.setState( Upload.State.UPLOADING ); return finishStash( { - bucket: upload.bucket, // Automatically ignored if undefined watchlist: ( upload.getWatchlist() ) ? 1 : undefined, comment: upload.getComment(), filename: upload.getFilename(),