/**
* Provides an interface for uploading files to MediaWiki.
+ *
* @class mw.Api.plugin.upload
* @singleton
*/
/**
* @private
* Get nonce for iframe IDs on the page.
+ *
* @return {number}
*/
function getNonce() {
/**
* @private
* Get new iframe object for an upload.
+ *
* @return {HTMLIframeElement}
*/
function getNewIframe( id ) {
/**
* @private
* Shortcut for getting hidden inputs
+ *
* @return {jQuery}
*/
function getHiddenInput( name, val ) {
* This function will return a promise, which when resolved, will pass back a function
* to finish the stash upload. You can call that function with an argument containing
* more, or conflicting, data to pass to the server. For example:
+ *
* // upload a file to the stash with a placeholder filename
* api.uploadToStash( file, { filename: 'testing.png' } ).done( function ( finish ) {
* // finish is now the function we can use to finalize the upload
* // the upload is complete, data holds the API response
* } );
* } );
+ *
* @param {File|HTMLInputElement} file
* @param {Object} [data]
* @return {jQuery.Promise}