|
|
@ -4,7 +4,7 @@ const trackList = document.getElementById("trackList");
|
|
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
pagedjs.id = "printview";
|
|
|
|
|
|
|
|
|
|
|
|
const printLib = document.getElementById("btn-print");
|
|
|
|
const printLib = document.getElementById("btn-print");
|
|
|
|
|
|
|
|
|
|
|
@ -26,6 +26,7 @@ function fetchContents() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function populateContributions(contributions) {
|
|
|
|
function populateContributions(contributions) {
|
|
|
|
|
|
|
|
contributions.sort((a, b) => a.order - b.order);
|
|
|
|
contributions.forEach((contribution) => {
|
|
|
|
contributions.forEach((contribution) => {
|
|
|
|
contributionsList.appendChild(createSection(contribution));
|
|
|
|
contributionsList.appendChild(createSection(contribution));
|
|
|
|
createIndexSection(contribution);
|
|
|
|
createIndexSection(contribution);
|
|
|
@ -48,7 +49,7 @@ function atlasLink() {
|
|
|
|
let groups = atlas.querySelectorAll("g");
|
|
|
|
let groups = atlas.querySelectorAll("g");
|
|
|
|
for (const group of groups) {
|
|
|
|
for (const group of groups) {
|
|
|
|
let link = document.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
|
|
let link = document.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
|
|
link.setAttributeNS("http://www.w3.org/2000/svg", "href", "#" + group.id);
|
|
|
|
link.setAttribute("href", "#" + group.id);
|
|
|
|
link.innerHTML = group.innerHTML;
|
|
|
|
link.innerHTML = group.innerHTML;
|
|
|
|
group.innerHTML = "";
|
|
|
|
group.innerHTML = "";
|
|
|
|
group.appendChild(link);
|
|
|
|
group.appendChild(link);
|
|
|
@ -77,17 +78,13 @@ function createIndexSection(contribution) {
|
|
|
|
trackList.appendChild(table);
|
|
|
|
trackList.appendChild(table);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function printViewToggle() {
|
|
|
|
function printViewToggle() {
|
|
|
|
var printview = document.getElementById("printview")
|
|
|
|
var printview = document.getElementById("printview");
|
|
|
|
if (!printview) {
|
|
|
|
if (!printview) {
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementsByTagName("head")[0].appendChild(pagedjs);
|
|
|
|
document.getElementsByTagName("head")[0].appendChild(pagedjs);
|
|
|
|
// sto provando sta porcata qui, ma non funzia uguale. quando la pagina si trasforma in pagedjs la variabile del btn non è più definita (????)
|
|
|
|
// sto provando sta porcata qui, ma non funzia uguale. quando la pagina si trasforma in pagedjs la variabile del btn non è più definita (????)
|
|
|
|
var btnPrint = document.getElementById("btn-print");
|
|
|
|
var btnPrint = document.getElementById("btn-print");
|
|
|
|
console.log(btnPrint);
|
|
|
|
console.log(btnPrint);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//document.getElementsByTagName("head")[0].removeChild(printview);
|
|
|
|
//document.getElementsByTagName("head")[0].removeChild(printview);
|
|
|
|
pagejs.remove();
|
|
|
|
pagejs.remove();
|
|
|
|