MCPcopy Index your code
hub / github.com/refined-github/refined-github / addButton

Function addButton

source/features/deep-reblame.tsx:73–95  ·  view source on GitHub ↗
(hunk: HTMLElement)

Source from the content-addressed store, hash-verified

71}
72
73function 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
97async function init(signal: AbortSignal): Promise<void> {
98 delegate('.rgh-deep-reblame', 'click', redirectToBlameCommit, {signal});

Callers

nothing calls this directly

Calls 1

multilineAriaLabelFunction · 0.85

Tested by

no test coverage detected