diff --git a/app/src/config/about.ts b/app/src/config/about.ts index 7fc3ddc29..9b2550805 100644 --- a/app/src/config/about.ts +++ b/app/src/config/about.ts @@ -203,7 +203,7 @@ export const about = { about.element.querySelector("#authCode").addEventListener("click", () => { setAccessAuthCode(); }); - const importKeyElement = about.element.querySelector("#importKey") + const importKeyElement = about.element.querySelector("#importKey"); importKeyElement.addEventListener("click", () => { const passwordDialog = new Dialog({ title: window.siyuan.languages.key, @@ -224,25 +224,25 @@ export const about = { }); btnsElement[1].addEventListener("click", () => { fetchPost("/api/repo/importRepoKey", {key: textAreaElement.value}, () => { - window.siyuan.config.repo.key = textAreaElement.value + window.siyuan.config.repo.key = textAreaElement.value; importKeyElement.classList.add("fn__none"); importKeyElement.previousElementSibling.classList.add("fn__none"); importKeyElement.nextElementSibling.classList.remove("fn__none"); passwordDialog.destroy(); - }) + }); }); }); about.element.querySelector("#initKey").addEventListener("click", () => { fetchPost("/api/repo/initRepoKey", {}, (response) => { - window.siyuan.config.repo.key = response.data.key + window.siyuan.config.repo.key = response.data.key; importKeyElement.classList.add("fn__none"); importKeyElement.previousElementSibling.classList.add("fn__none"); importKeyElement.nextElementSibling.classList.remove("fn__none"); - }) + }); }); about.element.querySelector("#copyKey").addEventListener("click", () => { - showMessage(window.siyuan.languages.copied) - writeText(window.siyuan.config.repo.key) + showMessage(window.siyuan.languages.copied); + writeText(window.siyuan.config.repo.key); }); const networkServeElement = about.element.querySelector("#networkServe") as HTMLInputElement; networkServeElement.addEventListener("change", () => { diff --git a/app/src/config/repos.ts b/app/src/config/repos.ts index 5eed28b47..82d5c55fc 100644 --- a/app/src/config/repos.ts +++ b/app/src/config/repos.ts @@ -192,24 +192,24 @@ const setE2eePassword = () => { width: isMobile() ? "80vw" : "520px", }); dialog.element.querySelector(".b3-dialog__content").addEventListener("click", (event) => { - let target = event.target as HTMLElement + let target = event.target as HTMLElement; while (target && !target.classList.contains("b3-dialog__content")) { if (target.classList.contains("b3-list-item")) { target.parentElement.classList.add("fn__none"); if (target.getAttribute("data-type") === "default") { - target.parentElement.nextElementSibling.classList.remove("fn__none") + target.parentElement.nextElementSibling.classList.remove("fn__none"); } else { - target.parentElement.nextElementSibling.nextElementSibling.classList.remove("fn__none") + target.parentElement.nextElementSibling.nextElementSibling.classList.remove("fn__none"); } break; } else if (target.classList.contains("b3-button--outline")) { - target.parentElement.classList.add("fn__none") - dialog.element.querySelector(".b3-list").classList.remove("fn__none") + target.parentElement.classList.add("fn__none"); + dialog.element.querySelector(".b3-list").classList.remove("fn__none"); break; } - target = target.parentElement + target = target.parentElement; } - }) + }); const btnsElement = dialog.element.querySelectorAll(".b3-dialog__action .b3-button"); const inputElement = dialog.element.querySelector(".b3-text-field") as HTMLInputElement; inputElement.addEventListener("keydown", (event) => { @@ -231,11 +231,11 @@ const setE2eePassword = () => { dialog.destroy(); }); btnsElement[1].addEventListener("click", () => { - if (!dialog.element.querySelector('.b3-list').classList.contains("fn__none")) { + if (!dialog.element.querySelector(".b3-list").classList.contains("fn__none")) { showMessage(window.siyuan.languages.plsChoose); return; } - const mode = dialog.element.querySelector('div[data-type="default"]').classList.contains("fn__none") ? 1 : 0 + const mode = dialog.element.querySelector('div[data-type="default"]').classList.contains("fn__none") ? 1 : 0; fetchPost("/api/system/setE2EEPasswd", { e2eePasswd: inputElement.value, mode //0:内置密码; 1:自定义密码 diff --git a/app/src/protyle/util/table.ts b/app/src/protyle/util/table.ts index 08fbad660..e242e8437 100644 --- a/app/src/protyle/util/table.ts +++ b/app/src/protyle/util/table.ts @@ -61,7 +61,7 @@ export const setTableAlign = (protyle: IProtyle, cellElements: HTMLElement[], no for (let k = 0; k < rowCnt; k++) { currentColumns.forEach(item => { tableElement.rows[k].cells[item].setAttribute("align", type); - }) + }); } updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html); nodeElement.querySelector("wbr").remove(); diff --git a/app/src/util/history.ts b/app/src/util/history.ts index 1a17eac2e..1ab193384 100644 --- a/app/src/util/history.ts +++ b/app/src/util/history.ts @@ -107,16 +107,16 @@ const renderAssets = (element: HTMLElement) => { const renderRepo = (element: Element, currentPage: number) => { element.setAttribute("data-init", "true"); element.setAttribute("data-page", currentPage.toString()); - const previousElement = element.querySelector('[data-type="previous"]') - const nextElement = element.querySelector('[data-type="next"]') + const previousElement = element.querySelector('[data-type="previous"]'); + const nextElement = element.querySelector('[data-type="next"]'); if (currentPage > 1) { - previousElement.removeAttribute("disabled") + previousElement.removeAttribute("disabled"); } else { previousElement.setAttribute("disabled", "disabled"); } fetchPost("/api/repo/getRepoIndexLogs", {page: currentPage}, (response) => { if (currentPage < response.data.pageCount) { - nextElement.removeAttribute("disabled") + nextElement.removeAttribute("disabled"); } else { nextElement.setAttribute("disabled", "disabled"); } @@ -254,11 +254,11 @@ export const openHistory = () => { const firstPanelElement = dialog.element.querySelector("#historyContainer [data-type=doc]") as HTMLElement; renderDoc(currentNotebook, firstPanelElement); - const repoElement = dialog.element.querySelector('#historyContainer [data-type="repo"]') + const repoElement = dialog.element.querySelector('#historyContainer [data-type="repo"]'); dialog.element.addEventListener("click", (event) => { let target = event.target as HTMLElement; while (target && !target.isEqualNode(dialog.element)) { - const type = target.getAttribute("data-type") + const type = target.getAttribute("data-type"); if (target.classList.contains("item")) { target.parentElement.querySelector(".item--focus").classList.remove("item--focus"); Array.from(dialog.element.querySelector("#historyContainer").children).forEach((item: HTMLElement) => { @@ -302,7 +302,7 @@ export const openHistory = () => { break; } else if (target.classList.contains("b3-list-item__action")) { confirmDialog("⚠️ " + window.siyuan.languages.rollback, `${window.siyuan.languages.rollbackConfirm.replace("${date}", target.parentElement.textContent.trim())}`, () => { - const dataType = target.parentElement.getAttribute("data-type") + const dataType = target.parentElement.getAttribute("data-type"); if (dataType === "assets") { fetchPost("/api/history/rollbackAssetsHistory", { historyPath: target.parentElement.getAttribute("data-path") @@ -349,9 +349,9 @@ export const openHistory = () => { } else if (type === "repo") { target.parentElement.nextElementSibling.innerHTML = target.getAttribute("data-memo"); } - let currentItem = hasClosestByClassName(target, "b3-list") as HTMLElement + let currentItem = hasClosestByClassName(target, "b3-list") as HTMLElement; if (currentItem) { - currentItem = currentItem.querySelector(".b3-list-item--focus") + currentItem = currentItem.querySelector(".b3-list-item--focus"); if (currentItem) { currentItem.classList.remove("b3-list-item--focus"); } @@ -378,13 +378,13 @@ export const openHistory = () => { }); btnsElement[1].addEventListener("click", () => { fetchPost("/api/repo/indexRepo", {message: textAreaElement.value}, () => { - renderRepo(repoElement, 1) - }) + renderRepo(repoElement, 1); + }); genRepoDialog.destroy(); }); break; } else if ((type === "previous" || type === "next") && target.getAttribute("disabled") !== "disabled") { - const currentPage = parseInt(repoElement.getAttribute("data-page")) + const currentPage = parseInt(repoElement.getAttribute("data-page")); renderRepo(repoElement, type === "previous" ? currentPage - 1 : currentPage + 1); break; }