mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
This commit is contained in:
parent
be3f57512a
commit
ba42d4f34b
1 changed files with 40 additions and 37 deletions
|
|
@ -772,29 +772,21 @@ export class Gutter {
|
||||||
}
|
}
|
||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
}
|
}
|
||||||
}, {
|
}]);
|
||||||
|
const copyTextRefMenu = this.genCopyTextRef(selectsElement);
|
||||||
|
if (copyTextRefMenu) {
|
||||||
|
copyMenu.splice(7, 0, copyTextRefMenu);
|
||||||
|
}
|
||||||
|
if (!protyle.disabled) {
|
||||||
|
copyMenu.push({
|
||||||
id: "duplicate",
|
id: "duplicate",
|
||||||
iconHTML: "",
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.duplicate,
|
label: window.siyuan.languages.duplicate,
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.duplicate.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.duplicate.custom,
|
||||||
disabled: protyle.disabled,
|
|
||||||
click() {
|
click() {
|
||||||
duplicateBlock(selectsElement, protyle);
|
duplicateBlock(selectsElement, protyle);
|
||||||
}
|
}
|
||||||
}]);
|
|
||||||
copyMenu.splice(4, 1, {
|
|
||||||
id: "copyHPath",
|
|
||||||
iconHTML: "",
|
|
||||||
label: window.siyuan.languages.copyHPath,
|
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.copyHPath.custom,
|
|
||||||
click: () => {
|
|
||||||
copyTextByType([selectsElement[0].getAttribute("data-node-id")], "hPath");
|
|
||||||
focusBlock(selectsElement[0]);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
const copyTextRefMenu = this.genCopyTextRef(selectsElement);
|
|
||||||
if (copyTextRefMenu) {
|
|
||||||
copyMenu.splice(7, 0, copyTextRefMenu);
|
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
id: "copy",
|
id: "copy",
|
||||||
|
|
@ -1291,16 +1283,11 @@ export class Gutter {
|
||||||
}
|
}
|
||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
id: type === "NodeAttributeView" ? "duplicateMirror" : "duplicate",
|
|
||||||
iconHTML: "",
|
|
||||||
label: type === "NodeAttributeView" ? window.siyuan.languages.duplicateMirror : window.siyuan.languages.duplicate,
|
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.duplicate.custom,
|
|
||||||
disabled: protyle.disabled,
|
|
||||||
click() {
|
|
||||||
duplicateBlock([nodeElement], protyle);
|
|
||||||
}
|
|
||||||
}]);
|
}]);
|
||||||
|
const copyTextRefMenu = this.genCopyTextRef([nodeElement]);
|
||||||
|
if (copyTextRefMenu) {
|
||||||
|
copyMenu.splice(7, 0, copyTextRefMenu);
|
||||||
|
}
|
||||||
if (type === "NodeAttributeView") {
|
if (type === "NodeAttributeView") {
|
||||||
copyMenu.splice(6, 0, {
|
copyMenu.splice(6, 0, {
|
||||||
iconHTML: "",
|
iconHTML: "",
|
||||||
|
|
@ -1309,20 +1296,36 @@ export class Gutter {
|
||||||
writeText(nodeElement.getAttribute("data-av-id"));
|
writeText(nodeElement.getAttribute("data-av-id"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (!protyle.disabled) {
|
||||||
|
copyMenu.push({
|
||||||
|
id: "duplicateMirror",
|
||||||
|
iconHTML: "",
|
||||||
|
label: window.siyuan.languages.duplicateMirror,
|
||||||
|
accelerator: window.siyuan.config.keymap.editor.general.duplicate.custom,
|
||||||
|
click() {
|
||||||
|
duplicateBlock([nodeElement], protyle);
|
||||||
|
}
|
||||||
|
});
|
||||||
copyMenu.push({
|
copyMenu.push({
|
||||||
id: "duplicateCompletely",
|
id: "duplicateCompletely",
|
||||||
iconHTML: "",
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.duplicateCompletely,
|
label: window.siyuan.languages.duplicateCompletely,
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.duplicateCompletely.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.duplicateCompletely.custom,
|
||||||
disabled: protyle.disabled,
|
|
||||||
click() {
|
click() {
|
||||||
duplicateCompletely(protyle, nodeElement as HTMLElement);
|
duplicateCompletely(protyle, nodeElement as HTMLElement);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const copyTextRefMenu = this.genCopyTextRef([nodeElement]);
|
} else if (!protyle.disabled) {
|
||||||
if (copyTextRefMenu) {
|
copyMenu.push({
|
||||||
copyMenu.splice(7, 0, copyTextRefMenu);
|
id: "duplicate",
|
||||||
|
iconHTML: "",
|
||||||
|
label: window.siyuan.languages.duplicate,
|
||||||
|
accelerator: window.siyuan.config.keymap.editor.general.duplicate.custom,
|
||||||
|
click() {
|
||||||
|
duplicateBlock([nodeElement], protyle);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
id: "copy",
|
id: "copy",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue