Compare commits
3 Commits
0f3c940c3f
...
704c9c0cbf
Author | SHA1 | Date |
---|---|---|
Dirk Heilig | 704c9c0cbf | |
Dirk Heilig | d522878755 | |
Dirk Heilig | 38d31ec345 |
|
@ -78,6 +78,6 @@
|
|||
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}" />
|
||||
<link rel="shortcut icon" href="{{ "images/favicon.ico" | relURL }}" type="image/x-icon" />
|
||||
<script src="/js/jquery-3.7.1.min.js"></script>
|
||||
<script src="/js/layout.js"></script>
|
||||
<script src="/js/href_handling.js.js"></script>
|
||||
<script src="/js/door-status.js"></script>
|
||||
<script src="/js/calendar.js"></script>
|
|
@ -41,7 +41,6 @@ xmlHttp.onreadystatechange = function() {
|
|||
|
||||
li.attr('title',item.description)
|
||||
li.appendTo(box)
|
||||
console.log(item)
|
||||
}
|
||||
$(".location",box).click(function(){
|
||||
navigator.clipboard.writeText($(this).attr('data-loc'))
|
||||
|
|
|
@ -4,7 +4,6 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||
fetch("https://spaceapi.c3re.de/").then(function(response) {
|
||||
return( response.json());
|
||||
}).then(function(data) {
|
||||
console.log(data)
|
||||
document.getElementById("ds-img").setAttribute("src",data.state.open?data.state.icon.open:data.state.icon.closed);
|
||||
document.getElementById("ds-status").innerHTML=data.state.open?"Geöffnet":"Geschlossen";
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.querySelectorAll('a').forEach(function(element) {
|
||||
const myhost = window.location.hostname;
|
||||
const linkhost=new URL(element.href).hostname;
|
||||
if(myhost === linkhost) {
|
||||
let prefetchUrl=new URL(element.href).toString()
|
||||
// lest make a prefetch tag for this url
|
||||
let link = document.createElement('link');
|
||||
link.setAttribute('rel', 'prefetch');
|
||||
link.setAttribute('href', prefetchUrl);
|
||||
link.setAttribute('as', 'document');
|
||||
document.head.appendChild(link);
|
||||
}else {
|
||||
element.setAttribute("target", "_blank");
|
||||
}
|
||||
})
|
||||
});
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.querySelectorAll('a[href^="http"]').forEach(function(element) {
|
||||
const myhost = window.location.hostname;
|
||||
const linkhost=new URL(element.href).hostname;
|
||||
if(myhost === linkhost) return;
|
||||
element.setAttribute("target","_blank");
|
||||
})
|
||||
});
|
Loading…
Reference in New Issue