added: bookmarks list in command palette

This commit is contained in:
quenousimporte 2024-01-08 11:46:38 +01:00
parent 3ffacd309d
commit d065c41686
1 changed files with 11 additions and 0 deletions

11
main.js
View File

@ -1673,6 +1673,13 @@ function commandpalette()
text: s, text: s,
suffix: s == "password" ? null : [settings[s]] suffix: s == "password" ? null : [settings[s]]
}; };
}))
.concat(JSON.parse((getnote("bookmarks") || {content: "[]"}).content).map(b =>
{
return {
prefix: "open bookmark ",
text: b.title
};
}))) })))
.then(selected => .then(selected =>
{ {
@ -1690,6 +1697,10 @@ function commandpalette()
{ {
editsetting(selected.text); editsetting(selected.text);
} }
else if (selected.prefix == "open bookmark ")
{
window.open(JSON.parse(getnote("bookmarks").content).find(b => b.title == selected.text).url, "_blank");
}
else else
{ {
var command = commands.find(c => c.hint == selected.text); var command = commands.find(c => c.hint == selected.text);