2023-04-06 22:25:50 +08:00
|
|
|
import {fetchPost} from "../util/fetch";
|
|
|
|
|
import {Dialog} from "../dialog";
|
2023-06-07 10:36:20 +08:00
|
|
|
import {highlightRender} from "../protyle/render/highlightRender";
|
2023-04-06 22:25:50 +08:00
|
|
|
import {isMobile} from "../util/functions";
|
2024-01-10 22:31:28 +08:00
|
|
|
import {Constants} from "../constants";
|
2023-04-06 22:25:50 +08:00
|
|
|
|
|
|
|
|
export const openChangelog = () => {
|
|
|
|
|
fetchPost("/api/system/getChangelog", {}, (response) => {
|
|
|
|
|
if (!response.data.show) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const dialog = new Dialog({
|
2023-05-23 20:41:11 +08:00
|
|
|
title: `✨ ${window.siyuan.languages.whatsNewInSiYuan} v${window.siyuan.config.system.kernelVersion}`,
|
2023-04-20 10:05:24 +08:00
|
|
|
width: isMobile() ? "92vw" : "768px",
|
2023-05-22 22:08:01 +08:00
|
|
|
height: isMobile() ? "80vh" : "70vh",
|
|
|
|
|
content: `<div style="overflow:auto;" class="b3-dialog__content b3-typography b3-typography--default">${response.data.html}</div>`
|
2023-04-06 22:25:50 +08:00
|
|
|
});
|
2024-01-10 22:31:28 +08:00
|
|
|
dialog.element.setAttribute("data-key", Constants.DIALOG_CHANGELOG);
|
2023-04-06 22:25:50 +08:00
|
|
|
highlightRender(dialog.element);
|
|
|
|
|
});
|
2023-04-06 22:32:33 +08:00
|
|
|
};
|