Itaku -- Pagination

Paginate itaku.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Itaku -- Pagination
// @license      MIT
// @namespace    http://tampermonkey.net/
// @version      2025-05-13
// @description  Paginate itaku.
// @author       twi
// @match        https://itaku.ee/*
// @icon         https://itaku.ee/assets/favicon-yellow.svg
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
    // Because itaku doesn't do a true document reload on switching between pages (the "app" within the document mutates its own contents), we use an observer
    // probably a bit of over-coding to disconnect the observer, but it's more ~correct~ and works just the same because the app itself is never swapped out.
    const o = new MutationObserver(function(mutList) {
        // This is the minimum i can disable in hopes to not break anything
        document.querySelector('.mat-sidenav-content').__zone_symbol__scrollfalse[0].callback = () => {};
        disconnect();
    });
    const disconnect = () => { o.disconnect(); } // what's customary in js here anyway? is omitting the curly braces a sin or is using them? without feels less readable.
    const c = { subtree:true, characterData:true };
    o.observe(document, c);
})();