mirror of
https://github.com/siyuan-note/plugin-sample-vite-svelte.git
synced 2025-06-07 18:46:01 +00:00
change
This commit is contained in:
parent
837f5ae1f5
commit
22c27c0542
2 changed files with 37 additions and 3 deletions
17
src/index.ts
17
src/index.ts
|
@ -9,7 +9,9 @@ import {
|
|||
getFrontend,
|
||||
getBackend,
|
||||
IModel,
|
||||
Setting
|
||||
Setting,
|
||||
fetchPost,
|
||||
Protyle
|
||||
} from "siyuan";
|
||||
import "@/index.scss";
|
||||
|
||||
|
@ -167,6 +169,15 @@ export default class PluginSample extends Plugin {
|
|||
actionElement: btnaElement,
|
||||
});
|
||||
|
||||
this.protyleSlash = [{
|
||||
filter: ["insert emoji 😊", "插入表情 😊", "crbqwx"],
|
||||
html: `<div class="b3-list-item__first"><span class="b3-list-item__text">${this.i18n.insertEmoji}</span><span class="b3-list-item__meta">😊</span></div>`,
|
||||
id: "insertEmoji",
|
||||
callback(protyle: Protyle) {
|
||||
protyle.insert("😊");
|
||||
}
|
||||
}];
|
||||
|
||||
console.log(this.i18n.helloPlugin);
|
||||
}
|
||||
|
||||
|
@ -240,10 +251,10 @@ export default class PluginSample extends Plugin {
|
|||
});
|
||||
menu.addItem({
|
||||
icon: "iconInfo",
|
||||
label: "Dialog",
|
||||
label: "Dialog(open help first)",
|
||||
accelerator: this.commands[0].customHotkey,
|
||||
click: () => {
|
||||
this.showDialog()
|
||||
this.showDialog();
|
||||
}
|
||||
});
|
||||
if (!this.isMobile) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue