]> git.aero2k.de Git - dfde/dfde-singlepage.git/commitdiff
pagination check master
authorThorsten S. <mail@aero2k.de>
Sun, 28 Jan 2024 19:55:31 +0000 (20:55 +0100)
committerThorsten S. <mail@aero2k.de>
Sun, 28 Jan 2024 19:55:31 +0000 (20:55 +0100)
dfde-singlepage.user.js [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 4c39101..1a5553a
     myButton_a.innerText = "∞";
 
     myButton.appendChild(myButton_a)
-    document.querySelector(".pagination ul").prepend(myButton);
+    const pagination = document.querySelector(".pagination ul");
+    if (pagination) {
+        pagination.prepend(myButton);
+    }
 
     function clickit() {
         if (unsuitable) { window.location.href= "https://debianforum.de/forum/viewtopic.php?" + thread_id; }
         let promises = []
 
-        const pageForm = document.querySelector('input[name=page-number]');
-        const postPerPage = pageForm ? parseInt(pageForm.attributes["data-per-page"].value) : 25;
+        const postPerPage = parseInt(document.querySelector('input[name=page-number]').attributes["data-per-page"].value);
 
         // async wrapper to fix the order of requests/posts
         const fn = async() => {