diff options
Diffstat (limited to 'www/js/importer.js')
-rw-r--r-- | www/js/importer.js | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/www/js/importer.js b/www/js/importer.js index 7e190f2..4ea55b3 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.Importer.prototype.getUploadByCartNumber = function (cartNumber) { +Rdxport.Importer.prototype.getUploadByCartNumber = function (cartNumber) { var upload = null; $.each(this.uploads, function(index, currentUpload){ if (currentUpload.cart !== null && @@ -124,7 +124,7 @@ Rivendell.Importer.prototype.getUploadByCartNumber = function (cartNumber) { return upload; }; -Rivendell.Importer.prototype.getUploadByCartAndCutNumber = function (cartNumber, cutNumber) { +Rdxport.Importer.prototype.getUploadByCartAndCutNumber = function (cartNumber, cutNumber) { var upload = null; $.each(this.uploads, function(index, currentUpload) { if (currentUpload.cart !== null && @@ -137,7 +137,7 @@ Rivendell.Importer.prototype.getUploadByCartAndCutNumber = function (cartNumber, return 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; @@ -156,12 +156,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(); @@ -183,7 +183,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) { @@ -204,14 +204,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); + rdxport.addCart(this.group.groupName, 'audio', {CART_NUMBER: this.newCartNumber}, function(cartXML) { + self.cart = new Rdxport.Cart(cartXML, self.group); success(file); }).fail(function() { //self.importFileUploadError(files[0], 'Failed to add Cart.'); @@ -220,9 +220,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(); @@ -232,18 +232,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(); |