Refactor footer scripts into default layout and enhance service worker registration with sync capabilities

This commit is contained in:
2025-03-20 11:30:49 +01:00
parent 63de9a9476
commit f1cf7f2867
2 changed files with 23 additions and 20 deletions

View File

@@ -17,22 +17,3 @@
</ul>
<span></span>
</footer>
<script
src="https://code.jquery.com/jquery-3.7.1.min.js"
integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
crossorigin="anonymous"></script>
<script src="{{ "/assets/js/materialize.min.js" | relative_url }}"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var sidenavElems = document.querySelectorAll('.sidenav');
var sidenavInstances = M.Sidenav.init(sidenavElems, {});
});
document.querySelectorAll("button").forEach(button => {
const href = button.getAttribute("data-href");
if (!href) return;
button.addEventListener("click", () => {
window.location.href = button.getAttribute("data-href");
});
});
</script>