Skip to content

Commit

Permalink
Merge pull request #25 from TCOTC/dev-menu-id
Browse files Browse the repository at this point in the history
  • Loading branch information
TCOTC authored Sep 19, 2024
2 parents 3e26436 + b23ec5f commit d0796a3
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 51 deletions.
1 change: 1 addition & 0 deletions app/src/menus/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {Constants} from "../constants";

export const transferBlockRef = (id: string) => {
window.siyuan.menus.menu.append(new MenuItem({
id: "transferBlockRef",
label: window.siyuan.languages.transferBlockRef,
icon: "iconScrollHoriz",
click() {
Expand Down
4 changes: 4 additions & 0 deletions app/src/menus/protyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,7 @@ export const iframeMenu = (protyle: IProtyle, nodeElement: Element) => {
const iframeElement = nodeElement.querySelector("iframe");
let html = nodeElement.outerHTML;
const subMenus: IMenu[] = [{
id: "asset",
iconHTML: "",
type: "readonly",
label: `<textarea spellcheck="false" rows="1" class="b3-text-field fn__size200" placeholder="${window.siyuan.languages.link}" style="margin: 4px 0">${iframeElement.getAttribute("src") || ""}</textarea>`,
Expand Down Expand Up @@ -1843,6 +1844,7 @@ export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string)
const videoElement = nodeElement.querySelector(type === "NodeVideo" ? "video" : "audio");
let html = nodeElement.outerHTML;
const subMenus: IMenu[] = [{
id: "asset",
iconHTML: "",
type: "readonly",
label: `<textarea spellcheck="false" rows="1" style="margin: 4px 0" class="b3-text-field" placeholder="${window.siyuan.languages.link}">${videoElement.getAttribute("src")}</textarea>`,
Expand All @@ -1862,6 +1864,7 @@ export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string)
type: "separator"
});
subMenus.push({
id: "rename",
label: window.siyuan.languages.rename,
icon: "iconEdit",
click() {
Expand All @@ -1872,6 +1875,7 @@ export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string)
const VideoSrc = videoElement.getAttribute("src");
if (VideoSrc) {
subMenus.push({
id: "openBy",
label: window.siyuan.languages.openBy,
icon: "iconOpen",
submenu: openMenu(protyle.app, VideoSrc, true, false) as IMenu[]
Expand Down
Loading

0 comments on commit d0796a3

Please sign in to comment.