BIGFIX: scrolling on fp, loading times

This commit is contained in:
Simon Martens
2025-03-04 09:02:24 +01:00
parent 1eae2c23fd
commit 1d32eee20d
4 changed files with 23 additions and 13 deletions

View File

@@ -3,7 +3,7 @@ var x = (r) => {
}; };
var _ = (r, t, e) => t.has(r) || x("Cannot " + e); 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); 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]", y = "xslt-template", k = "xslt-transformed", M = "filter-list", m = "filter-list-list", C = "filter-list-item", I = "filter-list-input", w = "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"; 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", H = "int-link", R = "popup-image", $ = "tab-list", N = "filter-pill", F = "image-reel";
var d, b, E; var d, b, E;
class V { class V {
constructor() { constructor() {
@@ -23,9 +23,9 @@ class V {
} }
} }
d = new WeakMap(), b = new WeakSet(), E = function(t) { d = new WeakMap(), b = new WeakSet(), E = function(t) {
if (t.getAttribute(k) === "true" || !t.hasAttribute(y)) if (t.getAttribute(k) === "true" || !t.hasAttribute(w))
return; return;
let e = "#" + t.getAttribute(y), i = c(this, d).get(e); let e = "#" + t.getAttribute(w), i = c(this, d).get(e);
if (!i) { if (!i) {
let h = htmx.find(e); let h = htmx.find(e);
if (h) { if (h) {
@@ -119,7 +119,7 @@ class U extends HTMLElement {
return ["data-url"]; return ["data-url"];
} }
set items(e) { set items(e) {
Array.isArray(e) && (this._items = e, this.render()), htmx && htmx.process(this); Array.isArray(e) && (this._items = e, this.render());
} }
get items() { get items() {
return this._items; return this._items;
@@ -157,7 +157,7 @@ class U extends HTMLElement {
let e = this.querySelector("#" + m); let e = this.querySelector("#" + m);
if (!e) if (!e)
return; return;
let i = new Mark(e.querySelectorAll("." + w)); let i = new Mark(e.querySelectorAll("." + y));
this._filter && i.mark(this._filter, { this._filter && i.mark(this._filter, {
separateWordSearch: !0 separateWordSearch: !0
}); });
@@ -197,7 +197,7 @@ class U extends HTMLElement {
} }
getLinkText(e) { getLinkText(e) {
let i = this.getSearchText(e); let i = this.getSearchText(e);
return i === "" ? "" : `<span class="${w}">${i}</span>`; return i === "" ? "" : `<span class="${y}">${i}</span>`;
} }
getURL(e) { getURL(e) {
if (this._queryparam) { if (this._queryparam) {
@@ -216,7 +216,7 @@ class U extends HTMLElement {
${this.Input()} ${this.Input()}
${this.List()} ${this.List()}
</div> </div>
`; `, htmx && htmx.process(this);
} }
ActiveDot(e) { ActiveDot(e) {
return g(this, f, L).call(this, e), ""; return g(this, f, L).call(this, e), "";
@@ -253,6 +253,9 @@ class U extends HTMLElement {
<a <a
href="${this.getURL(i)}" href="${this.getURL(i)}"
hx-indicator="body" hx-indicator="body"
hx-swap="outerHTML show:none"
hx-select="main"
hx-target="main"
class="${C} block px-2.5 py-0.5 hover:bg-slate-200 no-underline ${s % 2 === 0 ? "bg-stone-100" : "bg-stone-50"}" 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"' : ""}> ${g(this, f, L).call(this, i) ? 'aria-current="page"' : ""}>
${this.ActiveDot(i)} ${this.ActiveDot(i)}
@@ -742,12 +745,12 @@ class X extends HTMLElement {
} }
} }
v = new WeakMap(); v = new WeakMap();
customElements.define(R, K); customElements.define(H, K);
customElements.define(P, p); customElements.define(P, p);
customElements.define(M, U); customElements.define(M, U);
customElements.define(B, D); customElements.define(B, D);
customElements.define(q, z); customElements.define(q, z);
customElements.define(H, G); customElements.define(R, G);
customElements.define($, j); customElements.define($, j);
customElements.define(N, O); customElements.define(N, O);
customElements.define(F, X); customElements.define(F, X);

View File

@@ -15,7 +15,7 @@
placeholder="Suchbegriff" placeholder="Suchbegriff"
x-model="search" x-model="search"
hx-get="" hx-get=""
hx-trigger="input[if: this.value.length >= 3] delay:3000ms, keyup[enter, if: this.value.length >= 2]" hx-trigger="input delay:1000ms, keyup[enter]"
hx-select="#searchresults" hx-select="#searchresults"
hx-target="#searchresults" hx-target="#searchresults"
hx-swap="outerHTML" hx-swap="outerHTML"

View File

@@ -11,12 +11,16 @@
:class="search ? 'inactive' : 'active'" :class="search ? 'inactive' : 'active'"
href="?letter={{ $r }}" href="?letter={{ $r }}"
{{ if eq $model.active $r }}aria-current="page"{{ end }} {{ if eq $model.active $r }}aria-current="page"{{ end }}
hx-indicator="body"
hx-select="main" hx-select="main"
hx-target="main" hx-target="main"
hx-swap="outerHTML scroll:#pageheading:top" hx-swap="outerHTML show:none"
>{{ $r }}</a >{{ $r }}</a
> >
{{ end }} {{ end }}
<i class="ml-2 pb-1 ri-hourglass-2-fill request-indicator spinning"></i>
</div> </div>
<div class="flex-grow"></div> <div class="flex-grow"></div>

View File

@@ -242,8 +242,6 @@ class FilterList extends HTMLElement {
this._items = data; this._items = data;
this.render(); this.render();
} }
if (!htmx) return;
htmx.process(this);
} }
get items() { get items() {
@@ -451,6 +449,8 @@ class FilterList extends HTMLElement {
${this.List()} ${this.List()}
</div> </div>
`; `;
if (!htmx) return;
htmx.process(this);
} }
ActiveDot(item) { ActiveDot(item) {
@@ -506,6 +506,9 @@ class FilterList extends HTMLElement {
<a <a
href="${this.getURL(item)}" href="${this.getURL(item)}"
hx-indicator="body" hx-indicator="body"
hx-swap="outerHTML show:none"
hx-select="main"
hx-target="main"
class="${FILTER_LIST_ITEM} block px-2.5 py-0.5 hover:bg-slate-200 no-underline ${ class="${FILTER_LIST_ITEM} block px-2.5 py-0.5 hover:bg-slate-200 no-underline ${
index % 2 === 0 ? "bg-stone-100" : "bg-stone-50" index % 2 === 0 ? "bg-stone-100" : "bg-stone-50"
}" }"