THE GREAT JS CLEANUP

This commit is contained in:
Simon Martens
2025-09-22 17:30:21 +02:00
parent 0307bd9c9c
commit f8d7b92be0
18 changed files with 2351 additions and 2898 deletions

View File

@@ -1,32 +1 @@
<title>KGPZ &ndash; Ausgabe {{ .model.Number.No }}&hairsp;/&hairsp;{{ .model.Year }}</title>
<script>
// Make template data available to JavaScript
window.templateData = {
targetPage: {{ if .targetPage }}{{ .targetPage }}{{ else }}0{{ end }}
};
</script>
{{ if .targetPage }}
<script>
// Auto-scroll to target page when page loads
document.addEventListener('DOMContentLoaded', function() {
// Wait for newspaper layout to be initialized
setTimeout(function() {
const targetPage = {{ .targetPage }};
const pageContainer = document.querySelector('[data-page-container="' + targetPage + '"]');
if (pageContainer) {
pageContainer.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
// Highlight the page in the Inhaltsverzeichnis
if (typeof markCurrentPageInInhaltsverzeichnis === 'function') {
markCurrentPageInInhaltsverzeichnis(targetPage);
}
}
}, 500); // Give time for layout initialization
});
</script>
{{ end }}