(hunk: HTMLElement)
| 71 | } |
| 72 | |
| 73 | function addButton(hunk: HTMLElement): void { |
| 74 | const reblameLink = $optional('a[aria-labelledby^="reblame-"]', hunk); |
| 75 | if (reblameLink) { |
| 76 | reblameLink.setAttribute( |
| 77 | 'aria-label', |
| 78 | 'View blame prior to this change. Hold `Alt` to extract commits from this PR first', |
| 79 | ); |
| 80 | reblameLink.classList.add('rgh-deep-reblame'); |
| 81 | } else { |
| 82 | $('.timestamp-wrapper-mobile', hunk).after( |
| 83 | <button |
| 84 | type="button" |
| 85 | aria-label={multilineAriaLabel( |
| 86 | 'View blame prior to this change', |
| 87 | '(extracts commits from this PR first)', |
| 88 | )} |
| 89 | className="rgh-deep-reblame Button Button--iconOnly Button--invisible Button--small d-flex" |
| 90 | > |
| 91 | <VersionsIcon /> |
| 92 | </button>, |
| 93 | ); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | async function init(signal: AbortSignal): Promise<void> { |
| 98 | delegate('.rgh-deep-reblame', 'click', redirectToBlameCommit, {signal}); |
nothing calls this directly
no test coverage detected