summaryrefslogtreecommitdiff
path: root/www/js/importer.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/importer.js')
-rw-r--r--www/js/importer.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/www/js/importer.js b/www/js/importer.js
index 5f7db6f..7e190f2 100644
--- a/www/js/importer.js
+++ b/www/js/importer.js
@@ -113,6 +113,30 @@ Rivendell.Importer.prototype.removeUpload = function(upload) {
});
};
+Rivendell.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;
+};
+
+Rivendell.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;
+};
+
Rivendell.Upload = function(group, groupView, createCart, newCartNumber, useMetadata, dropzone) {
this.group = group;
this.groupView = groupView;
@@ -121,6 +145,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 +187,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) {