Commits

anatoly techtonik committed 6610c3c

issue #322 - patch to make search index throbber work asap
ideally before downloading / caching index js

  • Participants

Comments (0)

Files changed (3)

+^\.hg
+^\.mq
+syntax: glob
+status
+guards

322.improve-search-responsiveness.diff

+# HG changeset patch
+# Parent 5ffe2aa4e387cdd97c11350bfbd493e3c5fc2495
+# User anatoly techtonik <techtonik@gmail.com>
+diff -r 5ffe2aa4e387 -r 3f1c9e27de86 sphinx/themes/basic/search.html
+--- a/sphinx/themes/basic/search.html	Tue Feb 23 19:10:43 2010 +0200
++++ b/sphinx/themes/basic/search.html	Mon Apr 26 10:25:44 2010 +0300
+@@ -11,6 +11,12 @@
+ {% set title = _('Search') %}
+ {% set script_files = script_files + ['_static/searchtools.js'] %}
+ {% block body %}
++  <script type="text/javascript">
++    jQuery(function($) {
++      Search.loadIndex("{{ pathto('searchindex.js', 1) }}");
++    })
++  </script>
++
+   <h1 id="search-documentation">{{ _('Search') }}</h1>
+   <div id="fallback" class="admonition warning">
+   <script type="text/javascript">$('#fallback').hide();</script>
+@@ -50,5 +56,4 @@
+ {% endblock %}
+ {% block footer %}
+   {{ super() }}
+-  <script type="text/javascript" src="{{ pathto('searchindex.js', 1) }}"></script>
+ {% endblock %}
+diff -r 5ffe2aa4e387 -r 3f1c9e27de86 sphinx/themes/basic/static/searchtools.js
+--- a/sphinx/themes/basic/static/searchtools.js	Tue Feb 23 19:10:43 2010 +0200
++++ b/sphinx/themes/basic/static/searchtools.js	Mon Apr 26 10:25:44 2010 +0300
+@@ -252,6 +252,10 @@
+   hasIndex : function() {
+       return this._index !== null;
+   },
++  
++  loadIndex : function(url) {
++      jQuery.getScript(url);
++  },
+ 
+   deferQuery : function(query) {
+       this._queued_query = query;
+322.improve-search-responsiveness.diff