From 64b27a0914f7d6f3f6c60001c3a66fd7d432421e Mon Sep 17 00:00:00 2001 From: Peter Grassberger Date: Mon, 22 Feb 2016 19:59:00 +0100 Subject: Warn about running uploads 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(''); } else { activateButton = $(''); - status.addClass('label-danger').html(''); + status.addClass('label-warning').html(''); } var deleteButton = $(''); -- cgit v0.10.2