diff options
author | Peter Grassberger <petertheone@gmail.com> | 2016-04-01 15:30:45 (GMT) |
---|---|---|
committer | Peter Grassberger <petertheone@gmail.com> | 2016-04-01 15:30:45 (GMT) |
commit | 8db94592d6222fbd0153cf05c83724d7ac518634 (patch) | |
tree | fe89e9ed21ce849f3f5fcbfecff335d1cc90f409 /www/js/importer.js | |
parent | 3c584d7ee53ecfb35f32a2182971dfbc30009590 (diff) | |
parent | 4a79af6bf48f7543a407d86fc73ce70f39fc6d94 (diff) |
Merge branch 'master' into rdxportjs-refactor
Conflicts:
www/js/importer.js
www/js/jingles.js
www/js/musicpools.js
www/js/shows.js
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) { |