Add command

This commit is contained in:
kitelev 2024-12-30 15:44:42 +05:00
parent 5eb4e42702
commit cd96ed0bf2
2 changed files with 12 additions and 2 deletions

12
main.ts
View File

@ -4,8 +4,18 @@ export default class ExoPlugin extends Plugin {
async onload() { async onload() {
this.addRibbonIcon('dice', 'Exo', () => { this.addRibbonIcon('dice', 'Exo', () => {
new Notice('This is Exocortex!'); this.showModal();
}); });
this.addCommand({
id: 'exo-first-notice',
name: 'Shows simple Notice',
callback: () => {this.showModal()}
})
}
async showModal(): Promise<void> {
new Notice('This is Exocortex!');
} }
onunload() { onunload() {

View File

@ -3,7 +3,7 @@
"name": "Exocortex", "name": "Exocortex",
"version": "0.0.1", "version": "0.0.1",
"minAppVersion": "0.15.0", "minAppVersion": "0.15.0",
"description": "prototype plugin implementing the Exocortex concept", "description": "Prototype plugin implementing the Exocortex concept",
"author": "kitelev", "author": "kitelev",
"authorUrl": "https://t.me/kitelev", "authorUrl": "https://t.me/kitelev",
"fundingUrl": "https://buymeacoffee.com/kitelev", "fundingUrl": "https://buymeacoffee.com/kitelev",