This commit is contained in:
parent
3c0be0faaa
commit
ebbf05a712
5 changed files with 14 additions and 1 deletions
|
@ -119,6 +119,7 @@ export abstract class Constants {
|
|||
},
|
||||
editor: {
|
||||
general: {
|
||||
copyID: {default: "", custom: ""},
|
||||
netImg2LocalAsset: {default: "", custom: ""},
|
||||
hLayout: {default: "", custom: ""},
|
||||
vLayout: {default: "", custom: ""},
|
||||
|
|
|
@ -603,7 +603,8 @@ export const copySubMenu = (id: string, name: string, accelerator = true, focusE
|
|||
});
|
||||
}
|
||||
}, {
|
||||
label: window.siyuan.languages.copy + " ID",
|
||||
label: window.siyuan.languages.copyID,
|
||||
accelerator: accelerator ? window.siyuan.config.keymap.editor.general.copyID.custom : undefined,
|
||||
click: () => {
|
||||
writeText(id);
|
||||
if (focusElement) {
|
||||
|
|
|
@ -105,6 +105,10 @@ export class Title {
|
|||
writeText(`((${protyle.block.rootID} '${this.editElement.textContent}'))`);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.copyID.custom, event)) {
|
||||
writeText(protyle.block.rootID);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.copyBlockEmbed.custom, event)) {
|
||||
writeText(`{{select * from blocks where id='${protyle.block.rootID}'}}`);
|
||||
event.preventDefault();
|
||||
|
|
|
@ -21,6 +21,7 @@ export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent) => {
|
|||
event.stopPropagation();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.refresh.custom, event)) {
|
||||
addLoading(protyle);
|
||||
fetchPost("/api/filetree/getDoc", {
|
||||
|
|
|
@ -866,6 +866,12 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
return true;
|
||||
}
|
||||
/// #endif
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.copyID.custom, event)) {
|
||||
writeText(nodeElement.getAttribute("data-node-id"));
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
}
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.copyBlockRef.custom, event)) {
|
||||
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
|
||||
let actionElement;
|
||||
|
|
Loading…
Add table
Reference in a new issue