added: command to change a setting
This commit is contained in:
parent
431cac35c3
commit
2935034202
19
main.js
19
main.js
|
@ -260,6 +260,10 @@ var commands = [
|
||||||
hint: "Settings",
|
hint: "Settings",
|
||||||
action: editsettings
|
action: editsettings
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
hint: "Change a setting",
|
||||||
|
action: changesetting
|
||||||
|
},
|
||||||
{
|
{
|
||||||
hint: "Restore default settings",
|
hint: "Restore default settings",
|
||||||
action: restoresettings
|
action: restoresettings
|
||||||
|
@ -935,6 +939,21 @@ function editsettings()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changesetting()
|
||||||
|
{
|
||||||
|
searchinlist(Object.keys(settings).map(name => name + ": " + settings[name]))
|
||||||
|
.then(setting =>
|
||||||
|
{
|
||||||
|
var name = setting.split(":").shift();
|
||||||
|
if (settings[name])
|
||||||
|
{
|
||||||
|
settings[name] = prompt(name, settings[name]);
|
||||||
|
savesettings();
|
||||||
|
loadsettings();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function decryptnote()
|
function decryptnote()
|
||||||
{
|
{
|
||||||
decryptstring(md.value)
|
decryptstring(md.value)
|
||||||
|
|
Loading…
Reference in New Issue