mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -15,6 +15,7 @@ import {hasClosestByAttribute} from "../protyle/util/hasClosest";
|
||||
import {BlockPanel} from "../block/Panel";
|
||||
import {Setting} from "./Setting";
|
||||
import {clearOBG} from "../layout/dock/util";
|
||||
import {Constants} from "../constants";
|
||||
|
||||
export class Plugin {
|
||||
private app: App;
|
||||
@@ -75,6 +76,29 @@ export class Plugin {
|
||||
value: options.name,
|
||||
writable: false,
|
||||
});
|
||||
|
||||
this.updateProtyleToolbar([]).forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
return
|
||||
}
|
||||
if (!window.siyuan.config.keymap.plugin) {
|
||||
window.siyuan.config.keymap.plugin = {};
|
||||
}
|
||||
if (!window.siyuan.config.keymap.plugin[options.name]) {
|
||||
window.siyuan.config.keymap.plugin[options.name] = {
|
||||
[toolbarItem.name]: {
|
||||
default: toolbarItem.hotkey,
|
||||
custom: toolbarItem.hotkey,
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!window.siyuan.config.keymap.plugin[options.name][toolbarItem.name]) {
|
||||
window.siyuan.config.keymap.plugin[options.name][toolbarItem.name] = {
|
||||
default: toolbarItem.hotkey,
|
||||
custom: toolbarItem.hotkey,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
public onload() {
|
||||
|
||||
Reference in New Issue
Block a user