Sha256: bd6e2830d326588515a28b78f10515f0eb9cafcbdefd27d652c4abf28970042f
Contents?: true
Size: 719 Bytes
Versions: 2
Compression:
Stored size: 719 Bytes
Contents
// Upload part constructor function UploadPart(blob, key, upload) { var part, xhr; part = this; this.size = blob.size; this.blob = blob; this.num = key; this.xhr = xhr = upload.createXhrRequest(); xhr.onload = function() { upload.handler.onPartSuccess(upload, part); }; xhr.onerror = function() { upload.handler.onError(upload, part); }; xhr.upload.onprogress = _.throttle(function(e) { if (upload.inprogress[key] != 0) { upload.inprogress[key] = e.loaded; } }, 1000); }; UploadPart.prototype.activate = function() { this.xhr.send(this.blob); this.status = "active"; }; UploadPart.prototype.pause = function() { this.xhr.abort(); this.status = "paused"; };
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
s3_multipart-0.0.10.5 | javascripts/uploadpart.js |
s3_multipart-0.0.10.4 | javascripts/uploadpart.js |