diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index aa9bb9a84..064dc38b4 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -50,7 +50,7 @@ export const kernelError = () => { ` }); - dialog.element.id = 'errorLog' + dialog.element.id = "errorLog"; const restartElement = dialog.element.querySelector(".b3-button"); if (restartElement) { restartElement.addEventListener("click", () => { diff --git a/app/src/history/diff.ts b/app/src/history/diff.ts index 1f43f3116..06fd529f3 100644 --- a/app/src/history/diff.ts +++ b/app/src/history/diff.ts @@ -75,7 +75,7 @@ const renderCompare = (element: HTMLElement) => { leftElement.lastElementChild.classList.remove("fn__none"); onGet(response, leftEditor.protyle, [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML]); } - textElement.previousElementSibling.textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm") + textElement.previousElementSibling.textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm"); }); const id2 = element.getAttribute("data-id2"); if (id2) { @@ -91,7 +91,7 @@ const renderCompare = (element: HTMLElement) => { rightElement.lastElementChild.classList.remove("fn__none"); onGet(response, rightEditor.protyle, [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML]); } - textElement.previousElementSibling.textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm") + textElement.previousElementSibling.textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm"); }); } else { rightElement.classList.add("fn__none"); @@ -143,10 +143,10 @@ export const showDiff = (data: { id: string, time: string }[]) => { break; } else if (target.classList.contains("block__icon")) { if (target.getAttribute("data-direct") === "left") { - target.setAttribute("data-direct", "right") + target.setAttribute("data-direct", "right"); genHTML(right, left, dialog, "right"); } else { - target.setAttribute("data-direct", "left") + target.setAttribute("data-direct", "left"); genHTML(left, right, dialog, "left"); } event.preventDefault(); @@ -167,17 +167,17 @@ const genHTML = (left: string, right: string, dialog: Dialog, direct:string) => const headElement = dialog.element.querySelector(".b3-dialog__header"); headElement.innerHTML = `
- ${left.substring(0, 7)} + ${left.substring(0, 7)} ${isPhone ? "" : ''} ${dayjs(response.data.left.created).format("YYYY-MM-DD HH:mm")} - ${right.substring(0, 7)} + ${right.substring(0, 7)} ${isPhone ? "" : ''} ${dayjs(response.data.right.created).format("YYYY-MM-DD HH:mm")} -
` +`; headElement.nextElementSibling.innerHTML = `
`; }); -} +}; diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts index b74985354..bd1174cb0 100644 --- a/app/src/protyle/util/insertHTML.ts +++ b/app/src/protyle/util/insertHTML.ts @@ -34,7 +34,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false, let id = blockElement.getAttribute("data-node-id"); range.insertNode(document.createElement("wbr")); let oldHTML = blockElement.outerHTML; - const isNodeCodeBlock = blockElement.getAttribute("data-type") === "NodeCodeBlock" + const isNodeCodeBlock = blockElement.getAttribute("data-type") === "NodeCodeBlock"; if (!isBlock && (isNodeCodeBlock || protyle.toolbar.getCurrentType(range).includes("code"))) { range.deleteContents(); diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts index 84bda1c33..46031fb1e 100644 --- a/app/src/protyle/util/paste.ts +++ b/app/src/protyle/util/paste.ts @@ -6,16 +6,14 @@ import {writeText} from "./compatibility"; import {clipboard} from "electron"; /// #endif import {hasClosestBlock} from "./hasClosest"; -import {focusByWbr, getEditorRange} from "./selection"; +import {getEditorRange} from "./selection"; import {blockRender} from "../markdown/blockRender"; import {highlightRender} from "../markdown/highlightRender"; -import {updateTransaction} from "../wysiwyg/transaction"; import {fetchPost, fetchSyncPost} from "../../util/fetch"; import {isDynamicRef, isFileAnnotation} from "../../util/functions"; import {insertHTML} from "./insertHTML"; import {scrollCenter} from "../../util/highlightById"; import {hideElements} from "../ui/hideElements"; -import {hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock"; const filterClipboardHint = (protyle: IProtyle, textPlain: string) => { let needRender = true;