()
| 1739 | } |
| 1740 | |
| 1741 | resetScrubberPreviewHint() { |
| 1742 | const text = document.getElementById('scrubber-preview-hint-text'); |
| 1743 | if (!text || !this.scrubberDiffState.previewHintDefault) return; |
| 1744 | text.innerHTML = this.scrubberDiffState.previewHintDefault; |
| 1745 | } |
| 1746 | |
| 1747 | updateScrubberPreviewHint() { |
| 1748 | const text = document.getElementById('scrubber-preview-hint-text'); |
| 1749 | if (!text) return; |
| 1750 | |
| 1751 | let hintHtml = ''; |
| 1752 | if (this.scrubberState.ctrlPinned) { |
| 1753 | hintHtml = `<span class="scrubber-shortcut-key">esc</span> <span>exit edit</span>`; |
| 1754 | } else if (this.scrubberState.ctrlHeld) { |
| 1755 | hintHtml = `<span class="scrubber-shortcut-key">⌥</span> <span>edit</span>`; |
| 1756 | } else { |
| 1757 | hintHtml = `<span class="scrubber-shortcut-key">ctrl</span> <span>preview</span> <span class="opacity-40 mx-0.5">|</span> <span class="scrubber-shortcut-key">⌥</span> <span>edit</span>`; |
| 1758 | } |
| 1759 | |
| 1760 | if (text.innerHTML !== hintHtml) { |
| 1761 | text.innerHTML = hintHtml; |
| 1762 | } |
| 1763 | } |
| 1764 | |
| 1765 | setScrubberPreviewHintEdited() { |
| 1766 | // When edited, we can show a different hint or just keep the dynamic one. |
| 1767 | // The user didn't specify special hint for edited state in the latest request, |
| 1768 | // but previously we showed "ctrl ctrl pin | esc exit". |
| 1769 | // Let's stick to the dynamic hint based on control key state. |
| 1770 | this.updateScrubberPreviewHint(); |
| 1771 | } |
| 1772 | |
| 1773 | setScrubberPreviewEditing(isEditing) { |
| 1774 | this.scrubberDiffState.previewEditing = Boolean(isEditing); |
| 1775 | const inputCard = this.app.elements.inputCard; |
| 1776 | if (!inputCard) return; |
| 1777 | if (this.scrubberDiffState.previewEditing) { |
| 1778 | inputCard.classList.add('scrubber-preview-editing'); |
| 1779 | } else { |
| 1780 | inputCard.classList.remove('scrubber-preview-editing'); |
| 1781 | } |
| 1782 | } |
| 1783 |
no test coverage detected