diff options
Diffstat (limited to 'www/js/importer.js')
-rw-r--r-- | www/js/importer.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/www/js/importer.js b/www/js/importer.js index 86f7947..13e7aff 100644 --- a/www/js/importer.js +++ b/www/js/importer.js @@ -113,6 +113,30 @@ Rdxport.Importer.prototype.removeUpload = function(upload) { }); }; +Rdxport.Importer.prototype.getUploadByCartNumber = function (cartNumber) { + var upload = null; + $.each(this.uploads, function(index, currentUpload){ + if (currentUpload.cart !== null && + currentUpload.cart.number === cartNumber ) { + upload = currentUpload; + } + }); + return upload; +}; + +Rdxport.Importer.prototype.getUploadByCartAndCutNumber = function (cartNumber, cutNumber) { + var upload = null; + $.each(this.uploads, function(index, currentUpload) { + if (currentUpload.cart !== null && + currentUpload.cart.number === cartNumber && + currentUpload.cut !== null && + currentUpload.cut.number === cutNumber) { + upload = currentUpload; + } + }); + return upload; +}; + Rdxport.Upload = function(group, groupView, createCart, newCartNumber, useMetadata, dropzone) { this.group = group; this.groupView = groupView; @@ -121,6 +145,11 @@ Rdxport.Upload = function(group, groupView, createCart, newCartNumber, useMetada this.useMetadata = useMetadata; this.dropzone = dropzone; + this.uploadprogress = { + progress: 0, + total: 0, + bytesSent: 0 + }; this.cart = null; this.cut = null; @@ -158,6 +187,7 @@ Rdxport.Upload.prototype.import = function() { var self = this; this.dropzone.off('uploadprogress').on('uploadprogress', function(file) { + self.uploadprogress = file.upload; self.groupView.uploadProgress(self, file); }); this.dropzone.off(Dropzone.SUCCESS).on(Dropzone.SUCCESS, function(file) { |