浏览代码

[enh] results favico handling

asciimoo 11 年前
父节点
当前提交
4f4cb1caca

+ 0
- 1
searx/engines/dailymotion.py 查看文件

@@ -1,7 +1,6 @@
1 1
 from urllib import urlencode
2 2
 from lxml import html
3 3
 from json import loads
4
-from cgi import escape
5 4
 
6 5
 categories = ['videos']
7 6
 locale = 'en_US'

+ 2
- 1
searx/static/css/style.css 查看文件

@@ -79,7 +79,6 @@ a { text-decoration: none; color: #1a11be; }
79 79
 a:visited { color: #7b11be; }
80 80
 
81 81
 .result { margin: 19px 0 18px 0; padding: 0; max-width: 55em;  clear: both; }
82
-.result:hover { background: #e8e7e6; }
83 82
 .result_title { margin-bottom: 0; }
84 83
 .result h3 { font-size: 1em; word-wrap:break-word; margin: 5px 0 1px 0; padding: 0 }
85 84
 .result .content { font-size: 0.8em; margin: 0; padding: 0; max-width: 54em; word-wrap:break-word; line-height: 1.24; }
@@ -201,3 +200,5 @@ tr:hover td { background: #DDDDDD; }
201 200
 
202 201
   .result img { max-width: 90%; width: auto; height: auto }
203 202
 }
203
+
204
+.favicon { float: left; margin-right: 4px; }

+ 2
- 4
searx/templates/result_templates/default.html 查看文件

@@ -1,13 +1,11 @@
1 1
 <div class="result {{ result.class }}">
2 2
 
3 3
   {% if result['favicon'] %}
4
-  <div style="float:left; margin:2px;">
5
-    <img width="18" height="18" src="static/img/icon_{{result['favicon']}}.ico" alt="{{result['favicon']}}.ico" title="{{result['favicon']}}.ico" />
6
-  </div>
4
+    <img width="14" height="14" class="favicon" src="static/img/icon_{{result['favicon']}}.ico" />
7 5
   {% endif %}
8 6
 
9 7
   <div>
10
-    <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3></br>
8
+    <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
11 9
     <p class="content">{% if result.content %}{{ result.content|safe }}<br />{% endif %}</p>
12 10
     <p class="url">{{ result.pretty_url }}</p>
13 11
   </div>

+ 2
- 4
searx/templates/result_templates/videos.html 查看文件

@@ -1,13 +1,11 @@
1 1
 <div class="result">
2 2
   {% if result['favicon'] %}
3
-  <div style="float:left; margin:2px;">
4
-    <img width="18" height="18" src="static/img/icon_{{result['favicon']}}.ico" alt="{{result['favicon']}}.ico" title="{{result['favicon']}}.ico" />
5
-  </div>
3
+    <img width="14" height="14" class="favicon" src="static/img/icon_{{result['favicon']}}.ico" />
6 4
   {% endif %}
7 5
 
8 6
     <p>
9 7
       <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
10
-      <a href="{{ result.url }}"><img width="300" height="170"  src="{{ result.thumbnail }}" title={{ result.title }} alt=" {{ result.title }}"/></a>
8
+      <a href="{{ result.url }}"><img width="400px" src="{{ result.thumbnail }}" title={{ result.title }} alt=" {{ result.title }}"/></a>
11 9
       <p class="url">{{ result.url }}</p>
12 10
     </p>
13 11
 </div>

+ 1
- 1
searx/templates/results.html 查看文件

@@ -9,7 +9,7 @@
9 9
     {% if suggestions %}
10 10
     <div id="suggestions"><span>Suggestions: </span>{% for suggestion in suggestions %}<form method="post" action="/"><input type="hidden" name="q" value="{{suggestion}}"><input type="submit" value="{{ suggestion }}" /></form>{% endfor %}</div>
11 11
     {% endif %}
12
-    
12
+
13 13
 
14 14
     <div id ="result_count">
15 15
         Number of results: {{ number_of_results }}