interface.js: added placeholder support
This commit is contained in:
parent
25be65b32f
commit
b9a56f38f5
@ -16,9 +16,13 @@ let tabs = new TabList({});
|
||||
|
||||
let encForm = tabs.createForm({label: "Encryption"});
|
||||
|
||||
let encMsg = encForm.createTextArea({label: "Message"});
|
||||
let encMsg = encForm.createTextArea({
|
||||
label: "Message",
|
||||
placeholder: "Type a secret message",
|
||||
});
|
||||
let encPass = encForm.createPasswordInput({
|
||||
label: "Password",
|
||||
placeholder: "Enter your password",
|
||||
enabledFunc: function() {return !encManualKey.value}
|
||||
});
|
||||
let encPbkdf2Iters = encForm.createNumberInput({
|
||||
@ -122,10 +126,12 @@ let decForm = tabs.createForm({label: "Decryption"});
|
||||
|
||||
let decMsg = decForm.createTextArea({
|
||||
label: "Encrypted message",
|
||||
placeholder: "Paste the encrypted output",
|
||||
dataType: "json-b64",
|
||||
});
|
||||
let decPass = decForm.createPasswordInput({
|
||||
label: "Password",
|
||||
placeholder: "Enter your password",
|
||||
enabledFunc: function() {return !decManualKey.value}
|
||||
});
|
||||
let decKey = decForm.createMediumTextBox({
|
||||
|
@ -302,7 +302,7 @@ function bufToB64 (buf) {
|
||||
|
||||
class FormElement extends InterfaceElement {
|
||||
constructor({tag, fragment, advanced=false, form,
|
||||
value, dataType,
|
||||
value, dataType, placeholder,
|
||||
labelTag, label="",
|
||||
enabled=true, enabledFunc,
|
||||
visibleFunc
|
||||
@ -349,6 +349,7 @@ class FormElement extends InterfaceElement {
|
||||
this.advanced = advanced;
|
||||
|
||||
if (value !== undefined) this.value = value;
|
||||
if (placeholder !== undefined) this.handle.placeholder = placeholder;
|
||||
}
|
||||
|
||||
get value() {
|
||||
|
Loading…
Reference in New Issue
Block a user