reduce title opacity of On hold PRs

23/01/2025, 12:23:20

目前为 2025-01-23 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name reduce title opacity of On hold PRs
  3. // @namespace Violentmonkey Scripts
  4. // @match https://github.com/navikt/aksel/pulls*
  5. // @grant none
  6. // @version 1.0
  7. // @author popular-software
  8. // @description 23/01/2025, 12:23:20
  9. // @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2
  10. // @run-at document-end
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. const LABEL_TO_DIM = "On hold :pause_button:";
  15. const ONLY_DIM_TITLE = false;
  16.  
  17. const disconnect = VM.observe(document.body, () => {
  18. const nodes = document.body.querySelectorAll(`div.flex-auto:has(.Link--primary):has(a[data-name="${LABEL_TO_DIM}"])`);
  19.  
  20. for (let node of nodes) {
  21. if (ONLY_DIM_TITLE) {
  22. const title = node.querySelector('a');
  23. title.style = "opacity: 0.2;";
  24. }
  25. else {
  26. node.style = "opacity: 0.2; font-size: 10px;";
  27. }
  28. }
  29.  
  30. });
  31.  
  32. // You can also disconnect the observer explicitly when it's not used any more
  33. // disconnect();