Compare commits

...

3 Commits

Author SHA1 Message Date
Dirk Heilig 704c9c0cbf Flutizität erhöhen (link prefetch= 2024-01-09 13:05:30 +01:00
Dirk Heilig d522878755 remove debug outout 2024-01-09 13:03:33 +01:00
Dirk Heilig 38d31ec345 remove debug outout 2024-01-09 13:03:14 +01:00
5 changed files with 19 additions and 12 deletions

View File

@ -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>

View File

@ -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'))

View File

@ -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";

View File

@ -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");
}
})
});

View File

@ -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");
})
});