deactivate autocompleter by default

This commit is contained in:
Thomas Pointhuber 2014-03-21 11:11:31 +01:00
parent cc7f3cb617
commit c8cf95aa56
5 changed files with 45 additions and 21 deletions

View file

@ -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>

View file

@ -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>