update
This commit is contained in:
15
main.ts
15
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_PROJECT_DETAILS_VIEW, (leaf) => new ProjectDetailsView(leaf));
|
||||||
this.registerView(VIEW_TYPE_COLLECTION_VIEW, (leaf) => new CollectionView(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", () => {
|
this.addRibbonIcon(RIBBON_ICON, "Projekte", () => {
|
||||||
void this.activateProjectView();
|
void this.activateProjectView();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user