mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-16 03:58:07 +01:00
This commit is contained in:
parent
7688733364
commit
4ee566cbd9
30 changed files with 153 additions and 163 deletions
|
|
@ -53,13 +53,8 @@ export const loadAssets = (data: IAppearance) => {
|
|||
getAllModels().graph.forEach(item => {
|
||||
item.searchGraph(false);
|
||||
});
|
||||
const localPDF = JSON.parse(localStorage.getItem(Constants.LOCAL_PDFTHEME) || "{}");
|
||||
let pdfTheme: string;
|
||||
if (window.siyuan.config.appearance.mode === 0) {
|
||||
pdfTheme = localPDF.light || "light";
|
||||
} else {
|
||||
pdfTheme = localPDF.dark || "dark";
|
||||
}
|
||||
const pdfTheme = window.siyuan.config.appearance.mode === 0 ? window.siyuan.storage[Constants.LOCAL_PDFTHEME].light :
|
||||
window.siyuan.storage[Constants.LOCAL_PDFTHEME].dark;
|
||||
document.querySelectorAll(".pdf__outer").forEach(item => {
|
||||
const darkElement = item.querySelector("#pdfDark");
|
||||
const lightElement = item.querySelector("#pdfLight");
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export const newDailyNote = () => {
|
|||
});
|
||||
return;
|
||||
}
|
||||
const localNotebookId = localStorage.getItem(Constants.LOCAL_DAILYNOTEID);
|
||||
const localNotebookId = window.siyuan.storage[Constants.LOCAL_DAILYNOTEID];
|
||||
if (localNotebookId && getNotebookName(localNotebookId) && !isMobile()) {
|
||||
fetchPost("/api/filetree/createDailyNote", {
|
||||
notebook: localNotebookId,
|
||||
|
|
@ -66,7 +66,7 @@ export const newDailyNote = () => {
|
|||
});
|
||||
btnsElement[1].addEventListener("click", () => {
|
||||
const notebook = selectElement.value;
|
||||
localStorage.setItem(Constants.LOCAL_DAILYNOTEID, notebook);
|
||||
window.siyuan.storage[Constants.LOCAL_DAILYNOTEID] = notebook;
|
||||
fetchPost("/api/filetree/createDailyNote", {
|
||||
notebook,
|
||||
app: Constants.SIYUAN_APPID,
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ const initBar = () => {
|
|||
notebook: item.id,
|
||||
app: Constants.SIYUAN_APPID,
|
||||
});
|
||||
localStorage.setItem(Constants.LOCAL_DAILYNOTEID, item.id);
|
||||
window.siyuan.storage[Constants.LOCAL_DAILYNOTEID] = item.id;
|
||||
}
|
||||
}).element);
|
||||
}
|
||||
|
|
@ -380,11 +380,15 @@ const initWindow = () => {
|
|||
return;
|
||||
}
|
||||
const msgId = showMessage(window.siyuan.languages.exporting, -1);
|
||||
localStorage.setItem(Constants.LOCAL_EXPORTPDF, JSON.stringify(Object.assign(ipcData.pdfOptions, {
|
||||
window.siyuan.storage[Constants.LOCAL_EXPORTPDF] = {
|
||||
removeAssets: ipcData.removeAssets,
|
||||
keepFold: ipcData.keepFold,
|
||||
mergeSubdocs: ipcData.mergeSubdocs,
|
||||
})));
|
||||
landscape: ipcData.pdfOptions.landscape,
|
||||
marginType: ipcData.pdfOptions.marginType,
|
||||
pageSize: ipcData.pdfOptions.pageSize,
|
||||
scale: ipcData.pdfOptions.scale,
|
||||
};
|
||||
try {
|
||||
if (window.siyuan.config.export.addFooter) {
|
||||
ipcData.pdfOptions.displayHeaderFooter = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue