/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2026 metamuffin */ function init_paging() { const el = document.querySelector(".next_page") as HTMLAnchorElement if (!el) return document.body.onscroll = () => { const end = document.body.clientHeight - document.body.parentElement!.scrollTop - document.body.parentElement!.clientHeight if (end < 200) { document.body.onscroll = () => { } load_next(el) } } } async function load_next(el: HTMLAnchorElement) { const res = await fetch(el.href + "&no_scaff") if (!res.ok) throw "aaa" const ext = await res.text() el.remove() document.getElementById("main")!.innerHTML += ext init_paging() } globalThis.addEventListener("DOMContentLoaded", init_paging)