Browse Source

Merge pull request #246 from Cqoicebordel/pix-arts

New theme !
Adam Tauber 10 years ago
parent
commit
952473d297

+ 1
- 0
Makefile View File

@@ -51,6 +51,7 @@ styles:
51 51
 	@lessc -x searx/static/themes/courgette/less/style-rtl.less > searx/static/themes/courgette/css/style-rtl.css
52 52
 	@lessc -x searx/static/less/bootstrap/bootstrap.less > searx/static/css/bootstrap.min.css
53 53
 	@lessc -x searx/static/themes/oscar/less/oscar/oscar.less > searx/static/themes/oscar/css/oscar.min.css
54
+	@lessc -x searx/static/themes/pix-art/less/style.less > searx/static/themes/pix-art/css/style.css
54 55
 
55 56
 grunt:
56 57
 	@grunt --gruntfile searx/static/themes/oscar/gruntfile.js

+ 1
- 0
searx/static/themes/pix-art/css/style.css
File diff suppressed because it is too large
View File


BIN
searx/static/themes/pix-art/img/favicon.png View File


BIN
searx/static/themes/pix-art/img/preference-icon-pixel.png View File


BIN
searx/static/themes/pix-art/img/search-icon-pixel.png View File


BIN
searx/static/themes/pix-art/img/searx-pixel-small.png View File


BIN
searx/static/themes/pix-art/img/searx-pixel.png View File


+ 141
- 0
searx/static/themes/pix-art/js/searx.js View File

@@ -0,0 +1,141 @@
1
+if(searx.autocompleter) {
2
+    window.addEvent('domready', function() {
3
+	    new Autocompleter.Request.JSON('q', '/autocompleter', {
4
+		    postVar:'q',
5
+		    postData:{
6
+			    'format': 'json'
7
+		    },
8
+		    ajaxOptions:{
9
+		        timeout: 5   // Correct option?
10
+		    },
11
+		    'minLength': 4,
12
+		    'selectMode': false,
13
+		    cache: true,
14
+		    delay: 300
15
+	    });
16
+    });
17
+}
18
+
19
+(function (w, d) {
20
+    'use strict';
21
+    function addListener(el, type, fn) {
22
+        if (el.addEventListener) {
23
+            el.addEventListener(type, fn, false);
24
+        } else {
25
+            el.attachEvent('on' + type, fn);
26
+        }
27
+    }
28
+
29
+    function placeCursorAtEnd() {
30
+        if (this.setSelectionRange) {
31
+            var len = this.value.length * 2;
32
+            this.setSelectionRange(len, len);
33
+        }
34
+    }
35
+
36
+    addListener(w, 'load', function () {
37
+        var qinput = d.getElementById('q');
38
+        if (qinput !== null && qinput.value === "") {
39
+            addListener(qinput, 'focus', placeCursorAtEnd);
40
+            qinput.focus();
41
+        }
42
+    });
43
+
44
+    if (!!('ontouchstart' in window)) {
45
+        document.getElementsByTagName("html")[0].className += " touch";
46
+    }
47
+
48
+})(window, document);
49
+
50
+var xmlHttp
51
+
52
+function GetXmlHttpObject(){
53
+
54
+    var xmlHttp = null;
55
+
56
+    try {
57
+        // Firefox, Opera 8.0+, Safari
58
+        xmlHttp = new XMLHttpRequest();
59
+    }
60
+    catch (e) {
61
+        // Internet Explorer
62
+        try {
63
+            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
64
+        }
65
+        catch (e){
66
+            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
67
+        }
68
+    }
69
+    return xmlHttp;
70
+}
71
+
72
+var timer;
73
+
74
+// Load more results
75
+function load_more(query,page){
76
+
77
+    xmlHttp = GetXmlHttpObject();
78
+    clearTimeout(timer);
79
+
80
+    if(xmlHttp == null){
81
+        alert ("Your browser does not support AJAX!");
82
+        return;
83
+    }
84
+
85
+    favicons[page] = [];
86
+
87
+    xmlHttp.onreadystatechange = function(){
88
+        
89
+        var loader = document.getElementById('load_more');
90
+
91
+        // If 4, response OK
92
+        if (xmlHttp.readyState == 4){
93
+            
94
+            var res = xmlHttp.responseText;
95
+
96
+            clearTimeout(timer);
97
+            timer = setTimeout(function(){},6000);
98
+
99
+            var results = document.getElementById('results_list');
100
+
101
+            var newNode = document.createElement('span');      
102
+            newNode.innerHTML = res;
103
+            results_list.appendChild(newNode);
104
+
105
+            var scripts = newNode.getElementsByTagName('script');
106
+            for (var ix = 0; ix < scripts.length; ix++) {
107
+                eval(scripts[ix].text);
108
+            }
109
+
110
+            load_images(page);
111
+            document.getElementById("load_more").onclick = function() { load_more(query, (page+1)); }
112
+            loader.removeAttribute("disabled");
113
+            
114
+        } else {
115
+            loader.disabled = 'disabled';
116
+        }
117
+    }
118
+    var url = "/";
119
+    var params = "q="+query+"&pageno="+page+"&category_general=1&category_files=1&category_images=1&category_it=1&category_map=1&category_music=1&category_news=1&category_social+media=1&category_videos=1";
120
+    xmlHttp.open("POST",url,true);
121
+    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
122
+    xmlHttp.setRequestHeader("Content-length", params.length);
123
+    xmlHttp.setRequestHeader("Connection", "close");
124
+    xmlHttp.send(params);
125
+}
126
+
127
+// Load the images on the canvas in the page
128
+function load_images(page){
129
+    var arrayLength = favicons[page].length;
130
+    for (var i = 1; i < arrayLength+1; i++) {
131
+        var img = new Image();
132
+        img.setAttribute("i",i)
133
+        img.onload = function () {
134
+            var id = 'canvas-'+page+'-'+this.getAttribute("i");
135
+            var can = document.getElementById(id);
136
+            var ctx = can.getContext("2d");
137
+            ctx.drawImage(this, 0, 0, 16, 16);
138
+        };
139
+        img.src = favicons[page][i];
140
+    }
141
+}

+ 119
- 0
searx/static/themes/pix-art/less/definitions.less View File

@@ -0,0 +1,119 @@
1
+/*
2
+ * searx, A privacy-respecting, hackable metasearch engine
3
+ *
4
+ * To change the colors of the site, simple edit this variables
5
+ */
6
+
7
+/// Basic Colors
8
+
9
+@color-base: #3498DB;
10
+@color-base-dark: #2980B9;
11
+@color-base-light: #ECF0F1;
12
+@color-highlight: #094089;
13
+@color-black: #000000;
14
+
15
+/// General
16
+
17
+@color-font: #444;
18
+@color-font-light: #888;
19
+
20
+@color-red: #C0392B;
21
+
22
+@color-url-font: #1a11be;
23
+@color-url-visited-font: #8E44AD;
24
+@results-width: 50em;
25
+
26
+
27
+/// Start-Screen
28
+
29
+// hmarg
30
+@color-hmarg-border: @color-base;
31
+@color-hmarg-font: @color-base;
32
+@color-hmarg-font-hover: @color-base;
33
+
34
+
35
+/// Search-Input
36
+
37
+@color-search-border: @color-base;
38
+@color-search-background: #FFF;
39
+@color-search-font: #222;
40
+
41
+/// Autocompleter
42
+
43
+@color-autocompleter-choices-background: #FFF;
44
+@color-autocompleter-choices-border: @color-base;
45
+@color-autocompleter-choices-border-left-right: @color-base;
46
+@color-autocompleter-choices-border-bottom: @color-base;
47
+
48
+@color-autocompleter-choices-font: #444;
49
+
50
+/// Answers
51
+@color-answers-border: @color-base-dark;
52
+
53
+// Selected
54
+@color-autocompleter-selected-background: #444;
55
+@color-autocompleter-selected-font: #FFF;
56
+@color-autocompleter-selected-queried-font: #9FCFFF;
57
+
58
+/// Categories
59
+
60
+@color-categories-item-selected: @color-base;
61
+@color-categories-item-selected-font: #FFF;
62
+
63
+@color-categories-item-border-selected: @color-base-dark;
64
+@color-categories-item-border-unselected: #E8E7E6;
65
+@color-categories-item-border-unselected-hover: @color-base;
66
+
67
+
68
+/// Results
69
+
70
+@color-suggestions-button-background: @color-base;
71
+@color-suggestions-button-font: #FFF;
72
+
73
+@color-download-button-background: @color-base;
74
+@color-download-button-font: #FFF;
75
+
76
+@color-result-search-background: @color-base-light;
77
+
78
+@color-result-definition-border: gray;
79
+@color-result-torrent-border: lightgray;
80
+@color-result-top-border: #E8E7E6;
81
+
82
+// Link to result
83
+@color-result-link-font: @color-base-dark;
84
+@color-result-link-visited-font: @color-url-visited-font;
85
+
86
+// Url to result
87
+@color-result-url-font: @color-red;
88
+
89
+// Publish Date
90
+@color-result-publishdate-font: @color-font-light;
91
+
92
+// Images
93
+@color-result-image-span-background-hover: rgba(0, 0, 0, 0.6);
94
+@color-result-image-span-font: #FFF;
95
+
96
+// Search-URL
97
+@color-result-search-url-border: #888;
98
+@color-result-search-url-font: #444;
99
+
100
+
101
+/// Settings
102
+
103
+@color-settings-fieldset: @color-base;
104
+@color-settings-tr-hover: #DDD;
105
+
106
+// Labels
107
+@color-settings-label-allowed-background: #E74C3C;
108
+@color-settings-label-allowed-font: #FFF;
109
+
110
+@color-settings-label-deny-background: #2ECC71;
111
+@color-settings-label-deny-font: @color-font;
112
+
113
+@color-settings-return-background: @color-base;
114
+@color-settings-return-font: #FFF;
115
+
116
+/// Other
117
+
118
+@color-engines-font: @color-font-light;
119
+@color-percentage-div-background: #444;

+ 27
- 0
searx/static/themes/pix-art/less/mixins.less View File

@@ -0,0 +1,27 @@
1
+/*
2
+ * searx, A privacy-respecting, hackable metasearch engine
3
+ */
4
+
5
+// Mixins
6
+
7
+.text-size-adjust (@property: 100%) {  	
8
+	-webkit-text-size-adjust: @property;
9
+	-ms-text-size-adjust: @property;
10
+	-moz-text-size-adjust: @property;
11
+	text-size-adjust: @property;
12
+}
13
+
14
+.rounded-corners (@radius: 4px) {	
15
+	-webkit-border-radius: @radius;
16
+	-moz-border-radius: @radius;
17
+	border-radius: @radius;
18
+}
19
+
20
+.user-select () {
21
+	-webkit-touch-callout: none;
22
+	-webkit-user-select: none;
23
+	-khtml-user-select: none;
24
+	-moz-user-select: none;
25
+	-ms-user-select: none;
26
+	user-select: none;
27
+}

+ 57
- 0
searx/static/themes/pix-art/less/search.less View File

@@ -0,0 +1,57 @@
1
+/*
2
+ * searx, A privacy-respecting, hackable metasearch engine
3
+ */
4
+
5
+.search  {
6
+	padding: 0;
7
+	margin: 0;
8
+}
9
+
10
+#search_wrapper {
11
+	position: relative;
12
+	width: @results-width;
13
+	padding: 10px;
14
+}
15
+
16
+.center #search_wrapper {
17
+	margin-left: auto;
18
+	margin-right: auto;
19
+}
20
+
21
+.q {
22
+	background: none repeat scroll 0 0 @color-search-background;
23
+	border: 1px solid @color-search-border;
24
+	color: @color-search-font;
25
+	font-size: 16px;
26
+	font-family: "Courier New", Courier, monospace;
27
+	height: 28px;
28
+	margin: 0;
29
+	outline: medium none;
30
+	padding: 2px;
31
+	padding-left: 8px;
32
+	padding-right: 0px !important;
33
+	width: 100%;
34
+	z-index: 2;
35
+}
36
+
37
+#search_submit {
38
+	position: absolute;
39
+	top: 15px;
40
+	right: 5px;
41
+	padding: 0;
42
+	border: 0;
43
+	background: url('../img/search-icon-pixel.png') no-repeat;
44
+	background-size: 24px 24px;
45
+	opacity: 0.8;
46
+	width: 24px;
47
+	height: 24px;
48
+	font-size: 0;
49
+}
50
+
51
+@media screen and (max-width: @results-width) {
52
+	#search_wrapper {
53
+		width: 90%;
54
+		clear:both;
55
+		overflow: hidden
56
+	}
57
+}

+ 451
- 0
searx/static/themes/pix-art/less/style.less View File

@@ -0,0 +1,451 @@
1
+/*
2
+ * searx, A privacy-respecting, hackable metasearch engine
3
+ *
4
+ * To convert "style.less" to "style.css" run: $make styles
5
+ */
6
+
7
+@import "definitions.less";
8
+
9
+@import "mixins.less";
10
+
11
+
12
+// Main LESS-Code
13
+
14
+html {
15
+	font-family: "Courier New", Courier, monospace;
16
+	font-size: 0.9em;
17
+	.text-size-adjust;
18
+	color: @color-font;
19
+	padding: 0;
20
+	margin: 0;
21
+}
22
+
23
+body, #container {
24
+	padding: 0;
25
+	margin: 0;
26
+}
27
+
28
+canvas {
29
+    image-rendering: optimizeSpeed;
30
+    image-rendering: -moz-crisp-edges;
31
+    image-rendering: -webkit-optimize-contrast;
32
+    image-rendering: optimize-contrast;
33
+    image-rendering: pixelated;
34
+    -ms-interpolation-mode: nearest-neighbor;
35
+    width:32px;
36
+    height:32px;
37
+}
38
+
39
+#container {
40
+    width: 100%;
41
+    position: absolute;
42
+    top: 0;
43
+}
44
+
45
+// Search-Field
46
+
47
+@import "search.less";
48
+
49
+.row {
50
+	max-width: 800px;
51
+	margin: 20px auto;
52
+	text-align: justify;
53
+
54
+	h1 { 
55
+		font-size: 3em;
56
+		margin-top: 50px; 
57
+	}
58
+
59
+	p { 
60
+		padding: 0 10px;
61
+		max-width: 700px;
62
+	}
63
+
64
+	h3,ul { 
65
+		margin: 4px 8px;
66
+	}
67
+}
68
+
69
+.hmarg {
70
+    margin: 0 20px;
71
+    border: 1px solid @color-hmarg-border;
72
+    padding: 4px 10px;
73
+}
74
+
75
+a {
76
+	&:link.hmarg { 
77
+		color: @color-hmarg-font; 
78
+	}
79
+
80
+	&:visited.hmarg {
81
+		color: @color-hmarg-font;
82
+	}
83
+
84
+	&:active.hmarg { 
85
+		color: @color-hmarg-font-hover; 
86
+	}
87
+
88
+	&:hover.hmarg { 
89
+		color: @color-hmarg-font-hover; 
90
+	}
91
+}
92
+
93
+.top_margin { 
94
+	margin-top: 60px; 
95
+}
96
+
97
+.center {
98
+	text-align: center;
99
+}
100
+
101
+h1 {
102
+	font-size: 5em;
103
+}
104
+
105
+div.title {
106
+	background: url('../img/searx-pixel.png') no-repeat;
107
+	width: 100%;
108
+    min-height: 80px;
109
+	background-position: center;
110
+
111
+	h1 {
112
+		visibility: hidden;
113
+	}
114
+}
115
+
116
+input[type="button"], 
117
+input[type="submit"] {
118
+	font-family: "Courier New", Courier, monospace;
119
+	padding: 4px 12px;
120
+	margin: 2px 4px;
121
+	display: inline-block;
122
+	background: @color-download-button-background;
123
+	color: @color-download-button-font;
124
+	.rounded-corners;
125
+	border: 0;
126
+	cursor: pointer;
127
+}
128
+
129
+input[type="button"]:disabled {
130
+	cursor: progress;
131
+}
132
+
133
+input[type="checkbox"] {
134
+	visibility: hidden;
135
+}
136
+
137
+fieldset {
138
+	margin: 8px;
139
+	border: 1px solid @color-settings-fieldset;
140
+}
141
+
142
+#logo {
143
+	position: absolute;
144
+	top: 13px;
145
+	left: 10px;
146
+}
147
+
148
+#categories {
149
+	margin: 0 10px;
150
+	.user-select;
151
+}
152
+
153
+.checkbox_container {
154
+	display: inline-block;
155
+	position: relative;
156
+	margin: 0 3px;
157
+	padding: 0px;
158
+
159
+	input {
160
+		display: none;
161
+	}
162
+}
163
+
164
+.checkbox_container label, .engine_checkbox label {
165
+	cursor: pointer;
166
+	padding: 4px 10px;
167
+	margin: 0;
168
+	display: block;
169
+	text-transform: capitalize;
170
+	.user-select;
171
+}
172
+
173
+.checkbox_container input[type="checkbox"]:checked + label {
174
+	background: @color-categories-item-selected;
175
+	color: @color-categories-item-selected-font;
176
+}
177
+
178
+.engine_checkbox {
179
+	padding: 4px;
180
+}
181
+
182
+label {
183
+	&.allow {
184
+		background: @color-settings-label-allowed-background;
185
+		padding: 4px 8px; 
186
+		color: @color-settings-label-allowed-font;
187
+		display: none;
188
+	}
189
+
190
+	&.deny {
191
+		background: @color-settings-label-deny-background;
192
+		padding: 4px 8px; 
193
+		color: @color-settings-label-deny-font;
194
+		display: inline;
195
+	}
196
+}
197
+
198
+.engine_checkbox input[type="checkbox"]:checked + label {
199
+	&:nth-child(2) + label {
200
+		display: none;
201
+	}
202
+
203
+	&.allow {
204
+		display: inline;
205
+	}
206
+}
207
+
208
+a {
209
+	text-decoration: none;
210
+	color: @color-url-font;
211
+
212
+	&:visited {
213
+		color: @color-url-visited-font;
214
+	}
215
+}
216
+
217
+.engines {
218
+	color: @color-engines-font;
219
+}
220
+
221
+.small_font {
222
+	font-size: 0.8em;
223
+}
224
+
225
+.small p {
226
+	margin: 2px 0;
227
+}
228
+
229
+.right {
230
+	float: right;
231
+}
232
+
233
+.invisible {
234
+	display: none;
235
+}
236
+
237
+.left {
238
+	float: left;
239
+}
240
+
241
+.highlight {
242
+    color: @color-highlight;
243
+}
244
+
245
+.content .highlight {
246
+    color: @color-black;
247
+}
248
+
249
+.percentage {
250
+	position: relative;
251
+	width: 300px;
252
+
253
+	div {
254
+		background: @color-percentage-div-background;
255
+	}
256
+}
257
+
258
+table {
259
+	width: 100%;
260
+}
261
+
262
+td {
263
+	padding: 0 4px;
264
+}
265
+
266
+tr {
267
+	&:hover {
268
+		background: @color-settings-tr-hover;
269
+	}
270
+}
271
+
272
+#results {
273
+	margin: auto;
274
+	padding: 0;
275
+	width: @results-width;
276
+	margin-bottom: 20px;
277
+}
278
+
279
+#search_url {
280
+	margin-top: 8px;
281
+
282
+	input {
283
+		border: 1px solid @color-result-search-url-border;
284
+		padding: 4px;
285
+		color: @color-result-search-url-font;
286
+		width: 14em;
287
+		display: block;
288
+		margin: 4px;
289
+        font-size: 0.8em;
290
+	}
291
+} 
292
+
293
+#preferences {
294
+	top: 10px;
295
+	padding: 0;
296
+	border: 0;
297
+	background: url('../img/preference-icon-pixel.png') no-repeat;
298
+	background-size: 28px 28px;
299
+	opacity: 0.8;
300
+	width: 28px;
301
+	height: 30px;
302
+	display: block;
303
+
304
+	* {
305
+		display: none;
306
+	}
307
+}
308
+
309
+#pagination {
310
+	clear: both;
311
+	text-align: center;
312
+        br {
313
+        	clear: both;
314
+        }
315
+}
316
+
317
+#apis {
318
+	margin-top: 8px;
319
+	clear: both;
320
+}
321
+
322
+#categories_container {
323
+    position: relative;
324
+}
325
+
326
+@media screen and (max-width: @results-width) {
327
+
328
+	#results {
329
+	        margin: auto;
330
+	        padding: 0;
331
+	        width: 90%;
332
+	}
333
+
334
+	.checkbox_container {
335
+		display: block;
336
+        width: 90%;
337
+		//float: left;
338
+
339
+		label {
340
+			border-bottom: 0;
341
+		}
342
+	}
343
+
344
+	.preferences_container {
345
+		display: none;
346
+		postion: fixed !important;
347
+		top: 100px;
348
+		right: 0px;
349
+	}
350
+
351
+}
352
+
353
+@media screen and (max-width: 75em) {
354
+
355
+        div.title {
356
+
357
+        	h1 {
358
+                font-size: 1em;
359
+        	}
360
+        }
361
+
362
+        html.touch #categories {
363
+                width: 95%;
364
+                height: 30px;
365
+                text-align: left;
366
+                overflow-x: scroll;
367
+                overflow-y: hidden;
368
+                -webkit-overflow-scrolling: touch;
369
+                
370
+                #categories_container {
371
+                        width: 1000px;
372
+                        width: -moz-max-content;
373
+                        width: -webkit-max-content;
374
+                        width: max-content;
375
+
376
+                        .checkbox_container {
377
+                                display: inline-block;
378
+                                width: auto;
379
+                        }
380
+                }
381
+        }
382
+
383
+	#categories {
384
+        font-size: 90%;
385
+        clear: both;
386
+
387
+        .checkbox_container {
388
+                margin-top: 2px;
389
+                margin: auto;
390
+        }
391
+    }
392
+
393
+	#categories {
394
+		font-size: 90%;
395
+		clear: both;
396
+
397
+		.checkbox_container {
398
+			margin-top: 2px;
399
+			margin: auto; 
400
+		}
401
+	}
402
+
403
+	#apis {
404
+		display: none;
405
+	}
406
+
407
+	#search_url {
408
+		display: none;
409
+	}
410
+
411
+	#logo {
412
+		display: none;
413
+	}
414
+}
415
+
416
+.favicon {
417
+	float: left;
418
+	margin-right: 4px;
419
+	margin-top: 2px;
420
+}
421
+
422
+.preferences_back {
423
+	background: none repeat scroll 0 0 @color-settings-return-background;
424
+    border: 0 none;
425
+    .rounded-corners;
426
+    cursor: pointer;
427
+    display: inline-block;
428
+    margin: 2px 4px;
429
+    padding: 4px 6px;
430
+
431
+	a {
432
+		color: @color-settings-return-font;
433
+	}
434
+}
435
+
436
+.hidden {
437
+    opacity: 0;
438
+    overflow: hidden;
439
+    font-size: 0.8em;
440
+    position: absolute;
441
+    bottom: -20px;
442
+    width: 100%;
443
+    text-position: center;
444
+    background: white;
445
+    transition: opacity 1s ease;
446
+}
447
+
448
+#categories_container:hover .hidden {
449
+    transition: opacity 1s ease;
450
+    opacity: 0.8;
451
+}

+ 65
- 0
searx/templates/pix-art/about.html View File

@@ -0,0 +1,65 @@
1
+{% extends 'pix-art/base.html' %}
2
+{% block content %}
3
+<div class="row"{% if rtl %} dir="ltr"{% endif %}>
4
+    <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
5
+
6
+    <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
7
+    </p>
8
+    <h2>Why use Searx?</h2>
9
+    <ul>
10
+        <li>Searx may not offer you as personalised results as Google, but it doesn't generate a profile about you</li>
11
+        <li>Searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you</li>
12
+        <li>Searx is free software, the code is 100% open and you can help to make it better. See more on <a href="https://github.com/asciimoo/searx">github</a></li>
13
+    </ul>
14
+    <p>If you do care about privacy, want to be a conscious user, or otherwise believe
15
+    in digital freedom, make Searx your default search engine or run it on your own server</p>
16
+
17
+<h2>Technical details - How does it work?</h2>
18
+
19
+<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
20
+inspired by the <a href="http://seeks-project.info/">seeks project</a>.<br />
21
+It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, if Searx used from the search bar it performs GET requests.<br />
22
+Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
23
+</p>
24
+
25
+<h2>How can I make it my own?</h2>
26
+
27
+<p>Searx appreciates your concern regarding logs, so take the <a href="https://github.com/asciimoo/searx">code</a> and run it yourself! <br />Add your Searx to this <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">list</a> to help other people reclaim their privacy and make the Internet freer!
28
+<br />The more decentralized Internet is the more freedom we have!</p>
29
+
30
+
31
+<h2>More about searx</h2>
32
+
33
+<ul>
34
+    <li><a href="https://github.com/asciimoo/searx">github</a></li>
35
+    <li><a href="https://www.ohloh.net/p/searx/">ohloh</a></li>
36
+    <li><a href="https://twitter.com/Searx_engine">twitter</a></li>
37
+    <li>IRC: #searx @ freenode (<a href="https://kiwiirc.com/client/irc.freenode.com/searx">webclient</a>)</li>
38
+    <li><a href="https://www.transifex.com/projects/p/searx/">transifex</a></li>
39
+</ul>
40
+
41
+
42
+<hr />
43
+
44
+<h2 id="faq">FAQ</h2>
45
+
46
+<h3>How to add to firefox?</h3>
47
+<p><a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a> searx as a search engine on any version of Firefox! (javascript required)</p>
48
+
49
+<h2 id="dev_faq">Developer FAQ</h2>
50
+
51
+<h3>New engines?</h3>
52
+<ul>
53
+    <li>Edit your <a href="https://raw.github.com/asciimoo/searx/master/searx/settings.yml">settings.yml</a></li>
54
+    <li>Create your custom engine module, check the <a href="https://github.com/asciimoo/searx/blob/master/examples/basic_engine.py">example engine</a></li>
55
+</ul>
56
+<p>Don't forget to restart searx after config edit!</p>
57
+
58
+<h3>Installation/WSGI support?</h3>
59
+<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p>
60
+
61
+<h3>How to debug engines?</h3>
62
+<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p>
63
+
64
+</div>
65
+{% endblock %}

+ 34
- 0
searx/templates/pix-art/base.html View File

@@ -0,0 +1,34 @@
1
+<!DOCTYPE html>
2
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}>
3
+    <head>
4
+        <meta charset="UTF-8" />
5
+        <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
6
+        <meta name="keywords" content="searx, search, search engine, metasearch, meta search" />
7
+        <meta name="generator" content="searx/{{ searx_version }}">
8
+        <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
9
+        <title>{% block title %}{% endblock %}searx</title>
10
+        <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />
11
+        <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" />
12
+        {% block styles %}
13
+        {% endblock %}
14
+        {% block meta %}{% endblock %}
15
+        {% block head %}
16
+        {% endblock %}
17
+        <script type="text/javascript">
18
+        var favicons = [[]];
19
+        </script>
20
+    </head>
21
+    <body>
22
+        <div id="container">
23
+            {% block content %}
24
+            {% endblock %}
25
+            <script type="text/javascript">
26
+                    searx = {};
27
+            </script>
28
+            <script src="{{ url_for('static', filename='js/searx.js') }}" ></script>
29
+            <script type="text/javascript">
30
+            load_images(1);
31
+            </script>
32
+        </div>
33
+    </body>
34
+</html>

+ 12
- 0
searx/templates/pix-art/index.html View File

@@ -0,0 +1,12 @@
1
+{% extends "pix-art/base.html" %}
2
+{% block content %}
3
+<div class="center">
4
+    <div class="title"><h1><img src="{{ url_for('static', filename='img/searx-pixel.png') }}" alt="Searx Logo"/></h1></div>
5
+    {% include 'pix-art/search.html' %}
6
+    <p class="top_margin">
7
+        <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a>
8
+        <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
9
+    </p>
10
+</div>
11
+{% endblock %}
12
+

+ 82
- 0
searx/templates/pix-art/preferences.html View File

@@ -0,0 +1,82 @@
1
+{% extends "default/base.html" %}
2
+{% block head %} {% endblock %}
3
+{% block content %}
4
+<div class="row">
5
+    <h2>{{ _('Preferences') }}</h2>
6
+
7
+    <form method="post" action="{{ url_for('preferences') }}" id="search_form">
8
+    <fieldset>
9
+        <legend>{{ _('Search language') }}</legend>
10
+        <p>
11
+        <select name='language'>
12
+            <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option>
13
+            {% for lang_id,lang_name,country_name in language_codes | sort(attribute=1) %}
14
+            <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option>
15
+            {% endfor %}
16
+        </select>
17
+        </p>
18
+    </fieldset>
19
+    <fieldset>
20
+        <legend>{{ _('Interface language') }}</legend>
21
+        <p>
22
+        <select name='locale'>
23
+            {% for locale_id,locale_name in locales.items() | sort %}
24
+            <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
25
+            {% endfor %}
26
+        </select>
27
+        </p>
28
+    </fieldset>
29
+    <fieldset>
30
+        <legend>{{ _('Method') }}</legend>
31
+        <p>
32
+        <select name='method'>
33
+            <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
34
+            <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
35
+        </select>
36
+        </p>
37
+    </fieldset>
38
+    <fieldset>
39
+        <legend>{{ _('Themes') }}</legend>
40
+        <p>
41
+        <select name="theme">
42
+            {% for name in themes %}
43
+            <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
44
+            {% endfor %}
45
+        </select>
46
+        </p>
47
+    </fieldset>
48
+    <fieldset>
49
+    <legend>{{ _('Currently used search engines') }}</legend>
50
+
51
+    <table>
52
+        <tr>
53
+            <th>{{ _('Engine name') }}</th>
54
+            <th>{{ _('Allow') }} / {{ _('Block') }}</th>
55
+        </tr>
56
+    {% for (categ,search_engines) in categs %}
57
+        {% for search_engine in search_engines %}
58
+
59
+            {% if not search_engine.private %}
60
+            <tr>
61
+                <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})&lrm;</td>
62
+                <td class="engine_checkbox">
63
+                    <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in blocked_engines %} checked="checked"{% endif %} />
64
+                    <label class="allow" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label>
65
+                    <label class="deny" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Block') }}</label>
66
+                </td>
67
+            </tr>
68
+            {% endif %}
69
+        {% endfor %}
70
+    {% endfor %}
71
+    </table>
72
+    </fieldset>
73
+    <p class="small_font">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
74
+    <br />
75
+    {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
76
+    </p>
77
+
78
+    <input type="submit" value="{{ _('save') }}" />
79
+    <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div>
80
+    </form>    
81
+</div>
82
+{% endblock %}

+ 6
- 0
searx/templates/pix-art/result_templates/default.html View File

@@ -0,0 +1,6 @@
1
+<a href="{{ result.url }}" title="{{ result.title | striptags }}">
2
+	<canvas id="canvas-{{ pageno }}-{{ index }}" class="icon" width="16" height="16"></canvas>
3
+</a>
4
+<script type="text/javascript">
5
+favicons[{{ pageno }}][{{ index }}] = 'http://{{ result.url | extract_domain }}/favicon.ico';
6
+</script>

+ 6
- 0
searx/templates/pix-art/result_templates/images.html View File

@@ -0,0 +1,6 @@
1
+<div class="image_result">
2
+    <p>
3
+        <a href="{{ result.img_src }}"><img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}" /></a>
4
+        <span class="url"><a href="{{ result.url }}" class="small_font">{{ _('original context') }}</a></span>
5
+    </p>
6
+</div>

+ 32
- 0
searx/templates/pix-art/results.html View File

@@ -0,0 +1,32 @@
1
+{% if pageno > 1 %}
2
+    {% for result in results %}
3
+        {% set index = loop.index %}
4
+        {% include 'pix-art/result_templates/default.html' %}
5
+    {% endfor %}
6
+{% else %}
7
+{% extends "pix-art/base.html" %}
8
+{% block title %}{{ q }} - {% endblock %}
9
+{% block meta %}{% endblock %}
10
+{% block content %}
11
+<div id="logo"><a href="./"><img src="{{ url_for('static', filename='img/searx-pixel-small.png') }}" alt="Searx Logo"/></a></div>
12
+<div class="preferences_container right"><a href="{{ url_for('preferences') }}" id="preferences"><span>preferences</span></a></div>
13
+<div class="small search center">
14
+    {% include 'pix-art/search.html' %}
15
+</div>
16
+<script type="text/javascript">
17
+    favicons[{{ pageno }}] = [];
18
+</script>
19
+<div id="results">
20
+    <span id="results_list">
21
+    {% for result in results %}
22
+        {% set index = loop.index %}
23
+        {% include 'pix-art/result_templates/default.html' %}
24
+    {% endfor %}
25
+    </span>
26
+    <div id="pagination">
27
+        <br />
28
+        <input type="button" onclick="load_more('{{ q }}', {{ pageno+1 }})" id="load_more" value="{{ _('Load more...') }}" />
29
+    </div>
30
+</div>
31
+{% endblock %}
32
+{% endif %}

+ 9
- 0
searx/templates/pix-art/search.html View File

@@ -0,0 +1,9 @@
1
+<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form">
2
+    <div id="search_wrapper">
3
+        <input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" size="100" {% if q %}value="{{ q }}"{% endif %}/>
4
+        <input type="submit" value="" id="search_submit" />
5
+        {% for category in categories %}
6
+        <input type="hidden" name="category_{{ category }}" value="1"/>
7
+        {% endfor %}
8
+    </div>
9
+</form>

+ 22
- 0
searx/templates/pix-art/stats.html View File

@@ -0,0 +1,22 @@
1
+{% extends "default/base.html" %}
2
+{% block head %} {% endblock %}
3
+{% block content %}
4
+<h2>{{ _('Engine stats') }}</h2>
5
+
6
+{% for stat_name,stat_category in stats %}
7
+<div class="left">
8
+    <table>
9
+        <tr colspan="3">
10
+            <th>{{ stat_name }}</th>
11
+        </tr>
12
+        {% for engine in stat_category %}
13
+        <tr>
14
+            <td>{{ engine.name }}</td>
15
+            <td>{{ '%.02f'|format(engine.avg) }}</td>
16
+            <td class="percentage"><div style="width: {{ engine.percentage }}%">&nbsp;</div></td>
17
+        </tr>
18
+        {% endfor %}
19
+    </table>
20
+</div>
21
+{% endfor %}
22
+{% endblock %}

+ 7
- 0
searx/webapp.py View File

@@ -42,6 +42,7 @@ except:
42 42
 
43 43
 from datetime import datetime, timedelta
44 44
 from urllib import urlencode
45
+from urlparse import urlparse
45 46
 from werkzeug.contrib.fixers import ProxyFix
46 47
 from flask import (
47 48
     Flask, request, render_template, url_for, Response, make_response,
@@ -181,6 +182,12 @@ def code_highlighter(codelines, language=None):
181 182
     return html_code
182 183
 
183 184
 
185
+# Extract domain from url
186
+@app.template_filter('extract_domain')
187
+def extract_domain(url):
188
+    return urlparse(url)[1]
189
+
190
+
184 191
 def get_base_url():
185 192
     if settings['server']['base_url']:
186 193
         hostname = settings['server']['base_url']