|
|
@ -3,6 +3,9 @@ const contributionsList = document.getElementById("contributions");
|
|
|
|
|
|
|
|
|
|
|
|
const pagedjs = document.createElement("script");
|
|
|
|
const pagedjs = document.createElement("script");
|
|
|
|
pagedjs.src = "https://unpkg.com/pagedjs/dist/paged.polyfill.js";
|
|
|
|
pagedjs.src = "https://unpkg.com/pagedjs/dist/paged.polyfill.js";
|
|
|
|
|
|
|
|
pagedjs.id ="printview"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const printLib = document.getElementById("print");
|
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener("load", () => {
|
|
|
|
window.addEventListener("load", () => {
|
|
|
|
fetchContents();
|
|
|
|
fetchContents();
|
|
|
@ -10,6 +13,8 @@ window.addEventListener("load", () => {
|
|
|
|
//document.getElementsByTagName("head")[0].appendChild(pagedjs);
|
|
|
|
//document.getElementsByTagName("head")[0].appendChild(pagedjs);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printLib.addEventListener("click", () => printViewToggle())
|
|
|
|
|
|
|
|
|
|
|
|
function fetchContents() {
|
|
|
|
function fetchContents() {
|
|
|
|
fetch("https://hub.xpub.nl/soupboat/atlas-api/contributions")
|
|
|
|
fetch("https://hub.xpub.nl/soupboat/atlas-api/contributions")
|
|
|
|
.then((response) => response.json())
|
|
|
|
.then((response) => response.json())
|
|
|
@ -44,3 +49,19 @@ function atlasLink() {
|
|
|
|
group.appendChild(link);
|
|
|
|
group.appendChild(link);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function printViewToggle() {
|
|
|
|
|
|
|
|
var printview = document.getElementById("printview")
|
|
|
|
|
|
|
|
if (!printview) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementsByTagName("head")[0].appendChild(pagedjs);
|
|
|
|
|
|
|
|
console.log("first")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//document.getElementsByTagName("head")[0].removeChild(printview);
|
|
|
|
|
|
|
|
pagejs.remove();
|
|
|
|
|
|
|
|
console.log("aooooo che cazzo");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|