summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-02-22 18:59:00 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-02-22 18:59:00 (GMT)
commit64b27a0914f7d6f3f6c60001c3a66fd7d432421e (patch)
tree7bd6d18bf905016504a60669f9af93fb907e2086 /www
parent502912ed02337c8b3420b9c3acf328e822c2c4f3 (diff)
Warn about running uploads
Diffstat (limited to 'www')
-rw-r--r--www/js/apps.js5
-rw-r--r--www/js/auth.js5
-rw-r--r--www/js/importer.js15
-rw-r--r--www/js/jingles.js2
4 files changed, 26 insertions, 1 deletions
diff --git a/www/js/apps.js b/www/js/apps.js
index 1fa44d1..0e52f22 100644
--- a/www/js/apps.js
+++ b/www/js/apps.js
@@ -29,6 +29,11 @@ var rdxport = null;
var importer = null;
function apps_select(app) {
+ if (importer && importer.isUploading()) {
+ alert('Achtung: Es laufen noch imports.');
+ return;
+ }
+
$('.container').removeClass('fullWidth');
shows_cleanup();
diff --git a/www/js/auth.js b/www/js/auth.js
index aee8502..77d7f53 100644
--- a/www/js/auth.js
+++ b/www/js/auth.js
@@ -64,6 +64,11 @@ function auth_loginError(req, status, error) {
}
function auth_logout() {
+ if (importer && importer.isUploading()) {
+ alert('Achtung: Es laufen noch imports.');
+ return;
+ }
+
auth_cleanup();
apps_cleanup();
diff --git a/www/js/importer.js b/www/js/importer.js
index c5b48df..5f7db6f 100644
--- a/www/js/importer.js
+++ b/www/js/importer.js
@@ -86,6 +86,16 @@ Rivendell.Importer.prototype.openModal = function(group, groupView, createCart,
this.$el.modal({keyboard: true});
};
+Rivendell.Importer.prototype.isUploading = function() {
+ var $result = false;
+ $.each(this.uploads, function(index, upload) {
+ if (upload && upload.isUploading()) {
+ $result = true;
+ }
+ });
+ return $result;
+};
+
Rivendell.Importer.prototype.cancelAllUploads = function() {
$.each(this.uploads, function(index, upload){
if (upload) {
@@ -117,6 +127,11 @@ Rivendell.Upload = function(group, groupView, createCart, newCartNumber, useMeta
this.import();
};
+Rivendell.Upload.prototype.isUploading = function() {
+ var files = this.dropzone.getUploadingFiles();
+ return files.length > 0;
+};
+
Rivendell.Upload.prototype.cancel = function() {
this.dropzone.off(Dropzone.ERROR);
this.dropzone.removeAllFiles(true);
diff --git a/www/js/jingles.js b/www/js/jingles.js
index ea010d0..4748df8 100644
--- a/www/js/jingles.js
+++ b/www/js/jingles.js
@@ -220,7 +220,7 @@ Rivendell.JingleCutView.prototype.render = function() {
status.addClass('label-success').html('<span class="glyphicon glyphicon-ok"></span>');
} else {
activateButton = $('<button class="btn btn-success btn-xs"><span class="glyphicon glyphicon-ok"></span>&nbsp;&nbsp;Aktivieren</button>');
- status.addClass('label-danger').html('<span class="glyphicon glyphicon-ban-circle"></span>');
+ status.addClass('label-warning').html('<span class="glyphicon glyphicon-ban-circle"></span>');
}
var deleteButton = $('<button class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;Löschen</button>');