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
feat(popup_editor): integrate with calendar for existing notes
Elian Dorandccdb5ceb7fd
diff --git a/apps/client/src/services/link.ts b/apps/client/src/services/link.tsindex a16f0bccf3..3e357ee77c 100644--- a/apps/client/src/services/link.ts+++ b/apps/client/src/services/link.ts@@ -231,6 +231,7 @@ export function parseNavigationStateFromUrl(url: string | undefined) {let ntxId: string | null = null;let hoistedNoteId: string | null = null;let searchString: string | null = null;+ let openInPopup = false;if (paramString) {for (const pair of paramString.split("&")) {@@ -246,6 +247,8 @@ export function parseNavigationStateFromUrl(url: string | undefined) {searchString = value; // supports triggering search from URL, e.g. #?searchString=blabla} else if (["viewMode", "attachmentId"].includes(name)) {(viewScope as any)[name] = value;+ } else if (name === "popup") {+ openInPopup = true;} else {console.warn(`Unrecognized hash parameter '${name}'.`);}@@ -266,7 +269,8 @@ export function parseNavigationStateFromUrl(url: string | undefined) {ntxId,hoistedNoteId,viewScope,- searchString+ searchString,+ openInPopup};}@@ -299,7 +303,7 @@ function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent | JQuery.MouseDownEvent}}- const { notePath, viewScope } = parseNavigationStateFromUrl(hrefLink);+ const { notePath, viewScope, openInPopup } = parseNavigationStateFromUrl(hrefLink);const ctrlKey = evt && utils.isCtrlKey(evt);const shiftKey = evt?.shiftKey;@@ -311,7 +315,9 @@ function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent | JQuery.MouseDownEventconst openInNewWindow = isLeftClick && evt?.shiftKey && !ctrlKey;if (notePath) {- if (openInNewWindow) {+ if (openInPopup) {+ appContext.triggerCommand("openInPopup", { noteIdOrPath: notePath });+ } else if (openInNewWindow) {appContext.triggerCommand("openInWindow", { notePath, viewScope });} else if (openInNewTab) {appContext.tabManager.openTabWithNoteWithHoisting(notePath, {diff --git a/apps/client/src/widgets/view_widgets/calendar_view.ts b/apps/client/src/widgets/view_widgets/calendar_view.tsindex 4d6a329138..9cb0747153 100644--- a/apps/client/src/widgets/view_widgets/calendar_view.ts+++ b/apps/client/src/widgets/view_widgets/calendar_view.ts@@ -533,7 +533,7 @@ export default class CalendarView extends ViewMode<{}> {const eventData: EventInput = {title: title,start: startDate,- url: `#${note.noteId}`,+ url: `#${note.noteId}?popup`,noteId: note.noteId,color: color ?? undefined,iconClass: note.getLabelValue("iconClass"),