on master help sign in
[enh] chrome opensearch support
commit174daf703b341455c3320b61034cdb74bee9b55d authorasciimoo <asciimoo@gmail.com> dateSun 20 Oct 2013, 22:37 (13 years ago) parenta2bbf02
4 files changed+10−6
searx/static/css/style.css+3−2 searx/templates/base.html+1−1 searx/templates/search.html+1−1 searx/webapp.py+5−2
searx/static/css/style.css+3−2
@@ -12,7 +12,7 @@ input { border: 2px solid #666666; color: #444444; padding: 8px; background-col
1212
1313input[type="checkbox"] { visibility: hidden; }
1414
15−.checkbox_container { display: inline-block; position: relative; margin: 0; padding-left: 3px; margin: 0 10px; }
15+.checkbox_container { display: inline-block; position: relative; padding-left: 3px; margin: 0 10px; }
1616.checkbox_container label {
1717 cursor: pointer;
1818}
@@ -53,8 +53,9 @@ input[type="checkbox"] { visibility: hidden; }
5353
5454a { text-decoration: none; }
5555
56−.result_title { margin-bottom: 0; }
5756
57+.result { margin-bottom: 16px; }
58+.result_title { margin-bottom: 0; }
5859.result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 50em; }
5960.result h3 { font-size: 0.9em;}
6061.result { max-width: 70em; }
searx/templates/base.html+1−1
@@ -3,7 +3,7 @@
33<head>
44 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
55 <meta http-equiv="content-language" content="en" />
6− <meta name="description" content="Searx - a hackable metasearch engine respecting privacy" />
6+ <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
77 <meta name="keywords" content="searx, search, search engine, metasearch, meta search" />
88 <title>searx {% block title %}{% endblock %}</title>
99 <link rel="stylesheet" href="/static/css/style.css" type="text/css" media="screen" charset="utf-8" />
searx/templates/search.html+1−1
@@ -1,4 +1,4 @@
1−<form method="post" action="">
1+<form method="post" action="/">
22 <input type="text" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
33 <input type="submit" value="search" />
44 <p>
searx/webapp.py+5−2
@@ -37,7 +37,7 @@ opensearch_xml = '''<?xml version="1.0" encoding="utf-8"?>
3737 <Description>Search searx</Description>
3838 <InputEncoding>UTF-8</InputEncoding>
3939 <LongName>searx meta search engine</LongName>
40− <Url type="text/html" method="post" template="{host}">
40+ <Url type="text/html" method="{method}" template="{host}">
4141 <Param name="q" value="{{searchTerms}}" />
4242 </Url>
4343</OpenSearchDescription>
@@ -105,7 +105,10 @@ def fav():
105105@app.route('/opensearch.xml', methods=['GET'])
106106def opensearch():
107107 global opensearch_xml
108− ret = opensearch_xml.format(host=url_for('index', _external=True))
108+ method = 'post'
109+ if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
110+ method = 'get'
111+ ret = opensearch_xml.format(method=method, host=url_for('index', _external=True))
109112 resp = Response(response=ret,
110113 status=200,
111114 mimetype="application/xml")