mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-28 16:55:32 +00:00
Merge branch 'main' of github.com:Theodor-Springmann-Stiftung/musenalm into main
This commit is contained in:
4
views/.gitignore
vendored
4
views/.gitignore
vendored
@@ -22,7 +22,3 @@ dist-ssr
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
|
||||
# For now
|
||||
assets
|
||||
|
||||
Binary file not shown.
BIN
views/assets/Lesekabinett/anonymus.pdf
Normal file
BIN
views/assets/Lesekabinett/anonymus.pdf
Normal file
Binary file not shown.
39
views/assets/Lesekabinett/beschreibungen.txt
Normal file
39
views/assets/Lesekabinett/beschreibungen.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
Joseph Franz von Ratschky: Vorbericht. in: Wiener Musenalmanach. 1779, S. 3-6.
|
||||
ratschky_in_wiener_1779.pdf
|
||||
|
||||
Gottfried August Bürger: Nothgedrungene Nachrede. in: Göttinger Musenalmanach. 1782, S. 184-192.
|
||||
buerger_in_goettinger_1782.pdf
|
||||
|
||||
Christian Cay Lorenz Hirschfeld: An die Leser. in: Gartenkalender. 1783, S. 272.
|
||||
hirschfeld_in_gartenkalender_1783.pdf
|
||||
|
||||
Johann Heinrich Voß: Ankündigung. in: Hamburger Musenalmanach. 1784, S. 222ff.
|
||||
voss_in_hamburger_1784.pdf
|
||||
|
||||
Gotthold Friedrich Stäudlin: Nachrede. in: Schwäbischer Musenalmanach. 1786 [o. S.].
|
||||
staeudlin_in_schwaebischer_1786.pdf
|
||||
|
||||
Gottfried August Bürger: Fürbitte eines ans peinliche Kreuz der Verlegenheit genagelten Herausgebers eines Musenalmanachs. in: Göttinger Musenalmanach. 1789, S. 104.
|
||||
buerger_in_goettinger_1789.pdf
|
||||
|
||||
Anonymus: Die deutschen Almanache. in: Bibliothek der redenden und bildenden Künste. Zweyten Bandes erstes Stück. Leipzig, in der Dyckischen Buchhandlung, 1806, S. 207-217.
|
||||
anonymus.pdf
|
||||
|
||||
Stephan Schütze: Die Neujahrsversammlung. Ein dramatischer Prolog. in: Taschenbuch der Liebe und Freundschaft gewidmet. 1813, S. 1-20.
|
||||
schuetze_in_taschenbuch_1813.pdf
|
||||
|
||||
N. B. E.: Die deutschen Taschenbücher für 1820. in: Hermes oder kritisches Jahrbuch der Literatur. Zweites Stück für das Jahr 1820. Amsterdam, in der Verlags-Expedition des Hermes, S. 191-235.
|
||||
nbe_in_hermes_1820.pdf
|
||||
|
||||
Ferdinand Johannes Wit: Die Almanachomanie. in: Politisches Taschenbuch. 1831, S. 102-111.
|
||||
wit_in_politaschenbuch_1831.pdf
|
||||
|
||||
August Wilhelm Schlegel: Recept. in: Deutscher Musenalmanach (Chamisso, Schwab, Gaudy). 1836, S. 18.
|
||||
schlegel_in_deutscher_1836.pdf
|
||||
|
||||
Robert Eduard Prutz: Die Musenalmanache und Taschenbücher in Deutschland. in: Neue Schriften. Zur deutschen Literatur- und Kulturgeschichte. Erster Band, Halle, G. Schwetschke'scher Verlag, 1854, S. 105-165.
|
||||
prutz_in_musenalmanache.pdf
|
||||
|
||||
Anonymus: Woher das Wort Almanach komme. in: Neues Wochenblatt zum Nuzzen und zur Unterhaltung für Kinder und junge Leute. Erstes Bändchen, erstes Stück, Leipzig, in der Sommerschen Buchhandlung 1794, S. 8f.
|
||||
allatroia_anonymus_wochenblatt_1794.pdf
|
||||
Allatroia
|
||||
BIN
views/assets/Lesekabinett/buerger_in_goettinger_1782.pdf
Normal file
BIN
views/assets/Lesekabinett/buerger_in_goettinger_1782.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/buerger_in_goettinger_1789.pdf
Normal file
BIN
views/assets/Lesekabinett/buerger_in_goettinger_1789.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/hirschfeld_in_gartenkalender_1783.pdf
Normal file
BIN
views/assets/Lesekabinett/hirschfeld_in_gartenkalender_1783.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/nbe_in_hermes_1820.pdf
Normal file
BIN
views/assets/Lesekabinett/nbe_in_hermes_1820.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/prutz_in_musenalmanache_1854.pdf
Normal file
BIN
views/assets/Lesekabinett/prutz_in_musenalmanache_1854.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/ratschky_in_wiener_1779.pdf
Normal file
BIN
views/assets/Lesekabinett/ratschky_in_wiener_1779.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/schlegel_in_deutscher_1836.pdf
Normal file
BIN
views/assets/Lesekabinett/schlegel_in_deutscher_1836.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/schuetze_in_taschenbuch_1813.pdf
Normal file
BIN
views/assets/Lesekabinett/schuetze_in_taschenbuch_1813.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/staeudlin_in_schwaebischer_1786.pdf
Normal file
BIN
views/assets/Lesekabinett/staeudlin_in_schwaebischer_1786.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/voss_in_hamburger_1784.pdf
Normal file
BIN
views/assets/Lesekabinett/voss_in_hamburger_1784.pdf
Normal file
Binary file not shown.
BIN
views/assets/Lesekabinett/wit_in_politaschenbuch_1831.pdf
Normal file
BIN
views/assets/Lesekabinett/wit_in_politaschenbuch_1831.pdf
Normal file
Binary file not shown.
BIN
views/assets/fonts/Spectral-Regular.ttf
Normal file
BIN
views/assets/fonts/Spectral-Regular.ttf
Normal file
Binary file not shown.
BIN
views/assets/hintergrund.webp
Normal file
BIN
views/assets/hintergrund.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
BIN
views/assets/hintergrund_lower.webp
Normal file
BIN
views/assets/hintergrund_lower.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 749 KiB |
BIN
views/assets/hintergrund_rename.png
Normal file
BIN
views/assets/hintergrund_rename.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.3 MiB |
BIN
views/assets/musen.png
Normal file
BIN
views/assets/musen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 249 KiB |
758
views/assets/scripts.js
Normal file
758
views/assets/scripts.js
Normal file
@@ -0,0 +1,758 @@
|
||||
var x = (r) => {
|
||||
throw TypeError(r);
|
||||
};
|
||||
var _ = (r, t, e) => t.has(r) || x("Cannot " + e);
|
||||
var c = (r, t, e) => (_(r, t, "read from private field"), e ? e.call(r) : t.get(r)), n = (r, t, e) => t.has(r) ? x("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), u = (r, t, e, i) => (_(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e), g = (r, t, e) => (_(r, t, "access private method"), e);
|
||||
const S = "script[xslt-onload]", w = "xslt-template", k = "xslt-transformed", M = "filter-list", m = "filter-list-list", C = "filter-list-item", I = "filter-list-input", y = "filter-list-searchable", B = "scroll-button", q = "tool-tip", P = "abbrev-tooltips", R = "int-link", H = "popup-image", $ = "tab-list", N = "filter-pill", F = "image-reel";
|
||||
var d, b, E;
|
||||
class V {
|
||||
constructor() {
|
||||
n(this, b);
|
||||
n(this, d);
|
||||
u(this, d, /* @__PURE__ */ new Map());
|
||||
}
|
||||
setup() {
|
||||
let t = htmx.findAll(S);
|
||||
for (let e of t)
|
||||
g(this, b, E).call(this, e);
|
||||
}
|
||||
hookupHTMX() {
|
||||
htmx.on("htmx:load", (t) => {
|
||||
this.setup();
|
||||
});
|
||||
}
|
||||
}
|
||||
d = new WeakMap(), b = new WeakSet(), E = function(t) {
|
||||
if (t.getAttribute(k) === "true" || !t.hasAttribute(w))
|
||||
return;
|
||||
let e = "#" + t.getAttribute(w), i = c(this, d).get(e);
|
||||
if (!i) {
|
||||
let h = htmx.find(e);
|
||||
if (h) {
|
||||
let A = h.innerHTML ? new DOMParser().parseFromString(h.innerHTML, "application/xml") : h.contentDocument;
|
||||
i = new XSLTProcessor(), i.importStylesheet(A), c(this, d).set(e, i);
|
||||
} else
|
||||
throw new Error("Unknown XSLT template: " + e);
|
||||
}
|
||||
let s = new DOMParser().parseFromString(t.innerHTML, "application/xml"), a = i.transformToFragment(s, document), l = new XMLSerializer().serializeToString(a);
|
||||
t.outerHTML = l;
|
||||
};
|
||||
class O extends HTMLElement {
|
||||
constructor() {
|
||||
super(), this._value = "", this.render();
|
||||
}
|
||||
static get observedAttributes() {
|
||||
return ["data-text", "data-queryparam", "data-value"];
|
||||
}
|
||||
set value(t) {
|
||||
this.setAttribute("data-value", t);
|
||||
}
|
||||
get value() {
|
||||
return this.getAttribute("data-value") || "";
|
||||
}
|
||||
set text(t) {
|
||||
this.setAttribute("data-text", t);
|
||||
}
|
||||
get text() {
|
||||
return this.getAttribute("data-text") || "";
|
||||
}
|
||||
set queryparam(t) {
|
||||
this.setAttribute("data-queryparam", t);
|
||||
}
|
||||
get queryparam() {
|
||||
return this.getAttribute("data-queryparam") || "";
|
||||
}
|
||||
connectedCallback() {
|
||||
this._filter = this.text, this._queryparam = this.queryparam, this.render(), htmx.process(this);
|
||||
}
|
||||
attributeChangedCallback(t, e, i) {
|
||||
e !== i && (t === "data-text" && (this._filter = i), t === "data-queryparam" && (this._queryparam = i), t === "data-value" && (this._value = i), this.render());
|
||||
}
|
||||
getURL() {
|
||||
if (this._queryparam) {
|
||||
let t = new URL(window.location), e = new URLSearchParams(t.search);
|
||||
return e.delete(this._queryparam), e.delete("page"), t.search = e.toString(), t.toString();
|
||||
}
|
||||
return "#";
|
||||
}
|
||||
render() {
|
||||
this.innerHTML = `
|
||||
<a href="${this.getURL()}" class="!no-underline block text-base" hx-target="#searchresults" hx-select="#searchresults" hx-swap="outerHTML show:window:top">
|
||||
<div class="flex flex-row filter-pill rounded-lg bg-orange-100 hover:saturate-50 px-2.5">
|
||||
${this.renderIcon()}
|
||||
<div class="flex flex-row filter-pill-label-value !items-baseline text-slate-700">
|
||||
<div class="filter-pill-label font-bold mr-1.5 align-baseline">${this.text}</div>
|
||||
${this.renderValue()}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
renderIcon() {
|
||||
return this.value === "true" || this.value === "false" ? `
|
||||
<div href="${this.getURL()}" class="filter-pill-close no-underline font-bold mr-1 text-orange-900 hover:text-orange-800">
|
||||
<i class="ri-close-circle-line"></i>
|
||||
</div>
|
||||
` : `<div
|
||||
href="${this.getURL()}"
|
||||
class="filter-pill-close no-underline font-bold mr-1 text-orange-900 hover:text-orange-800">
|
||||
<i class="ri-arrow-left-s-line"></i>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
renderValue() {
|
||||
return this.value === "true" || this.value === "false" ? "" : `
|
||||
<div class="filter-pill-value">${this.value}</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
var o, T, f, L;
|
||||
class U extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
n(this, f);
|
||||
n(this, o, !1);
|
||||
n(this, T, "");
|
||||
this._items = [], this._url = "", this._filterstart = !1, this._placeholder = "Liste filtern...", this._queryparam = "", this._startparams = null, this.render();
|
||||
}
|
||||
static get observedAttributes() {
|
||||
return ["data-url"];
|
||||
}
|
||||
set items(e) {
|
||||
Array.isArray(e) && (this._items = e, this.render()), htmx && htmx.process(this);
|
||||
}
|
||||
get items() {
|
||||
return this._items;
|
||||
}
|
||||
connectedCallback() {
|
||||
this._url = this.getAttribute("data-url") || "./", this._filterstart = this.getAttribute("data-filterstart") === "true", this._placeholder = this.getAttribute("data-placeholder") || "Liste filtern...", this._queryparam = this.getAttribute("data-queryparam") || "", this._queryparam, this._filterstart && u(this, o, !0), this.addEventListener("input", this.onInput.bind(this)), this.addEventListener("keydown", this.onEnter.bind(this)), this.addEventListener("focusin", this.onGainFocus.bind(this)), this.addEventListener("focusout", this.onLoseFocus.bind(this));
|
||||
}
|
||||
attributeChangedCallback(e, i, s) {
|
||||
e === "data-url" && i !== s && (this._url = s, this.render()), e === "data-filterstart" && i !== s && (this._filterstart = s === "true", this.render()), e === "data-placeholder" && i !== s && (this._placeholder = s, this.render()), e === "data-queryparam" && i !== s && (this._queryparam = s, this.render());
|
||||
}
|
||||
onInput(e) {
|
||||
e.target && e.target.tagName.toLowerCase() === "input" && (this._filter = e.target.value, this.renderList());
|
||||
}
|
||||
onGainFocus(e) {
|
||||
e.target && e.target.tagName.toLowerCase() === "input" && (u(this, o, !1), this.renderList());
|
||||
}
|
||||
onLoseFocus(e) {
|
||||
let i = this.querySelector("input");
|
||||
if (e.target && e.target === i) {
|
||||
if (relatedElement = e.relatedTarget, relatedElement && this.contains(relatedElement))
|
||||
return;
|
||||
i.value = "", this._filter = "", this._filterstart && u(this, o, !0), this.renderList();
|
||||
}
|
||||
}
|
||||
onEnter(e) {
|
||||
if (e.target && e.target.tagName.toLowerCase() === "input" && e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
const i = this.querySelector("a");
|
||||
i && i.click();
|
||||
}
|
||||
}
|
||||
mark() {
|
||||
if (typeof Mark != "function")
|
||||
return;
|
||||
let e = this.querySelector("#" + m);
|
||||
if (!e)
|
||||
return;
|
||||
let i = new Mark(e.querySelectorAll("." + y));
|
||||
this._filter && i.mark(this._filter, {
|
||||
separateWordSearch: !0
|
||||
});
|
||||
}
|
||||
// INFO: allows for setting a custom HREF of the list item
|
||||
// The function takes the item as parameter fn(item) and should return a string.
|
||||
setHREFFunc(e) {
|
||||
this.getHREF = e, this.render();
|
||||
}
|
||||
// INFO: allows for setting a custom link text of the list item
|
||||
// The function takes the item as parameter fn(item) and should return a string or
|
||||
// an HTML template literal.
|
||||
setLinkTextFunc(e) {
|
||||
this.getLinkText = e, this.render();
|
||||
}
|
||||
// INFO: allows for setting the text that will be filtered for.
|
||||
// The function takes the item as parameter fn(item) and should return a string.
|
||||
setSearchTextFunc(e) {
|
||||
this.getSearchText = e, this.render();
|
||||
}
|
||||
getHREF(e) {
|
||||
if (e) {
|
||||
if (!e.id)
|
||||
return "";
|
||||
} else return "";
|
||||
return e.id;
|
||||
}
|
||||
getHREFEncoded(e) {
|
||||
return encodeURIComponent(this.getHREF(e));
|
||||
}
|
||||
getSearchText(e) {
|
||||
if (e) {
|
||||
if (!e.name)
|
||||
return "";
|
||||
} else return "";
|
||||
return e.name;
|
||||
}
|
||||
getLinkText(e) {
|
||||
let i = this.getSearchText(e);
|
||||
return i === "" ? "" : `<span class="${y}">${i}</span>`;
|
||||
}
|
||||
getURL(e) {
|
||||
if (this._queryparam) {
|
||||
let i = new URL(window.location), s = new URLSearchParams(i.search);
|
||||
return s.set(this._queryparam, this.getHREF(e)), s.delete("page"), i.search = s.toString(), i.toString();
|
||||
}
|
||||
return this._url + this.getHREFEncoded(e);
|
||||
}
|
||||
renderList() {
|
||||
let e = this.querySelector("#" + m);
|
||||
e && (e.outerHTML = this.List()), this.mark();
|
||||
}
|
||||
render() {
|
||||
this.innerHTML = `
|
||||
<div class="font-serif text-base shadow-inner border border-stone-100">
|
||||
${this.Input()}
|
||||
${this.List()}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
ActiveDot(e) {
|
||||
return g(this, f, L).call(this, e), "";
|
||||
}
|
||||
NoItems(e) {
|
||||
return e.length === 0 ? '<div class="px-2 py-0.5 italic text-gray-500">Keine Einträge gefunden</div>' : "";
|
||||
}
|
||||
Input() {
|
||||
return `
|
||||
<div class="flex w-full py-0.5 border-b border-zinc-600 bg-stone-50">
|
||||
<i class="ri-arrow-right-s-line pl-2"></i>
|
||||
<div class="grow">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="${this._placeholder}"
|
||||
class="${I} w-full placeholder:italic px-2 py-0.5" />
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
List() {
|
||||
let e = this._items;
|
||||
if (this._filter)
|
||||
if (this._filterstart)
|
||||
e = this._items.filter((i) => this.getSearchText(i).toLowerCase().startsWith(this._filter.toLowerCase()));
|
||||
else {
|
||||
let i = this._filter.split(" ");
|
||||
e = this._items.filter((s) => i.every((a) => this.getSearchText(s).toLowerCase().includes(a.toLowerCase())));
|
||||
}
|
||||
return `
|
||||
<div id="${m}" class="${m} pt-1 max-h-60 overflow-auto bg-stone-50 ${c(this, o) ? "hidden" : ""}">
|
||||
${e.map(
|
||||
(i, s) => `
|
||||
<a
|
||||
href="${this.getURL(i)}"
|
||||
class="${C} block px-2.5 py-0.5 hover:bg-slate-200 no-underline ${s % 2 === 0 ? "bg-stone-100" : "bg-stone-50"}"
|
||||
${g(this, f, L).call(this, i) ? 'aria-current="page"' : ""}>
|
||||
${this.ActiveDot(i)}
|
||||
${this.getLinkText(i)}
|
||||
</a>
|
||||
`
|
||||
).join("")}
|
||||
${this.NoItems(e)}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
o = new WeakMap(), T = new WeakMap(), f = new WeakSet(), L = function(e) {
|
||||
if (!e)
|
||||
return !1;
|
||||
let i = this.getHREF(e);
|
||||
return i === "" ? !1 : this._queryparam && (new URLSearchParams(window.location.search).get(this._queryparam) || "") === i ? !0 : !!window.location.href.endsWith(i);
|
||||
};
|
||||
class D extends HTMLElement {
|
||||
constructor() {
|
||||
super(), this.handleScroll = this.handleScroll.bind(this), this.scrollToTop = this.scrollToTop.bind(this);
|
||||
}
|
||||
connectedCallback() {
|
||||
this.innerHTML = `
|
||||
<button
|
||||
class="
|
||||
scroll-to-top
|
||||
fixed bottom-5 right-5
|
||||
hidden
|
||||
bg-gray-800 text-white
|
||||
p-2
|
||||
rounded-md
|
||||
cursor-pointer
|
||||
text-2xl
|
||||
hover:opacity-80
|
||||
transition-opacity
|
||||
border-0
|
||||
"
|
||||
aria-label="Scroll to top"
|
||||
>
|
||||
<i class="ri-arrow-up-double-line"></i>
|
||||
</button>
|
||||
`, this._button = this.querySelector(".scroll-to-top"), window.addEventListener("scroll", this.handleScroll), this._button.addEventListener("click", this.scrollToTop);
|
||||
}
|
||||
disconnectedCallback() {
|
||||
window.removeEventListener("scroll", this.handleScroll), this._button.removeEventListener("click", this.scrollToTop);
|
||||
}
|
||||
handleScroll() {
|
||||
(window.scrollY || document.documentElement.scrollTop) > 300 ? this._button.classList.remove("hidden") : this._button.classList.add("hidden");
|
||||
}
|
||||
scrollToTop() {
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
}
|
||||
}
|
||||
class z extends HTMLElement {
|
||||
static get observedAttributes() {
|
||||
return ["position", "timeout"];
|
||||
}
|
||||
constructor() {
|
||||
super(), this._tooltipBox = null, this._timeout = 200, this._hideTimeout = null, this._hiddenTimeout = null;
|
||||
}
|
||||
connectedCallback() {
|
||||
this.classList.add(
|
||||
"w-full",
|
||||
"h-full",
|
||||
"relative",
|
||||
"block",
|
||||
"leading-none",
|
||||
"[&>*]:leading-normal"
|
||||
);
|
||||
const t = this.querySelector(".data-tip"), e = t ? t.innerHTML : "Tooltip";
|
||||
t && t.remove(), this._tooltipBox = document.createElement("div"), this._tooltipBox.innerHTML = e, this._tooltipBox.className = [
|
||||
"opacity-0",
|
||||
"hidden",
|
||||
"absolute",
|
||||
"px-2",
|
||||
"py-1",
|
||||
"text-sm",
|
||||
"text-white",
|
||||
"bg-gray-900",
|
||||
"rounded",
|
||||
"shadow",
|
||||
"z-10",
|
||||
"whitespace-nowrap",
|
||||
"transition-all",
|
||||
"duration-200",
|
||||
"font-sans"
|
||||
].join(" "), this.appendChild(this._tooltipBox), this._updatePosition(), this.addEventListener("mouseenter", () => this._showTooltip()), this.addEventListener("mouseleave", () => this._hideTooltip());
|
||||
}
|
||||
attributeChangedCallback(t, e, i) {
|
||||
t === "position" && this._tooltipBox && this._updatePosition(), t === "timeout" && i && (this._timeout = parseInt(i) || 200);
|
||||
}
|
||||
_showTooltip() {
|
||||
clearTimeout(this._hideTimeout), clearTimeout(this._hiddenTimeout), this._tooltipBox.classList.remove("hidden"), setTimeout(() => {
|
||||
this._tooltipBox.classList.remove("opacity-0"), this._tooltipBox.classList.add("opacity-100");
|
||||
}, 16);
|
||||
}
|
||||
_hideTooltip() {
|
||||
this._hideTimeout = setTimeout(() => {
|
||||
this._tooltipBox.classList.remove("opacity-100"), this._tooltipBox.classList.add("opacity-0"), this._hiddenTimeout = setTimeout(() => {
|
||||
this._tooltipBox.classList.add("hidden");
|
||||
}, this._timeout + 100);
|
||||
}, this._timeout);
|
||||
}
|
||||
_updatePosition() {
|
||||
switch (this._tooltipBox.classList.remove(
|
||||
"bottom-full",
|
||||
"left-1/2",
|
||||
"-translate-x-1/2",
|
||||
"mb-2",
|
||||
// top
|
||||
"top-full",
|
||||
"mt-2",
|
||||
// bottom
|
||||
"right-full",
|
||||
"-translate-y-1/2",
|
||||
"mr-2",
|
||||
"top-1/2",
|
||||
// left
|
||||
"left-full",
|
||||
"ml-2"
|
||||
// right
|
||||
), this.getAttribute("position") || "top") {
|
||||
case "bottom":
|
||||
this._tooltipBox.classList.add(
|
||||
"top-full",
|
||||
"left-1/2",
|
||||
"transform",
|
||||
"-translate-x-1/2",
|
||||
"mt-0.5"
|
||||
);
|
||||
break;
|
||||
case "left":
|
||||
this._tooltipBox.classList.add(
|
||||
"right-full",
|
||||
"top-1/2",
|
||||
"transform",
|
||||
"-translate-y-1/2",
|
||||
"mr-0.5"
|
||||
);
|
||||
break;
|
||||
case "right":
|
||||
this._tooltipBox.classList.add(
|
||||
"left-full",
|
||||
"top-1/2",
|
||||
"transform",
|
||||
"-translate-y-1/2",
|
||||
"ml-0.5"
|
||||
);
|
||||
break;
|
||||
case "top":
|
||||
default:
|
||||
this._tooltipBox.classList.add(
|
||||
"bottom-full",
|
||||
"left-1/2",
|
||||
"transform",
|
||||
"-translate-x-1/2",
|
||||
"mb-0.5"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
class G extends HTMLElement {
|
||||
constructor() {
|
||||
super(), this.overlay = null, this._preview = null, this._description = null, this._imageURL = "", this._hideDLButton = !1;
|
||||
}
|
||||
connectedCallback() {
|
||||
this.classList.add("cursor-pointer"), this.classList.add("select-none"), this._imageURL = this.getAttribute("data-image-url") || "", this._hideDLButton = this.getAttribute("data-hide-dl-button") || !1, this._preview = this.querySelector("img"), this._description = this.querySelector(".image-description"), this._preview && this._preview.addEventListener("click", () => {
|
||||
this.showOverlay();
|
||||
});
|
||||
}
|
||||
disconnectedCallback() {
|
||||
this.overlay && this.overlay.parentNode && this.overlay.parentNode.removeChild(this.overlay);
|
||||
}
|
||||
showOverlay() {
|
||||
this.overlay = document.createElement("div"), this.overlay.classList.add(
|
||||
"fixed",
|
||||
"inset-0",
|
||||
"z-50",
|
||||
"bg-black/70",
|
||||
"flex",
|
||||
"items-center",
|
||||
"justify-center",
|
||||
"p-4"
|
||||
), this.overlay.innerHTML = `
|
||||
<div class="relative w-max max-w-dvw max-h-dvh shadow-lg flex flex-col items-center justify-center gap-4">
|
||||
<div>
|
||||
<div class="absolute -right-16 text-white text-4xl flex flex-col">
|
||||
<button class="hover:text-gray-300 cursor-pointer focus:outline-none" aria-label="Close popup">
|
||||
<i class="ri-close-fill text-4xl"></i>
|
||||
</button>
|
||||
${this.downloadButton()}
|
||||
</div>
|
||||
<img
|
||||
src="${this._imageURL}"
|
||||
alt="Popup Image"
|
||||
class="full max-h-[80vh] max-w-[80vw] object-contain block relative ${this.descriptionImgClass()}"
|
||||
/>
|
||||
${this.description()}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
const t = this.overlay.querySelector("button");
|
||||
t && t.addEventListener("click", () => {
|
||||
this.hideOverlay();
|
||||
}), this.overlay.addEventListener("click", (e) => {
|
||||
e.target === this.overlay && this.hideOverlay();
|
||||
}), document.body.appendChild(this.overlay);
|
||||
}
|
||||
descriptionImgClass() {
|
||||
return this.description ? "" : "0";
|
||||
}
|
||||
description() {
|
||||
return this._description ? `
|
||||
<div class="font-serif text-left description-content mt-3 text-slate-900 ">
|
||||
<div class="max-w-[80ch] hyphens-auto px-6 py-2 bg-stone-50 shadow-lg">
|
||||
${this._description.innerHTML}
|
||||
</div>
|
||||
</div>
|
||||
` : "";
|
||||
}
|
||||
downloadButton() {
|
||||
return this._hideDLButton ? "" : `
|
||||
<tool-tip position="right">
|
||||
<a href="${this._imageURL}" target="_blank" class="text-white no-underline hover:text-gray-300"><i class="ri-file-download-line"></i></a>
|
||||
<div class="data-tip">Bild herunterladen</div>
|
||||
</tool-tip>
|
||||
`;
|
||||
}
|
||||
hideOverlay() {
|
||||
this.overlay.parentNode.removeChild(this.overlay), this.overlay = null;
|
||||
}
|
||||
}
|
||||
class j extends HTMLElement {
|
||||
static get observedAttributes() {
|
||||
}
|
||||
constructor() {
|
||||
super(), this._showall = !1, this.shown = -1, this._headings = [], this._contents = [];
|
||||
}
|
||||
connectedCallback() {
|
||||
this._headings = Array.from(this.querySelectorAll(".tab-list-head")), this._contents = Array.from(this.querySelectorAll(".tab-list-panel")), this.hookupEvtHandlers(), this.hideDependent(), this._headings.length === 1 && this.expand(0);
|
||||
}
|
||||
expand(t) {
|
||||
t < 0 || t >= this._headings.length || (this.shown = t, this._contents.forEach((e, i) => {
|
||||
i === t ? (e.classList.remove("hidden"), this._headings[i].setAttribute("aria-pressed", "true")) : (e.classList.add("hidden"), this._headings[i].setAttribute("aria-pressed", "false"));
|
||||
}));
|
||||
}
|
||||
hookupEvtHandlers() {
|
||||
for (let t of this._headings)
|
||||
t.addEventListener("click", this.handleTabClick.bind(this)), t.classList.add("cursor-pointer"), t.classList.add("select-none"), t.setAttribute("role", "button"), t.setAttribute("aria-pressed", "false"), t.setAttribute("tabindex", "0");
|
||||
for (let t of this._contents)
|
||||
t.classList.add("hidden");
|
||||
}
|
||||
restore() {
|
||||
for (let t of this._headings)
|
||||
t.classList.add("cursor-pointer"), t.classList.add("select-none"), t.setAttribute("role", "button"), t.setAttribute("aria-pressed", "false"), t.setAttribute("tabindex", "0"), t.classList.remove("pointer-events-none"), t.classList.remove("!text-slate-900");
|
||||
for (let t of this._contents)
|
||||
t.classList.add("hidden");
|
||||
}
|
||||
disable() {
|
||||
for (let t of this._headings)
|
||||
t.classList.remove("cursor-pointer"), t.classList.remove("select-none"), t.removeAttribute("role"), t.removeAttribute("aria-pressed"), t.removeAttribute("tabindex"), t.classList.add("pointer-events-none"), t.classList.add("!text-slate-900");
|
||||
}
|
||||
showAll() {
|
||||
this._showall = !0, this.shown = -1, this.disable(), this._contents.forEach((t, e) => {
|
||||
t.classList.remove("hidden");
|
||||
let i = this._headings[e], s = i.querySelectorAll(".show-opened");
|
||||
for (let l of s)
|
||||
l.classList.add("hidden");
|
||||
let a = i.querySelectorAll(".show-closed");
|
||||
for (let l of a)
|
||||
l.classList.add("hidden");
|
||||
});
|
||||
}
|
||||
default() {
|
||||
this._showall = !1, this.restore(), this.hideDependent();
|
||||
}
|
||||
hideDependent() {
|
||||
if (this.shown < 0)
|
||||
for (const t of this._headings)
|
||||
this._hideAllDep(t, !1);
|
||||
else
|
||||
this._headings.forEach((t, e) => {
|
||||
this._hideAllDep(t, e === this.shown);
|
||||
});
|
||||
}
|
||||
_hideAllDep(t, e) {
|
||||
const i = t.querySelectorAll(".show-closed");
|
||||
for (let a of i)
|
||||
e ? a.classList.add("hidden") : a.classList.remove("hidden");
|
||||
const s = Array.from(t.querySelectorAll(".show-opened"));
|
||||
for (let a of s)
|
||||
e ? a.classList.remove("hidden") : a.classList.add("hidden");
|
||||
}
|
||||
handleTabClick(t) {
|
||||
if (!t.target) {
|
||||
console.warn("Invalid event target");
|
||||
return;
|
||||
}
|
||||
const e = this.findParentWithClass(t.target, "tab-list-head");
|
||||
if (!e) {
|
||||
console.warn("No parent found with class 'tab-list-head'");
|
||||
return;
|
||||
}
|
||||
const i = this._headings.indexOf(e);
|
||||
i === this.shown ? (this._contents[i].classList.toggle("hidden"), this._headings[i].setAttribute("aria-pressed", "false"), this.shown = -1) : this.expand(i), this.hideDependent();
|
||||
}
|
||||
findParentWithClass(t, e) {
|
||||
for (; t; ) {
|
||||
if (t.classList && t.classList.contains(e))
|
||||
return t;
|
||||
t = t.parentElement;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
class p extends HTMLElement {
|
||||
static get observedAttributes() {
|
||||
return ["data-text", "data-abbrevmap"];
|
||||
}
|
||||
static get defaultAbbrevMap() {
|
||||
return {
|
||||
"#": "Hinweis auf weitere Informationen in der Anmerkung.",
|
||||
$: "vermutlich",
|
||||
"+++": "Inhalte aus mehreren Almanachen interpoliert",
|
||||
B: "Blatt",
|
||||
BB: "Blätter",
|
||||
C: "Corrigenda",
|
||||
Diagr: "Diagramm",
|
||||
G: "Graphik",
|
||||
"G-Verz": "Verzeichnis der Kupfer u. ä.",
|
||||
GG: "Graphiken",
|
||||
Hrsg: "Herausgeber",
|
||||
"I-Verz": "Inhaltsverzeichnis",
|
||||
Kal: "Kalendarium",
|
||||
Kr: "Karte",
|
||||
MusB: "Musikbeigabe",
|
||||
MusBB: "Musikbeigaben",
|
||||
S: "Seite",
|
||||
SS: "Seiten",
|
||||
Sp: "Spiegel",
|
||||
T: "Titel",
|
||||
TG: "Titelgraphik, Titelportrait etc",
|
||||
"TG r": "Titelgraphik, Titelportrait etc recto",
|
||||
"TG v": "Titelgraphik, Titelportrait etc verso",
|
||||
Tab: "Tabelle",
|
||||
UG: "Umschlaggraphik",
|
||||
"UG r": "Umschlaggraphik recto",
|
||||
"UG v": "Umschlaggraphik verso",
|
||||
VB: "Vorsatzblatt",
|
||||
Vf: "Verfasser",
|
||||
VrlgM: "Verlagsmitteilung",
|
||||
Vrwrt: "Vorwort",
|
||||
ar: "arabische Paginierung",
|
||||
ar1: "erste arabische Paginierung",
|
||||
ar2: "zweite arabische Paginierung",
|
||||
ar3: "dritte arabische Paginierung",
|
||||
ar4: "vierte arabische Paginierung",
|
||||
ar5: "fünfte arabische Paginierung",
|
||||
ar6: "sechste arabische Paginierung",
|
||||
ar7: "siebte arabische Paginierung",
|
||||
gA: "graphische Anleitung",
|
||||
gT: "graphischer Titel",
|
||||
gTzA: "graphische Tanzanleitung",
|
||||
nT: "Nachtitel",
|
||||
röm: "römische Paginierung",
|
||||
röm1: "erste römische Paginierung",
|
||||
röm2: "zweite römische Paginierung",
|
||||
röm3: "dritte römische Paginierung",
|
||||
röm4: "vierte römische Paginierung",
|
||||
röm5: "fünfte römische Paginierung",
|
||||
röm6: "sechste römische Paginierung",
|
||||
röm7: "siebte römische Paginierung",
|
||||
vT: "Vortitel",
|
||||
zT: "Zwischentitel",
|
||||
"§§": "Hinweis auf Mängel im Almanach (Beschädigungen, fehlende Graphiken, unvollständige Sammlungen etc) in der Anmerkung"
|
||||
};
|
||||
}
|
||||
constructor() {
|
||||
super(), this._abbrevMap = p.defaultAbbrevMap;
|
||||
}
|
||||
connectedCallback() {
|
||||
this.render();
|
||||
}
|
||||
attributeChangedCallback(t, e, i) {
|
||||
e !== i && (t === "data-abbrevmap" && this._parseAndSetAbbrevMap(i), this.render());
|
||||
}
|
||||
_parseAndSetAbbrevMap(t) {
|
||||
if (!t) {
|
||||
this._abbrevMap = p.defaultAbbrevMap;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this._abbrevMap = JSON.parse(t);
|
||||
} catch {
|
||||
this._abbrevMap = p.defaultAbbrevMap;
|
||||
}
|
||||
}
|
||||
setAbbrevMap(t) {
|
||||
typeof t == "object" && t !== null && (this._abbrevMap = t, this.render());
|
||||
}
|
||||
get text() {
|
||||
return this.getAttribute("data-text") || "";
|
||||
}
|
||||
set text(t) {
|
||||
this.setAttribute("data-text", t);
|
||||
}
|
||||
render() {
|
||||
this.innerHTML = this.transformText(this.text, this._abbrevMap);
|
||||
}
|
||||
transformText(t, e) {
|
||||
let i = "", s = 0;
|
||||
for (; s < t.length; ) {
|
||||
if (s > 0 && !this.isSpaceOrPunct(t[s - 1])) {
|
||||
i += t[s], s++;
|
||||
continue;
|
||||
}
|
||||
const a = this.findLongestAbbrevAt(t, s, e);
|
||||
if (a) {
|
||||
const { match: l, meaning: h } = a;
|
||||
i += `
|
||||
<tool-tip position="top" class="!inline" timeout="300">
|
||||
<div class="data-tip p-2 text-sm text-white bg-gray-700 rounded shadow">
|
||||
${h}
|
||||
</div>
|
||||
<span class="cursor-help text-blue-900 hover:text-slate-800">
|
||||
${l}
|
||||
</span>
|
||||
</tool-tip>
|
||||
`, s += l.length;
|
||||
} else
|
||||
i += t[s], s++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
findLongestAbbrevAt(t, e, i) {
|
||||
let s = null, a = 0;
|
||||
for (const l of Object.keys(i))
|
||||
t.startsWith(l, e) && l.length > a && (s = l, a = l.length);
|
||||
return s ? { match: s, meaning: i[s] } : null;
|
||||
}
|
||||
isSpaceOrPunct(t) {
|
||||
return /\s|[.,;:!?]/.test(t);
|
||||
}
|
||||
}
|
||||
class K extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
connectedCallback() {
|
||||
this.style.cursor = "pointer", this.addEventListener("click", this.handleClick);
|
||||
}
|
||||
disconnectedCallback() {
|
||||
this.removeEventListener("click", this.handleClick);
|
||||
}
|
||||
handleClick(t) {
|
||||
const e = this.getAttribute("data-jump");
|
||||
if (e) {
|
||||
const i = document.querySelector(e);
|
||||
i ? i.scrollIntoView({ behavior: "smooth" }) : console.warn(`No element found for selector: ${e}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
var v;
|
||||
class X extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
n(this, v, 176);
|
||||
this._images = [];
|
||||
}
|
||||
connectedCallback() {
|
||||
this._images = Array.from(this.querySelectorAll(".primages")), this.calculateShownImages();
|
||||
const e = new ResizeObserver((i, s) => {
|
||||
this.calculateShownImages();
|
||||
});
|
||||
this._resizeObserver = e, e.observe(this);
|
||||
}
|
||||
disconnectedCallback() {
|
||||
this._resizeObserver.unobserve(this);
|
||||
}
|
||||
calculateShownImages() {
|
||||
const e = this.getBoundingClientRect();
|
||||
console.log(e);
|
||||
const i = Math.floor(e.width / (c(this, v) + 10));
|
||||
for (let s = 0; s < this._images.length; s++)
|
||||
s < i - 1 ? this._images[s].classList.remove("hidden") : this._images[s].classList.add("hidden");
|
||||
}
|
||||
}
|
||||
v = new WeakMap();
|
||||
customElements.define(R, K);
|
||||
customElements.define(P, p);
|
||||
customElements.define(M, U);
|
||||
customElements.define(B, D);
|
||||
customElements.define(q, z);
|
||||
customElements.define(H, G);
|
||||
customElements.define($, j);
|
||||
customElements.define(N, O);
|
||||
customElements.define(F, X);
|
||||
export {
|
||||
p as AbbreviationTooltips,
|
||||
U as FilterList,
|
||||
D as ScrollButton,
|
||||
V as XSLTParseProcess
|
||||
};
|
||||
1
views/assets/style.css
Normal file
1
views/assets/style.css
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user