mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
26 lines
944 B
JavaScript
26 lines
944 B
JavaScript
'use script';
|
|
|
|
document.getElementById('toggle').addEventListener('click', function(e) {
|
|
const loginForm = document.getElementById('loginForm');
|
|
|
|
if (!loginForm) {
|
|
const dialog = document.createElement('div');
|
|
dialog.setAttribute('id', 'loginForm');
|
|
|
|
const usernameInput = document.createElement('input');
|
|
usernameInput.setAttribute('type', 'text');
|
|
usernameInput.setAttribute('name', 'loginField');
|
|
usernameInput.setAttribute('placeholder', 'username');
|
|
dialog.append(usernameInput);
|
|
|
|
const passwordInput = document.createElement('input');
|
|
passwordInput.setAttribute('type', 'password');
|
|
passwordInput.setAttribute('name', 'passwordField');
|
|
passwordInput.setAttribute('placeholder', 'password');
|
|
dialog.append(passwordInput);
|
|
|
|
document.body.appendChild(dialog);
|
|
} else {
|
|
document.body.removeChild(loginForm);
|
|
}
|
|
});
|