From ab00e2a50f288669c702421acf548bbca298c0cc Mon Sep 17 00:00:00 2001 From: Zihad Date: Mon, 5 May 2025 20:22:11 +0600 Subject: [PATCH] feat: add command supports --- src/main.ts | 13 +++++++++++++ src/settings.ts | 1 + 2 files changed, 14 insertions(+) diff --git a/src/main.ts b/src/main.ts index 0413893..e01c6e0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -186,6 +186,19 @@ export default class EasyKeepViewPlugin extends Plugin { this.activateEasyKeepView(); }); + // Register commands here + this.addCommand({ + id: "open-easy-keep-view", + name: "Open Easy Keep View", + callback: () => this.activateEasyKeepView(), + }); + + this.addCommand({ + id: "create-easy-keep-note", + name: "Create New Easy Keep Note", + callback: () => this.createNewNote(), + }); + // Update database on file-open this.registerEvent(this.app.workspace.on("file-open", async (file) => { if (file) { diff --git a/src/settings.ts b/src/settings.ts index 4b0a849..8aae908 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -23,6 +23,7 @@ export const DEFAULT_SETTINGS: EasyKeepViewPluginSettings = { openAsHomepage: false, }; + export class EasySettingTab extends PluginSettingTab { plugin: EasyKeepViewPlugin;