SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
Merge branch 'master' of https://github.com/asciimoo/searx into code_results
Thomas Pointhuber400b54191c59
diff --cc searx/static/themes/default/less/code.lessindex a688dd98d,000000000..a688dd98dmode 100644,000000..100644--- a/searx/static/themes/default/less/code.less+++ b/searx/static/themes/default/less/code.lessdiff --cc searx/static/themes/oscar/js/searx.min.jsindex 000000000,d0640f110..2015c4d6amode 000000,100644..100644--- a/searx/static/themes/oscar/js/searx.min.js+++ b/searx/static/themes/oscar/js/searx.min.js@@@ -1,0 -1,2 +1,2 @@@-/*! oscar/searx.min.js | 05-01-2015 | https://github.com/asciimoo/searx */++/*! oscar/searx.min.js | 09-01-2015 | https://github.com/asciimoo/searx */+ requirejs.config({baseUrl:"./static/themes/oscar/js",paths:{app:"../app"}}),searx.autocompleter&&(searx.searchResults=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("value"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:"/autocompleter?q=%QUERY"}),searx.searchResults.initialize()),$(document).ready(function(){searx.autocompleter&&$("#q").typeahead(null,{name:"search-results",displayKey:function(a){return a},source:searx.searchResults.ttAdapter()})}),$(document).ready(function(){$("#q.autofocus").focus(),$(".select-all-on-click").click(function(){$(this).select()}),$(".btn-collapse").click(function(){var a=$(this).data("btn-text-collapsed"),b=$(this).data("btn-text-not-collapsed");""!==a&&""!==b&&(new_html=$(this).hasClass("collapsed")?$(this).html().replace(a,b):$(this).html().replace(b,a),$(this).html(new_html))}),$(".btn-toggle .btn").click(function(){var a="btn-"+$(this).data("btn-class"),b=$(this).data("btn-label-default"),c=$(this).data("btn-label-toggled");""!==c&&(new_html=$(this).hasClass("btn-default")?$(this).html().replace(b,c):$(this).html().replace(c,b),$(this).html(new_html)),$(this).toggleClass(a),$(this).toggleClass("btn-default")}),$(".media-loader").click(function(){var a=$(this).data("target"),b=$(a+" > iframe"),c=b.attr("src");(void 0===c||c===!1)&&b.attr("src",b.data("src"))}),$(".btn-sm").dblclick(function(){var a="btn-"+$(this).data("btn-class");$(this).hasClass("btn-default")?($(".btn-sm > input").attr("checked","checked"),$(".btn-sm > input").prop("checked",!0),$(".btn-sm").addClass(a),$(".btn-sm").addClass("active"),$(".btn-sm").removeClass("btn-default")):($(".btn-sm > input").attr("checked",""),$(".btn-sm > input").removeAttr("checked"),$(".btn-sm > input").checked=!1,$(".btn-sm").removeClass(a),$(".btn-sm").removeClass("active"),$(".btn-sm").addClass("btn-default"))})}),$(document).ready(function(){$(".searx_overpass_request").on("click",function(a){var b="https://overpass-api.de/api/interpreter?data=",c=b+"[out:json][timeout:25];(",d=");out meta;",e=$(this).data("osm-id"),f=$(this).data("osm-type"),g=$(this).data("result-table"),h="#"+$(this).data("result-table-loadicon"),i=["addr:city","addr:country","addr:housenumber","addr:postcode","addr:street"];if(e&&f&&g){g="#"+g;var j=null;switch(f){case"node":j=c+"node("+e+");"+d;break;case"way":j=c+"way("+e+");"+d;break;case"relation":j=c+"relation("+e+");"+d}if(j){$.ajax(j).done(function(a){if(a&&a.elements&&a.elements[0]){var b=a.elements[0],c=$(g).html();for(var d in b.tags)if(null===b.tags.name||-1==i.indexOf(d)){switch(c+="<tr><td>"+d+"</td><td>",d){case"phone":case"fax":c+='<a href="tel:'+b.tags[d].replace(/ /g,"")+'">'+b.tags[d]+"</a>";break;case"email":c+='<a href="mailto:'+b.tags[d]+'">'+b.tags[d]+"</a>";break;case"website":case"url":c+='<a href="'+b.tags[d]+'">'+b.tags[d]+"</a>";break;case"wikidata":c+='<a href="https://www.wikidata.org/wiki/'+b.tags[d]+'">'+b.tags[d]+"</a>";break;case"wikipedia":if(-1!=b.tags[d].indexOf(":")){c+='<a href="https://'+b.tags[d].substring(0,b.tags[d].indexOf(":"))+".wikipedia.org/wiki/"+b.tags[d].substring(b.tags[d].indexOf(":")+1)+'">'+b.tags[d]+"</a>";break}default:c+=b.tags[d]}c+="</td></tr>"}$(g).html(c),$(g).removeClass("hidden"),$(h).addClass("hidden")}}).fail(function(){$(h).html($(h).html()+'<p class="text-muted">could not load data!</p>')})}}$(this).off(a)}),$(".searx_init_map").on("click",function(a){var b=$(this).data("leaflet-target"),c=$(this).data("map-lon"),d=$(this).data("map-lat"),e=$(this).data("map-zoom"),f=$(this).data("map-boundingbox"),g=$(this).data("map-geojson");require(["leaflet-0.7.3.min"],function(){f&&(southWest=L.latLng(f[0],f[2]),northEast=L.latLng(f[1],f[3]),map_bounds=L.latLngBounds(southWest,northEast)),L.Icon.Default.imagePath="./static/themes/oscar/img/map";{var a=L.map(b),h="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",i='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors',j=new L.TileLayer(h,{minZoom:1,maxZoom:19,attribution:i}),k="http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg",l='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors | Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',m=new L.TileLayer(k,{minZoom:1,maxZoom:18,subdomains:"1234",attribution:l}),n="http://otile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg",o='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors | Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png"> | Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency';new L.TileLayer(n,{minZoom:1,maxZoom:11,subdomains:"1234",attribution:o})}map_bounds?setTimeout(function(){a.fitBounds(map_bounds,{maxZoom:17})},0):c&&d&&(e?a.setView(new L.LatLng(d,c),e):a.setView(new L.LatLng(d,c),8)),a.addLayer(m);var p={"OSM Mapnik":j,MapQuest:m};L.control.layers(p).addTo(a),g&&L.geoJson(g).addTo(a)}),$(this).off(a)})});diff --cc searx/static/themes/oscar/less/oscar/code.lessindex 90a2cd60c,000000000..90a2cd60cmode 100644,000000..100644--- a/searx/static/themes/oscar/less/oscar/code.less+++ b/searx/static/themes/oscar/less/oscar/code.lessdiff --cc searx/templates/oscar/macros.htmlindex 1dc696341,f61de2015..df604707d--- a/searx/templates/oscar/macros.html+++ b/searx/templates/oscar/macros.html@@@ -2,27 -1,3 +2,27 @@@{% macro icon(action) -%}<span class="glyphicon glyphicon-{{ action }}"></span>{%- endmacro %}++<!-- Draw favicon -->+<!-- TODO: using url_for methode -->+{% macro draw_favicon(favicon) -%}- <img width="32" height="32" class="favicon" src="static/oscar/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />++ <img width="32" height="32" class="favicon" src="static/themes/oscar/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />+{%- endmacro %}++<!-- Draw result header -->- {% macro result_header(result) -%}- <h4 class="result_header">{% if result.favicon %}{{ draw_favicon(result.favicon) }} {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>++{% macro result_header(result, favicons) -%}++ <h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>+{%- endmacro %}++<!-- Draw result sub header -->+{% macro result_sub_header(result) -%}+ {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}+ <small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>+{%- endmacro %}++<!-- Draw result footer -->+{% macro result_footer(result) -%}+ <div class="clearfix"></div>+ <span class="label label-default pull-right">{{ result.engine }}</span>+ <p class="text-muted">{{ result.pretty_url }}</p>+{%- endmacro %}diff --cc searx/templates/oscar/result_templates/code.htmlindex 236834d0a,000000000..e608bb04fmode 100644,000000..100644--- a/searx/templates/oscar/result_templates/code.html+++ b/searx/templates/oscar/result_templates/code.html@@@ -1,12 -1,0 +1,12 @@@+{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %}+- {{ result_header(result) }}++{{ result_header(result, favicons) }}+{{ result_sub_header(result) }}++{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}++{% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository|safe }}">{{ result.repository }}</a></p>{% endif %}++{{ result.codelines|code_highlighter(result.code_language)|safe }}++{{ result_footer(result) }}diff --cc searx/templates/oscar/result_templates/default.htmlindex bc967f01e,25506b2f5..0bba4cec3--- a/searx/templates/oscar/result_templates/default.html+++ b/searx/templates/oscar/result_templates/default.html@@@ -1,8 -1,25 +1,20 @@@- {% from 'oscar/macros.html' import result_header, result_sub_header, result_footer %}-{% from 'oscar/macros.html' import icon %}++{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %}- {{ result_header(result) }}-<h4 class="result_header">{% if result.engine~".png" in favicons %}<img width="32" height="32" class="favicon" src="{{ url_for('static', filename='img/icons/'+result.engine+'.png') }}" alt="{{ result.engine }}" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>--{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}-<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>++{{ result_header(result, favicons) }}+{{ result_sub_header(result) }}+ {% if result.embedded %}+ <small> • <a class="text-info btn-collapse collapsed cursor-pointer media-loader" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music') }} {{ _('show media') }}</a></small>+ {% endif %}++ {% if result.embedded %}+ <div id="result-media-{{ index }}" class="collapse">+ {% autoescape false %}+ {{ result.embedded }}+ {% endautoescape %}+ </div>+ {% endif %}+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}-<div class="clearfix"></div>--<span class="label label-default pull-right">{{ result.engine }}</span>-<p class="text-muted">{{ result.pretty_url }}</p>+{{ result_footer(result) }}diff --cc searx/templates/oscar/result_templates/images.htmlindex 69c2e6fff,94627c9b5..7ad4e2435--- a/searx/templates/oscar/result_templates/images.html+++ b/searx/templates/oscar/result_templates/images.html@@@ -9,7 -7,7 +9,7 @@@<div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>- <h4 class="modal-title">{% if result['favicon'] %}{{ draw_favicon(result['favicon']) }} {% endif %}{{ result.title|striptags }}</h4>- <h4 class="modal-title">{% if result.engine~".png" in favicons %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result.engine }}.png" alt="{{ result.engine }}" /> {% endif %}{{ result.title|striptags }}</h4>++ <h4 class="modal-title">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result.title|striptags }}</h4></div><div class="modal-body"><img class="img-responsive center-block" src="{{ result.img_src }}" alt="{{ result.title }}">diff --cc searx/templates/oscar/result_templates/map.htmlindex 6dfee52ba,c08e2e72b..3552d84f8--- a/searx/templates/oscar/result_templates/map.html+++ b/searx/templates/oscar/result_templates/map.html@@@ -1,7 -1,10 +1,7 @@@-{% from 'oscar/macros.html' import icon %}+{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %}- {{ result_header(result) }}-<h4 class="result_header">{% if result.engine~".png" in favicons %}<img width="32" height="32" class="favicon" src="{{ url_for('static', filename='img/icons/'+result.engine+'.png') }}" alt="{{ result.engine }}" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>--{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}--<small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>++{{ result_header(result, favicons) }}+{{ result_sub_header(result) }}{% if (result.latitude and result.longitude) or result.boundingbox %}<small> • <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></small>diff --cc searx/templates/oscar/result_templates/torrent.htmlindex da745c7ab,bfb6cdbe6..9fec91f01--- a/searx/templates/oscar/result_templates/torrent.html+++ b/searx/templates/oscar/result_templates/torrent.html@@@ -1,7 -1,9 +1,7 @@@-{% from 'oscar/macros.html' import icon %}+{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %}- {{ result_header(result) }}-<h4 class="result_header">{% if result.engine~".png" in favicons %}<img width="32" height="32" class="favicon" src="{{ url_for('static', filename='img/icons/'+result.engine+'.png') }}" alt="{{ result.engine }}" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>--{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}-<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>++{{ result_header(result, favicons) }}+{{ result_sub_header(result) }}<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span>, {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span><br/>diff --cc searx/templates/oscar/result_templates/videos.htmlindex 83d065e4c,32000e662..709c7563f--- a/searx/templates/oscar/result_templates/videos.html+++ b/searx/templates/oscar/result_templates/videos.html@@@ -1,11 -1,25 +1,23 @@@- {% from 'oscar/macros.html' import result_header, result_sub_header, result_footer %}-{% from 'oscar/macros.html' import icon %}++{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %}- {{ result_header(result) }}-<h4 class="result_header">{% if result.engine~".png" in favicons %}<img width="32" height="32" class="favicon" src="{{ url_for('static', filename='img/icons/'+result.engine+'.png') }}" alt="{{ result.engine }}" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>--{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}-<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>++{{ result_header(result, favicons) }}+{{ result_sub_header(result) }}+ {% if result.embedded %}+ <small> • <a class="text-info btn-collapse collapsed cursor-pointer media-loader" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film') }} {{ _('show video') }}</a></small>+ {% endif %}++ {% if result.embedded %}+ <div id="result-video-{{ index }}" class="collapse">+ {% autoescape false %}+ {{ result.embedded }}+ {% endautoescape %}+ </div>+ {% endif %}+<div class="container-fluid"><div class="row">- <img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ result.thumbnail|safe }}" alt="{{ result.title|urlencode }} {{ result['favicon'] }}" />+ <a href="{{ result.url }}"><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ result.thumbnail|safe }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a>{% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}</div></div>