Commit 65f7430f authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

Update eelo theme with js change from searx 1.0.0

parent 392cd19d
This diff is collapsed.
......@@ -2,27 +2,15 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: ['js/searx_src/*.js'],
dest: 'js/searx.js'
}
},
uglify: {
options: {
banner: '/*! eelo/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
},
dist: {
files: {
'js/searx.min.js': ['<%= concat.dist.dest %>']
'js/eelo.min.js': ['js/eelo.js']
}
}
},
jshint: {
files: ['gruntfile.js', 'js/searx_src/*.js'],
files: ['gruntfile.js', 'js/eelo.js'],
options: {
reporterOutput: "",
// options here to override JSHint defaults
......@@ -64,7 +52,7 @@ module.exports = function(grunt) {
watch: {
scripts: {
files: ['<%= jshint.files %>'],
tasks: ['jshint', 'concat', 'uglify']
tasks: ['jshint', 'uglify']
},
eelo_styles: {
files: ['less/eelo/**/*.less'],
......@@ -85,7 +73,7 @@ module.exports = function(grunt) {
grunt.registerTask('test', ['jshint']);
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less']);
grunt.registerTask('default', ['jshint', 'uglify', 'less']);
grunt.registerTask('styles', ['less']);
......
function build_video(a){var b,c="";for(b=0;b<a.length;b++)c+=" <div class='result result-videos'> <div class='result-content'> <a class='thumbnail' href='"+a[b].url+"' rel='noreferrer'> <img src='"+a[b].thumbnail+"' alt=\""+a[b].title+"\"> </a> <div> <h4 class='result_header'> <a href='"+a[b].url+"' rel='noreferrer'>"+a[b].title+"</a> </h4> </div> </div> </div>";return c}function build_image(a){var b,c="";for(b=0;b<a.length;b++)void 0!==a[b].thumbnail_src&&(c+=" <div class='result result-images'> <a href="+a[b].img_src+"' data-url='"+a[b].url+"' class='img-thumb-link'> <img src='"+a[b].thumbnail_src+"' alt=\""+a[b].title+'" title="'+a[b].title+"\" class='img-thumbnail'> </a> </div>");return c}$(document).ready(function(){function a(a,b){document.getElementById("image_view_image").src=b,document.getElementById("image_view_file_link").href=a.href,document.getElementById("image_view_url_link").href=a.dataset.url}if($("#results").on("click",".result.result-images",function(b){b.preventDefault();var c=b.target,d=c.src;"IMG"==c.tagName&&(c=c.parentElement);var e=document.getElementById("image_view_modal");e.classList.remove("hidden"),e.style.top=window.scrollY+"px",a(c,d),document.body.classList.add("lock")}),$("#close_image_view_modal").click(function(){document.getElementById("image_view_modal").classList.add("hidden"),document.getElementById("image_view_image").src="",document.getElementById("image_view_file_link").href="#",document.getElementById("image_view_url_link").href="#",document.body.classList.remove("lock")}),$("#results").has(".first-page-media-results").length){var b={headers:{"Content-Type":"application/json"}},c=$.param({format:"json",q:$("#q").attr("value"),language:$("select[name='language']").find("option:selected").attr("value"),time_range:$("select[name='time_range']").find("option:selected").attr("value")});fetch(window.location.origin+"/search?categories=images&"+c,{headers:b}).then(function(a){return a.json()}).then(function(a){a.results&&$("#default_images_container").append(build_image(a.results.slice(0,5)))}),fetch(window.location.origin+"/search?categories=videos&"+c,{headers:b}).then(function(a){return a.json()}).then(function(a){a.results&&$(".videos-gallery").append(build_video(a.results.slice(0,2)))})}});
\ No newline at end of file
../../oscar/js/jquery.min.js
\ No newline at end of file
This diff is collapsed.
/**
* searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >.
*
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/
requirejs.config({
baseUrl: './static/themes/oscar/js',
paths: {
app: '../app'
}
});
;/**
* searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >.
*
* (C) 2019 by Alexandre Flament
*/
window.searx = (function(d) {
'use strict';
// add data- properties
var script = d.currentScript || (function() {
var scripts = d.getElementsByTagName('script');
return scripts[scripts.length - 1];
})();
return {
autocompleter: script.getAttribute('data-autocompleter') === 'true',
method: script.getAttribute('data-method')
};
})(document);
;/**
* searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >.
*
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/
if(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(){
if(searx.autocompleter) {
$('#q').typeahead(null, {
name: 'search-results',
displayKey: function(result) {
return result;
},
source: searx.searchResults.ttAdapter()
});
}
});
;/*jshint multistr: true */
function build_video(videos) {
var i;
var res = "";
for (i = 0; i < videos.length; i++) {
res += "\
<div class='result result-videos'>\
<div class='result-content'>\
<a class='thumbnail' href='" + videos[i].url + "' rel='noreferrer'>\
<img src='" + videos[i].thumbnail + "' alt=\"" + videos[i].title + "\">\
</a>\
<div>\
<h4 class='result_header'>\
<a href='" + videos[i].url +"' rel='noreferrer'>" + videos[i].title + "</a>\
</h4>\
</div>\
</div>\
</div>";
}
return res;
}
function build_image(images) {
var i;
var res = "";
for (i = 0; i < images.length; i++) {
if (images[i].thumbnail_src === undefined) {
continue;
}
res += "\
<div class='result result-images'>\
<a href=" + images[i].img_src + "' data-url='" + images[i].url + "' class='img-thumb-link'>\
<img src='" + images[i].thumbnail_src + "' alt=\"" + images[i].title + "\" title=\"" + images[i].title + "\" class='img-thumbnail'>\
</a>\
</div>";
}
return res;
}
$(document).ready(function(){
function configure_image_view(target, view_url) {
document.getElementById("image_view_image").src = view_url;
document.getElementById("image_view_file_link").href = target.href;
document.getElementById("image_view_url_link").href = target.dataset.url;
}
$("#results").on("click", ".result.result-images", function (event) {
event.preventDefault();
var target = event.target;
var view_url = target.src;
if (target.tagName == "IMG") {
target = target.parentElement;
}
var modal = document.getElementById("image_view_modal");
modal.classList.remove("hidden");
modal.style.top = window.scrollY + "px";
configure_image_view(target, view_url);
document.body.classList.add("lock");
});
$("#close_image_view_modal").click(function () {
document.getElementById("image_view_modal").classList.add("hidden");
document.getElementById("image_view_image").src = "";
document.getElementById("image_view_file_link").href = "#";
document.getElementById("image_view_url_link").href = "#";
document.body.classList.remove("lock");
});
if ($("#results").has(".first-page-media-results").length) {
var headers = {"headers": { "Content-Type": "application/json"}};
var query_params = $.param({
"format": "json",
"q": $("#q").attr("value"),
"language": $("select[name='language']").find('option:selected').attr("value"),
"time_range": $("select[name='time_range']").find('option:selected').attr("value")
});
fetch(window.location.origin + "/search?categories=images&" + query_params, {"headers": headers})
.then(function(r) { return r.json(); })
.then(function(data) {
if (data.results) {
$("#default_images_container").append(build_image(data.results.slice(0, 5)));
}
});
fetch(window.location.origin + "/search?categories=videos&" + query_params, {"headers": headers})
.then(function(r) { return r.json(); })
.then(function(data) {
if (data.results) {
$(".videos-gallery").append(build_video(data.results.slice(0, 2)));
}
});
}
});
;/**
* searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >.
*
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/
$(document).ready(function(){
/**
* focus element if class="autofocus" and id="q"
*/
$('#q.autofocus').focus();
/**
* select full content on click if class="select-all-on-click"
*/
$(".select-all-on-click").click(function () {
$(this).select();
});
/**
* change text during btn-collapse click if possible
*/
$('.btn-collapse').click(function() {
var btnTextCollapsed = $(this).data('btn-text-collapsed');
var btnTextNotCollapsed = $(this).data('btn-text-not-collapsed');
if(btnTextCollapsed !== '' && btnTextNotCollapsed !== '') {
if($(this).hasClass('collapsed')) {
new_html = $(this).html().replace(btnTextCollapsed, btnTextNotCollapsed);
} else {
new_html = $(this).html().replace(btnTextNotCollapsed, btnTextCollapsed);
}
$(this).html(new_html);
}
});
/**
* change text during btn-toggle click if possible
*/
$('.btn-toggle .btn').click(function() {
var btnClass = 'btn-' + $(this).data('btn-class');
var btnLabelDefault = $(this).data('btn-label-default');
var btnLabelToggled = $(this).data('btn-label-toggled');
if(btnLabelToggled !== '') {
if($(this).hasClass('btn-default')) {
new_html = $(this).html().replace(btnLabelDefault, btnLabelToggled);
} else {
new_html = $(this).html().replace(btnLabelToggled, btnLabelDefault);
}
$(this).html(new_html);
}
$(this).toggleClass(btnClass);
$(this).toggleClass('btn-default');
});
/**
* change text during btn-toggle click if possible
*/
$('.media-loader').click(function() {
var target = $(this).data('target');
var iframe_load = $(target + ' > iframe');
var srctest = iframe_load.attr('src');
if(srctest === undefined || srctest === false){
iframe_load.attr('src', iframe_load.data('src'));
}
});
/**
* Select or deselect every categories on double clic
*/
$(".btn-sm").dblclick(function() {
var btnClass = 'btn-' + $(this).data('btn-class'); // primary
if($(this).hasClass('btn-default')) {
$(".btn-sm > input").attr('checked', 'checked');
$(".btn-sm > input").prop("checked", true);
$(".btn-sm").addClass(btnClass);
$(".btn-sm").addClass('active');
$(".btn-sm").removeClass('btn-default');
} else {
$(".btn-sm > input").attr('checked', '');
$(".btn-sm > input").removeAttr('checked');
$(".btn-sm > input").checked = false;
$(".btn-sm").removeClass(btnClass);
$(".btn-sm").removeClass('active');
$(".btn-sm").addClass('btn-default');
}
});
});
;/**
* searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >.
*
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/
$(document).ready(function(){
$(".searx_overpass_request").on( "click", function( event ) {
var overpass_url = "https://overpass-api.de/api/interpreter?data=";
var query_start = overpass_url + "[out:json][timeout:25];(";
var query_end = ");out meta;";
var osm_id = $(this).data('osm-id');
var osm_type = $(this).data('osm-type');
var result_table = $(this).data('result-table');
var result_table_loadicon = "#" + $(this).data('result-table-loadicon');
// tags which can be ignored
var osm_ignore_tags = [ "addr:city", "addr:country", "addr:housenumber", "addr:postcode", "addr:street" ];
if(osm_id && osm_type && result_table) {
result_table = "#" + result_table;
var query = null;
switch(osm_type) {
case 'node':
query = query_start + "node(" + osm_id + ");" + query_end;
break;
case 'way':
query = query_start + "way(" + osm_id + ");" + query_end;
break;
case 'relation':
query = query_start + "relation(" + osm_id + ");" + query_end;
break;
default:
break;
}
if(query) {
//alert(query);
var ajaxRequest = $.ajax( query )
.done(function( html) {
if(html && html.elements && html.elements[0]) {
var element = html.elements[0];
var newHtml = $(result_table).html();
for (var row in element.tags) {
if(element.tags.name === null || osm_ignore_tags.indexOf(row) == -1) {
newHtml += "<tr><td>" + row + "</td><td>";
switch(row) {
case "phone":
case "fax":
newHtml += "<a href=\"tel:" + element.tags[row].replace(/ /g,'') + "\">" + element.tags[row] + "</a>";
break;
case "email":
newHtml += "<a href=\"mailto:" + element.tags[row] + "\">" + element.tags[row] + "</a>";
break;
case "website":
case "url":
newHtml += "<a href=\"" + element.tags[row] + "\">" + element.tags[row] + "</a>";
break;
case "wikidata":
newHtml += "<a href=\"https://www.wikidata.org/wiki/" + element.tags[row] + "\">" + element.tags[row] + "</a>";
break;
case "wikipedia":
if(element.tags[row].indexOf(":") != -1) {
newHtml += "<a href=\"https://" + element.tags[row].substring(0,element.tags[row].indexOf(":")) + ".wikipedia.org/wiki/" + element.tags[row].substring(element.tags[row].indexOf(":")+1) + "\">" + element.tags[row] + "</a>";
break;
}
/* jshint ignore:start */
default:
/* jshint ignore:end */
newHtml += element.tags[row];
break;
}
newHtml += "</td></tr>";
}
}
$(result_table).html(newHtml);
$(result_table).removeClass('hidden');
$(result_table_loadicon).addClass('hidden');
}
})
.fail(function() {
$(result_table_loadicon).html($(result_table_loadicon).html() + "<p class=\"text-muted\">could not load data!</p>");
});
}
}
// this event occour only once per element
$( this ).off( event );
});
$(".searx_init_map").on( "click", function( event ) {
var leaflet_target = $(this).data('leaflet-target');
var map_lon = $(this).data('map-lon');
var map_lat = $(this).data('map-lat');
var map_zoom = $(this).data('map-zoom');
var map_boundingbox = $(this).data('map-boundingbox');
var map_geojson = $(this).data('map-geojson');
require(['leaflet-0.7.3.min'], function(leaflet) {
if(map_boundingbox) {
southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]);
northEast = L.latLng(map_boundingbox[1], map_boundingbox[3]);
map_bounds = L.latLngBounds(southWest, northEast);
}
// TODO hack
// change default imagePath
L.Icon.Default.imagePath = "./static/themes/oscar/img/map";
// init map
var map = L.map(leaflet_target);
// create the tile layer with correct attribution
var osmMapnikUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmMapnikAttrib='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
var osmMapnik = new L.TileLayer(osmMapnikUrl, {minZoom: 1, maxZoom: 19, attribution: osmMapnikAttrib});
var osmWikimediaUrl='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png';
var osmWikimediaAttrib = 'Wikimedia maps beta | Maps data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
var osmWikimedia = new L.TileLayer(osmWikimediaUrl, {minZoom: 1, maxZoom: 19, attribution: osmWikimediaAttrib});
// init map view
if(map_bounds) {
// TODO hack: https://github.com/Leaflet/Leaflet/issues/2021
setTimeout(function () {
map.fitBounds(map_bounds, {
maxZoom:17
});
}, 0);
} else if (map_lon && map_lat) {
if(map_zoom)
map.setView(new L.LatLng(map_lat, map_lon),map_zoom);
else
map.setView(new L.LatLng(map_lat, map_lon),8);
}
map.addLayer(osmMapnik);
var baseLayers = {
"OSM Mapnik": osmMapnik/*,
"OSM Wikimedia": osmWikimedia*/
};
L.control.layers(baseLayers).addTo(map);
if(map_geojson)
L.geoJson(map_geojson).addTo(map);
/*else if(map_bounds)
L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);*/
});
// this event occour only once per element
$( this ).off( event );
});
});
/*! eelo/searx.min.js | 26-05-2021 | https://github.com/asciimoo/searx */
function build_video(a){var b,c="";for(b=0;b<a.length;b++)c+=" <div class='result result-videos'> <div class='result-content'> <a class='thumbnail' href='"+a[b].url+"' rel='noreferrer'> <img src='"+a[b].thumbnail+"' alt=\""+a[b].title+"\"> </a> <div> <h4 class='result_header'> <a href='"+a[b].url+"' rel='noreferrer'>"+a[b].title+"</a> </h4> </div> </div> </div>";return c}function build_image(a){var b,c="";for(b=0;b<a.length;b++)void 0!==a[b].thumbnail_src&&(c+=" <div class='result result-images'> <a href="+a[b].img_src+"' data-url='"+a[b].url+"' class='img-thumb-link'> <img src='"+a[b].thumbnail_src+"' alt=\""+a[b].title+'" title="'+a[b].title+"\" class='img-thumbnail'> </a> </div>");return c}requirejs.config({baseUrl:"./static/themes/oscar/js",paths:{app:"../app"}}),window.searx=function(a){"use strict";var b=a.currentScript||function(){var b=a.getElementsByTagName("script");return b[b.length-1]}();return{autocompleter:"true"===b.getAttribute("data-autocompleter"),method:b.getAttribute("data-method")}}(document),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(){function a(a,b){document.getElementById("image_view_image").src=b,document.getElementById("image_view_file_link").href=a.href,document.getElementById("image_view_url_link").href=a.dataset.url}if($("#results").on("click",".result.result-images",function(b){b.preventDefault();var c=b.target,d=c.src;"IMG"==c.tagName&&(c=c.parentElement);var e=document.getElementById("image_view_modal");e.classList.remove("hidden"),e.style.top=window.scrollY+"px",a(c,d),document.body.classList.add("lock")}),$("#close_image_view_modal").click(function(){document.getElementById("image_view_modal").classList.add("hidden"),document.getElementById("image_view_image").src="",document.getElementById("image_view_file_link").href="#",document.getElementById("image_view_url_link").href="#",document.body.classList.remove("lock")}),$("#results").has(".first-page-media-results").length){var b={headers:{"Content-Type":"application/json"}},c=$.param({format:"json",q:$("#q").attr("value"),language:$("select[name='language']").find("option:selected").attr("value"),time_range:$("select[name='time_range']").find("option:selected").attr("value")});fetch(window.location.origin+"/search?categories=images&"+c,{headers:b}).then(function(a){return a.json()}).then(function(a){a.results&&$("#default_images_container").append(build_image(a.results.slice(0,5)))}),fetch(window.location.origin+"/search?categories=videos&"+c,{headers:b}).then(function(a){return a.json()}).then(function(a){a.results&&$(".videos-gallery").append(build_video(a.results.slice(0,2)))})}}),$(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&&($(this).hasClass("collapsed")?new_html=$(this).html().replace(a,b):new_html=$(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&&($(this).hasClass("btn-default")?new_html=$(this).html().replace(b,c):new_html=$(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&&!1!==c||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(a){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 h=L.map(b),i="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",j='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors',k=new L.TileLayer(i,{minZoom:1,maxZoom:19,attribution:j}),l="https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png",m='Wikimedia maps beta | Maps data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';new L.TileLayer(l,{minZoom:1,maxZoom:19,attribution:m});map_bounds?setTimeout(function(){h.fitBounds(map_bounds,{maxZoom:17})},0):c&&d&&(e?h.setView(new L.LatLng(d,c),e):h.setView(new L.LatLng(d,c),8)),h.addLayer(k);var n={"OSM Mapnik":k};L.control.layers(n).addTo(h),g&&L.geoJson(g).addTo(h)}),$(this).off(a)})});
\ No newline at end of file
../../oscar/js/searx.min.js
\ No newline at end of file
/**
* searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >.
*
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/