GreasyFork Total Scripts(modified)

Shows a user's total scripts count on GreasyFork(modified).

Устаревшая версия за 09.01.2022. Перейдите к последней версии.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey, Greasemonkey или Violentmonkey.

Для установки этого скрипта вам необходимо установить расширение, такое как Tampermonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Userscripts.

Чтобы установить этот скрипт, сначала вы должны установить расширение браузера, например Tampermonkey.

Чтобы установить этот скрипт, вы должны установить расширение — менеджер скриптов.

(у меня уже есть менеджер скриптов, дайте мне установить скрипт!)

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

(у меня уже есть менеджер стилей, дайте мне установить скрипт!)

// ==UserScript==
// @name              GreasyFork Total Scripts(modified)
// @namespace    pxgamer
// @version            0.2.8
// @description     Shows a user's total scripts count on GreasyFork(modified).
// @author             NotYou
// @include            *greatest.deepsurf.us/*/users/*
// @include            *greatest.deepsurf.us/*/scripts*
// @include            *sleazyfork.org/*/users/*
// @include            *sleazyfork.org/*/scripts*
// @require             https://code.jquery.com/jquery-1.7.2.min.js
// @license            GPLv3
// @license-link     https://www.gnu.org/licenses/gpl-3.0.txt
// @grant                none
// ==/UserScript==

/* What's New?:
 * All languages support (https://greatest.deepsurf.us/en/scripts/20343-greasyfork-total-scripts/discussions/15913)
 * Displaying Total user's scripts near "Scripts"
 * Colours change parallel to the number count
 * jQuery bug fix
 * Total Scripts at search
 * Total Libraries at search
 * Include Sleazy Fork.
 * Works with local override.
 * Shows Total Styles
 * Better colors for low number for better visibility
 * Total Libraries
 * Less Usless Code
 * Fixed Total Scripts at search
 */

// Total Scripts
(function() {
    'use strict';

    let jstotal = $("span:contains('JS')").length;
    let csstotal = $("span:contains('CSS')").length;
    let libtotal = $("span:contains('(Library)')").length;

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

// Total Styles

    if (csstotal == 1) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(125, 125, 125);font-variant: normal;">  [' + csstotal + ' Total Style]</span>');
    }
    else if(csstotal >= 100) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 16, 16);font-variant: normal;">  [' + csstotal + ' Total Styles]</span>');
    }
    else if(csstotal >= 50) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 87, 16);font-variant: normal;">  [' + csstotal + ' Total Styles]</span>');
    }
    else if(csstotal >= 25) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 159, 16);font-variant: normal;">  [' + csstotal + ' Total Styles]</span>');
    }
    else if(csstotal >= 10) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(21, 185, 16);font-variant: normal;">  [' + csstotal + ' Total Styles]</span>');
    }
    else if(csstotal >= 5) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 185, 153);font-variant: normal;">  [' + csstotal + ' Total Styles]</span>');
    }
    else if(csstotal > 1) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 42, 185);font-variant: normal;">  [' + csstotal + ' Total Styles]</span>');
    }
    else if(csstotal < 0){
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(213, 79, 79);font-variant: normal;">  [ Unexpected error! ]</span>');
    }

// Total Libraries

    if (libtotal == 1) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(125, 125, 125);font-variant: normal;">  [' + libtotal + ' Total Library]</span>');
    }
    else if(libtotal >= 100) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 16, 16);font-variant: normal;">  [' + libtotal + ' Total Libraries]</span>');
    }
    else if(libtotal >= 50) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 87, 16);font-variant: normal;">  [' + libtotal + ' Total Libraries]</span>');
    }
    else if(libtotal >= 25) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 159, 16);font-variant: normal;">  [' + libtotal + ' Total Libraries]</span>');
    }
    else if(libtotal >= 10) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(21, 185, 16);font-variant: normal;">  [' + libtotal + ' Total Libraries]</span>');
    }
    else if(libtotal >= 5) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 185, 153);font-variant: normal;">  [' + libtotal + ' Total Libraries]</span>');
    }
    else if(libtotal > 1) {
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 42, 185);font-variant: normal;">  [' + libtotal + ' Total Libraries]</span>');
    }
    else if(libtotal < 0){
        $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(213, 79, 79);font-variant: normal;">  [ Unexpected error! ]</span>');
    }
})();

// Total Libraries at search
if(window.location.href.includes("/libraries?q=")||window.location.href.includes("/libraries?locale_override=1&q=")) {
    (function() {
    'use strict';

    let t = $('li[data-script-type="library"]').length;
    if (t == 1) {
        $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(125, 125, 125);font-weight: bold;">  [' + t + ' Total Library]</span>');
    }
    else if(t >= 50) {
        $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(185, 87, 16);font-weight: bold;">  [' + t + ' Total Libraries]</span>');
    }
    else if(t >= 25) {
        $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(185, 159, 16);font-weight: bold;">  [' + t + ' Total Libraries]</span>');
    }
    else if(t >= 10) {
        $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(21, 185, 16);font-weight: bold;">  [' + t + ' Total Libraries]</span>');
    }
    else if(t >= 5) {
        $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(16, 185, 153);font-weight: bold;">  [' + t + ' Total Libraries]</span>');
    }
    else if(t > 1) {
        $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(16, 42, 185);font-weight: bold;">  [' + t + ' Total Libraries]</span>');
    }
    else if(t < 0){
        $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(213, 79, 79);font-weight: bold;">  [ Unexpected error! ]</span>');
    }
})(); // Total Scripts at search
} else if(window.location.href.includes("/scripts?q=")||(window.location.href.includes("/scripts?locale_override=1&q=")) != -1) {
    (function() {
        'use strict';

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

 // Log Message
let jstotal = $("span:contains('JS')").length;
let csstotal = $("span:contains('CSS')").length;
let libtotal = $("span:contains('(Library)')").length;
let t = $('li[data-script-type="library"]').length;
let l = $('li[data-script-type]').length;

console.log('[Total Scripts: ' + jstotal + ']\n[Total Styles: ' + csstotal + ']\n[Total Libraries: ' + libtotal + ']\n[Total Libraries At Search: ' + t + ']\n[Total Scripts At Search: ' + l + ']')