diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index a3fea0878..524b6c7b2 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -1,4 +1,5 @@
{
+ "location": "位置",
"noSplitScreenWhenOpenTab": "打开页签时不分屏",
"noSplitScreenWhenOpenTabTip": "打开搜索、PDF 等页签时不自动分屏",
"useChrome": "仅支持在基于 Chromium 内核的浏览器(比如 Chrome/Edge)中使用,使用其他浏览器会遇到无法解决的兼容性问题",
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 3e5528111..5be25eae6 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -64,6 +64,7 @@ import {hideTooltip} from "../dialog/tooltip";
import {clearSelect} from "../protyle/util/clear";
import {scrollCenter} from "../util/highlightById";
import {base64ToURL} from "../util/image";
+import {Dialog} from "../dialog";
const renderAssetList = (element: Element, k: string, position: IPosition, exts: string[] = []) => {
fetchPost("/api/search/searchAsset", {
@@ -2214,6 +2215,61 @@ export const tableMenu = (protyle: IProtyle, nodeElement: Element, cellElement:
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);
}
});
+ otherMenus.push({
+ icon: "iconHeadings",
+ label: window.siyuan.languages.title,
+ click: () => {
+ window.siyuan.menus.menu.remove();
+ const dialog = new Dialog({
+ title: window.siyuan.languages.title,
+ width: isMobile() ? "92vw" : "520px",
+ content: `
+
+
+
+
+
+
+
+
+`,
+ });
+ const html = nodeElement.outerHTML;
+ const inputElement = dialog.element.querySelector(".b3-text-field") as HTMLInputElement;
+ const btnsElement = dialog.element.querySelectorAll(".b3-button");
+ dialog.bindInput(inputElement, () => {
+ (btnsElement[1] as HTMLButtonElement).click();
+ });
+ inputElement.focus();
+ inputElement.value = nodeElement.querySelector("caption")?.innerHTML || "";
+ btnsElement[0].addEventListener("click", () => {
+ dialog.destroy();
+ });
+ btnsElement[1].addEventListener("click", () => {
+ const title = inputElement.value.trim();
+ const location = (dialog.element.querySelector("select") as HTMLSelectElement).value;
+ const captionElement = nodeElement.querySelector("caption");
+ if (title) {
+ const html = `
${Lute.EscapeHTMLStr(title)}`;
+ if (captionElement) {
+ captionElement.outerHTML = html;
+ } else {
+ nodeElement.querySelector("table").insertAdjacentHTML("afterbegin", html);
+ }
+ nodeElement.setAttribute("caption", html);
+ } else {
+ if (captionElement) {
+ captionElement.remove();
+ }
+ nodeElement.removeAttribute("caption");
+ }
+ updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);
+ });
+ }
+ });
otherMenus.push({id: "separator_1", type: "separator"});
otherMenus.push({
id: "alignLeft",