Skip to content

Commit ced9641

Browse files
committed
1 parent 2ab4648 commit ced9641

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.1.9
2+
3+
* [Add `open-menu-xxx` event bus for plugins ](https://github.com/siyuan-note/siyuan/issues/8617)
4+
15
## 0.1.8
26

37
* [Add protyleSlash to the plugin](https://github.com/siyuan-note/siyuan/issues/8599)

src/index.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,90 @@ export default class PluginSample extends Plugin {
429429
click: () => {
430430
this.eventBus.off("loaded-protyle", this.eventBusLog);
431431
}
432+
}, {
433+
icon: "iconSelect",
434+
label: "On open-menu-blockref",
435+
click: () => {
436+
this.eventBus.on("open-menu-blockref", this.eventBusLog);
437+
}
438+
}, {
439+
icon: "iconClose",
440+
label: "Off open-menu-blockref",
441+
click: () => {
442+
this.eventBus.off("open-menu-blockref", this.eventBusLog);
443+
}
444+
}, {
445+
icon: "iconSelect",
446+
label: "On open-menu-fileannotationref",
447+
click: () => {
448+
this.eventBus.on("open-menu-fileannotationref", this.eventBusLog);
449+
}
450+
}, {
451+
icon: "iconClose",
452+
label: "Off open-menu-fileannotationref",
453+
click: () => {
454+
this.eventBus.off("open-menu-fileannotationref", this.eventBusLog);
455+
}
456+
}, {
457+
icon: "iconSelect",
458+
label: "On open-menu-tag",
459+
click: () => {
460+
this.eventBus.on("open-menu-tag", this.eventBusLog);
461+
}
462+
}, {
463+
icon: "iconClose",
464+
label: "Off open-menu-tag",
465+
click: () => {
466+
this.eventBus.off("open-menu-tag", this.eventBusLog);
467+
}
468+
}, {
469+
icon: "iconSelect",
470+
label: "On open-menu-link",
471+
click: () => {
472+
this.eventBus.on("open-menu-link", this.eventBusLog);
473+
}
474+
}, {
475+
icon: "iconClose",
476+
label: "Off open-menu-link",
477+
click: () => {
478+
this.eventBus.off("open-menu-link", this.eventBusLog);
479+
}
480+
}, {
481+
icon: "iconSelect",
482+
label: "On open-menu-image",
483+
click: () => {
484+
this.eventBus.on("open-menu-image", this.eventBusLog);
485+
}
486+
}, {
487+
icon: "iconClose",
488+
label: "Off open-menu-image",
489+
click: () => {
490+
this.eventBus.off("open-menu-image", this.eventBusLog);
491+
}
492+
}, {
493+
icon: "iconSelect",
494+
label: "On open-menu-av",
495+
click: () => {
496+
this.eventBus.on("open-menu-av", this.eventBusLog);
497+
}
498+
}, {
499+
icon: "iconClose",
500+
label: "Off open-menu-av",
501+
click: () => {
502+
this.eventBus.off("open-menu-av", this.eventBusLog);
503+
}
504+
}, {
505+
icon: "iconSelect",
506+
label: "On open-menu-content",
507+
click: () => {
508+
this.eventBus.on("open-menu-content", this.eventBusLog);
509+
}
510+
}, {
511+
icon: "iconClose",
512+
label: "Off open-menu-content",
513+
click: () => {
514+
this.eventBus.off("open-menu-content", this.eventBusLog);
515+
}
432516
}]
433517
});
434518
menu.addSeparator();

0 commit comments

Comments
 (0)