|
3 | 3 | // @namespace http://axSgrease.nvaccess.org/ |
4 | 4 | // @description Improves the accessibility of Phabricator. |
5 | 5 | // @author James Teh <jteh@mozilla.com> |
6 | | -// @copyright 2018 Mozilla Corporation |
| 6 | +// @copyright 2018-2025 Mozilla Corporation |
7 | 7 | // @license Mozilla Public License version 2.0 |
8 | | -// @version 2018.2 |
| 8 | +// @version 2025.1 |
9 | 9 | // @grant GM_log |
10 | 10 | // @include https://phabricator.services.mozilla.com/D* |
11 | 11 | // ==/UserScript== |
@@ -35,6 +35,12 @@ function setLabel(el, label) { |
35 | 35 | el.setAttribute("aria-label", label); |
36 | 36 | } |
37 | 37 |
|
| 38 | +function labelHiddenStatusIcon(el, label) { |
| 39 | + el.removeAttribute("aria-hidden"); |
| 40 | + el.setAttribute("role", "image"); |
| 41 | + setLabel(el, label); |
| 42 | +} |
| 43 | + |
38 | 44 | /*** Code to apply the tweaks when appropriate. ***/ |
39 | 45 |
|
40 | 46 | function applyTweaks(root, tweaks) { |
@@ -90,6 +96,21 @@ const LOAD_TWEAKS = [ |
90 | 96 | // The diff is an h1, so the files inside the diff should be an h2, not an h1. |
91 | 97 | {selector: '.differential-file-icon-header', |
92 | 98 | tweak: [makeHeading, 2]}, |
| 99 | + // Reviewer status icons. |
| 100 | + {selector: '.phui-status-item-target .fa-circle-o', |
| 101 | + tweak: [labelHiddenStatusIcon, "pending"]}, |
| 102 | + {selector: '.phui-status-item-target .fa-minus-circle', |
| 103 | + tweak: [labelHiddenStatusIcon, "pending blocking"]}, |
| 104 | + {selector: '.phui-status-item-target .fa-check-circle', |
| 105 | + tweak: [labelHiddenStatusIcon, "accepted"]}, |
| 106 | + {selector: '.phui-status-item-target .fa-check-circle-o', |
| 107 | + tweak: [labelHiddenStatusIcon, "accepted prior"]}, |
| 108 | + {selector: '.phui-status-item-target .fa-times-circle', |
| 109 | + tweak: [labelHiddenStatusIcon, "requested changes"]}, |
| 110 | + {selector: '.phui-status-item-target .fa-times-circle-o', |
| 111 | + tweak: [labelHiddenStatusIcon, "requested changes to prior"]}, |
| 112 | + {selector: '.phui-status-item-target .fa-comment', |
| 113 | + tweak: [labelHiddenStatusIcon, "comment"]}, |
93 | 114 | ] |
94 | 115 |
|
95 | 116 | // Tweaks that must be applied whenever a node is added. |
|
0 commit comments