Greasy Fork is available in English.

OurPagination

Operate Torn's pagination using left-right arrow keys

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         OurPagination
// @namespace    dotp.cc
// @version      0.2
// @description  Operate Torn's pagination using left-right arrow keys
// @author       Lenin (2199004)
// @match        https://www.torn.com/hospitalview.php*
// @match        https://www.torn.com/jailview.php*
// @match        https://www.torn.com/page.php?sid=UserList*
// @match        https://www.torn.com/forums.php*
// @match        https://www.torn.com/bounties.php*
// @match        https://www.torn.com/comics.php*
// @match        https://www.torn.com/properties.php*
// @match        https://www.torn.com/joblist.php*
// @match        https://www.torn.com/messages.php*
// @match        https://www.torn.com/amarket.php*
// @match        https://www.torn.com/page.php?sid=travel*
// @match        https://www.torn.com/personals.php*
// @match        https://www.torn.com/page.php?sid=gallery*
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    document.addEventListener('keydown', function(e) {
        // Check if the focus is on a text input or textarea
        if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA' || document.activeElement.isContentEditable) {
            return; // Do nothing if the user is focused on an input box or textarea
        }

        // Check if the right arrow key is pressed
        if (e.keyCode === 39) { // 39 is the keycode for the right arrow key
            let rightPaginationLink = document.querySelector('i.pagination-right').parentNode;
            if (rightPaginationLink) {
                rightPaginationLink.click();
            }
        }
        // Check if the left arrow key is pressed
        else if (e.keyCode === 37) { // 37 is the keycode for the left arrow key
            let leftPaginationLink = document.querySelector('i.pagination-left').parentNode;
            if (leftPaginationLink) {
                leftPaginationLink.click();
            }
        }
    });
})();