opt: boot hash window ui

This commit is contained in:
KOWX712
2025-02-21 02:44:17 +08:00
parent 09f6f522de
commit a8e388d4cf
5 changed files with 23 additions and 36 deletions

View File

@@ -5,6 +5,11 @@ const card = document.getElementById('boot-hash-card');
const inputBox = document.getElementById('boot-hash-input');
const saveButton = document.getElementById('boot-hash-save-button');
// Remove empty spaces from input
window.trimInput = (input) => {
input.value = input.value.replace(/\s+/g, '');
};
// Function to handle Verified Boot Hash
document.getElementById("boot-hash").addEventListener("click", async () => {
const showCard = () => {
@@ -51,4 +56,11 @@ document.getElementById("boot-hash").addEventListener("click", async () => {
bootHashOverlay.addEventListener("click", (event) => {
if (event.target === bootHashOverlay) closeCard();
});
// Enter to save
inputBox.addEventListener('keydown', (e) => {
if (e.key === 'Enter') {
saveButton.click();
}
});
});