Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fixes to link parsing and tweaks
zadam1c0b55e42279
diff --git a/src/public/javascripts/services/link_map.js b/src/public/javascripts/services/link_map.jsindex 22f18e49e4..5eec78c7fc 100644--- a/src/public/javascripts/services/link_map.js+++ b/src/public/javascripts/services/link_map.js@@ -65,7 +65,7 @@ export default class LinkMap {graph,// param explanation here: https://github.com/dhotson/springy/issues/58400.0, // Spring stiffness- 400.0, // Node repulsion+ 200.0, // Node repulsion0.15 // Damping);@@ -79,6 +79,10 @@ export default class LinkMap {const note = notes.find(n => n.noteId === noteId);+ if (!note) {+ return null;+ }+const $noteBox = $("<div>").addClass("note-box").prop("id", noteBoxId);diff --git a/src/public/javascripts/widgets/link_map.js b/src/public/javascripts/widgets/link_map.jsindex e85eada7a2..2897fc1cba 100644--- a/src/public/javascripts/widgets/link_map.js+++ b/src/public/javascripts/widgets/link_map.js@@ -43,6 +43,16 @@ class LinkMapWidget extends StandardWidget {this.linkMapService.cleanup();}}++ syncDataReceived(syncData) {+ if (syncData.find(sd => sd.entityName === 'attributes' && sd.noteId === this.ctx.note.noteId)) {+ // no need to invalidate attributes since the Attribute class listens to this as well+ // (and is guaranteed to run first)+ if (this.linkMapService) {+ this.linkMapService.loadNotesAndRelations();+ }+ }+ }}export default LinkMapWidget;\ No newline at end of filediff --git a/src/public/javascripts/widgets/note_revisions.js b/src/public/javascripts/widgets/note_revisions.jsindex 7b7cb38a75..9fa3e87189 100644--- a/src/public/javascripts/widgets/note_revisions.js+++ b/src/public/javascripts/widgets/note_revisions.js@@ -9,6 +9,16 @@ const TPL = `class NoteRevisionsWidget extends StandardWidget {getWidgetTitle() { return "Note revisions"; }+ getHeaderActions() {+ const $showFullButton = $("<a>").append("show dialog").addClass('widget-header-action');+ $showFullButton.click(async () => {+ const attributesDialog = await import("../dialogs/note_revisions.js");+ attributesDialog.showDialog();+ });++ return [$showFullButton];+ }+async doRenderBody() {const revisionItems = await server.get(`notes/${this.ctx.note.noteId}/revisions`);diff --git a/src/services/notes.js b/src/services/notes.jsindex d9611c2e9b..374b06f218 100644--- a/src/services/notes.js+++ b/src/services/notes.js@@ -214,7 +214,7 @@ function findImageLinks(content, foundLinks) {while (match = re.exec(content)) {foundLinks.push({- type: 'image-link',+ name: 'image-link',value: match[1]});}@@ -244,7 +244,7 @@ function findRelationMapLinks(content, foundLinks) {for (const note of obj.notes) {foundLinks.push({- type: 'relation-map-link',+ name: 'relation-map-link',value: note.noteId})}