GreasyFork Total Scripts(modified)

Shows a user's total scripts count on GreasyFork

当前为 2021-12-18 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name             GreasyFork Total Scripts(modified)
// @namespace        pxgamer
// @version          0.2.1
// @description      Shows a user's total scripts count on GreasyFork
// @author           NotYou
// @include          *greasyfork.org/*/users/*
// @license          GPLv3
// @license-link     https://www.gnu.org/licenses/gpl-3.0.txt
// @grant            none
// ==/UserScript==

/* What's New?:
 * - All languagees support (https://greasyfork.org/en/scripts/20343-greasyfork-total-scripts/discussions/15913)
 * - Displaying near "Scripts"
 * - Colours change parallel to the number of violators
 */

(function() {
    'use strict';

    let l = $('li[data-script-id]').length;
    if (l == 1) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(191, 191, 191);">  [' + l + ' Total Script]</span>');
    }
    else if(l > 100) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 16, 16);">  [' + l + ' Total Scripts]</span>');
    }
    else if(l > 50) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 87, 16);">  [' + l + ' Total Scripts]</span>');
    }
    else if(l > 25) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 159, 16);">  [' + l + ' Total Scripts]</span>');
    }
    else if(l > 10) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(21, 185, 16);">  [' + l + ' Total Scripts]</span>');
    }
    else if(l > 5) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 185, 153);">  [' + l + ' Total Scripts]</span>');
    }
    else if(l > 1) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 42, 185);">  [' + l + ' Total Scripts]</span>');
    }
    else {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(213, 79, 79);">  [ Unexpected error! ]</span>');
    }
})();