summaryrefslogtreecommitdiff
path: root/www/js/importer.js
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-03-24 15:10:12 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-03-24 15:10:12 (GMT)
commit3c584d7ee53ecfb35f32a2182971dfbc30009590 (patch)
tree77716fe1ce3ad70659536b667e9c5cbf3a707bcf /www/js/importer.js
parent71b2740e35ca72b547ec70bd44579b6fc98ce3f5 (diff)
refactor rdxportjs (breaks stuff)
Diffstat (limited to 'www/js/importer.js')
-rw-r--r--www/js/importer.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/www/js/importer.js b/www/js/importer.js
index 5f7db6f..86f7947 100644
--- a/www/js/importer.js
+++ b/www/js/importer.js
@@ -22,21 +22,21 @@
'use strict';
-var Rivendell = Rivendell || {};
+var Rdxport = Rdxport || {};
-Rivendell.Importer = function() {
+Rdxport.Importer = function() {
this.$el = $('#uploadModal');
this.uploads = [];
};
-Rivendell.Importer.prototype.resetModal = function() {
+Rdxport.Importer.prototype.resetModal = function() {
$('div.modal-header h4', this.$el).text("Datei auswählen...");
$('.modal-body', this.$el).empty().css("background-image", "url('/img/dz-backdrop.png')");
$('#uploadModal-confirm', this.$el).attr('disabled','disabled').off('click');
};
-Rivendell.Importer.prototype.openModal = function(group, groupView, createCart, newCartNumber, useMetadata) {
+Rdxport.Importer.prototype.openModal = function(group, groupView, createCart, newCartNumber, useMetadata) {
createCart = typeof createCart === 'undefined' ? false : createCart;
useMetadata = typeof useMetadata === 'undefined' ? false : useMetadata;
@@ -74,7 +74,7 @@ Rivendell.Importer.prototype.openModal = function(group, groupView, createCart,
$('div.modal-body', self.$el).css("background-image", "url('/img/audio_file.png')");
$('#uploadModal-confirm', self.$el).off('click').on('click', function() {
- var upload = new Rivendell.Upload(group, groupView, createCart, newCartNumber, useMetadata, dropzone);
+ var upload = new Rdxport.Upload(group, groupView, createCart, newCartNumber, useMetadata, dropzone);
self.uploads.push(upload);
self.$el.off('hide.bs.modal');
@@ -86,7 +86,7 @@ Rivendell.Importer.prototype.openModal = function(group, groupView, createCart,
this.$el.modal({keyboard: true});
};
-Rivendell.Importer.prototype.isUploading = function() {
+Rdxport.Importer.prototype.isUploading = function() {
var $result = false;
$.each(this.uploads, function(index, upload) {
if (upload && upload.isUploading()) {
@@ -96,7 +96,7 @@ Rivendell.Importer.prototype.isUploading = function() {
return $result;
};
-Rivendell.Importer.prototype.cancelAllUploads = function() {
+Rdxport.Importer.prototype.cancelAllUploads = function() {
$.each(this.uploads, function(index, upload){
if (upload) {
upload.cancel();
@@ -104,7 +104,7 @@ Rivendell.Importer.prototype.cancelAllUploads = function() {
});
};
-Rivendell.Importer.prototype.removeUpload = function(upload) {
+Rdxport.Importer.prototype.removeUpload = function(upload) {
var self = this;
$.each(this.uploads, function(index, currentUpload){
if(currentUpload === upload) {
@@ -113,7 +113,7 @@ Rivendell.Importer.prototype.removeUpload = function(upload) {
});
};
-Rivendell.Upload = function(group, groupView, createCart, newCartNumber, useMetadata, dropzone) {
+Rdxport.Upload = function(group, groupView, createCart, newCartNumber, useMetadata, dropzone) {
this.group = group;
this.groupView = groupView;
this.createCart = createCart;
@@ -127,12 +127,12 @@ Rivendell.Upload = function(group, groupView, createCart, newCartNumber, useMeta
this.import();
};
-Rivendell.Upload.prototype.isUploading = function() {
+Rdxport.Upload.prototype.isUploading = function() {
var files = this.dropzone.getUploadingFiles();
return files.length > 0;
};
-Rivendell.Upload.prototype.cancel = function() {
+Rdxport.Upload.prototype.cancel = function() {
this.dropzone.off(Dropzone.ERROR);
this.dropzone.removeAllFiles(true);
this.dropzone.disable();
@@ -154,7 +154,7 @@ Rivendell.Upload.prototype.cancel = function() {
importer.removeUpload(this);
};
-Rivendell.Upload.prototype.import = function() {
+Rdxport.Upload.prototype.import = function() {
var self = this;
this.dropzone.off('uploadprogress').on('uploadprogress', function(file) {
@@ -174,14 +174,14 @@ Rivendell.Upload.prototype.import = function() {
});
};
-Rivendell.Upload.prototype.addCart = function(success) {
+Rdxport.Upload.prototype.addCart = function(success) {
var files = this.dropzone.getAcceptedFiles();
var file = files[files.length - 1];
var self = this;
if (this.createCart) {
rdxport.addCart(this.group.groupName, 'audio', this.newCartNumber, function(cartXML) {
- self.cart = new Rivendell.Cart(cartXML, self.group);
+ self.cart = new Rdxport.Cart(cartXML, self.group);
success(file);
}).fail(function() {
//self.importFileUploadError(files[0], 'Failed to add Cart.');
@@ -190,9 +190,9 @@ Rivendell.Upload.prototype.addCart = function(success) {
this.cart = this.group.carts[0];
success(file);
}
-}
+};
-Rivendell.Upload.prototype.importFileUploadSuccess = function() {
+Rdxport.Upload.prototype.importFileUploadSuccess = function() {
this.dropzone.off(Dropzone.ERROR);
this.dropzone.removeAllFiles(true);
this.dropzone.disable();
@@ -202,18 +202,18 @@ Rivendell.Upload.prototype.importFileUploadSuccess = function() {
this.group.fetchCarts();
};
-Rivendell.Upload.prototype.importFileUploadError = function(file, msg, xhr) {
+Rdxport.Upload.prototype.importFileUploadError = function(file, msg, xhr) {
var self = this;
this.groupView.uploadError(this, file, msg, xhr, function() {
self.cancel();
});
};
-Rivendell.Upload.prototype.addCut = function(file) {
+Rdxport.Upload.prototype.addCut = function(file) {
var self = this;
rdxport.addAndEditCut(this.cart.number, {DESCRIPTION: file.name}, function(cutXml) {
- self.cut = new Rivendell.Cut(cutXml, self.cart);
+ self.cut = new Rdxport.Cut(cutXml, self.cart);
self.dropzone.on('sending', function(file, xhr, formData) {
var cutNumber = $('cutNumber', cutXml).text();