Compare commits

..

No commits in common. "704c9c0cbf4735aa354c4b1d42b3afbaf7dd98a1" and "0f3c940c3f63782516db5de221498239fe0cdc95" have entirely different histories.

5 changed files with 12 additions and 19 deletions

View File

@ -78,6 +78,6 @@
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}" /> <link rel="stylesheet" href="{{ "css/style.css" | relURL }}" />
<link rel="shortcut icon" href="{{ "images/favicon.ico" | relURL }}" type="image/x-icon" /> <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/jquery-3.7.1.min.js"></script>
<script src="/js/href_handling.js.js"></script> <script src="/js/layout.js"></script>
<script src="/js/door-status.js"></script> <script src="/js/door-status.js"></script>
<script src="/js/calendar.js"></script> <script src="/js/calendar.js"></script>

View File

@ -41,6 +41,7 @@ xmlHttp.onreadystatechange = function() {
li.attr('title',item.description) li.attr('title',item.description)
li.appendTo(box) li.appendTo(box)
console.log(item)
} }
$(".location",box).click(function(){ $(".location",box).click(function(){
navigator.clipboard.writeText($(this).attr('data-loc')) navigator.clipboard.writeText($(this).attr('data-loc'))

View File

@ -4,6 +4,7 @@ document.addEventListener("DOMContentLoaded", function() {
fetch("https://spaceapi.c3re.de/").then(function(response) { fetch("https://spaceapi.c3re.de/").then(function(response) {
return( response.json()); return( response.json());
}).then(function(data) { }).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-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"; document.getElementById("ds-status").innerHTML=data.state.open?"Geöffnet":"Geschlossen";

View File

@ -1,18 +0,0 @@
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

@ -0,0 +1,9 @@
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");
})
});