Greasy Fork is available in English.

TBD: Pagination Reborn for TorrentBD

Lets you swiftly jump to any page you want without limitation.

// ==UserScript==
// @name         TBD: Pagination Reborn for TorrentBD
// @namespace    https://naeembolchhi.github.io/
// @version      0.6
// @description  Lets you swiftly jump to any page you want without limitation.
// @author       NaeemBolchhi
// @license      GPL-3.0-or-later
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDkuMC1jMDAwIDc5LjE3MWMyN2ZhYiwgMjAyMi8wOC8xNi0yMjozNTo0MSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI0LjAgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjhFNDkwRkQzRjcxNzExRUQ5NUQ1RjRBNTUzMTkwOTJBIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkO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KzXW6ksEglzPTNVSxkxdXgHyl2OG/OKBP09rQACAOsmD6cJSi+U3DPKuhutErTvOr2ul7r6FkJ+4vyVVW+LeNM6vNydP5YMAAA0ecjeVunic/zzfTnjaOOEgP3i42phq2lWE/O39z2Nq7jhD/o/JZXsQAKCj8gBc/IzBsqy4RCAYr/JGScuXULH8JP86u6/8Pu6b5F/fvcRwH6/shAc19/8FGAB0iesA0Ky9PgAAAABJRU5ErkJggg==
// @match        https://*.torrentbd.com/*
// @match        https://*.torrentbd.net/*
// @match        https://*.torrentbd.org/*
// @match        https://*.torrentbd.me/*
// @run-at       document-idle
// @grant        none
// ==/UserScript==

// Create a new element
function elemake(tag, innr, attr) {
    let element = document.createElement(tag);
    if (innr && innr !== "") {element.innerHTML = innr;}
    if (!attr) {return element;}

    for (let x = 0; x < attr.key.length; x++) {
        element.setAttribute(attr.key[x], attr.val[x]);
    }
    return element;
}

// Scrape variables from the URL
function urlVar(url) {
    let vars = {};
    url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
        vars[key] = value;
    });
    return vars;
}

// Add global styles
const pagiCSS = `
/* Pagination Parent */
ul.pagination, ul.pagination-new {
  text-align: center;
}

/* Pagination Form */
.pagireborn-form {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px 0 0;
}

/* Pagination Input */
.pagireborn-form input {
  outline: 0;
  padding: 0 10px;
  height: 28px;
  border: 1px solid var(--border-color);
  margin: 3px 2px;
  text-align: center;
}
.pagireborn-form input.pagireborn-num {
  background: transparent;
  width: 80px;
  transition: border .3s;
}
.pagireborn-form input.pagireborn-num:focus {
  border-color: #1aa599;
}
.pagireborn-form input.pagireborn-btn {
  color: var(--body-color);
  background: var(--main-bg);
}

/* Pagination Span */
.pagireborn-span {
  margin: 0 10px 0 0;
  padding: 0 10px;
  line-height: 26px;
  height: 28px;
  border: 1px solid var(--border-color);
  list-style-type: none;
  display: inline-block;
}
.pagireborn-span > i {
  line-height: 26px;
}

/* Cosmetic Changes */
ul.pagination li {
  list-style-type: none;
  display: inline-block;
  margin: 3px 2px;
  font-family: inherit;
  font-size: 14px;
  height: 28px;
  border: 1px solid var(--border-color);
  border-radius: 0;
}
ul.pagination li.active {
  background: var(--nav-bg);
  color: whitesmoke;
  cursor: initial;
  border-radius: 0;
}
ul.pagination li a {
  color: var(--body-color);
  line-height: 26px;
  padding: 0 10px;
  border-radius: 0;
}
ul.pagination li a:hover {
  color: var(--body-color);
}
ul.pagination li.active a {
  color: whitesmoke;
  cursor: initial;
}

/* Reborn for Mobile */
@media screen and (min-width: 601px) {
  .pagireborn-span {
    display: none;
  }
  ul.pagination, ul.pagination-new {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
@media screen and (max-width: 600px) {
  ul.pagination-new i.pagireborn-code,
  ul.pagination-new form.pagireborn-form,
  ul.pagination i.pagireborn-code,
  ul.pagination form.pagireborn-form {
    display: none;
  }
  ul.pagination-new.pagireborn-on i.pagireborn-code-off,
  ul.pagination-new.pagireborn-on li,
  ul.pagination.pagireborn-on i.pagireborn-code-off,
  ul.pagination.pagireborn-on li {
    display: none;
  }
  ul.pagination-new.pagireborn-on i.pagireborn-code,
  ul.pagination-new.pagireborn-on form.pagireborn-form,
  ul.pagination.pagireborn-on i.pagireborn-code,
  ul.pagination.pagireborn-on form.pagireborn-form {
    display: inline-block;
  }
  ul.pagination.pagireborn-on, ul.pagination-new.pagireborn-on {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
`;

// Add styles to head
document.head.appendChild(elemake("style",pagiCSS,{"key":["id","type"],"val":["pagiRestyle","text/css"]}));

// Update material icons css
try {document.querySelector("link[href*='material-icons.css']").href = "https://fonts.googleapis.com/icon?family=Material+Icons";} catch(e) {}

// Add toggler for mobile version
function pagiCode(target) {
    let pagiSpan = elemake("span",'<i class="material-icons pagireborn-code-off">code</i><i class="material-icons pagireborn-code">code_off</i>',{"key":["class"],"val":["pagireborn-span waves-effect"]});
    target.insertBefore(pagiSpan, target.children[0]);
}

// Add form for page jumping
function pagiMake(target) {
    let pagiForm = elemake("form",'<input type="page" class="pagireborn-num" value="" placeholder="Jump to" autocomplete="off"><input type="button" class="pagireborn-btn" value="Go">',{"key":["class"],"val":["pagireborn-form"]});
    target.insertBefore(pagiForm, target.children[0]);
}

// Clear any existing forms
function pagiClear(parent) {
    let what = document.querySelectorAll(`${parent} .pagireborn-form`);

    for (let x = 0; x < what.length; x++) {
        what[x].remove();
    }
}

// When someone clicks go or presses enter on the input box
function pagiGo(go) {
    let where = go.parentNode.getElementsByClassName("pagireborn-num")[0],
        paginator;
    if (isNaN(parseInt(where.value))) {return;}

    try {
        paginator = go.parentNode.parentNode.querySelector("li[data-paginate-to]");
        paginator.setAttribute("data-paginate-to", where.value);
    } catch(e) {
        paginator = go.parentNode.parentNode.querySelector("li a[href]");
        paginator.href = paginator.href.replace(`page=${urlVar(paginator.href).page}`, `page=${where.value}`);
    }

    paginator.click();
}

// Toggle class on pagination parent
function pagiSwitch(parent) {
    if (parent.classList.contains("pagireborn-on")) {
        parent.classList.remove("pagireborn-on");
    } else {
        parent.classList.add("pagireborn-on");
    }
}

// Add the new form to all pagination instances
function pagiType(key) {
    let pagiParent = document.querySelectorAll(`${key} ul[class*='pagination']`);

    try {pagiClear(`${key} ul[class*='pagination']`);} catch(e) {}

    try {pagiMake(pagiParent[0]);} catch(e) {}
    try {pagiMake(pagiParent[1]);} catch(e) {}
    try {pagiCode(pagiParent[0]);} catch(e) {}
    try {pagiCode(pagiParent[1]);} catch(e) {}
}

// IF Ready State is Complete
function readyComplete() {
    if (document.readyState !== "complete") {return;}

    // Try if parent object is found
    if (document.querySelector("#torrents-main")) {
        try {pagiType("#torrents-main");} catch(e) {}
    }
    if (document.querySelector(".pagination-block")) {
        try {pagiType(".pagination-block");} catch(e) {}
    }
}
readyComplete();

// IF Ready State has changed
document.onreadystatechange = function () {
    readyComplete();
}

// Mutation Observers
function initObserver(key) {
    let pagiObserver = new MutationObserver(function() {
        if (document.querySelector(`${key} .pagireborn-form`)) {
            return;
        }
        try {pagiType(key);} catch(e) {}
    });
    pagiObserver.observe(document.querySelector(key), {childList: true});
}

// Start Observers if parent object is found
if (document.querySelector("#torrents-main")) {
    initObserver("#torrents-main");
}
if (document.querySelector("#kuddus-results-container")) {
    initObserver("#kuddus-results-container");
}
if (document.querySelector("#forums")) {
    initObserver("#forums");
}
if (document.querySelector("#torrents")) {
    initObserver("#torrents");
}

// Event Listeners
document.addEventListener("click", function(event) {
    if (event.target.classList.contains("pagireborn-btn")) {
        pagiGo(event.target);
    }
    if (event.target.classList.contains("pagireborn-span")) {
        pagiSwitch(event.target.parentNode);
    }
    if (event.target.className.match(/pagireborn\-code/)) {
        pagiSwitch(event.target.parentNode.parentNode);
    }
});
document.addEventListener("submit", function(event) {
    if (!event.target.classList.contains("pagireborn-form")) {return;}
    event.preventDefault();
    pagiGo(event.target.getElementsByClassName("pagireborn-btn")[0]);
});