X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki%2Fmediawiki.Upload.js;h=02df2a8890937c64780f0aa76b488e28eec0031b;hb=2231d4e859628fc4d2fb63a7a752ead5b91ffef2;hp=4a463b0010b1246f9ab38e5478379642b51df93c;hpb=93cd933c16756158b603ffc623e71542a9f5a562;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki/mediawiki.Upload.js b/resources/src/mediawiki/mediawiki.Upload.js index 4a463b0010..02df2a8890 100644 --- a/resources/src/mediawiki/mediawiki.Upload.js +++ b/resources/src/mediawiki/mediawiki.Upload.js @@ -2,8 +2,6 @@ var UP; /** - * @class mw.Upload - * * Used to represent an upload in progress on the frontend. * Most of the functionality is implemented in mw.Api.plugin.upload, * but this model class will tie it together as well as let you perform @@ -43,6 +41,8 @@ * } ); * } ); * + * @class mw.Upload + * * @constructor * @param {Object|mw.Api} [apiconfig] A mw.Api object (or subclass), or configuration * to pass to the constructor of mw.Api. @@ -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. */