GreasyFork Total Scripts(modified)

Shows a user's total scripts count on GreasyFork

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

  1. // ==UserScript==
  2. // @name GreasyFork Total Scripts(modified)
  3. // @namespace pxgamer
  4. // @version 0.2.1
  5. // @description Shows a user's total scripts count on GreasyFork
  6. // @author NotYou
  7. // @include *greasyfork.org/*/users/*
  8. // @license GPLv3
  9. // @license-link https://www.gnu.org/licenses/gpl-3.0.txt
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. /* What's New?:
  14. * - All languagees support (https://greasyfork.org/en/scripts/20343-greasyfork-total-scripts/discussions/15913)
  15. * - Displaying near "Scripts"
  16. * - Colours change parallel to the number of violators
  17. */
  18.  
  19. (function() {
  20. 'use strict';
  21.  
  22. let l = $('li[data-script-id]').length;
  23. if (l == 1) {
  24. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(191, 191, 191);"> [' + l + ' Total Script]</span>');
  25. }
  26. else if(l > 100) {
  27. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 16, 16);"> [' + l + ' Total Scripts]</span>');
  28. }
  29. else if(l > 50) {
  30. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 87, 16);"> [' + l + ' Total Scripts]</span>');
  31. }
  32. else if(l > 25) {
  33. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 159, 16);"> [' + l + ' Total Scripts]</span>');
  34. }
  35. else if(l > 10) {
  36. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(21, 185, 16);"> [' + l + ' Total Scripts]</span>');
  37. }
  38. else if(l > 5) {
  39. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 185, 153);"> [' + l + ' Total Scripts]</span>');
  40. }
  41. else if(l > 1) {
  42. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 42, 185);"> [' + l + ' Total Scripts]</span>');
  43. }
  44. else {
  45. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(213, 79, 79);"> [ Unexpected error! ]</span>');
  46. }
  47. })();