From 730db777b633fe9b9efb3cf3e18628a53bac061f Mon Sep 17 00:00:00 2001 From: OFF0 Date: Wed, 23 Nov 2022 19:49:38 +0100 Subject: [PATCH] refactor: rename form to settingsform --- src/main.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.js b/src/main.js index 9fca2fd..eb2fea3 100644 --- a/src/main.js +++ b/src/main.js @@ -466,13 +466,13 @@ input.addEventListener('input', () => publish.disabled = !input.value); input.addEventListener('blur', () => sendStatus.textContent = ''); // settings -const form = document.querySelector('form[name="settings"]'); -const privateKeyInput = form.querySelector('#privatekey'); -const pubKeyInput = form.querySelector('#pubkey'); -const statusMessage = form.querySelector('#keystatus'); -const generateBtn = form.querySelector('button[name="generate"]'); -const importBtn = form.querySelector('button[name="import"]'); -const privateTgl = form.querySelector('button[name="privatekey-toggle"]'); +const settingsForm = document.querySelector('form[name="settings"]'); +const privateKeyInput = settingsForm.querySelector('#privatekey'); +const pubKeyInput = settingsForm.querySelector('#pubkey'); +const statusMessage = settingsForm.querySelector('#keystatus'); +const generateBtn = settingsForm.querySelector('button[name="generate"]'); +const importBtn = settingsForm.querySelector('button[name="import"]'); +const privateTgl = settingsForm.querySelector('button[name="privatekey-toggle"]'); generateBtn.addEventListener('click', () => { const privatekey = generatePrivateKey(); @@ -497,7 +497,7 @@ importBtn.addEventListener('click', () => { } }); -form.addEventListener('input', () => validKeys(privateKeyInput.value, pubKeyInput.value)); +settingsForm.addEventListener('input', () => validKeys(privateKeyInput.value, pubKeyInput.value)); function validKeys(privatekey, pubkey) { if (pubkey && privatekey) {