Sort Number for Greasy Fork Scripts

Show order number for Greasy Fork script list page, for every page, highlight your contribution

Από την 16/04/2021. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name            Sort Number  for Greasy Fork Scripts
// @name:zh-CN       脚本列表排序
// @name:ja      腳本清單排序
// @description   Show order number  for Greasy Fork script list page, for every page, highlight your contribution
// @description:zh-CN   脚本列表页显示排名序号, 翻页自动追加序号, 高亮你的作品
// @description:ja  スクリプトリストページにはランキング番号が表示されます。ページをめくると自動的に番号が追加されます。作品をハイライトします。
// @namespace    https://github.com/Germxu
// @homepage     https://github.com/Germxu/Scripts-for-TamperMonkey
// @supportURL   https://github.com/Germxu/Scripts-for-TamperMonkey/issues/new
// @version      0.9
// @author       Finn
// @run-at       document-start
// @match        https://greasyfork.org/*/scripts*
//@exclude       https://greasyfork.org/*/scripts/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const page = +new URLSearchParams(document.location.search).get('page')||1;
    const q= `<style>#browse-script-list{counter-reset: section ${(page-1)*50};}.ad-entry{height: 0;overflow: hidden;}#browse-script-list li{position:relative}.Finn{background:gold;}
              .ad-entry{display:none}#browse-script-list li:after{counter-increment: section;content:counter(section);font:bold 20px/30px Arial;color: #29b6f6;position:absolute;bottom:8px;right:15px}</style>`;
    document.documentElement.insertAdjacentHTML('afterbegin', q);

    window.addEventListener("DOMContentLoaded", function () {
        const a = document.querySelector(".user-profile-link a").href;
        document.querySelectorAll("#browse-script-list li").forEach(function(i){
            const b = i.querySelector("dd.script-list-author a");
            if( b&& b.href===a){
                i.className='Finn';
            }
      })

    })
})();