// S3MP Constructor function S3MP(options) { var files , progress_timer = [] , S3MP = this; _.extend(this, options); this.uploadList = []; // Handles all of the success/failure events, and // progress notifiers this.handler = { // Activate an appropriate number of parts (number = pipes) // when all of the parts have been successfully initialized beginUpload: function() { var i = []; function beginUpload(pipes, uploadObj) { var key = uploadObj.key , num_parts = uploadObj.parts.length if (typeof i[key] === "undefined") { i[key] = 0; } i[key]++; if (i[key] === num_parts) { for (var j=0; j