From 3ba0fae1610c87f652a392d3b91bd067810715cc Mon Sep 17 00:00:00 2001 From: dolymood Date: Mon, 6 May 2019 16:48:49 +0800 Subject: [PATCH] [release] 0.5.1 --- dist/uploader.js | 8 +++++--- dist/uploader.min.js | 4 ++-- dist/uploader.min.js.map | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dist/uploader.js b/dist/uploader.js index f1e320b..804850e 100644 --- a/dist/uploader.js +++ b/dist/uploader.js @@ -1,6 +1,6 @@ /*! * Uploader - Uploader library implements html5 file upload and provides multiple simultaneous, stable, fault tolerant and resumable uploads - * @version v0.5.0 + * @version v0.5.1 * @author dolymood * @link https://github.com/simple-uploader/Uploader * @license MIT @@ -302,7 +302,9 @@ utils.extend(Chunk.prototype, { utils.each(query, function (v, k) { data.append(k, v) }) - data.append(this.uploader.opts.fileParameterName, blob, this.file.name) + if (typeof blob !== 'undefined') { + data.append(this.uploader.opts.fileParameterName, blob, this.file.name) + } } this.xhr.open(method, target, true) @@ -377,7 +379,7 @@ var event = _dereq_('./event') var File = _dereq_('./file') var Chunk = _dereq_('./chunk') -var version = '0.5.0' +var version = '0.5.1' var isServer = typeof window === 'undefined' diff --git a/dist/uploader.min.js b/dist/uploader.min.js index d15f439..beebb55 100644 --- a/dist/uploader.min.js +++ b/dist/uploader.min.js @@ -1,9 +1,9 @@ /*! * Uploader - Uploader library implements html5 file upload and provides multiple simultaneous, stable, fault tolerant and resumable uploads - * @version v0.5.0 + * @version v0.5.1 * @author dolymood * @link https://github.com/simple-uploader/Uploader * @license MIT */ -!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.Uploader=e()}}(function(){return function r(n,a,o){function h(i,e){if(!a[i]){if(!n[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(u)return u(i,!0);throw new Error("Cannot find module '"+i+"'")}var s=a[i]={exports:{}};n[i][0].call(s.exports,function(e){var t=n[i][1][e];return h(t||e)},s,s.exports,r,n,a,o)}return a[i].exports}for(var u="function"==typeof require&&require,e=0;e=this.uploader.opts.maxChunkRetries?t=a.ERROR:(this.abort(),t=a.PENDING);var i=this.processedState;return i&&i.err&&(t=a.ERROR),t}return a.PENDING},message:function(){return this.xhr?this.xhr.responseText:""},progress:function(){if(this.pendingRetry)return 0;var e=this.status();return e===a.SUCCESS||e===a.ERROR?1:e===a.PENDING?0:0=this.uploader.opts.progressCallbacksInterval},_chunkEvent:function(t,e,i){var s=this.uploader,r=u.STATUS,n=this,a=this.getRoot(),o=function(e){n._measureSpeed(e),s._trigger("fileProgress",a,n,t),n._lastProgressCallback=Date.now()};switch(e){case r.PROGRESS:this._checkProgress()&&o();break;case r.ERROR:this._error(),this.abort(!0),s._trigger("fileError",a,this,i,t);break;case r.SUCCESS:if(this._updateUploadedChunks(i,t),this.error)return;clearTimeout(this._progeressId),this._progeressId=0;var h=Date.now()-this._lastProgressCallback;h>>0)).toLowerCase()}}),t.exports=n},{"./chunk":1,"./utils":5}],5:[function(e,t,i){var s=Object.prototype,r=Array.prototype,n=s.toString,l=function(e){return"[object Function]"===n.call(e)},p=Array.isArray||function(e){return"[object Array]"===n.call(e)},c=function(e){return"[object Object]"===n.call(e)&&Object.getPrototypeOf(e)===s},a=0,f={uid:function(){return++a},noop:function(){},bind:function(e,t){return function(){return e.apply(t,arguments)}},preventEvent:function(e){e.preventDefault()},stop:function(e){e.preventDefault(),e.stopPropagation()},nextTick:function(e,t){setTimeout(f.bind(e,t),0)},toArray:function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=e.length),r.slice.call(e,t,i)},isPlainObject:c,isFunction:l,isArray:p,isObject:function(e){return Object(e)===e},isString:function(e){return"string"==typeof e},isUndefined:function(e){return void 0===e},isDefined:function(e){return void 0!==e},each:function(e,t,i){if(f.isDefined(e.length))for(var s=0,r=e.length;s=this.uploader.opts.maxChunkRetries?t=a.ERROR:(this.abort(),t=a.PENDING);var i=this.processedState;return i&&i.err&&(t=a.ERROR),t}return a.PENDING},message:function(){return this.xhr?this.xhr.responseText:""},progress:function(){if(this.pendingRetry)return 0;var e=this.status();return e===a.SUCCESS||e===a.ERROR?1:e===a.PENDING?0:0=this.uploader.opts.progressCallbacksInterval},_chunkEvent:function(t,e,i){var s=this.uploader,r=u.STATUS,n=this,a=this.getRoot(),o=function(e){n._measureSpeed(e),s._trigger("fileProgress",a,n,t),n._lastProgressCallback=Date.now()};switch(e){case r.PROGRESS:this._checkProgress()&&o();break;case r.ERROR:this._error(),this.abort(!0),s._trigger("fileError",a,this,i,t);break;case r.SUCCESS:if(this._updateUploadedChunks(i,t),this.error)return;clearTimeout(this._progeressId),this._progeressId=0;var h=Date.now()-this._lastProgressCallback;h>>0)).toLowerCase()}}),t.exports=n},{"./chunk":1,"./utils":5}],5:[function(e,t,i){var s=Object.prototype,r=Array.prototype,n=s.toString,l=function(e){return"[object Function]"===n.call(e)},p=Array.isArray||function(e){return"[object Array]"===n.call(e)},c=function(e){return"[object Object]"===n.call(e)&&Object.getPrototypeOf(e)===s},a=0,f={uid:function(){return++a},noop:function(){},bind:function(e,t){return function(){return e.apply(t,arguments)}},preventEvent:function(e){e.preventDefault()},stop:function(e){e.preventDefault(),e.stopPropagation()},nextTick:function(e,t){setTimeout(f.bind(e,t),0)},toArray:function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=e.length),r.slice.call(e,t,i)},isPlainObject:c,isFunction:l,isArray:p,isObject:function(e){return Object(e)===e},isString:function(e){return"string"==typeof e},isUndefined:function(e){return void 0===e},isDefined:function(e){return void 0!==e},each:function(e,t,i){if(f.isDefined(e.length))for(var s=0,r=e.length;s