Skip to content

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

:rotating_light:

Vanessa418d5ba64fa4
diff --git a/app/electron/main.js b/app/electron/main.js
index 1ea464de7e..7fb790190a 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -946,9 +946,9 @@ powerMonitor.on("resume", async () => {
// 桌面端系统休眠唤醒后判断网络连通性后再执行数据同步 https://github.com/siyuan-note/siyuan/issues/6687
writeLog("system resume");
- const eNet = require("electron").net
+ const eNet = require("electron").net;
const isOnline = async () => {
- return eNet.isOnline()
+ return eNet.isOnline();
};
let online = false;
for (let i = 0; i < 7; i++) {
diff --git a/app/src/card/viewCards.ts b/app/src/card/viewCards.ts
index 70f9c8a77c..13a209fffd 100644
--- a/app/src/card/viewCards.ts
+++ b/app/src/card/viewCards.ts
@@ -142,7 +142,7 @@ export const viewCards = (deckID: string, title: string, deckType: "Tree" | "" |
target.parentElement.remove();
}
- dialog.element.querySelector(".counter").textContent = (parseInt(dialog.element.querySelector(".counter").textContent) - 1).toString()
+ dialog.element.querySelector(".counter").textContent = (parseInt(dialog.element.querySelector(".counter").textContent) - 1).toString();
if (cb) {
cb(removeResponse);
}
diff --git a/app/src/mobile/menu/getRecentDocs.ts b/app/src/mobile/menu/getRecentDocs.ts
index 4dced0f702..b876a5eaf5 100644
--- a/app/src/mobile/menu/getRecentDocs.ts
+++ b/app/src/mobile/menu/getRecentDocs.ts
@@ -23,10 +23,10 @@ ${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__
element.firstElementChild.addEventListener("click", (event) => {
const liElement = hasClosestByClassName(event.target as HTMLElement, "b3-list-item");
if (liElement) {
- openMobileFileById(liElement.dataset.nodeId, [Constants.CB_GET_SCROLL])
+ openMobileFileById(liElement.dataset.nodeId, [Constants.CB_GET_SCROLL]);
}
});
}
- })
+ });
});
-}
+};
diff --git a/app/src/mobile/menu/index.ts b/app/src/mobile/menu/index.ts
index f5c17ec2b5..783dcf104e 100644
--- a/app/src/mobile/menu/index.ts
+++ b/app/src/mobile/menu/index.ts
@@ -203,4 +203,4 @@ ${accountHTML}
target = target.parentElement;
}
});
-}
+};
diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts
index 236c8193fb..8540daf55a 100644
--- a/app/src/mobile/util/touch.ts
+++ b/app/src/mobile/util/touch.ts
@@ -20,28 +20,28 @@ export const handleTouchEnd = (event: TouchEvent) => {
return;
}
- const target = event.target as HTMLElement
- let scrollElement = hasClosestByAttribute(target, "data-type", "NodeCodeBlock") || hasClosestByAttribute(target, "data-type", "NodeTable")
+ const target = event.target as HTMLElement;
+ let scrollElement = hasClosestByAttribute(target, "data-type", "NodeCodeBlock") || hasClosestByAttribute(target, "data-type", "NodeTable");
if (scrollElement) {
- scrollElement = scrollElement.classList.contains("table") ? (scrollElement.firstElementChild as HTMLElement) : (scrollElement.firstElementChild.nextElementSibling as HTMLElement)
+ scrollElement = scrollElement.classList.contains("table") ? (scrollElement.firstElementChild as HTMLElement) : (scrollElement.firstElementChild.nextElementSibling as HTMLElement);
if ((xDiff < 0 && scrollElement.scrollLeft > 0) ||
(xDiff > 0 && scrollElement.clientWidth + scrollElement.scrollLeft < scrollElement.scrollWidth)) {
return;
}
}
- let show = false
+ let show = false;
if (new Date().getTime() - time < 1000) {
- show = true
+ show = true;
} else if (Math.abs(xDiff) > window.innerWidth / 3) {
- show = true
+ show = true;
}
- const menuElement = hasClosestByAttribute(target, "id", "menu")
+ const menuElement = hasClosestByAttribute(target, "id", "menu");
if (show && menuElement && xDiff < 0) {
closePanel();
return;
}
- const sideElement = hasClosestByAttribute(target, "id", "sidebar")
+ const sideElement = hasClosestByAttribute(target, "id", "sidebar");
if (show && sideElement && xDiff > 0) {
closePanel();
return;
@@ -54,7 +54,7 @@ export const handleTouchEnd = (event: TouchEvent) => {
if (xDiff > 0) {
popMenu();
} else {
- document.getElementById("toolbarFile").dispatchEvent(new CustomEvent("click"))
+ document.getElementById("toolbarFile").dispatchEvent(new CustomEvent("click"));
}
}
};
@@ -83,30 +83,30 @@ export const handleTouchMove = (event: TouchEvent) => {
yDiff = Math.floor(clientY - event.touches[0].clientY);
if (Math.abs(xDiff) > Math.abs(yDiff)) {
- const target = event.target as HTMLElement
- let scrollElement = hasClosestByAttribute(target, "data-type", "NodeCodeBlock") || hasClosestByAttribute(target, "data-type", "NodeTable")
+ const target = event.target as HTMLElement;
+ let scrollElement = hasClosestByAttribute(target, "data-type", "NodeCodeBlock") || hasClosestByAttribute(target, "data-type", "NodeTable");
if (scrollElement) {
- scrollElement = scrollElement.classList.contains("table") ? (scrollElement.firstElementChild as HTMLElement) : (scrollElement.firstElementChild.nextElementSibling as HTMLElement)
+ scrollElement = scrollElement.classList.contains("table") ? (scrollElement.firstElementChild as HTMLElement) : (scrollElement.firstElementChild.nextElementSibling as HTMLElement);
if ((xDiff < 0 && scrollElement.scrollLeft > 0) ||
(xDiff > 0 && scrollElement.clientWidth + scrollElement.scrollLeft < scrollElement.scrollWidth)) {
return;
}
}
- const menuElement = hasClosestByAttribute(target, "id", "menu")
+ const menuElement = hasClosestByAttribute(target, "id", "menu");
if (menuElement && xDiff < 0) {
- menuElement.style.right = xDiff + "px"
+ menuElement.style.right = xDiff + "px";
return;
}
- const sideElement = hasClosestByAttribute(target, "id", "sidebar")
+ const sideElement = hasClosestByAttribute(target, "id", "sidebar");
if (sideElement && xDiff > 0) {
- sideElement.style.left = -xDiff + "px"
+ sideElement.style.left = -xDiff + "px";
return;
}
console.log(event);
if (xDiff < 0) {
- document.getElementById("sidebar").style.left = -window.innerWidth - xDiff + "px"
+ document.getElementById("sidebar").style.left = -window.innerWidth - xDiff + "px";
} else {
- document.getElementById("menu").style.right = -window.innerWidth + xDiff + "px"
+ document.getElementById("menu").style.right = -window.innerWidth + xDiff + "px";
}
}
};
diff --git a/app/src/window/global/positionPDF.ts b/app/src/window/global/positionPDF.ts
index 8b4cd5f482..f8c0595ac0 100644
--- a/app/src/window/global/positionPDF.ts
+++ b/app/src/window/global/positionPDF.ts
@@ -7,5 +7,5 @@ export const positionPDF = (pathStr: string, page: string | number) => {
tab.parent.switchTab(tab.headElement);
tab.model.goToPage(page);
}
- })
-}
+ });
+};
diff --git a/app/src/window/index.ts b/app/src/window/index.ts
index 3144265cbe..b9e5887c0f 100644
--- a/app/src/window/index.ts
+++ b/app/src/window/index.ts
@@ -146,4 +146,4 @@ new App();
// 再次点击新窗口已打开的 PDF 时,需进行定位
window.newWindow = {
positionPDF: positionPDF
-}
+};