* Sets up font mode toggle controls and listeners. * Toggles between sans-serif and serif fonts in the chat area.
()
| 1679 | |
| 1680 | // Use capture phase to intercept before other handlers |
| 1681 | document.addEventListener('keydown', this.scrubberDiffState.globalEscapeHandler, true); |
| 1682 | } |
| 1683 | |
| 1684 | /** |
| 1685 | * Remove global Escape key handler. |
| 1686 | */ |
| 1687 | removeGlobalEscapeHandler() { |
| 1688 | if (!this.scrubberDiffState.globalEscapeHandler) return; |
| 1689 | document.removeEventListener('keydown', this.scrubberDiffState.globalEscapeHandler, true); |
| 1690 | this.scrubberDiffState.globalEscapeHandler = null; |
| 1691 | } |
| 1692 | |
| 1693 | updateScrubberHintVisibility() { |
| 1694 | const hint = document.getElementById('scrubber-shortcut-hint'); |
| 1695 | const input = this.app.elements.messageInput; |
| 1696 | if (!hint || !input) return; |
| 1697 | |
| 1698 | if (this.scrubberHintHtml === undefined) this.scrubberHintHtml = hint.innerHTML; |
| 1699 | const supported = this.supportsFeature('scrubber'); |
| 1700 | if (supported && hint.dataset.featureUnavailable === 'true') { |
| 1701 | hint.innerHTML = this.scrubberHintHtml; |
| 1702 | } else if (!supported && hint.dataset.featureUnavailable !== 'true') { |
| 1703 | hint.textContent = ''; |
| 1704 | } |
| 1705 | hint.dataset.featureUnavailable = String(!supported); |
| 1706 | hint.title = ''; |
| 1707 | const len = (input.value || '').length; |
| 1708 | // Hide hint completely after scrubbing (when tooltip can show) |
| 1709 | const hasPending = this.app.scrubberPending?.redacted === input.value; |
| 1710 | if (!supported || hasPending) { |
| 1711 | hint.classList.add('hint-hidden'); |
| 1712 | hint.classList.remove('faded'); |
| 1713 | input.classList.remove('hint-visible'); |
| 1714 | return; |
| 1715 | } |
| 1716 | if (len === 0) { |
| 1717 | // Empty input - show hint fully |
no test coverage detected