Skip to content

Commit

Permalink
copySubMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
TCOTC committed Sep 19, 2024
1 parent eb81057 commit de5d4b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/menus/commonMenuItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ export const openAttr = (nodeElement: Element, focusName = "bookmark", protyle?:

export const copySubMenu = (id: string, accelerator = true, focusElement?: Element) => {
return [{
id: "copyBlockRef",
iconHTML: "",
accelerator: accelerator ? window.siyuan.config.keymap.editor.general.copyBlockRef.custom : undefined,
label: window.siyuan.languages.copyBlockRef,
Expand All @@ -384,6 +385,7 @@ export const copySubMenu = (id: string, accelerator = true, focusElement?: Eleme
}
}
}, {
id: "copyBlockEmbed",
iconHTML: "",
label: window.siyuan.languages.copyBlockEmbed,
accelerator: accelerator ? window.siyuan.config.keymap.editor.general.copyBlockEmbed.custom : undefined,
Expand All @@ -394,6 +396,7 @@ export const copySubMenu = (id: string, accelerator = true, focusElement?: Eleme
}
}
}, {
id: "copyProtocol",
iconHTML: "",
label: window.siyuan.languages.copyProtocol,
accelerator: accelerator ? window.siyuan.config.keymap.editor.general.copyProtocol.custom : undefined,
Expand All @@ -404,6 +407,7 @@ export const copySubMenu = (id: string, accelerator = true, focusElement?: Eleme
}
}
}, {
id: "copyProtocolInMd",
iconHTML: "",
label: window.siyuan.languages.copyProtocolInMd,
accelerator: accelerator ? window.siyuan.config.keymap.editor.general.copyProtocolInMd.custom : undefined,
Expand All @@ -416,6 +420,7 @@ export const copySubMenu = (id: string, accelerator = true, focusElement?: Eleme
}
}
}, {
id: "copyHPath",
iconHTML: "",
label: window.siyuan.languages.copyHPath,
accelerator: accelerator ? window.siyuan.config.keymap.editor.general.copyHPath.custom : undefined,
Expand All @@ -427,6 +432,7 @@ export const copySubMenu = (id: string, accelerator = true, focusElement?: Eleme
});
}
}, {
id: "copyID",
iconHTML: "",
label: window.siyuan.languages.copyID,
accelerator: accelerator ? window.siyuan.config.keymap.editor.general.copyID.custom : undefined,
Expand Down
4 changes: 4 additions & 0 deletions app/src/protyle/gutter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ export class Gutter {
}

const copyMenu = (copySubMenu(id, true, nodeElement) as IMenu[]).concat([{
id: "copyPlainText",
iconHTML: "",
label: window.siyuan.languages.copyPlainText,
accelerator: window.siyuan.config.keymap.editor.general.copyPlainText.custom,
Expand All @@ -1190,6 +1191,7 @@ export class Gutter {
focusBlock(nodeElement);
}
}, {
id: "copyMirror",
iconHTML: "",
label: type === "NodeAttributeView" ? window.siyuan.languages.copyMirror : window.siyuan.languages.copy,
accelerator: "⌘C",
Expand All @@ -1202,6 +1204,7 @@ export class Gutter {
document.execCommand("copy");
}
}, {
id: "duplicateMirror",
iconHTML: "",
label: type === "NodeAttributeView" ? window.siyuan.languages.duplicateMirror : window.siyuan.languages.duplicate,
accelerator: window.siyuan.config.keymap.editor.general.duplicate.custom,
Expand All @@ -1212,6 +1215,7 @@ export class Gutter {
}]);
if (type === "NodeAttributeView") {
copyMenu.push({
id: "duplicateCompletely",
iconHTML: "",
label: window.siyuan.languages.duplicateCompletely,
accelerator: window.siyuan.config.keymap.editor.general.duplicateCompletely.custom,
Expand Down

0 comments on commit de5d4b6

Please sign in to comment.