mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
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: {
|
editor: {
|
||||||
general: {
|
general: {
|
||||||
|
copyID: {default: "", custom: ""},
|
||||||
netImg2LocalAsset: {default: "", custom: ""},
|
netImg2LocalAsset: {default: "", custom: ""},
|
||||||
hLayout: {default: "", custom: ""},
|
hLayout: {default: "", custom: ""},
|
||||||
vLayout: {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: () => {
|
click: () => {
|
||||||
writeText(id);
|
writeText(id);
|
||||||
if (focusElement) {
|
if (focusElement) {
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,10 @@ export class Title {
|
||||||
writeText(`((${protyle.block.rootID} '${this.editElement.textContent}'))`);
|
writeText(`((${protyle.block.rootID} '${this.editElement.textContent}'))`);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
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)) {
|
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.copyBlockEmbed.custom, event)) {
|
||||||
writeText(`{{select * from blocks where id='${protyle.block.rootID}'}}`);
|
writeText(`{{select * from blocks where id='${protyle.block.rootID}'}}`);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.refresh.custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.editor.general.refresh.custom, event)) {
|
||||||
addLoading(protyle);
|
addLoading(protyle);
|
||||||
fetchPost("/api/filetree/getDoc", {
|
fetchPost("/api/filetree/getDoc", {
|
||||||
|
|
|
||||||
|
|
@ -866,6 +866,12 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/// #endif
|
/// #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)) {
|
if (matchHotKey(window.siyuan.config.keymap.editor.general.copyBlockRef.custom, event)) {
|
||||||
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
|
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
|
||||||
let actionElement;
|
let actionElement;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue