=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e;
+},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2);
+});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request();
+this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false;
+this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d;
+}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml);
+}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e);
+}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();
+},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]);
+},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f;
+return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true;
+}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this;
+}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options;
+o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString();
+break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e;
+j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g;
+}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID();
+}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this);
+}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true;
+}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]);
+}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}else{if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this);
+}}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d;
+if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e};
+if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e);
+return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")});
+this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})();
+Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(f){var e=this.options,c=this.response;
+c.html=f.stripScripts(function(h){c.javascript=h;});var d=c.html.match(/]*>([\s\S]*?)<\/body>/i);if(d){c.html=d[1];}var b=new Element("div").set("html",c.html);
+c.tree=b.childNodes;c.elements=b.getElements(e.filter||"*");if(e.filter){c.tree=c.elements;}if(e.update){var g=document.id(e.update).empty();if(e.filter){g.adopt(c.elements);
+}else{g.set("html",c.html);}}else{if(e.append){var a=document.id(e.append);if(e.filter){c.elements.reverse().inject(a);}else{a.adopt(b.getChildren());}}}if(e.evalScripts){Browser.exec(c.javascript);
+}this.onSuccess(c.tree,c.elements,c.html,c.javascript);}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this;
+},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"});this.store("load",a);}return a;
+}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString}));return this;}});if(typeof JSON=="undefined"){this.JSON={};
+}(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4);
+};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");
+return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON();
+}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[];
+Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj;
+case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string);
+}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")");
+};})();Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"});
+},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure();
+}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b;
+this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path;
+}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure";
+}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");
+return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}});
+Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose();
+};(function(i,k){var l,f,e=[],c,b,d=k.createElement("div");var g=function(){clearTimeout(b);if(l){return;}Browser.loaded=l=true;k.removeListener("DOMContentLoaded",g).removeListener("readystatechange",a);
+k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.length;m--;){if(e[m]()){g();return true;}}return false;};var j=function(){clearTimeout(b);
+if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h);
+c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a);
+}else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this);
+}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;
+},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance;
+var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks;
+var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments);
+};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
+params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='";for(var param in params){if(params[param]){build+=' ';}}build+=" ";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild;
+},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement());
+return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+" ");
+return eval(rs);};})();
\ No newline at end of file
diff --git a/searx/static/courgette/js/searx.js b/searx/static/courgette/js/searx.js
new file mode 100644
index 000000000..47dc722da
--- /dev/null
+++ b/searx/static/courgette/js/searx.js
@@ -0,0 +1,45 @@
+if(searx.autocompleter) {
+ window.addEvent('domready', function() {
+ new Autocompleter.Request.JSON('q', '/autocompleter', {
+ postVar:'q',
+ postData:{
+ 'format': 'json'
+ },
+ ajaxOptions:{
+ timeout: 5 // Correct option?
+ },
+ 'minLength': 4,
+ // 'selectMode': 'type-ahead',
+ cache: true,
+ delay: 300
+ });
+ });
+}
+
+(function (w, d) {
+ 'use strict';
+ function addListener(el, type, fn) {
+ if (el.addEventListener) {
+ el.addEventListener(type, fn, false);
+ } else {
+ el.attachEvent('on' + type, fn);
+ }
+ }
+
+ function placeCursorAtEnd() {
+ if (this.setSelectionRange) {
+ var len = this.value.length * 2;
+ this.setSelectionRange(len, len);
+ }
+ }
+
+ addListener(w, 'load', function () {
+ var qinput = d.getElementById('q');
+ if (qinput !== null && qinput.value === "") {
+ addListener(qinput, 'focus', placeCursorAtEnd);
+ qinput.focus();
+ }
+ });
+
+})(window, document);
+
diff --git a/searx/templates/courgette/about.html b/searx/templates/courgette/about.html
new file mode 100644
index 000000000..19aba1905
--- /dev/null
+++ b/searx/templates/courgette/about.html
@@ -0,0 +1,66 @@
+{% extends 'default/base.html' %}
+{% block content %}
+{% include 'default/github_ribbon.html' %}
+
+
+
+
Searx is a metasearch engine , aggregating the results of other search engines while not storing information about its users.
+
+
Why use Searx?
+
+ Searx may not offer you as personalised results as Google, but it doesn't generate a profile about you
+ 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
+ Searx is free software, the code is 100% open and you can help to make it better. See more on github
+
+
If you do care about privacy, want to be a conscious user, or otherwise believe
+ in digital freedom, make Searx your default search engine or run it on your own server
+
+
Technical details - How does it work?
+
+
Searx is a metasearch engine ,
+inspired by the seeks project .
+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, Searx uses the search bar to perform GET requests.
+Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
+
+
+
How can I make it my own?
+
+
Searx appreciates your concern regarding logs, so take the code and run it yourself! Add your Searx to this list to help other people reclaim their privacy and make the Internet freer!
+ The more decentralized the Internet, is the more freedom we have!
+
+
+
More about searx
+
+
+
+
+
+
+
FAQ
+
+
How to add to firefox?
+
Install searx as a search engine on any version of Firefox! (javascript required)
+
+
Developer FAQ
+
+
New engines?
+
+
Don't forget to restart searx after config edit!
+
+
Installation/WSGI support?
+
See the installation and setup wiki page
+
+
How to debug engines?
+
Stats page contains some useful data about the engines used.
+
+
+{% endblock %}
diff --git a/searx/templates/courgette/base.html b/searx/templates/courgette/base.html
new file mode 100644
index 000000000..da5ae905f
--- /dev/null
+++ b/searx/templates/courgette/base.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ {% block title %}{% endblock %}searx
+
+
+ {% block styles %}
+ {% endblock %}
+ {% block head %}
+
+ {% endblock %}
+
+
+
+
+{% block content %}
+{% endblock %}
+{% if autocomplete %}
+
+
+{% endif %}
+
+
+
+
diff --git a/searx/templates/courgette/categories.html b/searx/templates/courgette/categories.html
new file mode 100644
index 000000000..57e63c85d
--- /dev/null
+++ b/searx/templates/courgette/categories.html
@@ -0,0 +1,7 @@
+
+{% for category in categories %}
+
+ {{ _(category) }}
+
+{% endfor %}
+
diff --git a/searx/templates/courgette/github_ribbon.html b/searx/templates/courgette/github_ribbon.html
new file mode 100644
index 000000000..bdd9cf180
--- /dev/null
+++ b/searx/templates/courgette/github_ribbon.html
@@ -0,0 +1,3 @@
+
+
+
diff --git a/searx/templates/courgette/index.html b/searx/templates/courgette/index.html
new file mode 100644
index 000000000..b4f55608b
--- /dev/null
+++ b/searx/templates/courgette/index.html
@@ -0,0 +1,12 @@
+{% extends "default/base.html" %}
+{% block content %}
+{% include 'default/github_ribbon.html' %}
+
+{% endblock %}
diff --git a/searx/templates/courgette/opensearch.xml b/searx/templates/courgette/opensearch.xml
new file mode 100644
index 000000000..f39283f99
--- /dev/null
+++ b/searx/templates/courgette/opensearch.xml
@@ -0,0 +1,27 @@
+
+
+ searx
+ Search searx
+ UTF-8
+ searx metasearch
+ {% if opensearch_method == 'get' %}
+
+ {% if autocomplete %}
+
+
+
+
+ {% endif %}
+ {% else %}
+
+
+
+ {% if autocomplete %}
+
+
+
+
+
+ {% endif %}
+ {% endif %}
+
diff --git a/searx/templates/courgette/opensearch_response_rss.xml b/searx/templates/courgette/opensearch_response_rss.xml
new file mode 100644
index 000000000..5673eb2e1
--- /dev/null
+++ b/searx/templates/courgette/opensearch_response_rss.xml
@@ -0,0 +1,23 @@
+
+
+
+ Searx search: {{ q }}
+ {{ base_url }}?q={{ q }}
+ Search results for "{{ q }}" - searx
+ {{ number_of_results }}
+ 1
+ {{ number_of_results }}
+
+
+ {% for r in results %}
+ -
+
{{ r.title }}
+ {{ r.url }}
+ {{ r.content }}
+ {% if r.pubdate %}{{ r.pubdate }} {% endif %}
+
+ {% endfor %}
+
+
diff --git a/searx/templates/courgette/preferences.html b/searx/templates/courgette/preferences.html
new file mode 100644
index 000000000..7d35de7c3
--- /dev/null
+++ b/searx/templates/courgette/preferences.html
@@ -0,0 +1,101 @@
+{% extends "default/base.html" %}
+{% block head %} {% endblock %}
+{% block content %}
+
+
{{ _('Preferences') }}
+
+
+
+{% endblock %}
diff --git a/searx/templates/courgette/result_templates/default.html b/searx/templates/courgette/result_templates/default.html
new file mode 100644
index 000000000..734f9066c
--- /dev/null
+++ b/searx/templates/courgette/result_templates/default.html
@@ -0,0 +1,13 @@
+
+
+ {% if result['favicon'] %}
+
+ {% endif %}
+
+
+
+ {% if result.publishedDate %}
{{ result.publishedDate }}
{% endif %}
+
{% if result.content %}{{ result.content|safe }} {% endif %}
+
{{ result.pretty_url }}
+
+
diff --git a/searx/templates/courgette/result_templates/images.html b/searx/templates/courgette/result_templates/images.html
new file mode 100644
index 000000000..1f15ff2bb
--- /dev/null
+++ b/searx/templates/courgette/result_templates/images.html
@@ -0,0 +1,6 @@
+
diff --git a/searx/templates/courgette/result_templates/torrent.html b/searx/templates/courgette/result_templates/torrent.html
new file mode 100644
index 000000000..6c62793a5
--- /dev/null
+++ b/searx/templates/courgette/result_templates/torrent.html
@@ -0,0 +1,7 @@
+
+
+ {% if result.content %}
{{ result.content|safe }}
{% endif %}
+
Seed: {{ result.seed }}, Leech: {{ result.leech }}
+
magnet link
+
{{ result.pretty_url }}
+
diff --git a/searx/templates/courgette/result_templates/videos.html b/searx/templates/courgette/result_templates/videos.html
new file mode 100644
index 000000000..8ceb0b180
--- /dev/null
+++ b/searx/templates/courgette/result_templates/videos.html
@@ -0,0 +1,12 @@
+
+ {% if result['favicon'] %}
+
+ {% endif %}
+
+
+
+ {% if result.publishedDate %}
{{ result.publishedDate }}
{% endif %}
+
+
{{ result.url }}
+
+
diff --git a/searx/templates/courgette/results.html b/searx/templates/courgette/results.html
new file mode 100644
index 000000000..d0b53b48a
--- /dev/null
+++ b/searx/templates/courgette/results.html
@@ -0,0 +1,79 @@
+{% extends "default/base.html" %}
+{% block title %}{{ q }} - {% endblock %}
+{% block content %}
+
+
+ {% include 'default/search.html' %}
+
+
+
+
+ {% if suggestions %}
+
{{ _('Suggestions') }}
+ {% for suggestion in suggestions %}
+
+ {% endfor %}
+
+ {% endif %}
+
+ {% for result in results %}
+ {% if result['template'] %}
+ {% include 'default/result_templates/'+result['template'] %}
+ {% else %}
+ {% include 'default/result_templates/default.html' %}
+ {% endif %}
+ {% endfor %}
+
+ {% if paging %}
+
+ {% endif %}
+
+{% endblock %}
diff --git a/searx/templates/courgette/search.html b/searx/templates/courgette/search.html
new file mode 100644
index 000000000..8a9965582
--- /dev/null
+++ b/searx/templates/courgette/search.html
@@ -0,0 +1,7 @@
+
diff --git a/searx/templates/courgette/stats.html b/searx/templates/courgette/stats.html
new file mode 100644
index 000000000..70fe98ac7
--- /dev/null
+++ b/searx/templates/courgette/stats.html
@@ -0,0 +1,22 @@
+{% extends "default/base.html" %}
+{% block head %} {% endblock %}
+{% block content %}
+{{ _('Engine stats') }}
+
+{% for stat_name,stat_category in stats %}
+
+
+
+ {{ stat_name }}
+
+ {% for engine in stat_category %}
+
+ {{ engine.name }}
+ {{ '%.02f'|format(engine.avg) }}
+
+
+ {% endfor %}
+
+
+{% endfor %}
+{% endblock %}