on master help sign in
[enh] set up special css classes for highlighting results + highlight definitions with dark grey border
commit74ca542a0282e269c991cc75511ccc76a7c8901c authorrhapsodhy <me@rhapsodhy.hu> dateSat 11 Jan 2014, 03:31 (13 years ago) parent04c4083
3 files changed+14−8
searx/engines/duckduckgo_definitions.py+4−3 searx/static/css/style.css+9−4 searx/templates/result_templates/default.html+1−1
searx/engines/duckduckgo_definitions.py+4−3
@@ -13,9 +13,10 @@ def response(resp):
1313 results = []
1414 if 'Definition' in search_res:
1515 if search_res.get('AbstractURL'):
16− res = {'title' : search_res.get('Heading', '')
17− ,'content' : search_res.get('Definition', '')
18− ,'url' : search_res.get('AbstractURL', '')
16+ res = {'title' : search_res.get('Heading', '')
17+ ,'content' : search_res.get('Definition', '')
18+ ,'url' : search_res.get('AbstractURL', '')
19+ ,'class' : 'definition_result'
1920 }
2021 results.append(res)
2122
searx/static/css/style.css+9−4
@@ -97,6 +97,11 @@ a:visited { color: #7b11be; }
9797.image_result p span a { color: #FFFFFF; }
9898.image_result p:hover span a { display: block; position: absolute; bottom: 0; right: 0; padding: 4px; background-color: rgba(0, 0, 0, 0.6); font-size: 0.7em; }
9999
100+.torrent_result { border-left: 10px solid lightgray; padding-left: 3px; }
101+.torrent_result p { margin: 3px; font-size: 0.8em; }
102+
103+.definition_result { border-left: 10px solid gray; padding-left: 3px; }
104+
100105.percentage { position: relative; width: 300px; }
101106.percentage div { background: #444444; }
102107td { padding: 0 4px; }
@@ -142,7 +147,7 @@ tr:hover td { background: #DDDDDD; }
142147#suggestions form { display: block; }
143148#suggestions input { padding: 2px 6px; margin: 2px 4px; font-size: 0.8em; display: inline-block; background: #E4E4E4; border-radius: 4px; border: 0; cursor: pointer; }
144149
145−#preferences {
150+#preferences {
146151 top: 10px;
147152 padding: 0;
148153 border: 0;
@@ -163,7 +168,7 @@ tr:hover td { background: #DDDDDD; }
163168}
164169
165170@media screen and (max-width: 60em) {
166−
171+
167172 #suggestions { position: static; max-width: 50em; margin: 0 0 2px 0; padding: 0; float: none; border: none; width: auto }
168173 #suggestions span { display: inline; font-size: 0.8em }
169174 #suggestions form { display: inline; }
@@ -172,13 +177,13 @@ tr:hover td { background: #DDDDDD; }
172177}
173178
174179@media screen and (max-width: 680px) {
175−
180+
176181 #search_wrapper { width: 90%; clear:both; overflow: hidden }
177182
178183 .right { display: none; postion: fixed !important; top: 100px; right: 0px; }
179184
180185 #categories { font-size: 80% }
181−
186+
182187 #categories .checkbox_container { margin-top: 2px; margin: 0 2px; }
183188
184189 .result { border-top: 1px solid #e8e7e6; margin: 7px 0 6px 0; }
searx/templates/result_templates/default.html+1−1
@@ -1,4 +1,4 @@
1−<div class="result">
1+<div class="result {{ result.class }}">
22 <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
33 <p class="content">{% if result.content %}{{ result.content|safe }}<br />{% endif %}</p>
44 <p class="url">{{ result.pretty_url }}</p>