GOG Abolish Reputation System

Abolish GOG forum's reputation system

  1. // ==UserScript==
  2. // @name GOG Abolish Reputation System
  3. // @author TheDcoder@protonmail.com
  4. // @description Abolish GOG forum's reputation system
  5. // @version 1.1
  6. // @homepageURL https://www.gog.com/forum/general/fight_the_bullies_lets_abolish_the_reputation_system
  7. // @namespace Violentmonkey Scripts
  8. // @match http*://www.gog.com/forum/*/*
  9. // @grant GM_addStyle
  10. // @grant GM_registerMenuCommand
  11. // @grant GM_getValue
  12. // @grant GM_setValue
  13. // @grant GM_notification
  14. // ==/UserScript==
  15.  
  16. const NO_REP_CSS =
  17. `
  18. .big_user_info .b_u_rep .xywka,
  19. .big_user_info .b_u_rep .t_u_stars_p,
  20. .post_rate_red, .post_rate_green,
  21. .rate_this_post_h_EN {
  22. display: none;
  23. }
  24.  
  25. .replay_h_EN {
  26. right: 0 !important;
  27. }
  28. `;
  29. const PROTEST_SIGNATURE = '[url=https://www.gog.com/forum/general/fight_the_bullies_lets_abolish_the_reputation_system]✊[/url]';
  30.  
  31. const OPTIONS = {
  32. ADD_SIG: {
  33. name: "Protest Signature",
  34. key: 'add_signature',
  35. def: true,
  36. },
  37. };
  38.  
  39. [
  40. OPTIONS.ADD_SIG,
  41. ].forEach(opt => {
  42. GM_registerMenuCommand(`Toggle ${opt.name.toLowerCase()}`, () => {
  43. toggle_option(opt);
  44. });
  45. });
  46.  
  47. if (window.location.pathname == '/forum/ajax/popUp') {
  48. main_post();
  49. } else {
  50. main_thread();
  51. }
  52.  
  53. async function main_post() {
  54. var enabled = await get_option(OPTIONS.ADD_SIG);
  55. if (!enabled) return;
  56. var textarea = document.getElementById('text');
  57. textarea.value += '\n\n' + PROTEST_SIGNATURE;
  58. }
  59.  
  60. async function main_thread() {
  61. GM_addStyle(NO_REP_CSS);
  62. }
  63.  
  64. async function get_option(opt) {
  65. return await GM_getValue(opt.key, opt.def);
  66. }
  67.  
  68. async function toggle_option(opt) {
  69. var value = await GM_getValue(opt.key, opt.def);
  70. value = !value;
  71. await GM_setValue(opt.key, value);
  72. notify_user(`${opt.name} has been ${value ? 'enabled' : 'disabled'}!`);
  73. }
  74.  
  75. async function notify_user(msg) {
  76. GM_notification({
  77. title: "GOG Abolish REP",
  78. text: msg,
  79. });
  80. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址