From f0acc2f838e8cfed805138244fecc4132c626aa1 Mon Sep 17 00:00:00 2001 From: m11 Date: Fri, 19 Feb 2021 21:20:58 +0100 Subject: [PATCH] =?UTF-8?q?Calendar:=20Only=20link=20to=20OSM=20if=20locat?= =?UTF-8?q?ion=20=3D=3D=20Sibillastra=C3=9Fe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/calv2.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/calv2.js b/js/calv2.js index 69727c4..479b175 100644 --- a/js/calv2.js +++ b/js/calv2.js @@ -130,7 +130,7 @@ Event.prototype.toHTML = function () { div_description.setAttribute('class', 'cal_descriptionbox') div_description.appendChild(span_summary) - if (this.location !== false && !/s(ibyllastra(ss|ß)e )9/i.test(this.location)) { + if (this.location !== false) { var span_location = document.createElement('span') span_location.setAttribute('class', 'cal_location') @@ -140,13 +140,14 @@ Event.prototype.toHTML = function () { span_location.appendChild(span_location_icon) - if (this.location.match(/tb(a|d)/i)) { - span_location.appendChild(document.createTextNode(this.location)) - } else { + if (/s(ibyllastra(ss|ß)e )9/i.test(this.location)) { var a_location_osm = document.createElement('a') a_location_osm.setAttribute('href', 'https://www.openstreetmap.org/search?query=' + encodeURI(this.location)) a_location_osm.appendChild(document.createTextNode(this.location)) span_location.appendChild(a_location_osm) + } else { + span_location.appendChild(document.createTextNode(this.location)) + span_location.innerHTML = autolinker.link( span_location.innerHTML ) } div_description.appendChild(span_location) @@ -286,4 +287,4 @@ function requestFailed(status) { document.getElementById('calendar-recurring').textContent = 'Something has gone wrong. Try reloading the page.' } -xhrRequest('https://cloud.chaospott.ru/remote.php/dav/public-calendars/5HM7B0ZOLEYC3QD0?export', processData, requestFailed) +xhrRequest('https://cloud.chaospott.de/remote.php/dav/public-calendars/5HM7B0ZOLEYC3QD0?export', processData, requestFailed)