chromium bugs colorize

Colorize bug list based on status

当前为 2016-10-10 提交的版本,查看 最新版本

  1. // ==UserScript==//
  2. // @name chromium bugs colorize
  3. // @description Colorize bug list based on status
  4. // @match https://bugs.chromium.org/p/*/list*
  5. // @version 1.0
  6. // @author wOxxOm
  7. // @namespace wOxxOm.scripts
  8. // @license MIT License
  9. // @run-at document-start
  10. // @require https://greasyfork.org/scripts/12228/code/setMutationHandler.js
  11. // ==/UserScript==
  12.  
  13. (document.head || document.documentElement).insertAdjacentHTML('beforeend', `
  14. <style>
  15. .wOxxOm-Starred { font-weight: bold }
  16. .wOxxOm-Archived { color: gray }
  17. .wOxxOm-Assigned { color: #3f71b1 }
  18. .wOxxOm-Available { color: #92479a }
  19. .wOxxOm-Duplicate,
  20. .wOxxOm-Invalid { opacity: 0.3 }
  21. .wOxxOm-ExternalDependency { color: #ababab }
  22. .wOxxOm-Fixed { color: #30a700 }
  23. .wOxxOm-Started,
  24. .wOxxOm-FixPending { color: #06908b }
  25. .wOxxOm-Unconfirmed,
  26. .wOxxOm-New { color: black }
  27. .wOxxOm-Untriaged { color: #947911 }
  28. .wOxxOm-Verified, .wOxxOm-Accepted { color: #6a846f }
  29. .wOxxOm-WontFix { color: red }
  30. </style>
  31. `);
  32.  
  33. setMutationHandler(document, 'td', function(nodes) {
  34. for (var i = 0, n; (n = nodes[i++]); ) {
  35. var text = n.textContent;
  36. if (!text)
  37. continue;
  38. text = text.trim();
  39. switch (text) {
  40. case 'Accepted':
  41. case 'Archived':
  42. case 'Assigned':
  43. case 'Available':
  44. case 'Duplicate':
  45. case 'ExternalDependency':
  46. case 'FixPending':
  47. case 'Fixed':
  48. case 'Invalid':
  49. case 'New':
  50. case 'Started':
  51. case 'Unconfirmed':
  52. case 'Untriaged':
  53. case 'Verified':
  54. case 'WontFix':
  55. n.parentNode.classList.add('wOxxOm-' + text);
  56. break;
  57. case '★':
  58. n.parentNode.classList.add('wOxxOm-Starred');
  59. break;
  60. }
  61. }
  62. });