Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Aug 12, 2023
1 parent 0ba495c commit 7fbf89a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.0

* [Add plugin event bus `open-siyuan-url-plugin` and `open-siyuan-url-block`](https://github.com/siyuan-note/siyuan/pull/8927)

## 0.1.12 2023-08-01

* Upgrade siyuan to 0.7.9
Expand Down
35 changes: 34 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,16 @@ export default class PluginSample extends Plugin {
hotkey: "⇧⌘M",
callback: () => {
this.showDialog();
}
},
fileTreeCallback: (file: any) => {
console.log(file, 'fileTreeCallback')
},
editorCallback: (protyle: any) => {
console.log(protyle, 'editorCallback')
},
dockCallback: (element: HTMLElement) => {
console.log(element, 'dockCallback')
},
});

this.addDock({
Expand Down Expand Up @@ -538,6 +547,30 @@ export default class PluginSample extends Plugin {
click: () => {
this.eventBus.off("input-search", this.eventBusLog);
}
}, {
icon: "iconSelect",
label: "On open-siyuan-url-plugin",
click: () => {
this.eventBus.on("open-siyuan-url-plugin", this.eventBusLog);
}
}, {
icon: "iconClose",
label: "Off open-siyuan-url-plugin",
click: () => {
this.eventBus.off("open-siyuan-url-plugin", this.eventBusLog);
}
}, {
icon: "iconSelect",
label: "On open-siyuan-url-block",
click: () => {
this.eventBus.on("open-siyuan-url-block", this.eventBusLog);
}
}, {
icon: "iconClose",
label: "Off open-siyuan-url-block",
click: () => {
this.eventBus.off("open-siyuan-url-block", this.eventBusLog);
}
}]
});
menu.addSeparator();
Expand Down

0 comments on commit 7fbf89a

Please sign in to comment.