nl_tokens: Helper class for resumable uploads using XHR / CORS . Can upload any Blob - like item whether files or in - memory constructs .
pl_tokens: function ( options ) { var noop = function ( ) { } ; this . isCordovaApp = options . isCordovaApp ; this . realUrl = options . realUrl ; this . file = options . file ; this . contentType = options . contentType || this . file . type || 'application/octet-stream' ; this . metadata = options . metadata || { 'title' : this . file . name , 'mimeType' : this . contentType } ; this . token = options . token ; this . onComplete = options . onComplete || noop ; this . onProgress = options . onProgress || noop ; this . onError = <mask> . onError || noop ; this . offset = options . offset || 0 ; this . chunkSize = options . chunkSize || 0 ; this . retryHandler = new RetryHandler ( ) ; this . url = options . url ; if ( ! this . url ) { var params = options . params || { } ; // params.uploadType = 'resumable'; this . url = this . buildUrl_ ( options . fileId , params , options . baseUrl ) ; } this . httpMethod = options . fileId ? 'PUT' : 'POST' ; this . currentXHR = null ; this . chunkProgress = 0 ; }