diff options
author | Alexander_Kabui | 2024-09-23 11:38:36 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-09-23 11:38:36 +0300 |
commit | 7613298d6c427f4f3cfd3bd843e6d41099cba125 (patch) | |
tree | eed21d816fc8be0ea407b96226850850854a88fd /gn2 | |
parent | 0b357115d88a38a4c0f128671636a37e2b5287c0 (diff) | |
download | genenetwork2-7613298d6c427f4f3cfd3bd843e6d41099cba125.tar.gz |
Refactor: move global search js to index file.
Diffstat (limited to 'gn2')
-rw-r--r-- | gn2/wqflask/templates/base.html | 41 | ||||
-rwxr-xr-x | gn2/wqflask/templates/index_page.html | 50 |
2 files changed, 45 insertions, 46 deletions
diff --git a/gn2/wqflask/templates/base.html b/gn2/wqflask/templates/base.html index 454139df..82387db2 100644 --- a/gn2/wqflask/templates/base.html +++ b/gn2/wqflask/templates/base.html @@ -233,7 +233,6 @@ </div> <script src="{{ url_for('js', filename='jquery/jquery.min.js') }}" type="text/javascript"></script> <script src="{{ url_for('js', filename='bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script> - <script src="/static/new/javascript/search_autocomplete.js"></script> <script> //http://stackoverflow.com/questions/11521763/bootstrap-scrollspy-not-working var $window = $(window) @@ -244,46 +243,6 @@ } }) </script> - <script type="text/javascript"> - $(document).ready(function() { - - const urlParams = new URLSearchParams(window.location.search) - let term = urlParams.get("terms") - - //should web scrap - var global_search_hint = [ - "cytochrome", - "cytochrome AND P450", - "cytochrome NEAR P450", - "cytochrome -P450", - "cytochrome NOT P450", - "species:human", - "group:BXD", - "Hs:chr4:9930021 species:mouse", - "Hs:chr4:9130000..9980000 species:mouse", - "mean:5..7", - "mean:7..", - "Hs:chr4:9930021", - "Hs:chr4:9930021 species:mouse", - "Hs:chr4:9130000..9980000 species:mouse", - "bx*", - "*", - ] - autocomplete(document.getElementById("term"), global_search_hint); - $("#term").keyup(function(event) { - if (event.keyCode === 13) { - event.preventDefault(); - $('#globalsearchform').attr('action', "/gsearch").submit(); - if ($("#term").val().trim() != "") { - saveBeforeSubmit($("#term").val().trim()) - $("#globalsearchform")[0].submit(); - } - - } - }) - - }); - </script> <script src="{{ url_for('js', filename='jquery-cookie/jquery.cookie.js') }}" type="text/javascript"></script> <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='jquery-ui/jquery-ui.min.js') }}"></script> <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='colorbox/jquery.colorbox-min.js') }}"></script> <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/parsley.min.js') }}"></script> diff --git a/gn2/wqflask/templates/index_page.html b/gn2/wqflask/templates/index_page.html index b836cbb1..216e1c38 100755 --- a/gn2/wqflask/templates/index_page.html +++ b/gn2/wqflask/templates/index_page.html @@ -418,11 +418,51 @@ {%endblock%} {% block js %} - - <script src="/static/new/javascript/dataset_select_menu_orig.js"></script> - - - <script type="text/javascript"> + +<script src="/static/new/javascript/search_autocomplete.js"></script> +<script src="/static/new/javascript/dataset_select_menu_orig.js"></script> + + <script type="text/javascript"> + $(document).ready(function() { + + const urlParams = new URLSearchParams(window.location.search) + let term = urlParams.get("terms") + + //should web scrap + var global_search_hint = [ + "cytochrome", + "cytochrome AND P450", + "cytochrome NEAR P450", + "cytochrome -P450", + "cytochrome NOT P450", + "species:human", + "group:BXD", + "Hs:chr4:9930021 species:mouse", + "Hs:chr4:9130000..9980000 species:mouse", + "mean:5..7", + "mean:7..", + "Hs:chr4:9930021", + "Hs:chr4:9930021 species:mouse", + "Hs:chr4:9130000..9980000 species:mouse", + "bx*", + "*" + ] + autocomplete(document.getElementById("term"), global_search_hint); + $("#term").keyup(function(event) { + if (event.keyCode === 13) { + event.preventDefault(); + $('#globalsearchform').attr('action', "/gsearch").submit(); + if ($("#term").val().trim() != "") { + saveBeforeSubmit($("#term").val().trim()) + $("#globalsearchform")[0].submit(); + } + + } + }) + + }); +</script> + <script type="text/javascript"> $(document).on('submit', '#searchform', function(event){ |