summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--askbot/skins/default/templates/main_page/javascript.html21
-rw-r--r--askbot/skins/default/templates/meta/bottom_scripts.html20
2 files changed, 21 insertions, 20 deletions
diff --git a/askbot/skins/default/templates/main_page/javascript.html b/askbot/skins/default/templates/main_page/javascript.html
index 10f8ede2..f1e0fb44 100644
--- a/askbot/skins/default/templates/main_page/javascript.html
+++ b/askbot/skins/default/templates/main_page/javascript.html
@@ -1,4 +1,5 @@
<script type="text/javascript">
+ /*<![CDATA[*/
var sortMethod = '{{sort}}';
var showSortByRelevance = {% if show_sort_by_relevance %}true{% else %}false{% endif %};
var minSearchWordLength = {{settings.MIN_SEARCH_WORD_LENGTH}};
@@ -22,6 +23,26 @@
askbot['urls']['set_tag_filter_strategy'] = '{% url "set_tag_filter_strategy" %}';
askbot['urls']['questions'] = '{% url "questions" %}';
askbot['urls']['question_url_template'] = scriptUrl + '{{'question/'|transurl}}{{ "{{QuestionID}}/" }}';
+
+ if (Modernizr.history) {
+ // history management works!
+ } else {
+ // no history support :(
+ //hash = unescape(window.location.hash).replace('#','').split("?")[0]
+ {# todo: fix this evil code!!! #}
+ var hash = History.unescapeHash(window.location.hash).replace('#','').split("?")[0];
+ var questions_url = askbot['urls']['questions'];
+ if (hash.substring(0, questions_url.length) === questions_url) {
+ var url = hash;
+ } else {
+ var url = questions_url + hash;
+ }
+ if (hash !== '' && hash !== undefined && url !== undefined){
+ {# was this causing strange redirects in IE??? #}
+ window.location = 'http://' + window.location.host + url;
+ }
+ }
+ /*]]>*/
</script>
<script type='text/javascript' src='{{"/js/editor.js"|media}}'></script>
{% if request.user.is_authenticated() %}
diff --git a/askbot/skins/default/templates/meta/bottom_scripts.html b/askbot/skins/default/templates/meta/bottom_scripts.html
index 989b1bd4..76bef90b 100644
--- a/askbot/skins/default/templates/meta/bottom_scripts.html
+++ b/askbot/skins/default/templates/meta/bottom_scripts.html
@@ -50,26 +50,6 @@
<script type="text/javascript">
/*<![CDATA[*/
$(document).ready(function(){
- {% if active_tab == 'questions' %}
- if (Modernizr.history) {
- // history management works!
- } else {
- // no history support :(
- //hash = unescape(window.location.hash).replace('#','').split("?")[0]
- {# todo: fix this evil code!!! #}
- var hash = History.unescapeHash(window.location.hash).replace('#','').split("?")[0];
- var questions_url = askbot['urls']['questions'];
- if (hash.substring(0, questions_url.length) === questions_url) {
- var url = hash;
- } else {
- var url = questions_url + hash;
- }
- if (hash !== '' && hash !== undefined && url !== undefined){
- {# was this causing strange redirects in IE??? #}
- window.location = 'http://' + window.location.host + url;
- }
- }
- {% endif %}
// focus input on the search bar endcomment
{% if active_tab in ('users', 'questions', 'tags') %}
$('#keywords').focus();