From 89cb2f548285dbc1c732f1dccecab07fdd95fad8 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Tue, 17 Oct 2023 14:08:30 +0200 Subject: [PATCH 1/6] added: timestamp and vault in zip name added: current tag in window title --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index d0bb09d..22c728d 100644 --- a/main.js +++ b/main.js @@ -1101,7 +1101,7 @@ function downloadnotes() zip.generateAsync({type:"blob"}) .then(function(content) { - saveAs(content, "notes.zip"); + saveAs(content, "notes " + timestamp() + " " + currentvault + ".zip"); }); } @@ -2516,7 +2516,7 @@ function mainkeydownhandler() function setwindowtitle() { - document.title = currentnote.title; + document.title = (currenttag ? currenttag + "\\": "") + currentnote.title; } function ontitlechange() From a38c7f9e583bd58d387566ae4b3432c879c4d47d Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Tue, 17 Oct 2023 14:09:20 +0200 Subject: [PATCH 2/6] added: current tag by default on new note --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index 22c728d..71b6cc5 100644 --- a/main.js +++ b/main.js @@ -2766,7 +2766,7 @@ function defaultheaders(title, tags = "") "---", "title: " + title, "date: " + timestamp().substr(0,10), - "tags: " + (tags || ""), + "tags: " + (tags || currenttag || ""), "---", "",""].join("\n"); } From 553c8a070132d122b71f004fedc87baa98446d5d Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Tue, 17 Oct 2023 17:11:04 +0200 Subject: [PATCH 3/6] changed: autocomplete multiple tags --- main.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 71b6cc5..d2c686d 100644 --- a/main.js +++ b/main.js @@ -2112,11 +2112,14 @@ function applycolors() if (slashpos > spacepos) { var snippetpart = raw.substring(slashpos); - var snippet = snippets.find(s => s.command.startsWith(snippetpart)); - if (snippet) - { - line += "" + snippet.command.substr(pos - slashpos) + ""; - } + + var matching = snippets + .filter(s => s.command.startsWith(snippetpart)) + .map(s => s.command.substring(1)); + + line += ""; + line += matching.join().substr(pos - slashpos - 1); + line += ""; } } } From 6e4a01b9c3f057b21a3f745ec681ba6a3b4d0b37 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Wed, 18 Oct 2023 08:50:51 +0200 Subject: [PATCH 4/6] disabled: number highlighting in code block as it breaks html encoding --- main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index d2c686d..324df7f 100644 --- a/main.js +++ b/main.js @@ -2057,7 +2057,8 @@ function applycolors() } else if (code) { - line = line.replace(/\b(\d+)\b/g, "$1"); + //breaks html escape + //line = line.replace(/\b(\d+)\b/g, "$1"); if (languagekeywords[language]) { var keywords = languagekeywords[language]; From 87f31a6a2675a27d963d73653bdecdfbf98ab8b4 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 19 Oct 2023 08:46:09 +0200 Subject: [PATCH 5/6] changed: F1 opens command palette --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 324df7f..7928bd1 100644 --- a/main.js +++ b/main.js @@ -120,7 +120,6 @@ var commands = [ allowunsaved: true }, { - shortcut: "F1", hint: "Show help", action: showhelp }, @@ -2459,9 +2458,10 @@ function mainkeydownhandler() fileindex = Math.max(fileindex, 0); applyfileindex(); } - else if (event.ctrlKey && event.key == " " || event.key == "F2") + else if (event.ctrlKey && event.key == " " || event.key == "F1") { commandpalette(); + event.preventDefault(); } else if (event.ctrlKey && event.shiftKey && (event.keyCode == "40" || event.keyCode == "38")) { From 40703c176474fc2ef39a384e37b317a2e8b73205 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 19 Oct 2023 09:09:39 +0200 Subject: [PATCH 6/6] Revert "disabled: number highlighting in code block as it breaks html encoding" This reverts commit 6e4a01b9c3f057b21a3f745ec681ba6a3b4d0b37. --- main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.js b/main.js index 7928bd1..ec2abde 100644 --- a/main.js +++ b/main.js @@ -2056,8 +2056,7 @@ function applycolors() } else if (code) { - //breaks html escape - //line = line.replace(/\b(\d+)\b/g, "$1"); + line = line.replace(/\b(\d+)\b/g, "$1"); if (languagekeywords[language]) { var keywords = languagekeywords[language];