diff --git a/app/src/menus/commonMenuItem.ts b/app/src/menus/commonMenuItem.ts index f42d9c425..e2f8db900 100644 --- a/app/src/menus/commonMenuItem.ts +++ b/app/src/menus/commonMenuItem.ts @@ -751,6 +751,7 @@ export const openMenu = (app: App, src: string, onlyMenu: boolean, showAccelerat ) { /// #if !MOBILE submenu.push({ + icon: "iconLayoutRight", label: window.siyuan.languages.insertRight, accelerator: showAccelerator ? "Click" : "", click() { @@ -780,6 +781,7 @@ export const openMenu = (app: App, src: string, onlyMenu: boolean, showAccelerat } /// #if !BROWSER submenu.push({ + icon: "iconFolder", label: window.siyuan.languages.showInFolder, accelerator: showAccelerator ? "⌘Click" : "", click: () => { diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 4b0973bec..11806fee3 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -666,7 +666,8 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme const titleElement = assetElement.querySelector(".protyle-action__title") as HTMLElement; const html = nodeElement.outerHTML; window.siyuan.menus.menu.append(new MenuItem({ - label: `
`, + iconHTML: "", + label: ``, bind(element) { element.querySelector("textarea").addEventListener("change", (event) => { const value = (event.target as HTMLInputElement).value.replace(/\n|\r\n|\r|\u2028|\u2029/g, ""); @@ -684,7 +685,8 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme } }).element); window.siyuan.menus.menu.append(new MenuItem({ - label: ``, + iconHTML: "", + label: ``, bind(element) { const inputElement = element.querySelector("textarea"); inputElement.value = titleElement.textContent; @@ -698,7 +700,8 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme } }).element); window.siyuan.menus.menu.append(new MenuItem({ - label: ``, + iconHTML: "", + label: ``, bind(element) { element.querySelector("textarea").value = imgElement.getAttribute("alt") || ""; } @@ -734,7 +737,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme } }, { iconHTML: Constants.ZWSP, - label: ``, + label: ``, bind(element) { fetchPost("/api/asset/getImageOCRText", { path: imgElement.getAttribute("src"), @@ -876,7 +879,8 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText const html = nodeElement.outerHTML; const linkAddress = linkElement.getAttribute("data-href"); window.siyuan.menus.menu.append(new MenuItem({ - label: ``, + iconHTML: "", + label: ``, bind(element) { const inputElement = element.querySelector("textarea"); inputElement.value = Lute.UnEscapeHTMLStr(linkAddress) || ""; @@ -896,7 +900,8 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText } }).element); window.siyuan.menus.menu.append(new MenuItem({ - label: ``, + iconHTML: "", + label: ``, bind(element) { const inputElement = element.querySelector("textarea"); // https://github.com/siyuan-note/siyuan/issues/6798 @@ -938,7 +943,8 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText } }).element); window.siyuan.menus.menu.append(new MenuItem({ - label: ``, + iconHTML: "", + label: ``, bind(element) { const inputElement = element.querySelector("textarea"); inputElement.value = Lute.UnEscapeHTMLStr(linkElement.getAttribute("data-title") || ""); @@ -1063,7 +1069,7 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => { const id = nodeElement.getAttribute("data-node-id"); let html = nodeElement.outerHTML; window.siyuan.menus.menu.append(new MenuItem({ - label: ``, + label: ``, bind(element) { const inputElement = element.querySelector("input"); inputElement.value = tagElement.textContent.replace(Constants.ZWSP, ""); @@ -1192,7 +1198,7 @@ export const iframeMenu = (protyle: IProtyle, nodeElement: Element) => { let html = nodeElement.outerHTML; const subMenus: IMenu[] = [{ iconHTML: "", - label: ``, + label: ``, bind(element) { element.querySelector("textarea").addEventListener("change", (event) => { const value = (event.target as HTMLTextAreaElement).value.replace(/\n|\r\n|\r|\u2028|\u2029/g, ""); @@ -1256,7 +1262,8 @@ export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string) const videoElement = nodeElement.querySelector(type === "NodeVideo" ? "video" : "audio"); let html = nodeElement.outerHTML; const subMenus: IMenu[] = [{ - label: ``, + iconHTML: "", + label: ``, bind(element) { element.querySelector("textarea").addEventListener("change", (event) => { videoElement.setAttribute("src", (event.target as HTMLTextAreaElement).value.replace(/\n|\r\n|\r|\u2028|\u2029/g, "")); diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.ts index 4e2463cd0..c436200f0 100644 --- a/app/src/protyle/render/av/openMenuPanel.ts +++ b/app/src/protyle/render/av/openMenuPanel.ts @@ -471,16 +471,27 @@ export const setFilter = (options: { +`; + break; + case "number": + selectHTML = ` + + + + + + + `; break; } menu.addItem({ iconHTML: "", - label: `` + label: `` }); menu.addItem({ iconHTML: "", - label: `` + label: `` }); const textElement = (window.siyuan.menus.menu.element.querySelector(".b3-text-field") as HTMLInputElement); textElement.addEventListener("keydown", (event) => {