Favorites enumerator

1/23/2021

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Favorites enumerator
// @namespace   Violentmonkey Scripts
// @match       https://exhentai.org/favorites.php*
// @require     http://code.jquery.com/jquery-3.5.1.min.js
// @grant       none
// @version     1.0
// @author      Smelly Stinkowitz
// @description 1/23/2021
// ==/UserScript==

(function() {
    'use strict';

    var rows = $(".glink");
    var page = $(location).attr("href");
    var num  = page.indexOf("page");
    var mult = 0;
    if (num > -1)
    {
        var argu = page.substring(num);
        var eqp  = argu.indexOf("=");
        var ns   = argu.substring(eqp+1);
        mult     = parseInt(ns);
    }

    for (var i = 0; i < rows.length; i++)
    {
        var s = rows[i].innerHTML;
        var t = "{" + (50*mult + (i+1)).toString() + "} -- " + s;
        rows[i].innerHTML = t;
    }
})();