mirror of
https://codeberg.org/valpackett/tiddlypwa.git
synced 2025-12-06 02:30:48 -08:00
Plugin: add password manager hints to the form
This commit is contained in:
parent
bd0aefea34
commit
a910fb43ba
2 changed files with 9 additions and 3 deletions
10
plugins/tiddlypwa/bootstrap.js
vendored
10
plugins/tiddlypwa/bootstrap.js
vendored
|
|
@ -62,7 +62,7 @@ Formatted with `deno fmt`.
|
||||||
|
|
||||||
form = dm('form', { class: 'tiddlypwa-form' });
|
form = dm('form', { class: 'tiddlypwa-form' });
|
||||||
passLbl = dm('label', { innerHTML: 'Password' });
|
passLbl = dm('label', { innerHTML: 'Password' });
|
||||||
passInput = dm('input', { attributes: { type: 'password' } });
|
passInput = dm('input', { attributes: { type: 'password', name: 'password', autocomplete: 'current-password' } });
|
||||||
submit = dm('button', { attributes: { type: 'submit' }, text: 'Log in' });
|
submit = dm('button', { attributes: { type: 'submit' }, text: 'Log in' });
|
||||||
feedback = dm('div', {});
|
feedback = dm('div', {});
|
||||||
|
|
||||||
|
|
@ -70,6 +70,10 @@ Formatted with `deno fmt`.
|
||||||
this.feedback.innerHTML = html;
|
this.feedback.innerHTML = html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setFresh() {
|
||||||
|
this.passInput.setAttribute('autocomplete', 'new-password');
|
||||||
|
}
|
||||||
|
|
||||||
showForm(empty) {
|
showForm(empty) {
|
||||||
if (this.formShown) return;
|
if (this.formShown) return;
|
||||||
this.formShown = true;
|
this.formShown = true;
|
||||||
|
|
@ -107,7 +111,7 @@ Formatted with `deno fmt`.
|
||||||
addTokenInput(handlerFunction) {
|
addTokenInput(handlerFunction) {
|
||||||
const tokLbl = dm('label', { text: 'Sync token' });
|
const tokLbl = dm('label', { text: 'Sync token' });
|
||||||
tokLbl.appendChild(dm('input', {
|
tokLbl.appendChild(dm('input', {
|
||||||
attributes: { type: 'password' },
|
attributes: { type: 'text', name: 'username', autocomplete: 'username' },
|
||||||
eventListeners: [{ name: 'change', handlerFunction }],
|
eventListeners: [{ name: 'change', handlerFunction }],
|
||||||
}));
|
}));
|
||||||
this.form.appendChild(tokLbl);
|
this.form.appendChild(tokLbl);
|
||||||
|
|
@ -123,7 +127,7 @@ Formatted with `deno fmt`.
|
||||||
});
|
});
|
||||||
const saltLbl = dm('label', { text: 'Salt' });
|
const saltLbl = dm('label', { text: 'Salt' });
|
||||||
saltLbl.appendChild(dm('input', {
|
saltLbl.appendChild(dm('input', {
|
||||||
attributes: { type: 'text' },
|
attributes: { type: 'text', name: 'salt', autocomplete: 'off' },
|
||||||
eventListeners: [{ name: 'change', handlerFunction }],
|
eventListeners: [{ name: 'change', handlerFunction }],
|
||||||
}));
|
}));
|
||||||
saltDtl.appendChild(saltLbl);
|
saltDtl.appendChild(saltLbl);
|
||||||
|
|
|
||||||
|
|
@ -580,6 +580,7 @@ Formatted with `deno fmt`.
|
||||||
<p><strong>Make up a strong password</strong> to protect the content of the wiki.</p>
|
<p><strong>Make up a strong password</strong> to protect the content of the wiki.</p>
|
||||||
`);
|
`);
|
||||||
askToken = false;
|
askToken = false;
|
||||||
|
this.modal.setFresh();
|
||||||
} else if (state === 'fresh') {
|
} else if (state === 'fresh') {
|
||||||
this.modal.setBody(`
|
this.modal.setBody(`
|
||||||
<p>Welcome to your new synchronized wiki!</p>
|
<p>Welcome to your new synchronized wiki!</p>
|
||||||
|
|
@ -587,6 +588,7 @@ Formatted with `deno fmt`.
|
||||||
<p>The password will be used to encrypt your data, hiding the content from the server and, if you choose not to use the "remember password" option, against unauthorized users of this device.</p>
|
<p>The password will be used to encrypt your data, hiding the content from the server and, if you choose not to use the "remember password" option, against unauthorized users of this device.</p>
|
||||||
<p>You will have to use that password to open this wiki on all synchronized devices/browsers.</p>
|
<p>You will have to use that password to open this wiki on all synchronized devices/browsers.</p>
|
||||||
`);
|
`);
|
||||||
|
this.modal.setFresh();
|
||||||
} else if (state === 'existing') {
|
} else if (state === 'existing') {
|
||||||
this.modal.setBody(`
|
this.modal.setBody(`
|
||||||
<p>Welcome back to your synchronized wiki!</p>
|
<p>Welcome back to your synchronized wiki!</p>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue