Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 11, 2025
1 parent e64482f commit fddd498
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog

## v0.3.8 2024-11
## v0.3.8 2025-01

* [Add plugin util `openSetting`](https://github.com/siyuan-note/siyuan/pull/13761)
* [Add plugin method `updateProtyleToolbar`](https://github.com/siyuan-note/plugin-sample/issues/24)

## v0.3.7 2024-11-05
Expand Down
16 changes: 12 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
lockScreen,
ICard,
ICardData,
Custom, exitSiYuan, getModelByDockType, getAllEditor, Files, platformUtils
Custom, exitSiYuan, getModelByDockType, getAllEditor, Files, platformUtils, openSetting
} from "siyuan";
import "./index.scss";
import {IMenuItem} from "siyuan/types";
Expand All @@ -34,7 +34,7 @@ export default class PluginSample extends Plugin {
private blockIconEventBindThis = this.blockIconEvent.bind(this);

updateProtyleToolbar(toolbar: Array<string | IMenuItem>) {
toolbar.push("|")
toolbar.push("|");
toolbar.push({
name: "insert-smail-emoji",
icon: "iconEmoji",
Expand All @@ -44,7 +44,7 @@ export default class PluginSample extends Plugin {
click(protyle: Protyle) {
protyle.insert("😊");
}
})
});
return toolbar;
}

Expand Down Expand Up @@ -363,6 +363,14 @@ export default class PluginSample extends Plugin {
const menu = new Menu("topBarSample", () => {
console.log(this.i18n.byeMenu);
});
menu.addItem({
icon: "iconSettings",
label: "Open Setting",
accelerator: this.commands[0].customHotkey,
click: () => {
openSetting(this.app);
}
});
menu.addItem({
icon: "iconInfo",
label: "Dialog(open doc first)",
Expand All @@ -372,7 +380,7 @@ export default class PluginSample extends Plugin {
}
});
menu.addItem({
icon: "iconInfo",
icon: "iconFocus",
label: "Select Opened Doc(open doc first)",
accelerator: this.commands[0].customHotkey,
click: () => {
Expand Down

0 comments on commit fddd498

Please sign in to comment.