GreasyFork Script Numbers figuccio

Aggiunge numeri accanto agli script GreasyFork nelle pagine utente.

15.02.2025 itibariyledir. En son verisyonu görün.

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           GreasyFork Script Numbers figuccio
// @namespace      https://greatest.deepsurf.us/users/237458
// @version        0.1
// @description    Aggiunge numeri accanto agli script GreasyFork nelle pagine utente.
// @author         figuccio
// @match          *://greatest.deepsurf.us/*/users/*
// @match          https://greatest.deepsurf.us/*
// @match          https://sleazyfork.org/*
// @license        MIT
// ==/UserScript==
(function() {
    'use strict';

    function addNumbersToScriptList(selector) {
        const scriptList = document.querySelectorAll(selector);

        if (scriptList) {
            scriptList.forEach((script, index) => {
                // Controllare se esiste già un intervallo di numeri per evitare duplicati
                if (!script.querySelector('.script-number')) { // Aggiunto controllo qui
                    const numberSpan = document.createElement('span');
                    numberSpan.classList.add('script-number'); // Aggiungi una classe per una facile selezione in seguito
                    numberSpan.style.marginRight = '5px';
                    numberSpan.style.fontWeight = 'bold';
                    numberSpan.style.background = 'red';
                    numberSpan.style.color = 'green';
                    numberSpan.textContent = `${index + 1}`;

                    script.insertBefore(numberSpan, script.firstChild);
                }
            });
        }
    }

    // Chiama la funzione per le pagine utente e gli elenchi di script regolari
    addNumbersToScriptList('.script-list > li'); // Pagine utente

   // Per l'elenco degli script principali sulla homepage di GreasyFork/SleazyFork/risultati di ricerca ecc.
// Probabilmente dovrai adattare questo selettore in base alla struttura HTML effettiva.
// Esamina l'HTML della pagina per trovare il selettore corretto. Questo è uno comune:
    addNumbersToScriptList('.script-list-container > ul > li'); //Ad esempio, ADATTARE IN BASE ALLE NECESSITÀ!
    addNumbersToScriptList('.script-list > li'); //Ad esempio, ADATTARE IN BASE ALLE NECESSITÀ!


})();