From 174daf703b341455c3320b61034cdb74bee9b55d Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sun, 20 Oct 2013 22:37:55 +0200 Subject: [PATCH] [enh] chrome opensearch support --- searx/static/css/style.css | 5 +++-- searx/templates/base.html | 2 +- searx/templates/search.html | 2 +- searx/webapp.py | 7 +++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/searx/static/css/style.css b/searx/static/css/style.css index c98a049b3..b045379b1 100644 --- a/searx/static/css/style.css +++ b/searx/static/css/style.css @@ -12,7 +12,7 @@ input { border: 2px solid #666666; color: #444444; padding: 8px; background-col input[type="checkbox"] { visibility: hidden; } -.checkbox_container { display: inline-block; position: relative; margin: 0; padding-left: 3px; margin: 0 10px; } +.checkbox_container { display: inline-block; position: relative; padding-left: 3px; margin: 0 10px; } .checkbox_container label { cursor: pointer; } @@ -53,8 +53,9 @@ input[type="checkbox"] { visibility: hidden; } a { text-decoration: none; } -.result_title { margin-bottom: 0; } +.result { margin-bottom: 16px; } +.result_title { margin-bottom: 0; } .result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 50em; } .result h3 { font-size: 0.9em;} .result { max-width: 70em; } diff --git a/searx/templates/base.html b/searx/templates/base.html index b435a0b5b..e8792c3d3 100644 --- a/searx/templates/base.html +++ b/searx/templates/base.html @@ -3,7 +3,7 @@ - + searx {% block title %}{% endblock %} diff --git a/searx/templates/search.html b/searx/templates/search.html index 6c7cc444a..a7225e017 100644 --- a/searx/templates/search.html +++ b/searx/templates/search.html @@ -1,4 +1,4 @@ -
+

diff --git a/searx/webapp.py b/searx/webapp.py index 517633ac6..fd208504b 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -37,7 +37,7 @@ opensearch_xml = ''' Search searx UTF-8 searx meta search engine - + @@ -105,7 +105,10 @@ def fav(): @app.route('/opensearch.xml', methods=['GET']) def opensearch(): global opensearch_xml - ret = opensearch_xml.format(host=url_for('index', _external=True)) + method = 'post' + if request.headers.get('User-Agent', '').lower().find('webkit') >= 0: + method = 'get' + ret = opensearch_xml.format(method=method, host=url_for('index', _external=True)) resp = Response(response=ret, status=200, mimetype="application/xml")