This commit is contained in:
frostime 2023-06-28 20:43:58 +08:00
parent 837f5ae1f5
commit 22c27c0542
2 changed files with 37 additions and 3 deletions

View file

@ -1,3 +1,26 @@
#helloPanel { #helloPanel {
border: 1px rgb(189, 119, 119) dashed; border: 1px rgb(189, 119, 119) dashed;
} }
.plugin-sample {
&__custom-tab {
background-color: var(--b3-theme-background);
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
&__custom-dock {
display: flex;
justify-content: center;
align-items: center;
}
&__time {
background: var(--b3-card-info-background);
border-radius: 4px;
padding: 2px 8px;
}
}

View file

@ -9,7 +9,9 @@ import {
getFrontend, getFrontend,
getBackend, getBackend,
IModel, IModel,
Setting Setting,
fetchPost,
Protyle
} from "siyuan"; } from "siyuan";
import "@/index.scss"; import "@/index.scss";
@ -167,6 +169,15 @@ export default class PluginSample extends Plugin {
actionElement: btnaElement, 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); console.log(this.i18n.helloPlugin);
} }
@ -240,10 +251,10 @@ export default class PluginSample extends Plugin {
}); });
menu.addItem({ menu.addItem({
icon: "iconInfo", icon: "iconInfo",
label: "Dialog", label: "Dialog(open help first)",
accelerator: this.commands[0].customHotkey, accelerator: this.commands[0].customHotkey,
click: () => { click: () => {
this.showDialog() this.showDialog();
} }
}); });
if (!this.isMobile) { if (!this.isMobile) {