From a89b823f8d273711469cc63622f329598c067a7b Mon Sep 17 00:00:00 2001
From: Alexandre Flament "+searx.translations.could_not_load+" "+searx.translations.could_not_load+" ";
- }
- }
- $(result_table).html(newHtml);
- $(result_table).removeClass('hidden');
- $(result_table_loadicon).addClass('hidden');
- }
- })
- .fail(function() {
- $(result_table_loadicon).html($(result_table_loadicon).html() + "" + row + " ";
- switch(row) {
- case "phone":
- case "fax":
- newHtml += "" + element.tags[row] + "";
- break;
- case "email":
- newHtml += "" + element.tags[row] + "";
- break;
- case "website":
- case "url":
- newHtml += "" + element.tags[row] + "";
- break;
- case "wikidata":
- newHtml += "" + element.tags[row] + "";
- break;
- case "wikipedia":
- if(element.tags[row].indexOf(":") != -1) {
- newHtml += "" + element.tags[row] + "";
- break;
- }
- /* jshint ignore:start */
- default:
- /* jshint ignore:end */
- newHtml += element.tags[row];
- break;
- }
- newHtml += " ";
- }
- }
- $(result_table).html(newHtml);
- $(result_table).removeClass('hidden');
- $(result_table_loadicon).addClass('hidden');
- }
- })
- .fail(function() {
- $(result_table_loadicon).html($(result_table_loadicon).html() + "" + row + " ";
- switch(row) {
- case "phone":
- case "fax":
- newHtml += "" + element.tags[row] + "";
- break;
- case "email":
- newHtml += "" + element.tags[row] + "";
- break;
- case "website":
- case "url":
- newHtml += "" + element.tags[row] + "";
- break;
- case "wikidata":
- newHtml += "" + element.tags[row] + "";
- break;
- case "wikipedia":
- if(element.tags[row].indexOf(":") != -1) {
- newHtml += "" + element.tags[row] + "";
- break;
- }
- /* jshint ignore:start */
- default:
- /* jshint ignore:end */
- newHtml += element.tags[row];
- break;
- }
- newHtml += " ";
- }
- }
- result_table_loadicon.parentNode.removeChild(result_table_loadicon);
- result_table.classList.remove('invisible');
- result_table.querySelector("tbody").innerHTML = newHtml;
- }
- })
- .catch(function() {
- result_table_loadicon.classList.remove('invisible');
- result_table_loadicon.innerHTML = could_not_load;
- });
- }
- }
-
- // this event occour only once per element
- event.preventDefault();
- });
-
searx.on('.searx_init_map', 'click', function(event) {
// no more request
this.classList.remove("searx_init_map");
diff --git a/searx/static/themes/simple/js/searx_src/searx_mapresult.js b/searx/static/themes/simple/js/searx_src/searx_mapresult.js
index 267ac94cb..2ccdbd1c7 100644
--- a/searx/static/themes/simple/js/searx_src/searx_mapresult.js
+++ b/searx/static/themes/simple/js/searx_src/searx_mapresult.js
@@ -19,93 +19,6 @@
'use strict';
searx.ready(function () {
- searx.on('.searx_overpass_request', 'click', function(event) {
- // no more request
- this.classList.remove("searx_overpass_request");
-
- //
- 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.dataset.osmId;
- var osm_type = this.dataset.osmType;
- var result_table = d.querySelector("#" + this.dataset.resultTable);
- var result_table_loadicon = d.querySelector("#" + this.dataset.resultTableLoadicon);
-
- // 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) {
- 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) {
- // console.log(query);
- searx.http( 'GET', query ).then(function(html, contentType) {
- html = JSON.parse(html);
- if(html && html.elements && html.elements[0]) {
- var element = html.elements[0];
- var newHtml = "";
- for (var row in element.tags) {
- if(element.tags.name === null || osm_ignore_tags.indexOf(row) == -1) {
- newHtml += "" + row + " ";
- switch(row) {
- case "phone":
- case "fax":
- newHtml += "" + element.tags[row] + "";
- break;
- case "email":
- newHtml += "" + element.tags[row] + "";
- break;
- case "website":
- case "url":
- newHtml += "" + element.tags[row] + "";
- break;
- case "wikidata":
- newHtml += "" + element.tags[row] + "";
- break;
- case "wikipedia":
- if(element.tags[row].indexOf(":") != -1) {
- newHtml += "" + element.tags[row] + "";
- break;
- }
- /* jshint ignore:start */
- default:
- /* jshint ignore:end */
- newHtml += element.tags[row];
- break;
- }
- newHtml += " ";
- }
- }
- result_table_loadicon.parentNode.removeChild(result_table_loadicon);
- result_table.classList.remove('invisible');
- result_table.querySelector("tbody").innerHTML = newHtml;
- }
- })
- .catch(function() {
- result_table_loadicon.classList.remove('invisible');
- result_table_loadicon.innerHTML = could_not_load;
- });
- }
- }
-
- // this event occour only once per element
- event.preventDefault();
- });
-
searx.on('.searx_init_map', 'click', function(event) {
// no more request
this.classList.remove("searx_init_map");
diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html
index 9713452b3..011ccc0bd 100644
--- a/searx/templates/oscar/result_templates/map.html
+++ b/searx/templates/oscar/result_templates/map.html
@@ -7,10 +7,6 @@
• {{ icon('globe') }} {{ _('show map') }}
{%- endif -%}
-{%- if result.osm and (result.osm.type and result.osm.id) -%}
- • {{ icon('map-marker') }} {{ _('show details') }}
-{%- endif -%}
-
{# {% if (result.latitude and result.longitude) %}
• {{ icon('map-marker') }} {{ _('show geodata') }}
{% endif %} #}
@@ -39,15 +35,6 @@
" + row + " ";
- switch(row) {
- case "phone":
- case "fax":
- newHtml += "" + element.tags[row] + "";
- break;
- case "email":
- newHtml += "" + element.tags[row] + "";
- break;
- case "website":
- case "url":
- newHtml += "" + element.tags[row] + "";
- break;
- case "wikidata":
- newHtml += "" + element.tags[row] + "";
- break;
- case "wikipedia":
- if(element.tags[row].indexOf(":") != -1) {
- newHtml += "" + element.tags[row] + "";
- break;
- }
- /* jshint ignore:start */
- default:
- /* jshint ignore:end */
- newHtml += element.tags[row];
- break;
- }
- newHtml += "