PageSourceSearch

https://zheyeshiyu.github.io/js/pagination.js

js zheyeshiyu.github.io collected 2026-10-03 10:14:57 UTC 1,244 bytes, 32 lines download raw bytes

1var icattoPage = {
2    toPage: function() {
3        console.log("执行跳转");
4        var e = document.querySelectorAll(".page-number")
5          , t = parseInt(e[e.length - 1].innerHTML)
6          , n = document.getElementById("toPageText")
7          , a = parseInt(n.value);
8        if (!isNaN(a) && a > 0 && "0" !== ("" + a)[0] && a <= t) {
9            var s = 1 == a ? "/" : "/page/" + a + "/#content-inner";
10            document.getElementById("toPageButton").href = s
11        }
12    },
13    listenToPageInputPress() {
14        var e = document.getElementById("toPageText")
15          , t = document.getElementById("toPageButton");
16        e && (e.addEventListener("keydown", (e=>{
17            13 === e.keyCode && (icattoPage.toPage(),
18            pjax.loadUrl(t.href))
19        }
20        )),
21        e.addEventListener("input", (function() {
22            "" === e.value || "0" === e.value ? t.classList.remove("haveValue") : t.classList.add("haveValue");
23            var n = document.querySelectorAll(".page-number")
24              , a = +n[n.length - 1].innerHTML;
25            +document.getElementById("toPageText").value > a && (e.value = a)
26        }
27        )))
28    }
29  }
30  icattoPage.listenToPageInputPress();
31  
32  // 自定页数跳转

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.