(nativeDiffButtons: HTMLElement)
| 29 | } |
| 30 | |
| 31 | function 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 | |
| 49 | function init(signal: AbortSignal): void { |
| 50 | observe('[action="/users/diffview"]', attachButtons, {signal}); |
nothing calls this directly
no test coverage detected