summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/js/importer.js14
-rw-r--r--www/js/jingles.js11
-rw-r--r--www/js/musicpools.js11
-rw-r--r--www/js/shows.js11
4 files changed, 15 insertions, 32 deletions
diff --git a/www/js/importer.js b/www/js/importer.js
index 1da9d1a..c813f1a 100644
--- a/www/js/importer.js
+++ b/www/js/importer.js
@@ -338,7 +338,7 @@ Rdxport.Upload.prototype.onerror = function(error) {
var file = {
cartNumber: this.cartNumber || this.newCartNumber
};
- this.importFileUploadError(file, error);
+ this.importFileUploadError(file, 500, error);
};
Rdxport.Upload.prototype.onmessage = function(event) {
@@ -350,7 +350,7 @@ Rdxport.Upload.prototype.onmessage = function(event) {
switch (data.TYPE.toLowerCase()) {
case Rdxport.Importer.TYPE_ERROR:
console.log(data);
- this.importFileUploadError(file, data.ERROR_STRING);
+ this.importFileUploadError(file, data.RESPONSE_CODE, data.ERROR_STRING);
break;
case Rdxport.Importer.TYPE_PROGRESS:
this.uploadprogress.current = data.CURRENT;
@@ -362,7 +362,11 @@ Rdxport.Upload.prototype.onmessage = function(event) {
break;
case Rdxport.Importer.TYPE_DONE:
console.log(data);
- this.importFileUploadSuccess();
+ if(data.RESPONSE_CODE < 400) {
+ this.importFileUploadSuccess();
+ } else {
+ this.importFileUploadError(file, data.RESPONSE_CODE, data.ERROR_STRING);
+ }
break;
}
@@ -472,9 +476,9 @@ Rdxport.Upload.prototype.importFileUploadSuccess = function() {
this.group.fetchCarts();
};
-Rdxport.Upload.prototype.importFileUploadError = function(file, msg, xhr) {
+Rdxport.Upload.prototype.importFileUploadError = function(file, status, errorString) {
var self = this;
- this.groupView.uploadError(this, file, msg, xhr, function() {
+ this.groupView.uploadError(this, file, status, errorString, function() {
self.cancel();
});
};
diff --git a/www/js/jingles.js b/www/js/jingles.js
index 64735f0..eeb3927 100644
--- a/www/js/jingles.js
+++ b/www/js/jingles.js
@@ -133,18 +133,11 @@ Rdxport.JingleGroupView.prototype.uploadProgress = function(upload, file) {
updateProgressBar($cut, upload);
};
-Rdxport.JingleGroupView.prototype.uploadError = function(upload, file, msg, xhr, acknowledge) {
+Rdxport.JingleGroupView.prototype.uploadError = function(upload, file, status, errorString, acknowledge) {
if (!file.cartNumber || !file.cutNumber) {
return;
}
- var responseCode = xhr.status;
- var errorString = xhr.statusText;
-
- //var xmlDoc = $.parseXML(msg);
- //var msg = $(xmlDoc);
- //var responseCode = msg.find('ResponseCode').text();
- //var errorString = msg.find('ErrorString').text();
- var reason = $('<span>').addClass('label').addClass('label-danger').text(responseCode).after($('<b>').text('&nbsp;' + errorString));
+ var reason = $('<span>').addClass('label').addClass('label-danger').text(status).after($('<b>').text(' ' + errorString));
var dismiss_button = '<button class="btn btn-info btn-xs">' +
'<span class="glyphicon glyphicon-remove"></span>&nbsp;&nbsp;Ok</button>';
diff --git a/www/js/musicpools.js b/www/js/musicpools.js
index db295c7..e3a9118 100644
--- a/www/js/musicpools.js
+++ b/www/js/musicpools.js
@@ -205,18 +205,11 @@ Rdxport.MusicpoolView.prototype.uploadProgress = function(upload, file) {
updateProgressBar($cart, upload);
};
-Rdxport.MusicpoolView.prototype.uploadError = function(upload, file, msg, xhr, acknowledge) {
+Rdxport.MusicpoolView.prototype.uploadError = function(upload, file, status, errorString, acknowledge) {
if (!file.cartNumber) {
return;
}
- var responseCode = xhr.status;
- var errorString = xhr.statusText;
-
- //var xmlDoc = $.parseXML(msg);
- //var msg = $(xmlDoc);
- //var responseCode = msg.find('ResponseCode').text();
- //var errorString = msg.find('ErrorString').text();
- var reason = $('<span>').addClass('label').addClass('label-danger').text(responseCode).after($('<b>').text('&nbsp;' + errorString));
+ var reason = $('<span>').addClass('label').addClass('label-danger').text(status).after($('<b>').text(' ' + errorString));
var dismiss_button = '<button class="btn btn-info btn-xs">' +
'<span class="glyphicon glyphicon-remove"></span>&nbsp;&nbsp;Ok</button>';
diff --git a/www/js/shows.js b/www/js/shows.js
index 1ec986d..fb54ea5 100644
--- a/www/js/shows.js
+++ b/www/js/shows.js
@@ -281,18 +281,11 @@ Rdxport.ShowView.prototype.uploadProgress = function(upload, file) {
updateProgressBar($cart, upload);
};
-Rdxport.ShowView.prototype.uploadError = function(upload, file, msg, xhr, acknowledge) {
+Rdxport.ShowView.prototype.uploadError = function(upload, file, status, errorString, acknowledge) {
if (!file.cartNumber) {
return;
}
- var responseCode = xhr.status;
- var errorString = xhr.statusText;
-
- //var xmlDoc = $.parseXML(msg);
- //var msg = $(xmlDoc);
- //var responseCode = msg.find('ResponseCode').text();
- //var errorString = msg.find('ErrorString').text();
- var reason = $('<span>').addClass('label').addClass('label-danger').text(responseCode).after($('<b>').text('&nbsp;' + errorString));
+ var reason = $('<span>').addClass('label').addClass('label-danger').text(status).after($('<b>').text(' ' + errorString));
var dismiss_button = '<button class="btn btn-info btn-xs">' +
'<span class="glyphicon glyphicon-remove"></span>&nbsp;&nbsp;Ok</button>';