Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:rotating_light:

Vanessac8604cf19e25
diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts
index 2e8f83843f..d545212f85 100644
--- a/app/src/layout/dock/Outline.ts
+++ b/app/src/layout/dock/Outline.ts
@@ -220,7 +220,7 @@ export class Outline extends Model {
public setCurrent(nodeElement: HTMLElement) {
if (nodeElement.getAttribute("data-type") === "NodeHeading") {
- this.setCurrentById(nodeElement.getAttribute("data-node-id"))
+ this.setCurrentById(nodeElement.getAttribute("data-node-id"));
} else {
let previousElement = getPreviousBlock(nodeElement);
while (previousElement) {
@@ -231,7 +231,7 @@ export class Outline extends Model {
}
}
if (previousElement) {
- this.setCurrentById(previousElement.getAttribute("data-node-id"))
+ this.setCurrentById(previousElement.getAttribute("data-node-id"));
} else {
fetchPost("/api/block/getBlockBreadcrumb", {
id: nodeElement.getAttribute("data-node-id"),
diff --git a/app/src/mobile/util/initFramework.ts b/app/src/mobile/util/initFramework.ts
index b19a2c52d0..3518806c50 100644
--- a/app/src/mobile/util/initFramework.ts
+++ b/app/src/mobile/util/initFramework.ts
@@ -8,7 +8,6 @@ import {fetchPost} from "../../util/fetch";
import {setInlineStyle} from "../../util/assets";
import {renderSnippet} from "../../config/util/snippets";
import {setEmpty} from "./setEmpty";
-import {disabledProtyle, enableProtyle} from "../../protyle/util/onGet";
import {getOpenNotebookCount} from "../../util/pathName";
import {popMenu} from "./menu";
import {MobileFiles} from "./MobileFiles";
@@ -76,7 +75,7 @@ export const initFramework = () => {
});
});
window.siyuan.mobile.files = new MobileFiles();
- document.getElementById("toolbarFile").addEventListener("click", (event) => {
+ document.getElementById("toolbarFile").addEventListener("click", () => {
hideKeyboardToolbar();
hideKeyboard();
sidebarElement.style.left = "0";
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index dda3e34788..50cb2c13a6 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -55,7 +55,7 @@ export const renderKeyboardToolbar = (protyle: IProtyle, range: Range) => {
<button data-type="tag"><svg><use xlink:href="#iconTags"></use></svg></button>
<button data-type="inline-math"><svg><use xlink:href="#iconMath"></use></svg></button>
<button data-type="inline-memo"><svg><use xlink:href="#iconM"></use></svg></button>
-<button data-type="indent"><svg><use xlink:href="#iconClose"></use></svg></button>`
+<button data-type="indent"><svg><use xlink:href="#iconClose"></use></svg></button>`;
const html = `<button data-type="add"><svg><use xlink:href="#iconAdd"></use></svg></button>
<button data-type="indent"><svg class="keyboard__svg--big"><use xlink:href="#iconBIU"></use></svg></button>
<button data-type="indent"><svg><use xlink:href="#iconTrashcan"></use></svg></button>
@@ -69,14 +69,14 @@ export const renderKeyboardToolbar = (protyle: IProtyle, range: Range) => {
<button data-type="redo"><svg><use xlink:href="#iconOutdent"></use></svg></button>
<button data-type="redo"><svg><use xlink:href="#iconUp"></use></svg></button>
<button data-type="redo"><svg><use xlink:href="#iconDown"></use></svg></button>
-`
+`;
toolbarElement.innerHTML = `<div class="fn__flex-1">
<div class="keyboard__dynamic">${html}</div>
<div class="fn__none keyboard__dynamic">${inlineHTML}</div>
</div>
<span class="keyboard__split"></span>
-<button data-type="done"><svg style="width: 36px"><use xlink:href="#iconKeyboardHide"></use></svg></button>`
-}
+<button data-type="done"><svg style="width: 36px"><use xlink:href="#iconKeyboardHide"></use></svg></button>`;
+};
export const hideKeyboardToolbar = () => {
const toolbarElement = document.getElementById("keyboardToolbar");
@@ -93,21 +93,21 @@ const disabledKeyboardToolbar = () => {
item.setAttribute("disabled", "disabled");
}
});
-}
+};
const enKeyboardToolbar = () => {
document.querySelectorAll("#keyboardToolbar button").forEach(item => {
item.removeAttribute("disabled");
});
-}
+};
export const initKeyboardToolbar = () => {
- window.addEventListener('focus', (event) => {
- const target = event.target as HTMLElement
+ window.addEventListener("focus", (event) => {
+ const target = event.target as HTMLElement;
if (["INPUT", "TEXTAREA"].includes(target.tagName)) {
- disabledKeyboardToolbar()
+ disabledKeyboardToolbar();
} else if (target.classList.contains("protyle-wysiwyg")) {
- enKeyboardToolbar()
+ enKeyboardToolbar();
}
}, true);
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 35711acdad..1a6f4b0721 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -778,7 +778,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
});
}
- const sourceIds: string [] = []
+ const sourceIds: string [] = [];
sourceElements.forEach(item => {
item.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");
item.removeAttribute("select-start");
diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts
index 447a2372ef..1fb0bb825a 100644
--- a/app/src/protyle/util/selection.ts
+++ b/app/src/protyle/util/selection.ts
@@ -213,7 +213,7 @@ export const getSelectionPosition = (nodeElement: Element, range?: Range) => {
return { // 选中多行不应遮挡第一行 https://github.com/siyuan-note/siyuan/issues/7541
left: rects[rects.length - 1].left,
top: rects[0].top
- }
+ };
}
return {
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 3c87126912..d01cf73862 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -176,7 +176,7 @@ export class WYSIWYG {
if (protyle.model) {
getAllModels().outline.forEach(item => {
if (item.blockId === protyle.block.rootID) {
- item.setCurrent(nodeElement)
+ item.setCurrent(nodeElement);
}
});
}