mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 16:56:10 +01:00
This commit is contained in:
parent
a02c616f22
commit
8520b02df5
3 changed files with 18 additions and 4 deletions
|
|
@ -56,9 +56,12 @@ export const keymap = {
|
|||
</label>`;
|
||||
});
|
||||
item.updateProtyleToolbar([]).forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name)) {
|
||||
return;
|
||||
}
|
||||
if (typeof toolbarItem.hotkey !== "string") {
|
||||
toolbarItem.hotkey = "";
|
||||
}
|
||||
const dockKeymap = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name];
|
||||
const keyValue = updateHotkeyTip(dockKeymap.custom);
|
||||
commandHTML += `<label class="b3-list-item b3-list-item--narrow b3-list-item--hide-action">
|
||||
|
|
|
|||
|
|
@ -80,9 +80,12 @@ export class Plugin {
|
|||
});
|
||||
|
||||
this.updateProtyleToolbar([]).forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name)) {
|
||||
return;
|
||||
}
|
||||
if (typeof toolbarItem.hotkey !== "string") {
|
||||
toolbarItem.hotkey = "";
|
||||
}
|
||||
if (!window.siyuan.config.keymap.plugin) {
|
||||
window.siyuan.config.keymap.plugin = {};
|
||||
}
|
||||
|
|
@ -99,6 +102,8 @@ export class Plugin {
|
|||
default: toolbarItem.hotkey,
|
||||
custom: toolbarItem.hotkey,
|
||||
};
|
||||
} else {
|
||||
window.siyuan.config.keymap.plugin[options.name][toolbarItem.name].default = toolbarItem.hotkey;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,9 +69,12 @@ export class Toolbar {
|
|||
protyle.app.plugins.forEach(item => {
|
||||
const pluginToolbar = item.updateProtyleToolbar(options.toolbar);
|
||||
pluginToolbar.forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name)) {
|
||||
return;
|
||||
}
|
||||
if (typeof toolbarItem.hotkey !== "string") {
|
||||
toolbarItem.hotkey = "";
|
||||
}
|
||||
if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
|
||||
toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
||||
}
|
||||
|
|
@ -90,9 +93,12 @@ export class Toolbar {
|
|||
protyle.app.plugins.forEach(item => {
|
||||
const pluginToolbar = item.updateProtyleToolbar(protyle.options.toolbar);
|
||||
pluginToolbar.forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name)) {
|
||||
return;
|
||||
}
|
||||
if (typeof toolbarItem.hotkey !== "string") {
|
||||
toolbarItem.hotkey = "";
|
||||
}
|
||||
if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
|
||||
toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue