aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn2/wqflask/static/gif/loader.gifbin0 -> 43889 bytes
-rw-r--r--gn2/wqflask/templates/base.html4
-rw-r--r--gn2/wqflask/templates/gnqa.html24
-rw-r--r--gn2/wqflask/templates/gnqa_answer.html26
4 files changed, 43 insertions, 11 deletions
diff --git a/gn2/wqflask/static/gif/loader.gif b/gn2/wqflask/static/gif/loader.gif
new file mode 100644
index 00000000..c2146b77
--- /dev/null
+++ b/gn2/wqflask/static/gif/loader.gif
Binary files differ
diff --git a/gn2/wqflask/templates/base.html b/gn2/wqflask/templates/base.html
index e0fc9e63..984cf92a 100644
--- a/gn2/wqflask/templates/base.html
+++ b/gn2/wqflask/templates/base.html
@@ -198,11 +198,11 @@
</div>
</div>
<div class="container-fluid" style="width: 100%; min-width: 650px; position: relative;background-color: #d5d5d5; height: 100px;">
- <form id="gnqna_search_home" style="display:none;width: 100%;">
+ <form id="gnqna_search_home" method="POST" action="/gnqna" style="display:none;width: 100%;">
<div >
<input id="gnqna_search_home_input" style="width:45vw" type="text" autocomplete="off"
-required placeholder="Ask More Questions or Topics (E.g Genes) " value='' name="quedrygnqa">
+required placeholder="Ask More Questions or Topics (E.g Genes) " value='' name="querygnqa">
</div>
</form>
<form method="get" action="/gsearch" id="globalsearchform">
diff --git a/gn2/wqflask/templates/gnqa.html b/gn2/wqflask/templates/gnqa.html
index bed2627d..46cc1e90 100644
--- a/gn2/wqflask/templates/gnqa.html
+++ b/gn2/wqflask/templates/gnqa.html
@@ -25,15 +25,30 @@
align-items: center;
}
+ #loader {
+ display: none;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ width: 100%;
+ background: rgba(0,0,0,0.75) url("/static/gif/loader.gif") no-repeat center center;
+ z-index: 10000;
+}
+
+
</style>
<div style="height: 100vh;width: 100vw; ">
+
+<div id="loader"></div>
<div id="main-search-controller" style="margin: 20px;width: 100%;height: 100%;">
<div id="gnqna_controller">
<form method="POST" action="/gnqna" id="gnqna_form">
<input id="gnqna_search" style="width:45vw" type="text" autocomplete="off"
-required placeholder="Ask a Question or Topic ( Genes) " value='' name="querygnqa">
+required placeholder="Ask a Question or Topic e.g ( Genes) " value='' name="querygnqa">
</form>
</div>
@@ -51,10 +66,11 @@ required placeholder="Ask a Question or Topic ( Genes) " value='' name="querygnq
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
-
- $("#gnqna_search").keyup(function(event) {
+ $("#gnqna_search").keypress(function(event) {
if (event.keyCode === 13) {
- $('#gnqna_form').attr('action', "/gnqna").submit();
+ $('#gnqna_form').submit();
+ let spinner = $("#loader")
+ spinner.show()
}
})
diff --git a/gn2/wqflask/templates/gnqa_answer.html b/gn2/wqflask/templates/gnqa_answer.html
index 4fb4b268..99242b29 100644
--- a/gn2/wqflask/templates/gnqa_answer.html
+++ b/gn2/wqflask/templates/gnqa_answer.html
@@ -95,11 +95,27 @@
/ box-shadow: rgb(38, 57, 77) 0px 20px 30px -10px; */
}
+ #loader {
+ display: none;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ width: 100%;
+ background: rgba(0,0,0,0.75) url("/static/gif/loader.gif") no-repeat center center;
+ z-index: 10000;
+}
+
</style>
<div style="height: 90vh;width: 100vw; margin-bottom: 10px;">
+
+ <div id="loader">
+
+ </div>
<div style="margin:10px; border:1px solid #ccc;padding: 15px;">
<div >
<h1 id="gnqa_query" style="font-weight: bolder">{{query}}<h1>
@@ -137,13 +153,13 @@
$('#globalsearchform').hide()
$('#gnqna_search_home').show()
$('footer').hide()
-
- $("#gnqna_search_home_input").keyup(function(event) {
-
- console.log("adding input")
+ $("#gnqna_search_home_input").keypress(function(event) {
if (event.keyCode === 13) {
console.log("clicked this button")
- $('#gnqna_search_home').attr('action', "/gnqna").submit();
+ $('#gnqna_search_home').submit();
+ let spinner = $("#loader")
+ spinner.show();
+
}
})
});