diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-06-16 19:37:24 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-06-16 19:37:24 +0200 |
commit | 88f0ecd60bededd88473fa8cd8c675fbb9ed381c (patch) | |
tree | 908761cebca5bc00b706153a93b17f3c7f9cf365 | |
parent | 3386edf21c1d49459e5373bdcde6a50686ae8d64 (diff) | |
download | Chimère - projet Saclay-88f0ecd60bededd88473fa8cd8c675fbb9ed381c.tar.bz2 Chimère - projet Saclay-88f0ecd60bededd88473fa8cd8c675fbb9ed381c.zip |
Search: html and JS integration of search module
-rw-r--r-- | templates/chimere/blocks/map.html | 15 | ||||
-rw-r--r-- | templates/chimere/main_map.html | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/templates/chimere/blocks/map.html b/templates/chimere/blocks/map.html index fe5ea06..56a87a3 100644 --- a/templates/chimere/blocks/map.html +++ b/templates/chimere/blocks/map.html @@ -27,8 +27,10 @@ $(function(){ <!-- var routing_panel_open = function(){ $('#frm_categories').hide(); + $('#search-box').hide(); $('#chimere_itinerary_panel').show(); $('#action-categories').removeClass('state-active'); + $('#action-search').removeClass('state-active'); $('#action-routing').addClass('state-active'); }; @@ -36,13 +38,26 @@ $(function(){ var category_panel_open = function(){ $('#chimere_itinerary_panel').hide(); + $('#search-box').hide(); $('#frm_categories').show(); $('#action-routing').removeClass('state-active'); + $('#action-search').removeClass('state-active'); $('#action-categories').addClass('state-active'); }; $('#action-categories').click(category_panel_open); + var search_panel_open = function(){ + $('#chimere_itinerary_panel').hide(); + $('#frm_categories').hide(); + $('#search-box').show(); + $('#action-routing').removeClass('state-active'); + $('#action-categories').removeClass('state-active'); + $('#action-search').addClass('state-active'); + }; + + $('#action-search').click(search_panel_open); + $('#sidebar-handler-hide').click(function(){$('#sidebar').hide();}); $('#sidebar-handler-show').click(function(){$('#sidebar').show();}); diff --git a/templates/chimere/main_map.html b/templates/chimere/main_map.html index 76b46fd..2acbba5 100644 --- a/templates/chimere/main_map.html +++ b/templates/chimere/main_map.html @@ -8,6 +8,9 @@ <script src="{{ STATIC_URL }}chimere/js/jquery.chimere.js" type="text/javascript"></script> <script src="{{ STATIC_URL }}saclay/js/SaclayCloud.js" type="text/javascript"></script> <script src="{{ STATIC_URL }}saclay/js/jquery.form.js" type="text/javascript"></script> +{% if has_search %} +<script src="{{ STATIC_URL }}chimere/js/search.js" type="text/javascript"></script> +<script src="{{ STATIC_URL }}chimere/js/search-autocomplete.js" type="text/javascript"></script>{% endif %} <script type='text/javascript' language='javascript'> <!-- @@ -53,6 +56,7 @@ <div id='categories'>{# dynamic content #} </div> </form> + <div id='search-box'></div> {% routing %} </div> <div id='edit-panel'> @@ -102,6 +106,15 @@ <script type="text/javascript"> <!-- $("#main-map").show(); + var has_search = {% if has_search %}true{% else %}false{% endif %}; + // array to keep trace of already displayed items + var search_result = new Array(); + var search_url = "/search/"; + $(function(){ + if (has_search){ + load_search_box(); + } + }); // --> </script> {% map_menu %} |