🎨 Improve export menu (#14960)

fix https://github.com/siyuan-note/siyuan/pull/14950
This commit is contained in:
Jeffrey Chen 2025-06-03 11:24:33 +08:00 committed by GitHub
parent 7419c4bca8
commit bb814179aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 22 deletions

View file

@ -530,12 +530,12 @@ export const exportMd = (id: string) => {
});
}
}, {
id: "exportMarkdown",
label: "Markdown",
icon: "iconMarkdown",
id: "exportSiYuanZip",
label: "SiYuan .sy.zip",
icon: "iconSiYuan",
click: () => {
const msgId = showMessage(window.siyuan.languages.exporting, -1);
fetchPost("/api/export/exportMd", {
fetchPost("/api/export/exportSY", {
id,
}, response => {
hideMessage(msgId);
@ -543,12 +543,12 @@ export const exportMd = (id: string) => {
});
}
}, {
id: "exportSiYuanZip",
label: "SiYuan .sy.zip",
icon: "iconSiYuan",
id: "exportMarkdown",
label: "Markdown .zip",
icon: "iconMarkdown",
click: () => {
const msgId = showMessage(window.siyuan.languages.exporting, -1);
fetchPost("/api/export/exportSY", {
fetchPost("/api/export/exportMd", {
id,
}, response => {
hideMessage(msgId);

View file

@ -158,7 +158,7 @@ const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
icon: "iconUpload",
submenu: [{
id: "exportMarkdown",
label: "Markdown",
label: "Markdown .zip",
icon: "iconMarkdown",
click: () => {
const msgId = showMessage(window.siyuan.languages.exporting, -1);
@ -374,19 +374,6 @@ export const initNavigationMenu = (app: App, liElement: HTMLElement) => {
type: "submenu",
icon: "iconUpload",
submenu: [{
id: "exportMarkdown",
label: "Markdown",
icon: "iconMarkdown",
click: () => {
const msgId = showMessage(window.siyuan.languages.exporting, -1);
fetchPost("/api/export/exportNotebookMd", {
notebook: notebookId
}, response => {
hideMessage(msgId);
openByMobile(response.data.zip);
});
}
}, {
id: "exportSiYuanZip",
label: "SiYuan .sy.zip",
icon: "iconSiYuan",
@ -399,6 +386,19 @@ export const initNavigationMenu = (app: App, liElement: HTMLElement) => {
openByMobile(response.data.zip);
});
}
}, {
id: "exportMarkdown",
label: "Markdown .zip",
icon: "iconMarkdown",
click: () => {
const msgId = showMessage(window.siyuan.languages.exporting, -1);
fetchPost("/api/export/exportNotebookMd", {
notebook: notebookId
}, response => {
hideMessage(msgId);
openByMobile(response.data.zip);
});
}
}]
}).element);
if (app.plugins) {