()
| 407 | }; |
| 408 | |
| 409 | let _bindOmniShortcuts = () => { |
| 410 | if (omniShortcutsBound) { |
| 411 | return; |
| 412 | } |
| 413 | omniShortcutsBound = true; |
| 414 | |
| 415 | document.addEventListener('keydown', event => { |
| 416 | if (!_isOmniMode() || event.altKey || event.ctrlKey || event.metaKey || _isEditableShortcutTarget(event.target)) { |
| 417 | return; |
| 418 | } |
| 419 | |
| 420 | let key = String(event.key || '').toLowerCase(); |
| 421 | if (key === '/') { |
| 422 | event.preventDefault(); |
| 423 | $('#fhJsonSearchInput').trigger('focus'); |
| 424 | return; |
| 425 | } |
| 426 | if (key === 'escape' && window.Formatter && Formatter.clearSelection) { |
| 427 | event.preventDefault(); |
| 428 | Formatter.clearSelection(); |
| 429 | return; |
| 430 | } |
| 431 | if (key === '[' && window.Formatter && Formatter.collapseAll) { |
| 432 | event.preventDefault(); |
| 433 | Formatter.collapseAll(); |
| 434 | _refreshOmniSelectionState(); |
| 435 | return; |
| 436 | } |
| 437 | if (key === ']' && window.Formatter && Formatter.expandAll) { |
| 438 | event.preventDefault(); |
| 439 | Formatter.expandAll(); |
| 440 | _refreshOmniSelectionState(); |
| 441 | } |
| 442 | }, true); |
| 443 | }; |
| 444 | |
| 445 | let _bindOmniSelectionEvents = () => { |
| 446 | if (omniSelectionEventsBound) { |
no test coverage detected