|
|
|
@@ -1,11 +1,11 @@
|
|
|
|
class H extends HTMLElement {
|
|
|
|
class B extends HTMLElement {
|
|
|
|
constructor() {
|
|
|
|
constructor() {
|
|
|
|
super(), this.scrollHandler = null, this.scrollTimeout = null, this.clickHandlers = [], this.manualNavigation = !1;
|
|
|
|
super(), this.scrollHandler = null, this.scrollTimeout = null, this.clickHandlers = [], this.manualNavigation = !1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
connectedCallback() {
|
|
|
|
connectedCallback() {
|
|
|
|
setTimeout(() => {
|
|
|
|
window.ExecuteNextSettle(() => {
|
|
|
|
this.initializeScrollspyAfterDelay();
|
|
|
|
this.initializeScrollspyAfterDelay();
|
|
|
|
}, 100);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
initializeScrollspyAfterDelay() {
|
|
|
|
initializeScrollspyAfterDelay() {
|
|
|
|
if (this.sections = document.querySelectorAll(".author-section"), this.navLinks = document.querySelectorAll(".scrollspy-link"), this.sections.length === 0 || this.navLinks.length === 0) {
|
|
|
|
if (this.sections = document.querySelectorAll(".author-section"), this.navLinks = document.querySelectorAll(".scrollspy-link"), this.sections.length === 0 || this.navLinks.length === 0) {
|
|
|
|
@@ -25,10 +25,10 @@ class H extends HTMLElement {
|
|
|
|
this.updateActiveLink(), this.updateSidebarScrollToTopButton();
|
|
|
|
this.updateActiveLink(), this.updateSidebarScrollToTopButton();
|
|
|
|
}, 50);
|
|
|
|
}, 50);
|
|
|
|
}, window.addEventListener("scroll", this.scrollHandler), this.navLinks.forEach((e) => {
|
|
|
|
}, window.addEventListener("scroll", this.scrollHandler), this.navLinks.forEach((e) => {
|
|
|
|
const t = (n) => {
|
|
|
|
const t = (i) => {
|
|
|
|
n.preventDefault();
|
|
|
|
i.preventDefault();
|
|
|
|
const i = e.getAttribute("data-target"), o = document.getElementById(i);
|
|
|
|
const n = e.getAttribute("data-target"), r = document.getElementById(n);
|
|
|
|
o && (this.updateActiveLinkImmediate(i), this.manualNavigation = !0, o.scrollIntoView({
|
|
|
|
r && (this.updateActiveLinkImmediate(n), this.manualNavigation = !0, r.scrollIntoView({
|
|
|
|
behavior: "smooth",
|
|
|
|
behavior: "smooth",
|
|
|
|
block: "start"
|
|
|
|
block: "start"
|
|
|
|
}), setTimeout(() => {
|
|
|
|
}), setTimeout(() => {
|
|
|
|
@@ -42,15 +42,15 @@ class H extends HTMLElement {
|
|
|
|
const e = document.getElementById("scrollspy-slider"), t = document.getElementById("scrollspy-nav");
|
|
|
|
const e = document.getElementById("scrollspy-slider"), t = document.getElementById("scrollspy-nav");
|
|
|
|
if (!e || !t || e.style.opacity === "0")
|
|
|
|
if (!e || !t || e.style.opacity === "0")
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
const n = t.getBoundingClientRect(), i = parseFloat(e.style.top), o = parseFloat(e.style.height), s = i + o, l = t.scrollTop, a = l + n.height;
|
|
|
|
const i = t.getBoundingClientRect(), n = parseFloat(e.style.top), r = parseFloat(e.style.height), s = n + r, l = t.scrollTop, a = l + i.height;
|
|
|
|
if (s > a) {
|
|
|
|
if (s > a) {
|
|
|
|
const c = s - n.height + 20;
|
|
|
|
const c = s - i.height + 20;
|
|
|
|
t.scrollTo({
|
|
|
|
t.scrollTo({
|
|
|
|
top: c,
|
|
|
|
top: c,
|
|
|
|
behavior: "smooth"
|
|
|
|
behavior: "smooth"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else if (i < l) {
|
|
|
|
} else if (n < l) {
|
|
|
|
const c = i - 20;
|
|
|
|
const c = n - 20;
|
|
|
|
t.scrollTo({
|
|
|
|
t.scrollTo({
|
|
|
|
top: Math.max(0, c),
|
|
|
|
top: Math.max(0, c),
|
|
|
|
behavior: "smooth"
|
|
|
|
behavior: "smooth"
|
|
|
|
@@ -62,62 +62,62 @@ class H extends HTMLElement {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
const e = [];
|
|
|
|
const e = [];
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
this.sections.forEach((i) => {
|
|
|
|
this.sections.forEach((n) => {
|
|
|
|
if (!i || !i.getAttribute) return;
|
|
|
|
if (!n || !n.getAttribute) return;
|
|
|
|
const o = i.getAttribute("id"), s = i.querySelector(".akteur-werke-section"), l = i.querySelector(".akteur-beitraege-section");
|
|
|
|
const r = n.getAttribute("id"), s = n.querySelector(".akteur-werke-section"), l = n.querySelector(".akteur-beitraege-section");
|
|
|
|
let a = !1;
|
|
|
|
let a = !1;
|
|
|
|
if (s) {
|
|
|
|
if (s) {
|
|
|
|
const c = s.getBoundingClientRect(), d = c.top < window.innerHeight, g = c.bottom > 0;
|
|
|
|
const c = s.getBoundingClientRect(), d = c.top < window.innerHeight, u = c.bottom > 0;
|
|
|
|
d && g && (a = !0);
|
|
|
|
d && u && (a = !0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (l && !a) {
|
|
|
|
if (l && !a) {
|
|
|
|
const c = l.getBoundingClientRect(), d = c.top < window.innerHeight, g = c.bottom > 0;
|
|
|
|
const c = l.getBoundingClientRect(), d = c.top < window.innerHeight, u = c.bottom > 0;
|
|
|
|
d && g && (a = !0);
|
|
|
|
d && u && (a = !0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!s && !l) {
|
|
|
|
if (!s && !l) {
|
|
|
|
const c = i.querySelector("div:first-child");
|
|
|
|
const c = n.querySelector("div:first-child");
|
|
|
|
if (c) {
|
|
|
|
if (c) {
|
|
|
|
const d = c.getBoundingClientRect(), g = d.top >= 0, h = d.bottom <= window.innerHeight;
|
|
|
|
const d = c.getBoundingClientRect(), u = d.top >= 0, h = d.bottom <= window.innerHeight;
|
|
|
|
g && h && (a = !0);
|
|
|
|
u && h && (a = !0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
a && e.push(o);
|
|
|
|
a && e.push(r);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch {
|
|
|
|
} catch {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const t = [], n = document.getElementById("scrollspy-slider");
|
|
|
|
const t = [], i = document.getElementById("scrollspy-slider");
|
|
|
|
if (this.navLinks.forEach((i) => {
|
|
|
|
if (this.navLinks.forEach((n) => {
|
|
|
|
i.classList.remove("font-medium");
|
|
|
|
n.classList.remove("font-medium");
|
|
|
|
const o = i.getAttribute("data-target");
|
|
|
|
const r = n.getAttribute("data-target");
|
|
|
|
e.includes(o) && (i.classList.add("font-medium"), t.push(i));
|
|
|
|
e.includes(r) && (n.classList.add("font-medium"), t.push(n));
|
|
|
|
}), t.length > 0 && n) {
|
|
|
|
}), t.length > 0 && i) {
|
|
|
|
const i = document.getElementById("scrollspy-nav"), o = i.getBoundingClientRect();
|
|
|
|
const n = document.getElementById("scrollspy-nav"), r = n.getBoundingClientRect();
|
|
|
|
let s = 1 / 0, l = -1 / 0;
|
|
|
|
let s = 1 / 0, l = -1 / 0;
|
|
|
|
t.forEach((c) => {
|
|
|
|
t.forEach((c) => {
|
|
|
|
const d = c.getBoundingClientRect(), g = d.top - o.top + i.scrollTop, h = g + d.height;
|
|
|
|
const d = c.getBoundingClientRect(), u = d.top - r.top + n.scrollTop, h = u + d.height;
|
|
|
|
s = Math.min(s, g), l = Math.max(l, h);
|
|
|
|
s = Math.min(s, u), l = Math.max(l, h);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
let a = l - s;
|
|
|
|
let a = l - s;
|
|
|
|
n.style.top = `${s}px`, n.style.height = `${a}px`, n.style.opacity = "1", setTimeout(() => this.ensureMarkerVisibility(), 100);
|
|
|
|
i.style.top = `${s}px`, i.style.height = `${a}px`, i.style.opacity = "1", setTimeout(() => this.ensureMarkerVisibility(), 100);
|
|
|
|
} else n && (n.style.opacity = "0");
|
|
|
|
} else i && (i.style.opacity = "0");
|
|
|
|
t.length > 0 && this.updateSidebarScroll(t);
|
|
|
|
t.length > 0 && this.updateSidebarScroll(t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateActiveLinkImmediate(e) {
|
|
|
|
updateActiveLinkImmediate(e) {
|
|
|
|
if (!this.navLinks) return;
|
|
|
|
if (!this.navLinks) return;
|
|
|
|
const t = document.getElementById("scrollspy-slider");
|
|
|
|
const t = document.getElementById("scrollspy-slider");
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
this.navLinks.forEach((i) => {
|
|
|
|
this.navLinks.forEach((n) => {
|
|
|
|
i && i.classList && i.classList.remove("font-medium");
|
|
|
|
n && n.classList && n.classList.remove("font-medium");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch {
|
|
|
|
} catch {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const n = document.querySelector(`[data-target="${e}"]`);
|
|
|
|
const i = document.querySelector(`[data-target="${e}"]`);
|
|
|
|
if (n && (n.classList.add("font-medium"), t)) {
|
|
|
|
if (i && (i.classList.add("font-medium"), t)) {
|
|
|
|
const i = document.getElementById("scrollspy-nav");
|
|
|
|
const n = document.getElementById("scrollspy-nav");
|
|
|
|
if (i) {
|
|
|
|
if (n) {
|
|
|
|
const o = i.getBoundingClientRect(), s = n.getBoundingClientRect(), l = s.top - o.top + i.scrollTop;
|
|
|
|
const r = n.getBoundingClientRect(), s = i.getBoundingClientRect(), l = s.top - r.top + n.scrollTop;
|
|
|
|
t.style.top = `${l}px`, t.style.height = `${s.height}px`, t.style.opacity = "1";
|
|
|
|
t.style.top = `${l}px`, t.style.height = `${s.height}px`, t.style.opacity = "1";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -126,17 +126,17 @@ class H extends HTMLElement {
|
|
|
|
if (this.manualNavigation) return;
|
|
|
|
if (this.manualNavigation) return;
|
|
|
|
const t = document.getElementById("scrollspy-nav");
|
|
|
|
const t = document.getElementById("scrollspy-nav");
|
|
|
|
if (!t) return;
|
|
|
|
if (!t) return;
|
|
|
|
const n = e[0], i = Math.max(
|
|
|
|
const i = e[0], n = Math.max(
|
|
|
|
document.body.scrollHeight,
|
|
|
|
document.body.scrollHeight,
|
|
|
|
document.body.offsetHeight,
|
|
|
|
document.body.offsetHeight,
|
|
|
|
document.documentElement.clientHeight,
|
|
|
|
document.documentElement.clientHeight,
|
|
|
|
document.documentElement.scrollHeight,
|
|
|
|
document.documentElement.scrollHeight,
|
|
|
|
document.documentElement.offsetHeight
|
|
|
|
document.documentElement.offsetHeight
|
|
|
|
), o = window.innerHeight, s = i - o, l = s > 0 ? window.scrollY / s : 0, a = t.clientHeight, d = t.scrollHeight - a;
|
|
|
|
), r = window.innerHeight, s = n - r, l = s > 0 ? window.scrollY / s : 0, a = t.clientHeight, d = t.scrollHeight - a;
|
|
|
|
if (d > 0) {
|
|
|
|
if (d > 0) {
|
|
|
|
const g = l * d, h = n.getBoundingClientRect(), P = t.getBoundingClientRect(), C = h.top - P.top + t.scrollTop, k = a / 2, T = C - k, m = 0.7, I = m * g + (1 - m) * T, b = Math.max(0, Math.min(d, I)), L = t.scrollTop;
|
|
|
|
const u = l * d, h = i.getBoundingClientRect(), C = t.getBoundingClientRect(), k = h.top - C.top + t.scrollTop, T = a / 2, I = k - T, b = 0.7, L = b * u + (1 - b) * I, w = Math.max(0, Math.min(d, L)), H = t.scrollTop;
|
|
|
|
Math.abs(b - L) > 10 && t.scrollTo({
|
|
|
|
Math.abs(w - H) > 10 && t.scrollTo({
|
|
|
|
top: b,
|
|
|
|
top: w,
|
|
|
|
behavior: "smooth"
|
|
|
|
behavior: "smooth"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -144,19 +144,19 @@ class H extends HTMLElement {
|
|
|
|
updateSidebarScrollToTopButton() {
|
|
|
|
updateSidebarScrollToTopButton() {
|
|
|
|
const e = document.getElementById("sidebar-scroll-to-top");
|
|
|
|
const e = document.getElementById("sidebar-scroll-to-top");
|
|
|
|
if (!e) return;
|
|
|
|
if (!e) return;
|
|
|
|
const t = window.pageYOffset || document.documentElement.scrollTop, n = window.innerHeight;
|
|
|
|
const t = window.pageYOffset || document.documentElement.scrollTop, i = window.innerHeight;
|
|
|
|
t > n * 0.5 ? (e.classList.remove("opacity-0"), e.classList.add("opacity-100")) : (e.classList.remove("opacity-100"), e.classList.add("opacity-0"));
|
|
|
|
t > i * 0.5 ? (e.classList.remove("opacity-0"), e.classList.add("opacity-100")) : (e.classList.remove("opacity-100"), e.classList.add("opacity-0"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cleanup() {
|
|
|
|
cleanup() {
|
|
|
|
this.scrollHandler && (window.removeEventListener("scroll", this.scrollHandler), this.scrollHandler = null), this.scrollTimeout && (clearTimeout(this.scrollTimeout), this.scrollTimeout = null), this.clickHandlers && this.clickHandlers.length > 0 && this.clickHandlers.forEach(({ link: t, handler: n }) => {
|
|
|
|
this.scrollHandler && (window.removeEventListener("scroll", this.scrollHandler), this.scrollHandler = null), this.scrollTimeout && (clearTimeout(this.scrollTimeout), this.scrollTimeout = null), this.clickHandlers && this.clickHandlers.length > 0 && this.clickHandlers.forEach(({ link: t, handler: i }) => {
|
|
|
|
t && n && t.removeEventListener("click", n);
|
|
|
|
t && i && t.removeEventListener("click", i);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const e = document.getElementById("scrollspy-slider");
|
|
|
|
const e = document.getElementById("scrollspy-slider");
|
|
|
|
e && (e.style.opacity = "0", e.style.height = "0"), this.sections = null, this.navLinks = null, this.clickHandlers = [], this.manualNavigation = !1;
|
|
|
|
e && (e.style.opacity = "0", e.style.height = "0"), this.sections = null, this.navLinks = null, this.clickHandlers = [], this.manualNavigation = !1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
customElements.define("akteure-scrollspy", H);
|
|
|
|
customElements.define("akteure-scrollspy", B);
|
|
|
|
class B extends HTMLElement {
|
|
|
|
class E extends HTMLElement {
|
|
|
|
constructor() {
|
|
|
|
constructor() {
|
|
|
|
super(), this.resizeObserver = null;
|
|
|
|
super(), this.resizeObserver = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -164,8 +164,8 @@ class B extends HTMLElement {
|
|
|
|
detectSidebarWidth() {
|
|
|
|
detectSidebarWidth() {
|
|
|
|
const e = document.querySelector('.lg\\:w-1\\/4, .lg\\:w-1\\/3, [class*="lg:w-1/"]');
|
|
|
|
const e = document.querySelector('.lg\\:w-1\\/4, .lg\\:w-1\\/3, [class*="lg:w-1/"]');
|
|
|
|
if (e) {
|
|
|
|
if (e) {
|
|
|
|
const i = e.getBoundingClientRect().width;
|
|
|
|
const n = e.getBoundingClientRect().width;
|
|
|
|
return console.log("Detected sidebar width:", i, "px"), `${i}px`;
|
|
|
|
return console.log("Detected sidebar width:", n, "px"), `${n}px`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const t = window.innerWidth;
|
|
|
|
const t = window.innerWidth;
|
|
|
|
return t < 1024 ? "0px" : t < 1280 ? `${Math.floor(t * 0.25)}px` : `${Math.floor(t * 0.2)}px`;
|
|
|
|
return t < 1024 ? "0px" : t < 1280 ? `${Math.floor(t * 0.25)}px` : `${Math.floor(t * 0.2)}px`;
|
|
|
|
@@ -281,22 +281,22 @@ class B extends HTMLElement {
|
|
|
|
e.style.width = t, console.log("Updated sidebar width to:", t);
|
|
|
|
e.style.width = t, console.log("Updated sidebar width to:", t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
show(e, t, n, i = !1, o = 0, s = null) {
|
|
|
|
show(e, t, i, n = !1, r = 0, s = null) {
|
|
|
|
const l = this.querySelector("#single-page-image"), a = this.querySelector("#page-number"), c = this.querySelector("#page-icon");
|
|
|
|
const l = this.querySelector("#single-page-image"), a = this.querySelector("#page-number"), c = this.querySelector("#page-icon");
|
|
|
|
this.querySelector("#page-indicator"), l.src = e, l.alt = t, this.currentPageNumber = n, this.currentIsBeilage = i, this.currentPartNumber = s;
|
|
|
|
this.querySelector("#page-indicator"), l.src = e, l.alt = t, this.currentPageNumber = i, this.currentIsBeilage = n, this.currentPartNumber = s;
|
|
|
|
const d = this.getIssueContext(n);
|
|
|
|
const d = this.getIssueContext(i);
|
|
|
|
if (a.innerHTML = d ? `${d}, ${n}` : `${n}`, o && n === o) {
|
|
|
|
if (a.innerHTML = d ? `${d}, ${i}` : `${i}`, r && i === r) {
|
|
|
|
a.style.position = "relative";
|
|
|
|
a.style.position = "relative";
|
|
|
|
const g = a.querySelector(".target-page-dot");
|
|
|
|
const u = a.querySelector(".target-page-dot");
|
|
|
|
g && g.remove();
|
|
|
|
u && u.remove();
|
|
|
|
const h = document.createElement("span");
|
|
|
|
const h = document.createElement("span");
|
|
|
|
h.className = "target-page-dot absolute -top-1 -right-1 w-3 h-3 bg-red-500 rounded-full z-10", h.title = "verlinkte Seite", a.appendChild(h);
|
|
|
|
h.className = "target-page-dot absolute -top-1 -right-1 w-3 h-3 bg-red-500 rounded-full z-10", h.title = "verlinkte Seite", a.appendChild(h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (s !== null)
|
|
|
|
if (s !== null)
|
|
|
|
c.innerHTML = `<span class="part-number bg-slate-100 text-slate-800 font-bold px-1.5 py-0.5 rounded border border-slate-400 flex items-center justify-center">${s}. Teil</span>`;
|
|
|
|
c.innerHTML = `<span class="part-number bg-slate-100 text-slate-800 font-bold px-1.5 py-0.5 rounded border border-slate-400 flex items-center justify-center">${s}. Teil</span>`;
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
const g = this.determinePageIconType(n, i);
|
|
|
|
const u = this.determinePageIconType(i, n);
|
|
|
|
c.innerHTML = this.getPageIconHTML(g);
|
|
|
|
c.innerHTML = this.getPageIconHTML(u);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.updateNavigationButtons(), this.style.display = "block", document.body.style.overflow = "hidden";
|
|
|
|
this.updateNavigationButtons(), this.style.display = "block", document.body.style.overflow = "hidden";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -308,13 +308,13 @@ class B extends HTMLElement {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Determine page icon type based on page position and whether it's beilage
|
|
|
|
// Determine page icon type based on page position and whether it's beilage
|
|
|
|
determinePageIconType(e, t) {
|
|
|
|
determinePageIconType(e, t) {
|
|
|
|
const n = t ? '.newspaper-page-container[data-beilage="true"]' : ".newspaper-page-container:not([data-beilage])", o = Array.from(document.querySelectorAll(n)).map((a) => {
|
|
|
|
const i = t ? '.newspaper-page-container[data-beilage="true"]' : ".newspaper-page-container:not([data-beilage])", r = Array.from(document.querySelectorAll(i)).map((a) => {
|
|
|
|
const c = a.getAttribute("data-page-container");
|
|
|
|
const c = a.getAttribute("data-page-container");
|
|
|
|
return c ? parseInt(c) : null;
|
|
|
|
return c ? parseInt(c) : null;
|
|
|
|
}).filter((a) => a !== null).sort((a, c) => a - c);
|
|
|
|
}).filter((a) => a !== null).sort((a, c) => a - c);
|
|
|
|
if (o.length === 0)
|
|
|
|
if (r.length === 0)
|
|
|
|
return "first";
|
|
|
|
return "first";
|
|
|
|
const s = o[0], l = o[o.length - 1];
|
|
|
|
const s = r[0], l = r[r.length - 1];
|
|
|
|
return e === s ? "first" : e === l ? "last" : e === s + 1 ? "even" : e === l - 1 ? "odd" : e % 2 === 0 ? "even" : "odd";
|
|
|
|
return e === s ? "first" : e === l ? "last" : e === s + 1 ? "even" : e === l - 1 ? "odd" : e % 2 === 0 ? "even" : "odd";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Generate page icon HTML based on type (same as Go PageIcon function)
|
|
|
|
// Generate page icon HTML based on type (same as Go PageIcon function)
|
|
|
|
@@ -349,14 +349,14 @@ class B extends HTMLElement {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Update navigation button visibility based on available pages
|
|
|
|
// Update navigation button visibility based on available pages
|
|
|
|
updateNavigationButtons() {
|
|
|
|
updateNavigationButtons() {
|
|
|
|
const e = this.querySelector("#prev-page-btn"), t = this.querySelector("#next-page-btn"), { prevPage: n, nextPage: i } = this.getAdjacentPages();
|
|
|
|
const e = this.querySelector("#prev-page-btn"), t = this.querySelector("#next-page-btn"), { prevPage: i, nextPage: n } = this.getAdjacentPages();
|
|
|
|
n !== null ? (e.disabled = !1, e.className = e.className.replace("opacity-50 cursor-not-allowed", ""), e.className = e.className.replace(
|
|
|
|
i !== null ? (e.disabled = !1, e.className = e.className.replace("opacity-50 cursor-not-allowed", ""), e.className = e.className.replace(
|
|
|
|
"bg-gray-50 text-gray-400",
|
|
|
|
"bg-gray-50 text-gray-400",
|
|
|
|
"bg-gray-100 text-gray-700"
|
|
|
|
"bg-gray-100 text-gray-700"
|
|
|
|
)) : (e.disabled = !0, e.className.includes("opacity-50") || (e.className += " opacity-50 cursor-not-allowed"), e.className = e.className.replace(
|
|
|
|
)) : (e.disabled = !0, e.className.includes("opacity-50") || (e.className += " opacity-50 cursor-not-allowed"), e.className = e.className.replace(
|
|
|
|
"bg-gray-100 text-gray-700",
|
|
|
|
"bg-gray-100 text-gray-700",
|
|
|
|
"bg-gray-50 text-gray-400"
|
|
|
|
"bg-gray-50 text-gray-400"
|
|
|
|
)), i !== null ? (t.disabled = !1, t.className = t.className.replace("opacity-50 cursor-not-allowed", ""), t.className = t.className.replace(
|
|
|
|
)), n !== null ? (t.disabled = !1, t.className = t.className.replace("opacity-50 cursor-not-allowed", ""), t.className = t.className.replace(
|
|
|
|
"bg-gray-50 text-gray-400",
|
|
|
|
"bg-gray-50 text-gray-400",
|
|
|
|
"bg-gray-100 text-gray-700"
|
|
|
|
"bg-gray-100 text-gray-700"
|
|
|
|
)) : (t.disabled = !0, t.className.includes("opacity-50") || (t.className += " opacity-50 cursor-not-allowed"), t.className = t.className.replace(
|
|
|
|
)) : (t.disabled = !0, t.className.includes("opacity-50") || (t.className += " opacity-50 cursor-not-allowed"), t.className = t.className.replace(
|
|
|
|
@@ -375,15 +375,15 @@ class B extends HTMLElement {
|
|
|
|
"for",
|
|
|
|
"for",
|
|
|
|
this.currentIsBeilage ? "beilage" : "main"
|
|
|
|
this.currentIsBeilage ? "beilage" : "main"
|
|
|
|
);
|
|
|
|
);
|
|
|
|
const n = t.map((l) => {
|
|
|
|
const i = t.map((l) => {
|
|
|
|
const a = l.getAttribute("data-page-container"), c = a ? parseInt(a) : null;
|
|
|
|
const a = l.getAttribute("data-page-container"), c = a ? parseInt(a) : null;
|
|
|
|
return console.log("Container page:", a, "parsed:", c), c;
|
|
|
|
return console.log("Container page:", a, "parsed:", c), c;
|
|
|
|
}).filter((l) => l !== null).sort((l, a) => l - a);
|
|
|
|
}).filter((l) => l !== null).sort((l, a) => l - a);
|
|
|
|
console.log("All pages found:", n), console.log("Current page:", this.currentPageNumber);
|
|
|
|
console.log("All pages found:", i), console.log("Current page:", this.currentPageNumber);
|
|
|
|
const i = n.indexOf(this.currentPageNumber);
|
|
|
|
const n = i.indexOf(this.currentPageNumber);
|
|
|
|
console.log("Current index:", i);
|
|
|
|
console.log("Current index:", n);
|
|
|
|
let o = null, s = null;
|
|
|
|
let r = null, s = null;
|
|
|
|
return i > 0 && (o = n[i - 1]), i < n.length - 1 && (s = n[i + 1]), console.log("Adjacent pages - prev:", o, "next:", s), { prevPage: o, nextPage: s };
|
|
|
|
return n > 0 && (r = i[n - 1]), n < i.length - 1 && (s = i[n + 1]), console.log("Adjacent pages - prev:", r, "next:", s), { prevPage: r, nextPage: s };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Navigate to previous page
|
|
|
|
// Navigate to previous page
|
|
|
|
goToPreviousPage() {
|
|
|
|
goToPreviousPage() {
|
|
|
|
@@ -397,20 +397,20 @@ class B extends HTMLElement {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Navigate to a specific page
|
|
|
|
// Navigate to a specific page
|
|
|
|
navigateToPage(e) {
|
|
|
|
navigateToPage(e) {
|
|
|
|
const t = this.currentIsBeilage ? '.newspaper-page-container[data-beilage="true"]' : ".newspaper-page-container:not([data-beilage])", n = document.querySelector(
|
|
|
|
const t = this.currentIsBeilage ? '.newspaper-page-container[data-beilage="true"]' : ".newspaper-page-container:not([data-beilage])", i = document.querySelector(
|
|
|
|
`${t}[data-page-container="${e}"]`
|
|
|
|
`${t}[data-page-container="${e}"]`
|
|
|
|
);
|
|
|
|
);
|
|
|
|
if (n) {
|
|
|
|
if (i) {
|
|
|
|
const i = n.querySelector(".newspaper-page-image");
|
|
|
|
const n = i.querySelector(".newspaper-page-image");
|
|
|
|
if (i) {
|
|
|
|
if (n) {
|
|
|
|
let o = null;
|
|
|
|
let r = null;
|
|
|
|
this.currentPartNumber !== null && (o = this.getPartNumberForPage(e)), this.show(
|
|
|
|
this.currentPartNumber !== null && (r = this.getPartNumberForPage(e)), this.show(
|
|
|
|
i.src,
|
|
|
|
n.src,
|
|
|
|
i.alt,
|
|
|
|
n.alt,
|
|
|
|
e,
|
|
|
|
e,
|
|
|
|
this.currentIsBeilage,
|
|
|
|
this.currentIsBeilage,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
o
|
|
|
|
r
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -419,36 +419,36 @@ class B extends HTMLElement {
|
|
|
|
getPartNumberForPage(e) {
|
|
|
|
getPartNumberForPage(e) {
|
|
|
|
const t = document.querySelector(`[data-page-container="${e}"]`);
|
|
|
|
const t = document.querySelector(`[data-page-container="${e}"]`);
|
|
|
|
if (t) {
|
|
|
|
if (t) {
|
|
|
|
const n = t.querySelector(".part-number");
|
|
|
|
const i = t.querySelector(".part-number");
|
|
|
|
if (n) {
|
|
|
|
if (i) {
|
|
|
|
const i = n.textContent.match(/(\d+)\./);
|
|
|
|
const n = i.textContent.match(/(\d+)\./);
|
|
|
|
if (i)
|
|
|
|
if (n)
|
|
|
|
return parseInt(i[1]);
|
|
|
|
return parseInt(n[1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Toggle sidebar visibility
|
|
|
|
// Toggle sidebar visibility
|
|
|
|
toggleSidebar() {
|
|
|
|
toggleSidebar() {
|
|
|
|
const e = this.querySelector("#sidebar-spacer"), t = this.querySelector("#sidebar-toggle-btn"), n = t.querySelector("i"), i = e.style.width, o = i === "0px" || i === "0";
|
|
|
|
const e = this.querySelector("#sidebar-spacer"), t = this.querySelector("#sidebar-toggle-btn"), i = t.querySelector("i"), n = e.style.width, r = n === "0px" || n === "0";
|
|
|
|
if (console.log("Current state - isCollapsed:", o), console.log("Current width:", i), o) {
|
|
|
|
if (console.log("Current state - isCollapsed:", r), console.log("Current width:", n), r) {
|
|
|
|
const s = this.detectSidebarWidth();
|
|
|
|
const s = this.detectSidebarWidth();
|
|
|
|
e.style.width = s, t.className = "w-10 h-10 bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-300 rounded flex items-center justify-center transition-colors duration-200 cursor-pointer", n.className = "ri-sidebar-fold-line text-lg font-bold", t.title = "Inhaltsverzeichnis ausblenden", console.log("Expanding sidebar to:", s);
|
|
|
|
e.style.width = s, t.className = "w-10 h-10 bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-300 rounded flex items-center justify-center transition-colors duration-200 cursor-pointer", i.className = "ri-sidebar-fold-line text-lg font-bold", t.title = "Inhaltsverzeichnis ausblenden", console.log("Expanding sidebar to:", s);
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
e.style.width = "0px", t.className = "w-10 h-10 bg-orange-100 hover:bg-orange-200 text-orange-700 border border-orange-300 rounded flex items-center justify-center transition-colors duration-200 cursor-pointer", n.className = "ri-sidebar-unfold-line text-lg font-bold", t.title = "Inhaltsverzeichnis einblenden", console.log("Collapsing sidebar");
|
|
|
|
e.style.width = "0px", t.className = "w-10 h-10 bg-orange-100 hover:bg-orange-200 text-orange-700 border border-orange-300 rounded flex items-center justify-center transition-colors duration-200 cursor-pointer", i.className = "ri-sidebar-unfold-line text-lg font-bold", t.title = "Inhaltsverzeichnis einblenden", console.log("Collapsing sidebar");
|
|
|
|
console.log("New width:", e.style.width);
|
|
|
|
console.log("New width:", e.style.width);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Extract issue context from document title, URL, or page container
|
|
|
|
// Extract issue context from document title, URL, or page container
|
|
|
|
getIssueContext(e) {
|
|
|
|
getIssueContext(e) {
|
|
|
|
const t = window.location.pathname, n = t.includes("/beitrag/");
|
|
|
|
const t = window.location.pathname, i = t.includes("/beitrag/");
|
|
|
|
if (n) {
|
|
|
|
if (i) {
|
|
|
|
const s = document.querySelector(`[data-page-container="${e}"]`);
|
|
|
|
const s = document.querySelector(`[data-page-container="${e}"]`);
|
|
|
|
if (s) {
|
|
|
|
if (s) {
|
|
|
|
const c = s.querySelector(".page-indicator");
|
|
|
|
const c = s.querySelector(".page-indicator");
|
|
|
|
if (c) {
|
|
|
|
if (c) {
|
|
|
|
const d = c.textContent.trim(), g = d.match(/(\d{1,2}\.\d{1,2}\.\d{4}\s+Nr\.\s+\d+)/);
|
|
|
|
const d = c.textContent.trim(), u = d.match(/(\d{1,2}\.\d{1,2}\.\d{4}\s+Nr\.\s+\d+)/);
|
|
|
|
if (g)
|
|
|
|
if (u)
|
|
|
|
return g[1];
|
|
|
|
return u[1];
|
|
|
|
const h = d.match(/(\d{4})\s+Nr\.\s+(\d+)/);
|
|
|
|
const h = d.match(/(\d{4})\s+Nr\.\s+(\d+)/);
|
|
|
|
if (h)
|
|
|
|
if (h)
|
|
|
|
return `${h[1]} Nr. ${h[2]}`;
|
|
|
|
return `${h[1]} Nr. ${h[2]}`;
|
|
|
|
@@ -459,28 +459,28 @@ class B extends HTMLElement {
|
|
|
|
return `${a[1]} Nr. ${a[2]}`;
|
|
|
|
return `${a[1]} Nr. ${a[2]}`;
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
return "";
|
|
|
|
return "";
|
|
|
|
const i = t.match(/\/(\d{4})\/(\d+)/);
|
|
|
|
const n = t.match(/\/(\d{4})\/(\d+)/);
|
|
|
|
if (i)
|
|
|
|
if (n)
|
|
|
|
return n ? `${i[1]} Nr. ${i[2]}` : "";
|
|
|
|
return i ? `${n[1]} Nr. ${n[2]}` : "";
|
|
|
|
const o = document.querySelector(".page-indicator");
|
|
|
|
const r = document.querySelector(".page-indicator");
|
|
|
|
if (o) {
|
|
|
|
if (r) {
|
|
|
|
const l = o.textContent.trim().match(/(\d{4})\s+Nr\.\s+(\d+)/);
|
|
|
|
const l = r.textContent.trim().match(/(\d{4})\s+Nr\.\s+(\d+)/);
|
|
|
|
if (l)
|
|
|
|
if (l)
|
|
|
|
return `${l[1]} Nr. ${l[2]}`;
|
|
|
|
return `${l[1]} Nr. ${l[2]}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "KGPZ";
|
|
|
|
return "KGPZ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
customElements.define("single-page-viewer", B);
|
|
|
|
customElements.define("single-page-viewer", E);
|
|
|
|
document.body.addEventListener("htmx:beforeRequest", function(r) {
|
|
|
|
document.body.addEventListener("htmx:beforeRequest", function(o) {
|
|
|
|
const e = document.querySelector("single-page-viewer");
|
|
|
|
const e = document.querySelector("single-page-viewer");
|
|
|
|
e && e.style.display !== "none" && (console.log("Cleaning up single page viewer before HTMX navigation"), e.destroy());
|
|
|
|
e && e.style.display !== "none" && (console.log("Cleaning up single page viewer before HTMX navigation"), e.destroy());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
window.addEventListener("beforeunload", function() {
|
|
|
|
window.addEventListener("beforeunload", function() {
|
|
|
|
const r = document.querySelector("single-page-viewer");
|
|
|
|
const o = document.querySelector("single-page-viewer");
|
|
|
|
r && r.destroy();
|
|
|
|
o && o.destroy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
class E extends HTMLElement {
|
|
|
|
class A extends HTMLElement {
|
|
|
|
constructor() {
|
|
|
|
constructor() {
|
|
|
|
super(), this.isVisible = !1, this.scrollHandler = null, this.htmxAfterSwapHandler = null;
|
|
|
|
super(), this.isVisible = !1, this.scrollHandler = null, this.htmxAfterSwapHandler = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -511,8 +511,8 @@ class E extends HTMLElement {
|
|
|
|
handleScroll() {
|
|
|
|
handleScroll() {
|
|
|
|
const e = this.querySelector("#scroll-to-top-btn");
|
|
|
|
const e = this.querySelector("#scroll-to-top-btn");
|
|
|
|
if (!e) return;
|
|
|
|
if (!e) return;
|
|
|
|
const t = window.pageYOffset || document.documentElement.scrollTop, n = window.innerHeight, i = t > n;
|
|
|
|
const t = window.pageYOffset || document.documentElement.scrollTop, i = window.innerHeight, n = t > i;
|
|
|
|
i && !this.isVisible ? (this.isVisible = !0, e.classList.remove("opacity-0", "pointer-events-none"), e.classList.add("opacity-100", "pointer-events-auto")) : !i && this.isVisible && (this.isVisible = !1, e.classList.remove("opacity-100", "pointer-events-auto"), e.classList.add("opacity-0", "pointer-events-none"));
|
|
|
|
n && !this.isVisible ? (this.isVisible = !0, e.classList.remove("opacity-0", "pointer-events-none"), e.classList.add("opacity-100", "pointer-events-auto")) : !n && this.isVisible && (this.isVisible = !1, e.classList.remove("opacity-100", "pointer-events-auto"), e.classList.add("opacity-0", "pointer-events-none"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scrollToTop() {
|
|
|
|
scrollToTop() {
|
|
|
|
window.scrollTo({
|
|
|
|
window.scrollTo({
|
|
|
|
@@ -521,30 +521,30 @@ class E extends HTMLElement {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
customElements.define("scroll-to-top-button", E);
|
|
|
|
customElements.define("scroll-to-top-button", A);
|
|
|
|
window.currentPageContainers = window.currentPageContainers || [];
|
|
|
|
window.currentPageContainers = window.currentPageContainers || [];
|
|
|
|
window.currentActiveIndex = window.currentActiveIndex || 0;
|
|
|
|
window.currentActiveIndex = window.currentActiveIndex || 0;
|
|
|
|
window.pageObserver = window.pageObserver || null;
|
|
|
|
window.pageObserver = window.pageObserver || null;
|
|
|
|
function A(r, e, t, n = null) {
|
|
|
|
function $(o, e, t, i = null) {
|
|
|
|
let i = document.querySelector("single-page-viewer");
|
|
|
|
let n = document.querySelector("single-page-viewer");
|
|
|
|
i || (i = document.createElement("single-page-viewer"), document.body.appendChild(i));
|
|
|
|
n || (n = document.createElement("single-page-viewer"), document.body.appendChild(n));
|
|
|
|
const o = r.closest('[data-beilage="true"]') !== null, s = window.templateData && window.templateData.targetPage ? window.templateData.targetPage : 0;
|
|
|
|
const r = o.closest('[data-beilage="true"]') !== null, s = window.templateData && window.templateData.targetPage ? window.templateData.targetPage : 0;
|
|
|
|
i.show(r.src, r.alt, e, o, s, n);
|
|
|
|
n.show(o.src, o.alt, e, r, s, i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function x() {
|
|
|
|
function S() {
|
|
|
|
document.getElementById("pageModal").classList.add("hidden");
|
|
|
|
document.getElementById("pageModal").classList.add("hidden");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function $() {
|
|
|
|
function N() {
|
|
|
|
if (window.pageObserver && (window.pageObserver.disconnect(), window.pageObserver = null), window.currentPageContainers = Array.from(document.querySelectorAll(".newspaper-page-container")), window.currentActiveIndex = 0, p(), document.querySelector(".newspaper-page-container")) {
|
|
|
|
if (window.pageObserver && (window.pageObserver.disconnect(), window.pageObserver = null), window.currentPageContainers = Array.from(document.querySelectorAll(".newspaper-page-container")), window.currentActiveIndex = 0, p(), document.querySelector(".newspaper-page-container")) {
|
|
|
|
let e = /* @__PURE__ */ new Set();
|
|
|
|
let e = /* @__PURE__ */ new Set();
|
|
|
|
window.pageObserver = new IntersectionObserver(
|
|
|
|
window.pageObserver = new IntersectionObserver(
|
|
|
|
(t) => {
|
|
|
|
(t) => {
|
|
|
|
if (t.forEach((n) => {
|
|
|
|
if (t.forEach((i) => {
|
|
|
|
const i = window.currentPageContainers.indexOf(n.target);
|
|
|
|
const n = window.currentPageContainers.indexOf(i.target);
|
|
|
|
i !== -1 && (n.isIntersecting ? e.add(i) : e.delete(i));
|
|
|
|
n !== -1 && (i.isIntersecting ? e.add(n) : e.delete(n));
|
|
|
|
}), e.size > 0) {
|
|
|
|
}), e.size > 0) {
|
|
|
|
const i = Array.from(e).sort((o, s) => o - s)[0];
|
|
|
|
const n = Array.from(e).sort((r, s) => r - s)[0];
|
|
|
|
i !== window.currentActiveIndex && (window.currentActiveIndex = i, p());
|
|
|
|
n !== window.currentActiveIndex && (window.currentActiveIndex = n, p());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -555,43 +555,21 @@ function $() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function N() {
|
|
|
|
function q() {
|
|
|
|
if (window.currentActiveIndex > 0) {
|
|
|
|
if (window.currentActiveIndex > 0) {
|
|
|
|
let r = -1;
|
|
|
|
let o = -1;
|
|
|
|
const e = [];
|
|
|
|
const e = [];
|
|
|
|
window.currentPageContainers.forEach((n, i) => {
|
|
|
|
window.currentPageContainers.forEach((i, n) => {
|
|
|
|
const o = n.getBoundingClientRect(), s = window.innerHeight, l = Math.max(o.top, 0), a = Math.min(o.bottom, s), c = Math.max(0, a - l), d = o.height;
|
|
|
|
const r = i.getBoundingClientRect(), s = window.innerHeight, l = Math.max(r.top, 0), a = Math.min(r.bottom, s), c = Math.max(0, a - l), d = r.height;
|
|
|
|
c / d >= 0.3 && e.push(i);
|
|
|
|
c / d >= 0.3 && e.push(n);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const t = Math.min(...e);
|
|
|
|
const t = Math.min(...e);
|
|
|
|
for (let n = t - 1; n >= 0; n--)
|
|
|
|
for (let i = t - 1; i >= 0; i--)
|
|
|
|
if (!e.includes(n)) {
|
|
|
|
if (!e.includes(i)) {
|
|
|
|
r = n;
|
|
|
|
o = i;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
r === -1 && t > 0 && (r = t - 1), r >= 0 && (window.currentActiveIndex = r, window.currentPageContainers[window.currentActiveIndex].scrollIntoView({
|
|
|
|
o === -1 && t > 0 && (o = t - 1), o >= 0 && (window.currentActiveIndex = o, window.currentPageContainers[window.currentActiveIndex].scrollIntoView({
|
|
|
|
behavior: "smooth",
|
|
|
|
|
|
|
|
block: "start"
|
|
|
|
|
|
|
|
}), setTimeout(() => {
|
|
|
|
|
|
|
|
p();
|
|
|
|
|
|
|
|
}, 100));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function q() {
|
|
|
|
|
|
|
|
if (window.currentActiveIndex < window.currentPageContainers.length - 1) {
|
|
|
|
|
|
|
|
let r = -1;
|
|
|
|
|
|
|
|
const e = [];
|
|
|
|
|
|
|
|
window.currentPageContainers.forEach((n, i) => {
|
|
|
|
|
|
|
|
const o = n.getBoundingClientRect(), s = window.innerHeight, l = Math.max(o.top, 0), a = Math.min(o.bottom, s), c = Math.max(0, a - l), d = o.height;
|
|
|
|
|
|
|
|
c / d >= 0.3 && e.push(i);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
const t = Math.max(...e);
|
|
|
|
|
|
|
|
for (let n = t + 1; n < window.currentPageContainers.length; n++)
|
|
|
|
|
|
|
|
if (!e.includes(n)) {
|
|
|
|
|
|
|
|
r = n;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
r === -1 && t < window.currentPageContainers.length - 1 && (r = t + 1), r >= 0 && r < window.currentPageContainers.length && (window.currentActiveIndex = r, window.currentPageContainers[window.currentActiveIndex].scrollIntoView({
|
|
|
|
|
|
|
|
behavior: "smooth",
|
|
|
|
behavior: "smooth",
|
|
|
|
block: "start"
|
|
|
|
block: "start"
|
|
|
|
}), setTimeout(() => {
|
|
|
|
}), setTimeout(() => {
|
|
|
|
@@ -600,7 +578,29 @@ function q() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function M() {
|
|
|
|
function M() {
|
|
|
|
if (S()) {
|
|
|
|
if (window.currentActiveIndex < window.currentPageContainers.length - 1) {
|
|
|
|
|
|
|
|
let o = -1;
|
|
|
|
|
|
|
|
const e = [];
|
|
|
|
|
|
|
|
window.currentPageContainers.forEach((i, n) => {
|
|
|
|
|
|
|
|
const r = i.getBoundingClientRect(), s = window.innerHeight, l = Math.max(r.top, 0), a = Math.min(r.bottom, s), c = Math.max(0, a - l), d = r.height;
|
|
|
|
|
|
|
|
c / d >= 0.3 && e.push(n);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
const t = Math.max(...e);
|
|
|
|
|
|
|
|
for (let i = t + 1; i < window.currentPageContainers.length; i++)
|
|
|
|
|
|
|
|
if (!e.includes(i)) {
|
|
|
|
|
|
|
|
o = i;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
o === -1 && t < window.currentPageContainers.length - 1 && (o = t + 1), o >= 0 && o < window.currentPageContainers.length && (window.currentActiveIndex = o, window.currentPageContainers[window.currentActiveIndex].scrollIntoView({
|
|
|
|
|
|
|
|
behavior: "smooth",
|
|
|
|
|
|
|
|
block: "start"
|
|
|
|
|
|
|
|
}), setTimeout(() => {
|
|
|
|
|
|
|
|
p();
|
|
|
|
|
|
|
|
}, 100));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function R() {
|
|
|
|
|
|
|
|
if (P()) {
|
|
|
|
const e = document.querySelector("#newspaper-content .newspaper-page-container");
|
|
|
|
const e = document.querySelector("#newspaper-content .newspaper-page-container");
|
|
|
|
e && e.scrollIntoView({
|
|
|
|
e && e.scrollIntoView({
|
|
|
|
behavior: "smooth",
|
|
|
|
behavior: "smooth",
|
|
|
|
@@ -614,13 +614,13 @@ function M() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function S() {
|
|
|
|
function P() {
|
|
|
|
const r = [];
|
|
|
|
const o = [];
|
|
|
|
window.currentPageContainers.forEach((e, t) => {
|
|
|
|
window.currentPageContainers.forEach((e, t) => {
|
|
|
|
const n = e.getBoundingClientRect(), i = window.innerHeight, o = Math.max(n.top, 0), s = Math.min(n.bottom, i), l = Math.max(0, s - o), a = n.height;
|
|
|
|
const i = e.getBoundingClientRect(), n = window.innerHeight, r = Math.max(i.top, 0), s = Math.min(i.bottom, n), l = Math.max(0, s - r), a = i.height;
|
|
|
|
l / a >= 0.3 && r.push(t);
|
|
|
|
l / a >= 0.3 && o.push(t);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
for (const e of r) {
|
|
|
|
for (const e of o) {
|
|
|
|
const t = window.currentPageContainers[e];
|
|
|
|
const t = window.currentPageContainers[e];
|
|
|
|
if (t && t.id && t.id.includes("beilage-"))
|
|
|
|
if (t && t.id && t.id.includes("beilage-"))
|
|
|
|
return !0;
|
|
|
|
return !0;
|
|
|
|
@@ -628,76 +628,76 @@ function S() {
|
|
|
|
return !1;
|
|
|
|
return !1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function p() {
|
|
|
|
function p() {
|
|
|
|
const r = document.getElementById("prevPageBtn"), e = document.getElementById("nextPageBtn"), t = document.getElementById("beilageBtn");
|
|
|
|
const o = document.getElementById("prevPageBtn"), e = document.getElementById("nextPageBtn"), t = document.getElementById("beilageBtn");
|
|
|
|
if (r && (window.currentActiveIndex <= 0 ? r.style.display = "none" : r.style.display = "flex"), e && (window.currentActiveIndex >= window.currentPageContainers.length - 1 ? e.style.display = "none" : e.style.display = "flex"), t) {
|
|
|
|
if (o && (window.currentActiveIndex <= 0 ? o.style.display = "none" : o.style.display = "flex"), e && (window.currentActiveIndex >= window.currentPageContainers.length - 1 ? e.style.display = "none" : e.style.display = "flex"), t) {
|
|
|
|
const n = S(), i = t.querySelector("i");
|
|
|
|
const i = P(), n = t.querySelector("i");
|
|
|
|
n ? (t.title = "Zur Hauptausgabe", t.className = "w-14 h-10 lg:w-16 lg:h-12 px-2 py-1 bg-gray-100 hover:bg-gray-200 text-gray-700 hover:text-gray-800 border border-gray-300 transition-colors duration-200 flex items-center justify-center cursor-pointer", i && (i.className = "ri-file-text-line text-lg lg:text-xl")) : (t.title = "Zu Beilage", t.className = "w-14 h-10 lg:w-16 lg:h-12 px-2 py-1 bg-amber-100 hover:bg-amber-200 text-amber-700 hover:text-amber-800 border border-amber-300 transition-colors duration-200 flex items-center justify-center cursor-pointer", i && (i.className = "ri-attachment-line text-lg lg:text-xl"));
|
|
|
|
i ? (t.title = "Zur Hauptausgabe", t.className = "w-14 h-10 lg:w-16 lg:h-12 px-2 py-1 bg-gray-100 hover:bg-gray-200 text-gray-700 hover:text-gray-800 border border-gray-300 transition-colors duration-200 flex items-center justify-center cursor-pointer", n && (n.className = "ri-file-text-line text-lg lg:text-xl")) : (t.title = "Zu Beilage", t.className = "w-14 h-10 lg:w-16 lg:h-12 px-2 py-1 bg-amber-100 hover:bg-amber-200 text-amber-700 hover:text-amber-800 border border-amber-300 transition-colors duration-200 flex items-center justify-center cursor-pointer", n && (n.className = "ri-attachment-line text-lg lg:text-xl"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function R() {
|
|
|
|
function z() {
|
|
|
|
const r = document.getElementById("shareLinkBtn");
|
|
|
|
const o = document.getElementById("shareLinkBtn");
|
|
|
|
let e = "";
|
|
|
|
let e = "";
|
|
|
|
if (window.currentActiveIndex !== void 0 && window.currentPageContainers && window.currentPageContainers[window.currentActiveIndex]) {
|
|
|
|
if (window.currentActiveIndex !== void 0 && window.currentPageContainers && window.currentPageContainers[window.currentActiveIndex]) {
|
|
|
|
const i = window.currentPageContainers[window.currentActiveIndex].querySelector("[data-page]");
|
|
|
|
const n = window.currentPageContainers[window.currentActiveIndex].querySelector("[data-page]");
|
|
|
|
i && (e = `/${i.getAttribute("data-page")}`);
|
|
|
|
n && (e = `/${n.getAttribute("data-page")}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const t = window.location.origin + window.location.pathname + e;
|
|
|
|
const t = window.location.origin + window.location.pathname + e;
|
|
|
|
navigator.share ? navigator.share({
|
|
|
|
navigator.share ? navigator.share({
|
|
|
|
title: document.title,
|
|
|
|
title: document.title,
|
|
|
|
url: t
|
|
|
|
url: t
|
|
|
|
}).catch((n) => {
|
|
|
|
}).catch((i) => {
|
|
|
|
w(t, r);
|
|
|
|
y(t, o);
|
|
|
|
}) : w(t, r);
|
|
|
|
}) : y(t, o);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function w(r, e) {
|
|
|
|
function y(o, e) {
|
|
|
|
if (navigator.clipboard)
|
|
|
|
if (navigator.clipboard)
|
|
|
|
navigator.clipboard.writeText(r).then(() => {
|
|
|
|
navigator.clipboard.writeText(o).then(() => {
|
|
|
|
u(e, "Link kopiert!");
|
|
|
|
g(e, "Link kopiert!");
|
|
|
|
}).catch((t) => {
|
|
|
|
}).catch((t) => {
|
|
|
|
u(e, "Kopieren fehlgeschlagen");
|
|
|
|
g(e, "Kopieren fehlgeschlagen");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
const t = document.createElement("textarea");
|
|
|
|
const t = document.createElement("textarea");
|
|
|
|
t.value = r, document.body.appendChild(t), t.select();
|
|
|
|
t.value = o, document.body.appendChild(t), t.select();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const n = document.execCommand("copy");
|
|
|
|
const i = document.execCommand("copy");
|
|
|
|
u(e, n ? "Link kopiert!" : "Kopieren fehlgeschlagen");
|
|
|
|
g(e, i ? "Link kopiert!" : "Kopieren fehlgeschlagen");
|
|
|
|
} catch {
|
|
|
|
} catch {
|
|
|
|
u(e, "Kopieren fehlgeschlagen");
|
|
|
|
g(e, "Kopieren fehlgeschlagen");
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
document.body.removeChild(t);
|
|
|
|
document.body.removeChild(t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function z() {
|
|
|
|
function V() {
|
|
|
|
const r = document.getElementById("citationBtn"), e = document.title || "KGPZ";
|
|
|
|
const o = document.getElementById("citationBtn"), e = document.title || "KGPZ";
|
|
|
|
let t = window.location.origin + window.location.pathname;
|
|
|
|
let t = window.location.origin + window.location.pathname;
|
|
|
|
t.includes("#") && (t = t.split("#")[0]);
|
|
|
|
t.includes("#") && (t = t.split("#")[0]);
|
|
|
|
const n = (/* @__PURE__ */ new Date()).toLocaleDateString("de-DE"), i = `Königsberger Gelehrte und Politische Zeitung (KGPZ). ${e}. Digital verfügbar unter: ${t} (Zugriff: ${n}).`;
|
|
|
|
const i = (/* @__PURE__ */ new Date()).toLocaleDateString("de-DE"), n = `Königsberger Gelehrte und Politische Zeitung (KGPZ). ${e}. Digital verfügbar unter: ${t} (Zugriff: ${i}).`;
|
|
|
|
if (navigator.clipboard)
|
|
|
|
if (navigator.clipboard)
|
|
|
|
navigator.clipboard.writeText(i).then(() => {
|
|
|
|
navigator.clipboard.writeText(n).then(() => {
|
|
|
|
u(r, "Zitation kopiert!");
|
|
|
|
g(o, "Zitation kopiert!");
|
|
|
|
}).catch((o) => {
|
|
|
|
}).catch((r) => {
|
|
|
|
u(r, "Kopieren fehlgeschlagen");
|
|
|
|
g(o, "Kopieren fehlgeschlagen");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
const o = document.createElement("textarea");
|
|
|
|
const r = document.createElement("textarea");
|
|
|
|
o.value = i, document.body.appendChild(o), o.select();
|
|
|
|
r.value = n, document.body.appendChild(r), r.select();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const s = document.execCommand("copy");
|
|
|
|
const s = document.execCommand("copy");
|
|
|
|
u(r, s ? "Zitation kopiert!" : "Kopieren fehlgeschlagen");
|
|
|
|
g(o, s ? "Zitation kopiert!" : "Kopieren fehlgeschlagen");
|
|
|
|
} catch {
|
|
|
|
} catch {
|
|
|
|
u(r, "Kopieren fehlgeschlagen");
|
|
|
|
g(o, "Kopieren fehlgeschlagen");
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
document.body.removeChild(o);
|
|
|
|
document.body.removeChild(r);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function u(r, e) {
|
|
|
|
function g(o, e) {
|
|
|
|
const t = document.querySelector(".simple-popup");
|
|
|
|
const t = document.querySelector(".simple-popup");
|
|
|
|
t && t.remove();
|
|
|
|
t && t.remove();
|
|
|
|
const n = document.createElement("div");
|
|
|
|
const i = document.createElement("div");
|
|
|
|
n.className = "simple-popup", n.textContent = e, n.style.cssText = `
|
|
|
|
i.className = "simple-popup", i.textContent = e, i.style.cssText = `
|
|
|
|
position: fixed;
|
|
|
|
position: fixed;
|
|
|
|
background: #374151;
|
|
|
|
background: #374151;
|
|
|
|
color: white;
|
|
|
|
color: white;
|
|
|
|
@@ -711,105 +711,105 @@ function u(r, e) {
|
|
|
|
transition: opacity 0.2s ease;
|
|
|
|
transition: opacity 0.2s ease;
|
|
|
|
white-space: nowrap;
|
|
|
|
white-space: nowrap;
|
|
|
|
`;
|
|
|
|
`;
|
|
|
|
const i = r.getBoundingClientRect(), o = window.innerHeight, s = window.innerWidth;
|
|
|
|
const n = o.getBoundingClientRect(), r = window.innerHeight, s = window.innerWidth;
|
|
|
|
let l = i.left - 10, a = i.bottom + 8;
|
|
|
|
let l = n.left - 10, a = n.bottom + 8;
|
|
|
|
const c = 120, d = 32;
|
|
|
|
const c = 120, d = 32;
|
|
|
|
l + c > s && (l = i.right - c + 10), a + d > o && (a = i.top - d - 8), n.style.left = Math.max(5, l) + "px", n.style.top = Math.max(5, a) + "px", document.body.appendChild(n), setTimeout(() => {
|
|
|
|
l + c > s && (l = n.right - c + 10), a + d > r && (a = n.top - d - 8), i.style.left = Math.max(5, l) + "px", i.style.top = Math.max(5, a) + "px", document.body.appendChild(i), setTimeout(() => {
|
|
|
|
n.style.opacity = "1";
|
|
|
|
i.style.opacity = "1";
|
|
|
|
}, 10), setTimeout(() => {
|
|
|
|
}, 10), setTimeout(() => {
|
|
|
|
n.style.opacity = "0", setTimeout(() => {
|
|
|
|
i.style.opacity = "0", setTimeout(() => {
|
|
|
|
n.parentNode && n.remove();
|
|
|
|
i.parentNode && i.remove();
|
|
|
|
}, 200);
|
|
|
|
}, 200);
|
|
|
|
}, 2e3);
|
|
|
|
}, 2e3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function V(r, e, t = !1) {
|
|
|
|
function O(o, e, t = !1) {
|
|
|
|
let n = "";
|
|
|
|
let i = "";
|
|
|
|
if (t)
|
|
|
|
if (t)
|
|
|
|
n = window.location.origin + window.location.pathname + `#beilage-1-page-${r}`;
|
|
|
|
i = window.location.origin + window.location.pathname + `#beilage-1-page-${o}`;
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
const o = window.location.pathname.split("/");
|
|
|
|
const r = window.location.pathname.split("/");
|
|
|
|
if (o.length >= 3) {
|
|
|
|
if (r.length >= 3) {
|
|
|
|
const s = o[1], l = o[2];
|
|
|
|
const s = r[1], l = r[2];
|
|
|
|
n = `${window.location.origin}/${s}/${l}/${r}`;
|
|
|
|
i = `${window.location.origin}/${s}/${l}/${o}`;
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
n = window.location.origin + window.location.pathname + `/${r}`;
|
|
|
|
i = window.location.origin + window.location.pathname + `/${o}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const i = n;
|
|
|
|
const n = i;
|
|
|
|
if (navigator.clipboard)
|
|
|
|
if (navigator.clipboard)
|
|
|
|
navigator.clipboard.writeText(i).then(() => {
|
|
|
|
navigator.clipboard.writeText(n).then(() => {
|
|
|
|
u(e, "Link kopiert!");
|
|
|
|
g(e, "Link kopiert!");
|
|
|
|
}).catch((o) => {
|
|
|
|
}).catch((r) => {
|
|
|
|
u(e, "Kopieren fehlgeschlagen");
|
|
|
|
g(e, "Kopieren fehlgeschlagen");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
const o = document.createElement("textarea");
|
|
|
|
const r = document.createElement("textarea");
|
|
|
|
o.value = i, document.body.appendChild(o), o.select();
|
|
|
|
r.value = n, document.body.appendChild(r), r.select();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const s = document.execCommand("copy");
|
|
|
|
const s = document.execCommand("copy");
|
|
|
|
u(e, s ? "Link kopiert!" : "Kopieren fehlgeschlagen");
|
|
|
|
g(e, s ? "Link kopiert!" : "Kopieren fehlgeschlagen");
|
|
|
|
} catch {
|
|
|
|
} catch {
|
|
|
|
u(e, "Kopieren fehlgeschlagen");
|
|
|
|
g(e, "Kopieren fehlgeschlagen");
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
document.body.removeChild(o);
|
|
|
|
document.body.removeChild(r);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function O(r, e) {
|
|
|
|
function D(o, e) {
|
|
|
|
const t = document.title || "KGPZ", n = window.location.pathname.split("/");
|
|
|
|
const t = document.title || "KGPZ", i = window.location.pathname.split("/");
|
|
|
|
let i;
|
|
|
|
let n;
|
|
|
|
if (n.length >= 3) {
|
|
|
|
if (i.length >= 3) {
|
|
|
|
const a = n[1], c = n[2];
|
|
|
|
const a = i[1], c = i[2];
|
|
|
|
i = `${window.location.origin}/${a}/${c}/${r}`;
|
|
|
|
n = `${window.location.origin}/${a}/${c}/${o}`;
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
i = `${window.location.origin}${window.location.pathname}/${r}`;
|
|
|
|
n = `${window.location.origin}${window.location.pathname}/${o}`;
|
|
|
|
const o = i, s = (/* @__PURE__ */ new Date()).toLocaleDateString("de-DE"), l = `Königsberger Gelehrte und Politische Zeitung (KGPZ). ${t}, Seite ${r}. Digital verfügbar unter: ${o} (Zugriff: ${s}).`;
|
|
|
|
const r = n, s = (/* @__PURE__ */ new Date()).toLocaleDateString("de-DE"), l = `Königsberger Gelehrte und Politische Zeitung (KGPZ). ${t}, Seite ${o}. Digital verfügbar unter: ${r} (Zugriff: ${s}).`;
|
|
|
|
if (navigator.clipboard)
|
|
|
|
if (navigator.clipboard)
|
|
|
|
navigator.clipboard.writeText(l).then(() => {
|
|
|
|
navigator.clipboard.writeText(l).then(() => {
|
|
|
|
u(e, "Zitation kopiert!");
|
|
|
|
g(e, "Zitation kopiert!");
|
|
|
|
}).catch((a) => {
|
|
|
|
}).catch((a) => {
|
|
|
|
u(e, "Kopieren fehlgeschlagen");
|
|
|
|
g(e, "Kopieren fehlgeschlagen");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
const a = document.createElement("textarea");
|
|
|
|
const a = document.createElement("textarea");
|
|
|
|
a.value = l, document.body.appendChild(a), a.select();
|
|
|
|
a.value = l, document.body.appendChild(a), a.select();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const c = document.execCommand("copy");
|
|
|
|
const c = document.execCommand("copy");
|
|
|
|
u(e, c ? "Zitation kopiert!" : "Kopieren fehlgeschlagen");
|
|
|
|
g(e, c ? "Zitation kopiert!" : "Kopieren fehlgeschlagen");
|
|
|
|
} catch {
|
|
|
|
} catch {
|
|
|
|
u(e, "Kopieren fehlgeschlagen");
|
|
|
|
g(e, "Kopieren fehlgeschlagen");
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
document.body.removeChild(a);
|
|
|
|
document.body.removeChild(a);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function y() {
|
|
|
|
function v() {
|
|
|
|
$(), window.addEventListener("scroll", function() {
|
|
|
|
N(), window.addEventListener("scroll", function() {
|
|
|
|
clearTimeout(window.scrollTimeout), window.scrollTimeout = setTimeout(() => {
|
|
|
|
clearTimeout(window.scrollTimeout), window.scrollTimeout = setTimeout(() => {
|
|
|
|
p();
|
|
|
|
p();
|
|
|
|
}, 50);
|
|
|
|
}, 50);
|
|
|
|
}), document.addEventListener("keydown", function(r) {
|
|
|
|
}), document.addEventListener("keydown", function(o) {
|
|
|
|
r.key === "Escape" && x();
|
|
|
|
o.key === "Escape" && S();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function f() {
|
|
|
|
function f() {
|
|
|
|
const r = window.location.pathname;
|
|
|
|
const o = window.location.pathname;
|
|
|
|
document.querySelectorAll(".citation-link[data-citation-url]").forEach((t) => {
|
|
|
|
document.querySelectorAll(".citation-link[data-citation-url]").forEach((t) => {
|
|
|
|
const n = t.getAttribute("data-citation-url");
|
|
|
|
const i = t.getAttribute("data-citation-url");
|
|
|
|
let i = !1;
|
|
|
|
let n = !1;
|
|
|
|
if (n === r)
|
|
|
|
if (i === o)
|
|
|
|
i = !0;
|
|
|
|
n = !0;
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
const o = r.match(/^\/(\d{4})\/(\d+)(?:\/(\d+))?$/), s = n.match(/^\/(\d{4})\/(\d+)$/);
|
|
|
|
const r = o.match(/^\/(\d{4})\/(\d+)(?:\/(\d+))?$/), s = i.match(/^\/(\d{4})\/(\d+)$/);
|
|
|
|
if (o && s) {
|
|
|
|
if (r && s) {
|
|
|
|
const [, l, a, c] = o, [, d, g] = s;
|
|
|
|
const [, l, a, c] = r, [, d, u] = s;
|
|
|
|
l === d && a === g && (i = !0);
|
|
|
|
l === d && a === u && (n = !0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
i ? (t.classList.add("text-red-700", "pointer-events-none"), t.setAttribute("aria-current", "page")) : (t.classList.remove("text-red-700", "pointer-events-none"), t.removeAttribute("aria-current"));
|
|
|
|
n ? (t.classList.add("text-red-700", "pointer-events-none"), t.setAttribute("aria-current", "page")) : (t.classList.remove("text-red-700", "pointer-events-none"), t.removeAttribute("aria-current"));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function v() {
|
|
|
|
function x() {
|
|
|
|
const r = window.location.pathname, e = document.body;
|
|
|
|
const o = window.location.pathname, e = document.body;
|
|
|
|
e.classList.remove(
|
|
|
|
e.classList.remove(
|
|
|
|
"page-akteure",
|
|
|
|
"page-akteure",
|
|
|
|
"page-ausgabe",
|
|
|
|
"page-ausgabe",
|
|
|
|
@@ -818,27 +818,41 @@ function v() {
|
|
|
|
"page-kategorie",
|
|
|
|
"page-kategorie",
|
|
|
|
"page-piece",
|
|
|
|
"page-piece",
|
|
|
|
"page-edition"
|
|
|
|
"page-edition"
|
|
|
|
), r.includes("/akteure/") || r.includes("/autoren") ? e.classList.add("page-akteure") : r.match(/\/\d{4}\/\d+/) ? e.classList.add("page-ausgabe") : r.includes("/search") || r.includes("/suche") ? e.classList.add("page-search") : r.includes("/ort/") ? e.classList.add("page-ort") : r.includes("/kategorie/") ? e.classList.add("page-kategorie") : r.includes("/beitrag/") ? e.classList.add("page-piece") : r.includes("/edition") && e.classList.add("page-edition");
|
|
|
|
), o.includes("/akteure/") || o.includes("/autoren") ? e.classList.add("page-akteure") : o.match(/\/\d{4}\/\d+/) ? e.classList.add("page-ausgabe") : o.includes("/search") || o.includes("/suche") ? e.classList.add("page-search") : o.includes("/ort/") ? e.classList.add("page-ort") : o.includes("/kategorie/") ? e.classList.add("page-kategorie") : o.includes("/beitrag/") ? e.classList.add("page-piece") : o.includes("/edition") && e.classList.add("page-edition");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
window.enlargePage = A;
|
|
|
|
let m = [];
|
|
|
|
window.closeModal = x;
|
|
|
|
window.ExecuteNextSettle = function(o) {
|
|
|
|
window.scrollToPreviousPage = N;
|
|
|
|
typeof o == "function" && m.push(o);
|
|
|
|
window.scrollToNextPage = q;
|
|
|
|
};
|
|
|
|
window.scrollToBeilage = M;
|
|
|
|
|
|
|
|
window.shareCurrentPage = R;
|
|
|
|
|
|
|
|
window.generateCitation = z;
|
|
|
|
|
|
|
|
window.copyPagePermalink = V;
|
|
|
|
|
|
|
|
window.generatePageCitation = O;
|
|
|
|
|
|
|
|
function K() {
|
|
|
|
function K() {
|
|
|
|
v(), f(), document.querySelector(".newspaper-page-container") && y();
|
|
|
|
for (; m.length > 0; ) {
|
|
|
|
let r = function(t) {
|
|
|
|
const o = m.shift();
|
|
|
|
v(), f(), setTimeout(() => {
|
|
|
|
try {
|
|
|
|
document.querySelector(".newspaper-page-container") && y();
|
|
|
|
o();
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
console.error("Error executing settle queue function:", e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
window.enlargePage = $;
|
|
|
|
|
|
|
|
window.closeModal = S;
|
|
|
|
|
|
|
|
window.scrollToPreviousPage = q;
|
|
|
|
|
|
|
|
window.scrollToNextPage = M;
|
|
|
|
|
|
|
|
window.scrollToBeilage = R;
|
|
|
|
|
|
|
|
window.shareCurrentPage = z;
|
|
|
|
|
|
|
|
window.generateCitation = V;
|
|
|
|
|
|
|
|
window.copyPagePermalink = O;
|
|
|
|
|
|
|
|
window.generatePageCitation = D;
|
|
|
|
|
|
|
|
function W() {
|
|
|
|
|
|
|
|
x(), f(), document.querySelector(".newspaper-page-container") && v();
|
|
|
|
|
|
|
|
let o = function(t) {
|
|
|
|
|
|
|
|
x(), f(), K(), setTimeout(() => {
|
|
|
|
|
|
|
|
document.querySelector(".newspaper-page-container") && v();
|
|
|
|
}, 50);
|
|
|
|
}, 50);
|
|
|
|
}, e = function(t) {
|
|
|
|
}, e = function(t) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
document.body.addEventListener("htmx:afterSettle", r), document.body.addEventListener("htmx:afterSettle", f), document.body.addEventListener("htmx:beforeRequest", e);
|
|
|
|
document.body.addEventListener("htmx:afterSettle", o), document.body.addEventListener("htmx:afterSettle", f), document.body.addEventListener("htmx:beforeRequest", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export {
|
|
|
|
export {
|
|
|
|
K as setup
|
|
|
|
W as setup
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|