GreasyFork Total Scripts(modified)

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

Verze ze dne 20. 12. 2021. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name GreasyFork Total Scripts(modified)
  3. // @namespace pxgamer
  4. // @version 0.2.4
  5. // @description Shows a user's total scripts count on GreasyFork(modified).
  6. // @author NotYou
  7. // @include *greatest.deepsurf.us/*/users/*
  8. // @include *greatest.deepsurf.us/*/scripts*
  9. // @require https://code.jquery.com/jquery-1.7.2.min.js
  10. // @license GPLv3
  11. // @license-link https://www.gnu.org/licenses/gpl-3.0.txt
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. /* What's New?:
  16. * - All languages support (https://greatest.deepsurf.us/en/scripts/20343-greasyfork-total-scripts/discussions/15913)
  17. * - Displaying near "Scripts"
  18. * - Colours change parallel to the number count
  19. * - jQuery bug fix
  20. * - Total script at search
  21. */
  22.  
  23. (function() {
  24. 'use strict';
  25.  
  26. let l = $('li[data-script-id]').length;
  27. if (l == 1) {
  28. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(191, 191, 191);font-variant: normal;"> [' + l + ' Total Script]</span>');
  29. }
  30. else if(l >= 100) {
  31. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 16, 16);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  32. }
  33. else if(l >= 50) {
  34. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 87, 16);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  35. }
  36. else if(l >= 25) {
  37. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 159, 16);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  38. }
  39. else if(l >= 10) {
  40. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(21, 185, 16);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  41. }
  42. else if(l >= 5) {
  43. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 185, 153);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  44. }
  45. else if(l > 1) {
  46. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 42, 185);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  47. }
  48. else if(l < 0){
  49. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(213, 79, 79);font-variant: normal;"> [ Unexpected error! ]</span>');
  50. }
  51. let t = $('li[data-script-id]').length;
  52. if (t == 1) {
  53. $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(191, 191, 191);font-variant: normal;font-weight: bold;"> [' + t + ' Total Script]</span>');
  54. }
  55. else if(t >= 100) {
  56. $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(185, 16, 16);font-variant: normal;font-weight: bold;"> [' + t + ' Total Scripts]</span>');
  57. }
  58. else if(t >= 50) {
  59. $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(185, 87, 16);font-variant: normal;font-weight: bold;"> [' + t + ' Total Scripts]</span>');
  60. }
  61. else if(t >= 25) {
  62. $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(185, 159, 16);font-variant: normal;font-weight: bold;"> [' + t + ' Total Scripts]</span>');
  63. }
  64. else if(t >= 10) {
  65. $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(21, 185, 16);font-variant: normal;font-weight: bold;"> [' + t + ' Total Scripts]</span>');
  66. }
  67. else if(t >= 5) {
  68. $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(16, 185, 153);font-variant: normal;font-weight: bold;"> [' + t + ' Total Scripts]</span>');
  69. }
  70. else if(t > 1) {
  71. $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(16, 42, 185);font-variant: normal;font-weight: bold;"> [' + t + ' Total Scripts]</span>');
  72. }
  73. else if(t < 0){
  74. $('div.sidebarred-main-content p:first').append('<span style="font-size: 15px;color: rgb(213, 79, 79);font-variant: normal;font-weight: bold;"> [ Unexpected error! ]</span>');
  75. }
  76. })();