Calendar: Only link to OSM if location == Sibillastraße
This commit is contained in:
parent
99acaa6503
commit
f0acc2f838
11
js/calv2.js
11
js/calv2.js
@ -130,7 +130,7 @@ Event.prototype.toHTML = function () {
|
|||||||
div_description.setAttribute('class', 'cal_descriptionbox')
|
div_description.setAttribute('class', 'cal_descriptionbox')
|
||||||
div_description.appendChild(span_summary)
|
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')
|
var span_location = document.createElement('span')
|
||||||
span_location.setAttribute('class', 'cal_location')
|
span_location.setAttribute('class', 'cal_location')
|
||||||
|
|
||||||
@ -140,13 +140,14 @@ Event.prototype.toHTML = function () {
|
|||||||
|
|
||||||
span_location.appendChild(span_location_icon)
|
span_location.appendChild(span_location_icon)
|
||||||
|
|
||||||
if (this.location.match(/tb(a|d)/i)) {
|
if (/s(ibyllastra(ss|ß)e )9/i.test(this.location)) {
|
||||||
span_location.appendChild(document.createTextNode(this.location))
|
|
||||||
} else {
|
|
||||||
var a_location_osm = document.createElement('a')
|
var a_location_osm = document.createElement('a')
|
||||||
a_location_osm.setAttribute('href', 'https://www.openstreetmap.org/search?query=' + encodeURI(this.location))
|
a_location_osm.setAttribute('href', 'https://www.openstreetmap.org/search?query=' + encodeURI(this.location))
|
||||||
a_location_osm.appendChild(document.createTextNode(this.location))
|
a_location_osm.appendChild(document.createTextNode(this.location))
|
||||||
span_location.appendChild(a_location_osm)
|
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)
|
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.'
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user