diff options
Diffstat (limited to 'www/js/importer.js')
-rw-r--r-- | www/js/importer.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/www/js/importer.js b/www/js/importer.js index 5f7db6f..cba7d23 100644 --- a/www/js/importer.js +++ b/www/js/importer.js @@ -113,6 +113,26 @@ Rivendell.Importer.prototype.removeUpload = function(upload) { }); }; +Rivendell.Importer.prototype.getUploadByCartId = function (cartNumber) { + var upload = null; + $.each(this.uploads, function(index, currentUpload){ + if (currentUpload.newCartNumber === cartNumber) { + upload = currentUpload; + } + }); + return upload; +}; + +Rivendell.Importer.prototype.hasUploadByCartId = function (cartNumber) { + var found = false; + $.each(this.uploads, function(index, currentUpload){ + if (currentUpload.newCartNumber === cartNumber) { + found = true; + } + }); + return found; +}; + Rivendell.Upload = function(group, groupView, createCart, newCartNumber, useMetadata, dropzone) { this.group = group; this.groupView = groupView; @@ -121,6 +141,11 @@ Rivendell.Upload = function(group, groupView, createCart, newCartNumber, useMeta this.useMetadata = useMetadata; this.dropzone = dropzone; + this.uploadprogress = { + progress: 0, + total: 0, + bytesSent: 0 + }; this.cart = null; this.cut = null; @@ -158,6 +183,7 @@ Rivendell.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) { |