feat: aggiunta console giocosa all'interno del sistema. fix: correzione di un warning.

This commit is contained in:
Gabriele Cimaschi committed 2026-09-16 15:55:57 +02:00
1 parent dcc0456070
commit 60259427d3
7 files changed
+805 -11

No files matched your search

+12 -3
View File
@@ -68,6 +68,7 @@ const App = {
pdf_save_edited: { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true },
ricerca_spudorata_open: { ctrl: true, alt: false, shift: true, key: 'f', enabled: true },
ticket_list_open: { ctrl: true, alt: false, shift: true, key: 'Backspace', enabled: true },
open_terminal_console: { ctrl: true, alt: true, shift: false, key: 't', enabled: true },
};
return defaults[id] || { ctrl: true, alt: false, shift: false, key: 'Enter', enabled: true };
},
@@ -92,13 +93,15 @@ const App = {
const isShift = sc.shift ? e.shiftKey : !e.shiftKey;
let targetKey = sc.key.toLowerCase();
let pressedKey = e.key.toLowerCase();
let pressedKey = (e.key || '').toLowerCase();
let codeKey = (e.code || '').replace(/^Key/, '').toLowerCase();
if (targetKey === 'space' && (pressedKey === ' ' || pressedKey === 'space')) {
if (targetKey === 'space' && (pressedKey === ' ' || pressedKey === 'space' || codeKey === 'space')) {
return isCtrlOrCmd && isAlt && isShift;
}
return isCtrlOrCmd && isAlt && isShift && (pressedKey === targetKey);
const matchesKey = (pressedKey === targetKey) || (codeKey === targetKey);
return isCtrlOrCmd && isAlt && isShift && matchesKey;
},
formatShortcutLabel(sc) {
@@ -302,6 +305,12 @@ const App = {
e.preventDefault();
window.location.hash = '#/tickets';
}
} else if (this.isShortcutTriggered(e, 'open_terminal_console')) {
e.preventDefault();
const consoleObj = window.ConsoleView || (typeof ConsoleView !== 'undefined' ? ConsoleView : null);
if (consoleObj) {
consoleObj.toggle();
}
}
}, true);