diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts index 829f7c408..207bbfafd 100644 --- a/app/src/asset/anno.ts +++ b/app/src/asset/anno.ts @@ -372,7 +372,7 @@ const getHightlightCoordsByRect = (pdf: any, color: string, rectResizeElement: H const mergeRects = (range: Range) => { const rects = range.getClientRects(); const mergedRects: { left: number, top: number, right: number, bottom: number }[] = []; - let lastTop: number = undefined + let lastTop: number = undefined; Array.from(rects).forEach(item => { if (item.height === 0 || item.width === 0) { return; @@ -381,11 +381,11 @@ const mergeRects = (range: Range) => { mergedRects.push({left: item.left, top: item.top, right: item.right, bottom: item.bottom}); lastTop = item.top; } else { - mergedRects[mergedRects.length - 1].right = item.right + mergedRects[mergedRects.length - 1].right = item.right; } - }) - return mergedRects -} + }); + return mergedRects; +}; const getHightlightCoordsByRange = (pdf: any, color: string) => { const range = window.getSelection().getRangeAt(0); diff --git a/app/src/config/repos.ts b/app/src/config/repos.ts index 8bb14818a..136fb40a4 100644 --- a/app/src/config/repos.ts +++ b/app/src/config/repos.ts @@ -524,7 +524,7 @@ ${passwordHTML} window.siyuan.config.sync.cloudName = name; getCloudList(true); }); - return + return; } confirmDialog(window.siyuan.languages.confirm, response.msg, () => { diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index f0da17945..833800b4c 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -149,7 +149,7 @@ const openFile = (options: IOpenFileOptions) => { wnd.split(direction).addTab(newTab(options)); } } else if (options.keepCursor && wnd.children[0].model) { - const tab = newTab(options) + const tab = newTab(options); tab.headElement.setAttribute("keep-cursor", options.id); wnd.addTab(tab, options.keepCursor); } else if (window.siyuan.config.fileTree.openFilesUseCurrentTab) { @@ -239,7 +239,7 @@ const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IMod if (options.mode) { setEditMode(editor.editor.protyle, options.mode); } -} +}; const newTab = (options: IOpenFileOptions) => { let tab: Tab; @@ -293,7 +293,7 @@ const newTab = (options: IOpenFileOptions) => { }); } return tab; -} +}; export const updatePanelByEditor = (protyle?: IProtyle, focus = true, pushBackStack = false, reload = false) => { let title = window.siyuan.languages.siyuanNote; diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts index 15ba5eb81..d666d33d9 100644 --- a/app/src/protyle/util/paste.ts +++ b/app/src/protyle/util/paste.ts @@ -21,11 +21,11 @@ const filterClipboardHint = (protyle: IProtyle, textPlain: string) => { needRender = false; return true; } - }) + }); if (needRender) { protyle.hint.render(protyle); } -} +}; export const pasteText = (protyle: IProtyle, textPlain: string, nodeElement: Element) => { const range = getEditorRange(protyle.wysiwyg.element); @@ -59,7 +59,7 @@ export const pasteText = (protyle: IProtyle, textPlain: string, nodeElement: Ele blockRender(protyle, protyle.wysiwyg.element); processRender(protyle.wysiwyg.element); highlightRender(protyle.wysiwyg.element); - filterClipboardHint(protyle, textPlain) + filterClipboardHint(protyle, textPlain); scrollCenter(protyle); }; @@ -199,7 +199,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven // 转换为 md,避免再次粘贴 ID 重复 const tempMd = protyle.lute.BlockDOM2StdMd(tempElement.innerHTML); writeText(tempMd); - filterClipboardHint(protyle, tempMd) + filterClipboardHint(protyle, tempMd); } else if (textHTML.endsWith(Constants.ZWSP)) { // 编辑器内部粘贴 tempElement.innerHTML = textHTML.substr(0, textHTML.length - 1); @@ -213,7 +213,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven }); const tempInnerHTML = tempElement.innerHTML; insertHTML(tempInnerHTML, protyle); - filterClipboardHint(protyle, tempInnerHTML) + filterClipboardHint(protyle, tempInnerHTML); } else { tempElement.innerHTML = textHTML; tempElement.querySelectorAll("[style]").forEach((e) => { @@ -239,7 +239,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven blockRender(protyle, protyle.wysiwyg.element); processRender(protyle.wysiwyg.element); highlightRender(protyle.wysiwyg.element); - filterClipboardHint(protyle, response.data) + filterClipboardHint(protyle, response.data); scrollCenter(protyle); }); return; @@ -258,7 +258,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven } const textPlainDom = protyle.lute.Md2BlockDOM(textPlain); insertHTML(textPlainDom, protyle); - filterClipboardHint(protyle, textPlainDom) + filterClipboardHint(protyle, textPlainDom); } blockRender(protyle, protyle.wysiwyg.element); processRender(protyle.wysiwyg.element); diff --git a/app/src/util/history.ts b/app/src/util/history.ts index 37137cbd5..825cf21c1 100644 --- a/app/src/util/history.ts +++ b/app/src/util/history.ts @@ -109,7 +109,7 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string element.lastElementChild.innerHTML = `
  • ${window.siyuan.languages.emptyContent}
  • `; return; } - let actionHTML = '' + let actionHTML = ""; if (type === "cloudTag") { actionHTML = ` `; @@ -450,7 +450,7 @@ export const openHistory = () => { confirmDialog(window.siyuan.languages.delete, `${window.siyuan.languages.confirmDelete} ${tag}?`, () => { fetchPost("/api/repo/" + type, {tag}, () => { if (target.parentElement.parentElement.childElementCount === 1) { - target.parentElement.parentElement.innerHTML = `
  • ${window.siyuan.languages.emptyContent}
  • ` + target.parentElement.parentElement.innerHTML = `
  • ${window.siyuan.languages.emptyContent}
  • `; } else { target.parentElement.remove(); }