This commit is contained in:
Vanessa 2022-06-07 21:05:06 +08:00
parent 0c7e5e8667
commit 6fc62d12ee
6 changed files with 14 additions and 14 deletions

View file

@ -162,11 +162,11 @@ export const exportConfig = {
properties: ["showOverwriteConfirmation"], properties: ["showOverwriteConfirmation"],
}).then((result: SaveDialogReturnValue) => { }).then((result: SaveDialogReturnValue) => {
if (!result.canceled) { if (!result.canceled) {
const id = showMessage(window.siyuan.languages.exporting, -1); const msgId = showMessage(window.siyuan.languages.exporting, -1);
fetchPost("/api/export/exportDataInFolder", { fetchPost("/api/export/exportDataInFolder", {
folder: result.filePath folder: result.filePath
}, () => { }, () => {
afterExport(result.filePath, id); afterExport(result.filePath, msgId);
}); });
} }
}); });

View file

@ -639,11 +639,11 @@ export const exportMd = (id: string) => {
label: "Markdown", label: "Markdown",
icon: "iconMarkdown", icon: "iconMarkdown",
click: () => { click: () => {
const id = showMessage(window.siyuan.languages.exporting, -1); const msgId = showMessage(window.siyuan.languages.exporting, -1);
fetchPost("/api/export/exportMd", { fetchPost("/api/export/exportMd", {
id, id,
}, response => { }, response => {
hideMessage(id); hideMessage(msgId);
if (window.siyuan.config.system.container === "ios") { if (window.siyuan.config.system.container === "ios") {
window.location.href = response.data.zip; window.location.href = response.data.zip;
} else if (window.siyuan.config.system.container === "android" && window.JSAndroid) { } else if (window.siyuan.config.system.container === "android" && window.JSAndroid) {
@ -658,11 +658,11 @@ export const exportMd = (id: string) => {
label: "SiYuan .sy.zip", label: "SiYuan .sy.zip",
icon: "iconSiYuan", icon: "iconSiYuan",
click: () => { click: () => {
const id = showMessage(window.siyuan.languages.exporting, -1); const msgId = showMessage(window.siyuan.languages.exporting, -1);
fetchPost("/api/export/exportSY", { fetchPost("/api/export/exportSY", {
id, id,
}, response => { }, response => {
hideMessage(id); hideMessage(msgId);
if (window.siyuan.config.system.container === "ios") { if (window.siyuan.config.system.container === "ios") {
window.location.href = response.data.zip; window.location.href = response.data.zip;
} else if (window.siyuan.config.system.container === "android" && window.JSAndroid) { } else if (window.siyuan.config.system.container === "android" && window.JSAndroid) {

View file

@ -108,12 +108,12 @@ export const initNavigationMenu = (liElement: HTMLElement) => {
label: window.siyuan.languages.export, label: window.siyuan.languages.export,
icon: "iconUpload", icon: "iconUpload",
click: () => { click: () => {
const id = showMessage(window.siyuan.languages.exporting, -1); const msgId = showMessage(window.siyuan.languages.exporting, -1);
fetchPost("/api/export/batchExportMd", { fetchPost("/api/export/batchExportMd", {
notebook: notebookId, notebook: notebookId,
path: "/" path: "/"
}, response => { }, response => {
hideMessage(id); hideMessage(msgId);
window.open(response.data.zip); window.open(response.data.zip);
}); });
} }

View file

@ -181,7 +181,7 @@ export class Breadcrumb {
this.mediaRecorder.cloneChannelData(left, right); this.mediaRecorder.cloneChannelData(left, right);
}; };
this.mediaRecorder.startRecordingNewWavFile(); this.mediaRecorder.startRecordingNewWavFile();
id = showMessage(window.siyuan.languages.recording, -1); messageId = showMessage(window.siyuan.languages.recording, -1);
}).catch(() => { }).catch(() => {
showMessage(window.siyuan.languages["record-tip"]); showMessage(window.siyuan.languages["record-tip"]);
}); });

View file

@ -126,7 +126,7 @@ const getExportPath = (option: { type: string, id: string }, pdfOption?: PrintTo
properties: ["showOverwriteConfirmation"], properties: ["showOverwriteConfirmation"],
}).then((result: SaveDialogReturnValue) => { }).then((result: SaveDialogReturnValue) => {
if (!result.canceled) { if (!result.canceled) {
const id = showMessage(window.siyuan.languages.exporting, -1); const msgId = showMessage(window.siyuan.languages.exporting, -1);
let url = "/api/export/exportHTML"; let url = "/api/export/exportHTML";
if (option.type === "htmlmd") { if (option.type === "htmlmd") {
url = "/api/export/exportMdHTML"; url = "/api/export/exportMdHTML";
@ -139,9 +139,9 @@ const getExportPath = (option: { type: string, id: string }, pdfOption?: PrintTo
savePath: result.filePath savePath: result.filePath
}, exportResponse => { }, exportResponse => {
if (option.type === "word") { if (option.type === "word") {
afterExport(result.filePath, id); afterExport(result.filePath, msgId);
} else { } else {
onExport(exportResponse, result.filePath, option.type, pdfOption, removeAssets, id); onExport(exportResponse, result.filePath, option.type, pdfOption, removeAssets, msgId);
} }
}); });
} }

View file

@ -130,12 +130,12 @@ const genUploadedLabel = (responseText: string, protyle: IProtyle) => {
}; };
export const uploadLocalFiles = (files: string[], protyle: IProtyle) => { export const uploadLocalFiles = (files: string[], protyle: IProtyle) => {
const id = showMessage(window.siyuan.languages.uploading, 0); const msgId = showMessage(window.siyuan.languages.uploading, 0);
fetchPost("/api/asset/insertLocalAssets", { fetchPost("/api/asset/insertLocalAssets", {
assetPaths: files, assetPaths: files,
id: protyle.block.rootID id: protyle.block.rootID
}, (response) => { }, (response) => {
hideMessage(id); hideMessage(msgId);
genUploadedLabel(JSON.stringify(response), protyle); genUploadedLabel(JSON.stringify(response), protyle);
}); });
}; };