mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix #30: disable the search box when javascript isn't available
This commit is contained in:
@@ -64,6 +64,7 @@
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- block sidebarsearch %}
|
{%- block sidebarsearch %}
|
||||||
{%- if pagename != "search" %}
|
{%- if pagename != "search" %}
|
||||||
|
<div id="searchbox" style="display: none">
|
||||||
<h3>{{ _('Quick search') }}</h3>
|
<h3>{{ _('Quick search') }}</h3>
|
||||||
<form class="search" action="{{ pathto('search') }}" method="get">
|
<form class="search" action="{{ pathto('search') }}" method="get">
|
||||||
<input type="text" name="q" size="18" /> <input type="submit" value="{{ _('Go') }}" />
|
<input type="text" name="q" size="18" /> <input type="submit" value="{{ _('Go') }}" />
|
||||||
@@ -71,6 +72,10 @@
|
|||||||
<input type="hidden" name="area" value="default" />
|
<input type="hidden" name="area" value="default" />
|
||||||
</form>
|
</form>
|
||||||
<p style="font-size: 90%">{{ _('Enter search terms or a module, class or function name.') }}</p>
|
<p style="font-size: 90%">{{ _('Enter search terms or a module, class or function name.') }}</p>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () { $('#searchbox').show(0); });
|
||||||
|
</script>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endblock %}
|
{%- endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,12 @@
|
|||||||
{% set script_files = script_files + ['_static/searchtools.js'] %}
|
{% set script_files = script_files + ['_static/searchtools.js'] %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<h1 id="search-documentation">{{ _('Search') }}</h1>
|
<h1 id="search-documentation">{{ _('Search') }}</h1>
|
||||||
|
<div id ="fallback" class="admonition warning">
|
||||||
|
<script type="text/javascript">$('#fallback').hide();</script>
|
||||||
|
<p>
|
||||||
|
{% trans %}Please activate Javascript to enable the search functionality.{% endtrans %}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
{% trans %}From here you can search these documents. Enter your search
|
{% trans %}From here you can search these documents. Enter your search
|
||||||
words into the box below and click "search". Note that the search
|
words into the box below and click "search". Note that the search
|
||||||
|
|||||||
Reference in New Issue
Block a user