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

Function attachButtons

source/features/one-click-diff-options.tsx:31–47  ·  view source on GitHub ↗
(nativeDiffButtons: HTMLElement)

Source from the content-addressed store, hash-verified

29}
30
31function attachButtons(nativeDiffButtons: HTMLElement): void {
32 nativeDiffButtons.parentElement!.after(
33 tooltipped(
34 {
35 label: `${isHidingWhitespace() ? 'Show' : 'Hide'} whitespace changes`,
36 shortcut: 'd w',
37 },
38 <a
39 href={getAlternateUrl()}
40 data-hotkey="d w"
41 className={cx('float-right mr-3 tmp-mr-3 btn btn-sm', isHidingWhitespace() && 'color-fg-subtle')}
42 >
43 {isHidingWhitespace() && <CheckIcon />} No Whitespace
44 </a>,
45 ),
46 );
47}
48
49function init(signal: AbortSignal): void {
50 observe('[action="/users/diffview"]', attachButtons, {signal});

Callers

nothing calls this directly

Calls 3

tooltippedFunction · 0.85
isHidingWhitespaceFunction · 0.85
getAlternateUrlFunction · 0.85

Tested by

no test coverage detected