Skip to content

Commit

Permalink
🎨 #24
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Nov 7, 2024
1 parent d1eb2a7 commit 27bc030
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
Custom, exitSiYuan, getModelByDockType, getAllEditor, Files, platformUtils
} from "siyuan";
import "./index.scss";
import {IMenuItem} from "siyuan/types";

const STORAGE_NAME = "menu-config";
const TAB_TYPE = "custom_tab";
Expand All @@ -32,6 +33,21 @@ export default class PluginSample extends Plugin {
private isMobile: boolean;
private blockIconEventBindThis = this.blockIconEvent.bind(this);

updateProtyleToolbar(toolbar: Array<string | IMenuItem>) {
toolbar.push("|")
toolbar.push({
name: "insert-smail-emoji",
icon: "iconEmoji",
hotkey: "⇧⌘I",
tipPosition: "n",
tip: this.i18n.insertEmoji,
click(protyle: Protyle) {
protyle.insert("😊");
}
})
return toolbar;
}

onload() {
this.data[STORAGE_NAME] = {readonlyText: "Readonly"};

Expand Down Expand Up @@ -218,17 +234,7 @@ export default class PluginSample extends Plugin {
"tag",
"inline-math",
"inline-memo",
"|",
{
name: "insert-smail-emoji",
icon: "iconEmoji",
hotkey: "⇧⌘I",
tipPosition: "n",
tip: this.i18n.insertEmoji,
click(protyle: Protyle) {
protyle.insert("😊");
}
}],
],
};

console.log(this.i18n.helloPlugin);
Expand Down

0 comments on commit 27bc030

Please sign in to comment.