From c4f580b55a168e99b6254216f73c3c22bc6a1ea4 Mon Sep 17 00:00:00 2001 From: Team3 Date: Thu, 21 May 2026 23:22:24 +0200 Subject: [PATCH] update --- main.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main.ts b/main.ts index f8f9630..e7915fb 100644 --- a/main.ts +++ b/main.ts @@ -17,6 +17,21 @@ export default class ProjektkontextPlugin extends Plugin { this.registerView(VIEW_TYPE_PROJECT_DETAILS_VIEW, (leaf) => new ProjectDetailsView(leaf)); this.registerView(VIEW_TYPE_COLLECTION_VIEW, (leaf) => new CollectionView(leaf)); + this.registerObsidianProtocolHandler("projektkontext", async (params) => { + const project = params.project; + if (!project) { + await this.activateProjectView(); + return; + } + const leaf = this.app.workspace.getLeaf(false); + await leaf.setViewState({ + type: VIEW_TYPE_PROJECT_DETAILS_VIEW, + active: true, + state: { project }, + }); + this.app.workspace.revealLeaf(leaf); + }); + this.addRibbonIcon(RIBBON_ICON, "Projekte", () => { void this.activateProjectView(); });