From c7c35b4bf0ce0e05e1ee952a203812a79c39f6bf Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 7 Jan 2025 10:44:59 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/13742 --- app/src/menus/protyle.ts | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 44c942771..0bbc76ef8 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -259,14 +259,28 @@ export const fileAnnotationRefMenu = (protyle: IProtyle, refElement: HTMLElement }).element); window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element); window.siyuan.menus.menu.append(new MenuItem({ - label: `${window.siyuan.languages.turnInto} ${window.siyuan.languages.text}`, + label: window.siyuan.languages.turnInto, icon: "iconRefresh", - click() { - nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); - removeInlineType(refElement, "file-annotation-ref", protyle.toolbar.range); - updateTransaction(protyle, id, nodeElement.outerHTML, oldHTML); - oldHTML = nodeElement.outerHTML; - } + submenu: [{ + iconHTML: "", + label: window.siyuan.languages.text, + click() { + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); + removeInlineType(refElement, "file-annotation-ref", protyle.toolbar.range); + updateTransaction(protyle, id, nodeElement.outerHTML, oldHTML); + oldHTML = nodeElement.outerHTML; + } + }, { + iconHTML: "", + label: window.siyuan.languages.text + " *", + click() { + refElement.insertAdjacentHTML("beforebegin", refElement.innerHTML + " "); + refElement.textContent = "*"; + nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); + updateTransaction(protyle, id, nodeElement.outerHTML, oldHTML); + oldHTML = nodeElement.outerHTML; + } + }] }).element); window.siyuan.menus.menu.append(new MenuItem({ icon: "iconTrashcan",