This commit is contained in:
Team3
2026-05-21 23:22:24 +02:00
parent e35ad61b2d
commit c4f580b55a

15
main.ts
View File

@@ -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();
});