diff --git a/src/main/webapp/js/upload.js b/src/main/webapp/js/upload.js index 5c187d0..635c698 100644 --- a/src/main/webapp/js/upload.js +++ b/src/main/webapp/js/upload.js @@ -17,27 +17,23 @@ form.onsubmit = function (event) { let xhr = new XMLHttpRequest(); - xhr.onloadstart = function(e) { + xhr.onloadstart = function (e) { loading.removeClass("hide"); $('.sidenav').sidenav('close'); loading.modal('open'); }; - xhr.onreadystatechange = function() { - if (xhr.readyState == XMLHttpRequest.DONE) { - if(xhr.responseText != null) { - loading.modal('close'); - console.log(xhr.responseText); - $('#error-message').text(xhr.responseText); - error.modal('open'); - } - } - } - xhr.onloadend = function (e) { clearSelected(); + if (/[a-z]/.test(xhr.responseText)) { + console.log(xhr.responseText); + loading.modal('close'); + $('#error-message').text(xhr.responseText); + error.modal('open'); + } updateDatasets(); form.reset(); + }; xhr.open('POST', form.getAttribute('action'), true); diff --git a/src/main/webapp/menu.jsp b/src/main/webapp/menu.jsp index 9b7d49f..b4b56f1 100644 --- a/src/main/webapp/menu.jsp +++ b/src/main/webapp/menu.jsp @@ -144,15 +144,16 @@ + -