From 882ebdbd8f69d261cbb4648841430f372fac3d69 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 9 Dec 2019 23:08:32 +0100 Subject: [PATCH 1/4] revert unicode regex since it's still not supported by ff --- src/public/javascripts/services/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/javascripts/services/utils.js b/src/public/javascripts/services/utils.js index 3586c5b75..d6c311f14 100644 --- a/src/public/javascripts/services/utils.js +++ b/src/public/javascripts/services/utils.js @@ -77,7 +77,7 @@ async function stopWatch(what, func) { } function formatValueWithWhitespace(val) { - return /[^\p{L}_-]/u.test(val) ? '"' + val + '"' : val; + return /[^\w_-]/.test(val) ? '"' + val + '"' : val; } function formatLabel(label) { From b62d79044a7ca771cd3d0980cfc8ed7bf0494aaa Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 20 Dec 2019 19:02:52 +0100 Subject: [PATCH 2/4] fix creating note from relation map, closes #771 --- package-lock.json | 2 +- src/public/javascripts/services/note_detail_relation_map.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2aa49222c..ca464fdcd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "trilium", - "version": "0.38.0-beta", + "version": "0.38.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/public/javascripts/services/note_detail_relation_map.js b/src/public/javascripts/services/note_detail_relation_map.js index 9a56ba3e4..45feb0d92 100644 --- a/src/public/javascripts/services/note_detail_relation_map.js +++ b/src/public/javascripts/services/note_detail_relation_map.js @@ -129,9 +129,10 @@ class NoteDetailRelationMap { return; } - const {note} = await server.post(`notes/${this.ctx.note.noteId}/children`, { + const {note} = await server.post(`notes/${this.ctx.note.noteId}/children?target=into`, { title, - target: 'into' + content: '', + type: 'text' }); toastService.showMessage("Click on canvas to place new note"); From 5350496ed441046e067ee6cd5824e3c570e1456c Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 20 Dec 2019 20:13:21 +0100 Subject: [PATCH 3/4] fix creating note from global ctrl+alt+p shortcut, closes #773 --- src/public/javascripts/services/entrypoints.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/public/javascripts/services/entrypoints.js b/src/public/javascripts/services/entrypoints.js index b8f4aa1bf..b5f9e352b 100644 --- a/src/public/javascripts/services/entrypoints.js +++ b/src/public/javascripts/services/entrypoints.js @@ -9,6 +9,7 @@ import noteDetailService from "./note_detail.js"; import keyboardActionService from "./keyboard_actions.js"; import hoistedNoteService from "./hoisted_note.js"; import treeCache from "./tree_cache.js"; +import server from "./server.js"; const NOTE_REVISIONS = "../dialogs/note_revisions.js"; const OPTIONS = "../dialogs/options.js"; @@ -232,15 +233,16 @@ function registerEntrypoints() { keyboardActionService.setGlobalActionHandler("CreateNoteIntoDayNote", async () => { const todayNote = await dateNoteService.getTodayNote(); - const notePath = await treeService.getSomeNotePath(todayNote); - const node = await treeService.expandToNote(notePath); - - const {note} = await treeService.createNote(node, todayNote.noteId, 'into', { - type: "text", - isProtected: node.data.isProtected + const {note} = await server.post(`notes/${todayNote.noteId}/children?target=into`, { + title: 'new note', + content: '', + type: 'text', + isProtected: todayNote.isProtected }); + await treeService.expandToNote(note.noteId); + await noteDetailService.openInTab(note.noteId, true); }); From f98fa4098fe3d0c53238b440de974b25c31ae67d Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 20 Dec 2019 20:17:58 +0100 Subject: [PATCH 4/4] clearer WS error message --- src/public/javascripts/services/ws.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/javascripts/services/ws.js b/src/public/javascripts/services/ws.js index 918ab8aee..754d58988 100644 --- a/src/public/javascripts/services/ws.js +++ b/src/public/javascripts/services/ws.js @@ -172,7 +172,7 @@ function connectWebSocket() { async function sendPing() { if (Date.now() - lastPingTs > 30000) { - console.log(utils.now(), "Lost connection to server"); + console.log(utils.now(), "Lost websocket connection to the backend"); } if (ws.readyState === ws.OPEN) {