if len(prefix) < 2:
return HttpResponse('')
tags_list = []
- result = ""
for tag in _tags_starting_with(prefix, request.user):
if not tag.name in tags_list:
- result += "\n" + tag.name
tags_list.append(tag.name)
- dict_result = {"matches": tags_list}
- return JSONResponse(dict_result, callback)
+ if request.GET.get('mozhint', ''):
+ result = [prefix, tags_list]
+ else:
+ result = {"matches": tags_list}
+ return JSONResponse(result, callback)
# ====================
# = Shelf management =
<?xml version="1.0" encoding="UTF-8"?>
-<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
+<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
+ xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Wolne Lektury</ShortName>
<Description>WolneLektury.pl, szkolna biblioteka internetowa.</Description>
+ <InputEncoding>UTF-8</InputEncoding>
<Tags>lektury</Tags>
<Developer>Fundacja Nowoczesna Polska</Developer>
<Language>pl</Language>
<Contact>fundacja@nowoczesnapolska.org.pl</Contact>
+ <Image height="16" width="16" type="image/x-icon">http://www.wolnelektury.pl/static/img/favicon.ico</Image>
+ <Image height="64" width="64" type="image/png">http://www.wolnelektury.pl/static/img/wl_icon_64.png</Image>
<Url type="application/atom+xml;profile=opds-catalog"
template="http://www.wolnelektury.pl/opds/search/?q={searchTerms}" />
+ <Url type="text/html" method="GET" template="http://www.wolnelektury.pl/katalog/szukaj?q={searchTerms}" />
+ <Url type="application/x-suggestions+json" method="GET" template="http://www.wolnelektury.pl/katalog/jtags?mozhint=1&q={searchTerms}" />
+ <moz:SearchForm>http://www.wolnelektury.pl/katalog/</moz:SearchForm>
<Query role="example" searchTerms="słowa" />
</OpenSearchDescription>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css">
<title>{% block title %}WolneLektury.pl{% endblock %}</title>
- <link rel="icon" href="{{ STATIC_URL }}img/favicon.png" type="image/x-icon" />
+ <link rel="icon" href="{{ STATIC_URL }}img/favicon.png" type="image/png" />
+ <link rel="search" type="application/opensearchdescription+xml" title="Wolne Lektury" href="{{ STATIC_URL }}opensearch.xml">
{% compressed_css "all" %}
<script type="text/javascript">var LANGUAGE_CODE = "{{ LANGUAGE_CODE }}";</script>
{% compressed_js "jquery" %}