on master help sign in
Merge branch 'master' of https://github.com/dalf/searx
commitba141d64ce88c2210759794eb7665a80348609ac authorasciimoo <asciimoo@gmail.com> dateFri 10 Jan 2014, 14:31 (13 years ago) parent1ba27628433421
6 files changed+117−75
searx/static/css/style.css+93−54 searx/static/img/preference-icon.png searx/templates/categories.html+3−1 searx/templates/result_templates/default.html+2−1 searx/templates/results.html+16−14 searx/templates/search.html+3−5
searx/static/css/style.css+93−54
@@ -2,8 +2,22 @@ html {
22 font-family: sans-serif;
33 font-size: 0.9em;
44 -webkit-text-size-adjust: 100%;
5− -ms-text-size-adjust: 100%;
5+ -ms-text-size-adjust: 100%;
6+ -moz-text-size-adjust: 100%;
67 color: #444444;
8+ padding: 0;
9+ margin: 0;
10+}
11+
12+body, #container {
13+ padding: 0;
14+ margin: 0;
15+}
16+
17+#container {
18+ width: 100%;
19+ position: absolute;
20+ top: 0;
721}
822
923.row { max-width: 800px; margin: auto; text-align: justify; }
@@ -22,60 +36,43 @@ h1 { font-size: 5em; }
2236div.title { background: url('/static/img/searx.png') no-repeat; width: 100%; background-position: center; }
2337div.title h1 { visibility: hidden; }
2438
25−
2639input[type="submit"] { border: 1px solid #666666; color: #444444; padding: 4px; background-color: #FFFFFF; margin-left: 8px; }
2740
2841input[type="checkbox"] { visibility: hidden; }
2942
30−.checkbox_container { display: inline-block; position: relative; padding-left: 3px; margin: 0 10px; }
43+#categories { margin: 0 10px; }
44+
45+.checkbox_container { display: inline-block; position: relative; margin: 0 3px; padding: 0px; }
46+.checkbox_container input {
47+ display: none;
48+}
3149.checkbox_container label {
3250 cursor: pointer;
33−}
34−.checkbox_container label.cb {
35− position: absolute;
36− width: 16px;
37− height: 16px;
38− top: 2px;
39− left: 2px;
40− background: #eee;
41− border:1px solid #ddd;
42−}
43−.checkbox_container label.cb:after {
44− opacity: 0.2;
45− content: '';
46− position: absolute;
47− width: 8px;
48− height: 4px;
49− background: transparent;
50− top: 3px;
51− left: 3px;
52− border: 3px solid #333;
53− border-top: none;
54− border-right: none;
55−
56− -webkit-transform: rotate(-45deg);
57− -moz-transform: rotate(-45deg);
58− -o-transform: rotate(-45deg);
59− -ms-transform: rotate(-45deg);
60− transform: rotate(-45deg);
61−}
62−.checkbox_container label.cb:hover:after {
63− opacity: 0.5;
64−}
65−.checkbox_container input[type=checkbox]:checked + label.cb:after {
66− opacity: 1;
51+ padding: 4px 10px;
52+ margin: 0;
53+ display: block;
54+ text-transform: capitalize;
55+
56+ -webkit-touch-callout: none;
57+ -webkit-user-select: none;
58+ -khtml-user-select: none;
59+ -moz-user-select: none;
60+ -ms-user-select: none;
61+ user-select: none;
6762}
6863
69−a { text-decoration: none; }
64+.checkbox_container input[type="checkbox"]:checked + label { background: #b8c1d9; }
65+.search .checkbox_container label { border-bottom: 4px solid #e8e7e6; }
66+.search .checkbox_container input[type="checkbox"]:checked + label { border-bottom: 4px solid #1a11be; }
7067
68+a { text-decoration: none; color: #1a11be; }
69+a:visited { color: #7b11be; }
7170
72−.result { margin-bottom: 16px; clear: both; }
71+.result { margin: 19px 0 18px 0; padding: 0; max-width: 55em; }
7372.result_title { margin-bottom: 0; }
74−.result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 54em; }
75−.result h3 { font-size: 0.9em;}
76−.result { max-width: 70em; }
77−
78−.url { font-weight: bold; word-wrap:break-word; }
73+.result h3 { font-size: 1em; word-wrap:break-word; margin: 5px 0 1px 0; padding: 0 }
74+.result .content { font-size: 0.8em; margin: 0; padding: 0; max-width: 54em; word-wrap:break-word; line-height: 1.24; }
75+.result .url { font-size: 0.8em; margin: 3px 0 0 0; padding: 0; max-width: 54em; word-wrap:break-word; color: #2e1c0b; }
7976
8077.q { width: 30em; }
8178
@@ -85,6 +82,8 @@ a { text-decoration: none; }
8582
8683.small p { margin: 2px 0; }
8784
85+.search { background: #e8e7e6; padding: 0; margin: 0 }
86+
8887.right { float: right; }
8988
9089.invisible { display: none; }
@@ -103,8 +102,7 @@ a { text-decoration: none; }
103102td { padding: 0 4px; }
104103tr:hover td { background: #DDDDDD; }
105104
106−
107−#search_wrapper { position: relative; max-width: 600px; margin: 10px; }
105+#search_wrapper { position: relative; max-width: 600px; padding: 10px; }
108106.center #search_wrapper { margin-left: auto; margin-right: auto; }
109107.q {
110108 background: none repeat scroll 0 0 #FFFFFF;
@@ -124,8 +122,8 @@ tr:hover td { background: #DDDDDD; }
124122}
125123#search_submit {
126124 position: absolute;
127− top: 5px;
128− right: 0px;
125+ top: 15px;
126+ right: 4px;
129127 padding: 0;
130128 border: 0;
131129 background: url('/static/img/search-icon.png') no-repeat;
@@ -135,14 +133,55 @@ tr:hover td { background: #DDDDDD; }
135133 height: 30px;
136134}
137135
138−#results { margin-left: 10px; margin-top: 10px; }
136+#results { margin: 10px; padding: 0; }
139137
140−#suggestions { max-width: 50em;}
141−#suggestions form { display: inline; }
138+#result_count { font-size: 0.8em; margin: 2px 0 2px 0; padding: 0 }
139+
140+#suggestions { position: absolute; left: 54em; width: 12em; margin: 0 2px 5px 5px; padding: 0 2px 2px 2px; }
141+#suggestions span { display: block; font-size: 0.8em; margin: 0 2px 10px 2px; padding: 0; }
142+#suggestions form { display: block; }
142143#suggestions input { padding: 2px 6px; margin: 2px 4px; font-size: 0.8em; display: inline-block; background: #E4E4E4; border-radius: 4px; border: 0; cursor: pointer; }
143144
144−@media screen and (max-width: 740px) {
145− .right { margin: 5px; }
145+#preferences {
146+ top: 10px;
147+ padding: 0;
148+ border: 0;
149+ background: url('/static/img/preference-icon.png') no-repeat;
150+ background-size: 28px 28px;
151+ opacity: 0.8;
152+ width: 28px;
153+ height: 30px;
154+ display: block;
155+}
156+
157+#preferences * {
158+ display: none;
159+}
160+
161+#apis {
162+ clear: both;
163+}
164+
165+@media screen and (max-width: 60em) {
166+
167+ #suggestions { position: static; max-width: 50em; margin: 0 0 2px 0; padding: 0; float: none; border: none; width: auto }
168+ #suggestions span { display: inline; font-size: 0.8em }
169+ #suggestions form { display: inline; }
170+ #suggestions input { padding: 2px 6px; margin: 2px 4px; font-size: 0.8em; display: inline-block; background: #E4E4E4; border-radius: 4px; border: 0; cursor: pointer; }
171+
172+}
173+
174+@media screen and (max-width: 680px) {
175+
176+ #search_wrapper { width: 90%; clear:both; overflow: hidden }
177+
178+ .right { display: none; postion: fixed !important; top: 100px; right: 0px; }
179+
180+ #categories { font-size: 80% }
181+
182+ #categories .checkbox_container { margin-top: 2px; margin: 0 2px; }
183+
184+ .result { border-top: 1px solid #e8e7e6; margin: 7px 0 6px 0; }
146185
147− #search_wrapper { max-width: 90%; clear:both }
186+ .result img { max-width: 90%; width: auto; height: auto }
148187}
searx/static/img/preference-icon.pngnew file

Binary file not shown.

searx/templates/categories.html+3−1
@@ -1,5 +1,7 @@
1+<div id="categories">
12{% for category in categories %}
23 <div class="checkbox_container">
3− <input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /><label for="checkbox_{{ category|replace(' ', '_') }}" class="cb"></label><label for="checkbox_{{ category|replace(' ', '_') }}">{{ category }}</label>
4+ <input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /></label><label for="checkbox_{{ category|replace(' ', '_') }}">{{ category }}</label>
45 </div>
56{% endfor %}
7+</div>
searx/templates/result_templates/default.html+2−1
@@ -1,4 +1,5 @@
11<div class="result">
22 <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
3− <p class="content">{% if result.content %}{{ result.content|safe }}<br />{% endif %}<span class="url">{{ result.pretty_url }}</span></p>
3+ <p class="content">{% if result.content %}{{ result.content|safe }}<br />{% endif %}</p>
4+ <p class="url">{{ result.pretty_url }}</p>
45</div>
searx/templates/results.html+16−14
@@ -1,15 +1,15 @@
11{% extends "base.html" %}
22{% block title %}{{ q }} - {% endblock %}
33{% block content %}
4−<div class="right"><a href="/preferences">preferences</a></div>
5−<div class="small">
4+<div class="right"><a href="/preferences" id="preferences"><span>preferences</span></a></div>
5+<div class="small search">
66 {% include 'search.html' %}
77</div>
88<div id="results">
99 {% if suggestions %}
10− <div id="suggestions">Suggestions: {% for suggestion in suggestions %}<form method="post" action="/"><input type="hidden" name="q" value="{{suggestion}}"><input type="submit" value="{{ suggestion }}" /></form>{% endfor %}</div>
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>
1111 {% endif %}
12− <div>
12+ <div id ="result_count">
1313 Number of results: {{ number_of_results }}
1414 </div>
1515 {% for result in results %}
@@ -19,19 +19,21 @@
1919 {% include 'result_templates/default.html' %}
2020 {% endif %}
2121 {% endfor %}
22− <form method="post" action="/">
22+ <div id="apis">
23+ <form method="post" action="/">
2324 <div class="left">
24− <input type="hidden" name="q" value="{{ q }}" />
25− <input type="hidden" name="format" value="csv" />
26− <input type="submit" value="download results in csv" />
25+ <input type="hidden" name="q" value="{{ q }}" />
26+ <input type="hidden" name="format" value="csv" />
27+ <input type="submit" value="download results in csv" />
2728 </div>
28− </form>
29− <form method="post" action="/">
29+ </form>
30+ <form method="post" action="/">
3031 <div class="">
31− <input type="hidden" name="q" value="{{ q }}" />
32− <input type="hidden" name="format" value="json" />
33− <input type="submit" value="download results in json" />
32+ <input type="hidden" name="q" value="{{ q }}" />
33+ <input type="hidden" name="format" value="json" />
34+ <input type="submit" value="download results in json" />
3435 </div>
35− </form>
36+ </form>
37+ </div>
3638</div>
3739{% endblock %}
searx/templates/search.html+3−5
@@ -1,9 +1,7 @@
11<form method="post" action="/" id="search_form">
2−<div id="search_wrapper">
2+ <div id="search_wrapper">
33 <input type="text" id="q" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
44 <input type="submit" value="" id="search_submit" />
5−</div>
6− <div>
7− {% include 'categories.html' %}
8− </div>
5+ </div>
6+ {% include 'categories.html' %}
97</form>