@ -1018,6 +1018,45 @@ class CsvxmlPage {
|
||||
|
||||
}
|
||||
|
||||
renderFooter() {
|
||||
|
||||
const footer = document.createElement("footer");
|
||||
|
||||
const licenseStatement = document.createElement("p");
|
||||
licenseStatement.textContent = "This work is licensed under the GNU Affero Public License Version 3.";
|
||||
footer.appendChild(licenseStatement);
|
||||
|
||||
const footerOptions = document.createElement("div");
|
||||
|
||||
const codeLink = document.createElement("a");
|
||||
codeLink.textContent = "Source code";
|
||||
codeLink.href = "https://gitea.armuli.eu/museum-digital/csvxml";
|
||||
footerOptions.appendChild(codeLink);
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
const refreshB = document.createElement("span");
|
||||
refreshB.textContent = "Reload application";
|
||||
refreshB.setAttribute("tabindex", 1);
|
||||
refreshB.addEventListener('click', function(e) {
|
||||
|
||||
Promise.all(['csvxml-cache-v1'].map(function(cache) {
|
||||
caches.has(cache).then(function(hasCache) {
|
||||
if (hasCache === true) {
|
||||
caches.delete(cache).then(function(deletionStatus) {});
|
||||
}
|
||||
})
|
||||
}))
|
||||
location.reload()
|
||||
|
||||
}, {passive: true, once: true});
|
||||
footerOptions.appendChild(refreshB);
|
||||
}
|
||||
|
||||
footer.appendChild(footerOptions);
|
||||
document.body.appendChild(footer);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
(async function() {
|
||||
@ -1056,6 +1095,7 @@ class CsvxmlPage {
|
||||
page.renderHelpTexts();
|
||||
page.renderUploader();
|
||||
page.renderMain();
|
||||
page.renderFooter();
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user