diff --git a/app/templates/corpora/analyse_corpus.html.j2 b/app/templates/corpora/analyse_corpus.html.j2
index ec0542d9..0f656aec 100644
--- a/app/templates/corpora/analyse_corpus.html.j2
+++ b/app/templates/corpora/analyse_corpus.html.j2
@@ -103,11 +103,23 @@
-
+
+
+
+
Fetching your results!
+
+
+
+
+
+
@@ -195,6 +206,8 @@
var queryFormSubmitElement = document.getElementById("query-form-submit");
var queryResultsElement = document.getElementById("query-results");
var contextResultsElement = document.getElementById("context-results");
+ var queryLoadingElement = document.getElementById("getting-query-results");
+ var queryResultsTableElement = document.getElementById("recieved-query-results");
queryFormSubmitElement.addEventListener("click", function(event) {
event.preventDefault();
let formData = new FormData(queryFormElement);
@@ -202,12 +215,16 @@
"hits_per_page": formData.get("hits_per_page"),
"query": formData.get("query")};
socket.emit("corpus_analysis", queryData);
+ queryLoadingElement.classList.remove("hide");
+ queryResultsTableElement.classList.add("hide");
M.toast({html: "Query has been sent!"});
});
socket.on("corpus_analysis", function(message) {
console.log("### corpus_analysis ###");
console.log(message);
+ queryLoadingElement.classList.add("hide");
+ queryResultsTableElement.classList.remove("hide");
queryResultsElement.innerHTML = "";
// Reset related global values
@@ -216,6 +233,7 @@
tokenElements = null;
if (message === null) {
+ queryResultsTableElement.classList.add("hide");
M.toast({"html": "No results for this query!", "classes": "red"});
return;
}