diff options
Diffstat (limited to 'askbot/skins/default/templates/main_page/javascript.html')
-rw-r--r-- | askbot/skins/default/templates/main_page/javascript.html | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/askbot/skins/default/templates/main_page/javascript.html b/askbot/skins/default/templates/main_page/javascript.html index e35113dd..e726d5b4 100644 --- a/askbot/skins/default/templates/main_page/javascript.html +++ b/askbot/skins/default/templates/main_page/javascript.html @@ -5,7 +5,7 @@ $(document).ready(function(){ /*var on_tab = '#nav_questions'; $(on_tab).attr('className','on');*/ - liveSearch().init('main_page'); + liveSearch().init('main_page', '{{query_string}}'); Hilite.exact = false; Hilite.elementid = "question-list"; Hilite.debug_referrer = location.href; @@ -48,3 +48,19 @@ <script type='text/javascript' src='{{"/js/tag_selector.js"|media}}'></script> {% endif %} <script type="text/javascript" src="{{"/js/live_search.js"|media}}"></script> +{% if active_tab != "tags" and active_tab != "users" %} +<script> +$("form#searchForm").submit(function(event) { + event.preventDefault(); + form_action = $("form#searchForm").attr('action') + query = $("input#keywords").attr('value').split(' ').join('+') + $("input#keywords").attr('value', '') + $("input#searchButton").attr('value', '') + form_action += 'section:{{parameters.scope}}/sort:{{parameters.sort}}/' + + 'query:' + query + '/search:search/' + + '{% if parameters.tags %}tags:{{parameters.tags}}/{% endif %}' + + '{% if parameters.author %}author:{{parameters.author}}/{% endif %}' + window.location.href = form_action; +}); +</script> +{% endif %} |