Skip to content

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

:rotating_light:

Vanessa99f16b2a7a1d
diff --git a/app/src/card/makeCard.ts b/app/src/card/makeCard.ts
index ae2d2bed0c..41ec394786 100644
--- a/app/src/card/makeCard.ts
+++ b/app/src/card/makeCard.ts
@@ -124,7 +124,7 @@ export const makeCard = (nodeElement: Element[]) => {
event.preventDefault();
break;
} else if (type === "view") {
- viewCards(target.parentElement.getAttribute("data-id"), target.parentElement.querySelector(".b3-list-item__text").textContent)
+ viewCards(target.parentElement.getAttribute("data-id"), target.parentElement.querySelector(".b3-list-item__text").textContent);
event.stopPropagation();
event.preventDefault();
break;
@@ -195,7 +195,7 @@ const viewCards = (deckID: string, title: string) => {
width: isMobile() ? "90vw" : "80vw",
height: "80vh",
destroyCallback() {
- edit.destroy()
+ edit.destroy();
}
});
if (response.data.blocks.length === 0) {
@@ -208,17 +208,17 @@ const viewCards = (deckID: string, title: string) => {
breadcrumbDocName: true
},
});
- getArticle(edit, dialog.element.querySelector(".b3-list-item--focus").getAttribute("data-id"))
+ getArticle(edit, dialog.element.querySelector(".b3-list-item--focus").getAttribute("data-id"));
const previousElement = dialog.element.querySelector('[data-type="previous"]');
const nextElement = dialog.element.querySelector('[data-type="next"]');
- const listElement = dialog.element.querySelector(".b3-list--background")
+ const listElement = dialog.element.querySelector(".b3-list--background");
if (response.data.pageCount > 1) {
nextElement.removeAttribute("disabled");
}
dialog.element.addEventListener("click", (event) => {
let target = event.target as HTMLElement;
while (target && !dialog.element.isSameNode(target)) {
- const type = target.getAttribute("data-type")
+ const type = target.getAttribute("data-type");
if (type === "previous") {
pageIndex--;
if (pageIndex <= 1) {
@@ -230,10 +230,10 @@ const viewCards = (deckID: string, title: string) => {
} else if (cardsResponse.data.pageCount > 1) {
nextElement.removeAttribute("disabled");
}
- nextElement.nextElementSibling.nextElementSibling.textContent = `${pageIndex}/${cardsResponse.data.pageCount}`
- listElement.innerHTML = renderViewItem(cardsResponse.data.blocks)
- getArticle(edit, dialog.element.querySelector(".b3-list-item--focus").getAttribute("data-id"))
- })
+ nextElement.nextElementSibling.nextElementSibling.textContent = `${pageIndex}/${cardsResponse.data.pageCount}`;
+ listElement.innerHTML = renderViewItem(cardsResponse.data.blocks);
+ getArticle(edit, dialog.element.querySelector(".b3-list-item--focus").getAttribute("data-id"));
+ });
event.stopPropagation();
event.preventDefault();
break;
@@ -246,19 +246,19 @@ const viewCards = (deckID: string, title: string) => {
} else if (cardsResponse.data.pageCount > 1) {
nextElement.removeAttribute("disabled");
}
- nextElement.nextElementSibling.nextElementSibling.textContent = `${pageIndex}/${cardsResponse.data.pageCount}`
- listElement.innerHTML = renderViewItem(cardsResponse.data.blocks)
- getArticle(edit, dialog.element.querySelector(".b3-list-item--focus").getAttribute("data-id"))
- })
+ nextElement.nextElementSibling.nextElementSibling.textContent = `${pageIndex}/${cardsResponse.data.pageCount}`;
+ listElement.innerHTML = renderViewItem(cardsResponse.data.blocks);
+ getArticle(edit, dialog.element.querySelector(".b3-list-item--focus").getAttribute("data-id"));
+ });
event.stopPropagation();
event.preventDefault();
break;
} else if (type === "card-item") {
const id = target.getAttribute("data-id");
if (id) {
- listElement.querySelector(".b3-list-item--focus")?.classList.remove("b3-list-item--focus")
- target.classList.add("b3-list-item--focus")
- getArticle(edit, id)
+ listElement.querySelector(".b3-list-item--focus")?.classList.remove("b3-list-item--focus");
+ target.classList.add("b3-list-item--focus");
+ getArticle(edit, id);
}
event.stopPropagation();
event.preventDefault();
@@ -274,11 +274,11 @@ const viewCards = (deckID: string, title: string) => {
event.preventDefault();
break;
}
- target = target.parentElement
+ target = target.parentElement;
}
- })
+ });
});
-}
+};
const getArticle = (edit: Protyle, id: string) => {
if (!id) {
@@ -293,11 +293,11 @@ const getArticle = (edit: Protyle, id: string) => {
}, getResponse => {
onGet(getResponse, edit.protyle, [Constants.CB_GET_ALL, Constants.CB_GET_HTML]);
});
-}
+};
const renderViewItem = (blocks: IBlock[]) => {
- let listHTML = ""
- let isFirst = true
+ let listHTML = "";
+ let isFirst = true;
blocks.forEach((item: IBlock) => {
if (item.type) {
const hPath = escapeHtml(getNotebookName(item.box)) + getDisplayName(item.hPath, false);
@@ -324,4 +324,4 @@ ${unicode2Emoji(item.ial.icon, false, "b3-list-item__graphic", true)}
listHTML = `<div class="b3-list--empty">${window.siyuan.languages.emptyContent}</div>`;
}
return listHTML;
-}
+};
diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts
index 6c2b104c61..8994c83e44 100644
--- a/app/src/card/openCard.ts
+++ b/app/src/card/openCard.ts
@@ -153,7 +153,7 @@ export const openCard = () => {
actionElements[0].classList.add("fn__none");
actionElements[1].querySelectorAll(".b3-button").forEach((element, btnIndex) => {
element.previousElementSibling.textContent = blocks[index].nextDues[btnIndex];
- })
+ });
actionElements[1].classList.remove("fn__none");
return;
}