summaryrefslogtreecommitdiff
path: root/searx/templates
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2014-03-21 11:11:31 +0100
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2014-03-21 11:11:31 +0100
commitc8cf95aa56590800c4f2d39a39d0a70537e7382e (patch)
treec23b01cdebee0c4cbaf6db5ed7a429cf571ae69c /searx/templates
parentcc7f3cb61798463036a886ae5f0ccd06aca5e625 (diff)
deactivate autocompleter by default
Diffstat (limited to 'searx/templates')
-rw-r--r--searx/templates/base.html6
-rw-r--r--searx/templates/opensearch.xml4
2 files changed, 10 insertions, 0 deletions
diff --git a/searx/templates/base.html b/searx/templates/base.html
index 2823c684e..d86982a59 100644
--- a/searx/templates/base.html
+++ b/searx/templates/base.html
@@ -13,13 +13,19 @@
{% block head %}
<link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
{% endblock %}
+ <script type="text/javascript">
+ searx = {};
+ searx.autocompleter = {% if client.autocompleter %}true{% else %}false{% endif %};
+ </script>
</head>
<body>
<div id="container">
{% block content %}
{% endblock %}
+{% if client.autocompleter %}
<script src="{{ url_for('static', filename='js/mootools-core-1.4.5-min.js') }}" ></script>
<script src="{{ url_for('static', filename='js/mootools-autocompleter-1.1.2-min.js') }}" ></script>
+{% endif %}
<script src="{{ url_for('static', filename='js/searx.js') }}" ></script>
</div>
</body>
diff --git a/searx/templates/opensearch.xml b/searx/templates/opensearch.xml
index b99a9bb24..403d18bb5 100644
--- a/searx/templates/opensearch.xml
+++ b/searx/templates/opensearch.xml
@@ -6,18 +6,22 @@
<LongName>searx metasearch</LongName>
{% if method == 'get' %}
<Url type="text/html" method="get" template="{{ host }}?q={searchTerms}"/>
+ {% if client.autocompleter %}
<Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
<Param name="format" value="x-suggestions" />
<Param name="q" value="{searchTerms}" />
</Url>
+ {% endif %}
{% else %}
<Url type="text/html" method="post" template="{{ host }}">
<Param name="q" value="{searchTerms}" />
</Url>
+ {% if client.autocompleter %}
<!-- TODO, POST REQUEST doesn't work -->
<Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
<Param name="format" value="x-suggestions" />
<Param name="q" value="{searchTerms}" />
</Url>
+ {% endif %}
{% endif %}
</OpenSearchDescription>