mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
🚨
This commit is contained in:
parent
6e3a826ac6
commit
6e9a953bf2
8 changed files with 21 additions and 23 deletions
|
|
@ -42,7 +42,7 @@ const renderProvider = (provider: number) => {
|
||||||
${window.siyuan.languages.featureBetaStage}
|
${window.siyuan.languages.featureBetaStage}
|
||||||
<div class="fn__hr"></div>
|
<div class="fn__hr"></div>
|
||||||
${window.siyuan.languages.syncThirdPartyProviderTip}
|
${window.siyuan.languages.syncThirdPartyProviderTip}
|
||||||
</div>`
|
</div>`;
|
||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
return `${tip}
|
return `${tip}
|
||||||
<div class="b3-label b3-label--noborder">
|
<div class="b3-label b3-label--noborder">
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,9 @@ class App {
|
||||||
case "rename":
|
case "rename":
|
||||||
getAllTabs().forEach((tab) => {
|
getAllTabs().forEach((tab) => {
|
||||||
if (tab.headElement) {
|
if (tab.headElement) {
|
||||||
const initTab = tab.headElement.getAttribute("data-initdata")
|
const initTab = tab.headElement.getAttribute("data-initdata");
|
||||||
if (initTab) {
|
if (initTab) {
|
||||||
const initTabData = JSON.parse(initTab)
|
const initTabData = JSON.parse(initTab);
|
||||||
if (initTabData.rootId === data.data.id) {
|
if (initTabData.rootId === data.data.id) {
|
||||||
tab.updateTitle(data.data.title);
|
tab.updateTitle(data.data.title);
|
||||||
}
|
}
|
||||||
|
|
@ -63,9 +63,9 @@ class App {
|
||||||
case "unmount":
|
case "unmount":
|
||||||
getAllTabs().forEach((tab) => {
|
getAllTabs().forEach((tab) => {
|
||||||
if (tab.headElement) {
|
if (tab.headElement) {
|
||||||
const initTab = tab.headElement.getAttribute("data-initdata")
|
const initTab = tab.headElement.getAttribute("data-initdata");
|
||||||
if (initTab) {
|
if (initTab) {
|
||||||
const initTabData = JSON.parse(initTab)
|
const initTabData = JSON.parse(initTab);
|
||||||
if (data.data.box === initTabData.notebookId) {
|
if (data.data.box === initTabData.notebookId) {
|
||||||
tab.parent.removeTab(tab.id);
|
tab.parent.removeTab(tab.id);
|
||||||
}
|
}
|
||||||
|
|
@ -76,9 +76,9 @@ class App {
|
||||||
case "removeDoc":
|
case "removeDoc":
|
||||||
getAllTabs().forEach((tab) => {
|
getAllTabs().forEach((tab) => {
|
||||||
if (tab.headElement) {
|
if (tab.headElement) {
|
||||||
const initTab = tab.headElement.getAttribute("data-initdata")
|
const initTab = tab.headElement.getAttribute("data-initdata");
|
||||||
if (initTab) {
|
if (initTab) {
|
||||||
const initTabData = JSON.parse(initTab)
|
const initTabData = JSON.parse(initTab);
|
||||||
if (data.data.ids.includes(initTabData.rootId)) {
|
if (data.data.ids.includes(initTabData.rootId)) {
|
||||||
tab.parent.removeTab(tab.id);
|
tab.parent.removeTab(tab.id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import {closePanel} from "./closePanel";
|
||||||
import {Constants} from "../../constants";
|
import {Constants} from "../../constants";
|
||||||
import {setAccessAuthCode} from "../../config/util/setAccessAuthCode";
|
import {setAccessAuthCode} from "../../config/util/setAccessAuthCode";
|
||||||
import {mountHelp, newDailyNote, newNotebook} from "../../util/mount";
|
import {mountHelp, newDailyNote, newNotebook} from "../../util/mount";
|
||||||
import {needSubscribe} from "../../util/needSubscribe";
|
|
||||||
import {repos} from "../../config/repos";
|
import {repos} from "../../config/repos";
|
||||||
import * as md5 from "blueimp-md5";
|
import * as md5 from "blueimp-md5";
|
||||||
import {showMessage} from "../../dialog/message";
|
import {showMessage} from "../../dialog/message";
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export const exportImage = (id: string) => {
|
||||||
id,
|
id,
|
||||||
keepFold: false,
|
keepFold: false,
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
const previewElement = exportDialog.element.querySelector("#preview")
|
const previewElement = exportDialog.element.querySelector("#preview");
|
||||||
previewElement.innerHTML = response.data.content;
|
previewElement.innerHTML = response.data.content;
|
||||||
processRender(previewElement);
|
processRender(previewElement);
|
||||||
highlightRender(previewElement);
|
highlightRender(previewElement);
|
||||||
|
|
@ -70,14 +70,13 @@ export const exportImage = (id: string) => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("file", blob, response.data.name + ".png");
|
formData.append("file", blob, response.data.name + ".png");
|
||||||
formData.append("type", "image/png");
|
formData.append("type", "image/png");
|
||||||
fetchPost("/api/export/exportAsFile", formData, () => {
|
fetchPost("/api/export/exportAsFile", formData);
|
||||||
hideMessage(msgId);
|
hideMessage(msgId);
|
||||||
exportDialog.destroy();
|
exportDialog.destroy();
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, Constants.TIMEOUT_TRANSITION)
|
}, Constants.TIMEOUT_TRANSITION);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export class Scroll {
|
||||||
</div>
|
</div>
|
||||||
<div class="b3-tooltips b3-tooltips__sw protyle-scroll__down" aria-label="${updateHotkeyTip("⌘End")}">
|
<div class="b3-tooltips b3-tooltips__sw protyle-scroll__down" aria-label="${updateHotkeyTip("⌘End")}">
|
||||||
<svg><use xlink:href="#iconDown"></use></svg>
|
<svg><use xlink:href="#iconDown"></use></svg>
|
||||||
</div>`
|
</div>`;
|
||||||
|
|
||||||
this.element = this.parentElement.querySelector(".protyle-scroll__bar");
|
this.element = this.parentElement.querySelector(".protyle-scroll__bar");
|
||||||
this.keepLazyLoad = false;
|
this.keepLazyLoad = false;
|
||||||
|
|
@ -44,11 +44,11 @@ export class Scroll {
|
||||||
});
|
});
|
||||||
/// #endif
|
/// #endif
|
||||||
this.parentElement.addEventListener("click", (event) => {
|
this.parentElement.addEventListener("click", (event) => {
|
||||||
const target = event.target as HTMLElement
|
const target = event.target as HTMLElement;
|
||||||
if (hasClosestByClassName(target, "protyle-scroll__up")) {
|
if (hasClosestByClassName(target, "protyle-scroll__up")) {
|
||||||
goHome(protyle)
|
goHome(protyle);
|
||||||
} else if (hasClosestByClassName(target, "protyle-scroll__down")) {
|
} else if (hasClosestByClassName(target, "protyle-scroll__down")) {
|
||||||
goEnd(protyle)
|
goEnd(protyle);
|
||||||
} else if (target.classList.contains("b3-slider")) {
|
} else if (target.classList.contains("b3-slider")) {
|
||||||
this.setIndex(protyle);
|
this.setIndex(protyle);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -544,7 +544,7 @@ export class Toolbar {
|
||||||
currentNewNode.style.fontSize === nextNewNode.style.fontSize &&
|
currentNewNode.style.fontSize === nextNewNode.style.fontSize &&
|
||||||
currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) {
|
currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) {
|
||||||
// 合并相同的 node
|
// 合并相同的 node
|
||||||
const currentType = currentNewNode.getAttribute("data-type")
|
const currentType = currentNewNode.getAttribute("data-type");
|
||||||
if (currentType.indexOf("inline-math") > -1) {
|
if (currentType.indexOf("inline-math") > -1) {
|
||||||
// 数学公式合并 data-content https://github.com/siyuan-note/siyuan/issues/6028
|
// 数学公式合并 data-content https://github.com/siyuan-note/siyuan/issues/6028
|
||||||
nextNewNode.setAttribute("data-content", currentNewNode.getAttribute("data-content") + nextNewNode.getAttribute("data-content"));
|
nextNewNode.setAttribute("data-content", currentNewNode.getAttribute("data-content") + nextNewNode.getAttribute("data-content"));
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ export const setPadding = (protyle: IProtyle) => {
|
||||||
if (!window.siyuan.config.editor.fullWidth && padding > 96) {
|
if (!window.siyuan.config.editor.fullWidth && padding > 96) {
|
||||||
if (padding > Constants.SIZE_EDITOR_WIDTH) {
|
if (padding > Constants.SIZE_EDITOR_WIDTH) {
|
||||||
// 超宽屏调整 https://ld246.com/article/1668266637363
|
// 超宽屏调整 https://ld246.com/article/1668266637363
|
||||||
padding = protyle.element.clientWidth / 3
|
padding = protyle.element.clientWidth / 3;
|
||||||
}
|
}
|
||||||
min16 = padding;
|
min16 = padding;
|
||||||
min24 = padding;
|
min24 = padding;
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ export const goHome = (protyle:IProtyle) => {
|
||||||
onGet(getResponse, protyle, [Constants.CB_GET_FOCUS]);
|
onGet(getResponse, protyle, [Constants.CB_GET_FOCUS]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
export const goEnd = (protyle:IProtyle) => {
|
export const goEnd = (protyle:IProtyle) => {
|
||||||
if (!protyle.scroll.element.classList.contains("fn__none") &&
|
if (!protyle.scroll.element.classList.contains("fn__none") &&
|
||||||
|
|
@ -251,4 +251,4 @@ export const goEnd = (protyle:IProtyle) => {
|
||||||
protyle.scroll.lastScrollTop = protyle.contentElement.scrollTop;
|
protyle.scroll.lastScrollTop = protyle.contentElement.scrollTop;
|
||||||
focusBlock(protyle.wysiwyg.element.lastElementChild, undefined, false);
|
focusBlock(protyle.wysiwyg.element.lastElementChild, undefined, false);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue