diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index fc77baafc..823278711 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -32,7 +32,7 @@ import {MenuItem} from "../menus/Menu";
import {escapeHtml} from "../util/escape";
import {isWindow} from "../util/functions";
import {hideAllElements} from "../protyle/ui/hideElements";
-import {focusByOffset, getSelectionOffset, getSelectionPosition} from "../protyle/util/selection";
+import {focusByOffset, getSelectionOffset} from "../protyle/util/selection";
export class Wnd {
public id: string;
@@ -760,7 +760,7 @@ export class Wnd {
id: string,
start: number,
end: number
- }
+ };
if (tab.model instanceof Editor && tab.model.editor.protyle.toolbar.range) {
const blockElement = hasClosestBlock(tab.model.editor.protyle.toolbar.range.startContainer);
if (blockElement) {
@@ -769,7 +769,7 @@ export class Wnd {
id: blockElement.getAttribute("data-node-id"),
start: startEnd.start,
end: startEnd.end
- }
+ };
}
}
this.element.querySelector(".layout-tab-container").append(tab.panelElement);
diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts
index 3bbc5594c..708851fa6 100644
--- a/app/src/layout/util.ts
+++ b/app/src/layout/util.ts
@@ -94,10 +94,10 @@ export const switchWnd = (newWnd: Wnd, targetWnd: Wnd) => {
id: blockElement.getAttribute("data-node-id"),
start: startEnd.start,
end: startEnd.end
- })
+ });
}
}
- })
+ });
newWnd.element.after(targetWnd.element);
targetWnd.children.forEach((item) => {
if (item.model instanceof Editor) {
@@ -107,7 +107,7 @@ export const switchWnd = (newWnd: Wnd, targetWnd: Wnd) => {
item.model.editor.protyle.toolbar.range = range;
}
}
- })
+ });
// 分割线
newWnd.element.after(newWnd.element.previousElementSibling);
newWnd.parent.children.find((item, index) => {
diff --git a/app/src/menus/Menu.ts b/app/src/menus/Menu.ts
index 3458d01f0..ec49f0206 100644
--- a/app/src/menus/Menu.ts
+++ b/app/src/menus/Menu.ts
@@ -135,7 +135,7 @@ export class Menu {
} else {
this.element.style.transform = "translateY(-100vh)";
}
- })
+ });
this.element.lastElementChild.scrollTop = 0;
}
}
diff --git a/app/src/menus/onGetnotebookconf.ts b/app/src/menus/onGetnotebookconf.ts
index 1afdd5f2e..510ffb814 100644
--- a/app/src/menus/onGetnotebookconf.ts
+++ b/app/src/menus/onGetnotebookconf.ts
@@ -56,7 +56,7 @@ export const onGetnotebookconf = (data: INotebookConf) => {
bindEvent() {
bindSettingEvent(document.querySelector("#model"), data);
}
- })
+ });
} else {
const dialog = new Dialog({
width: "80vw",
@@ -94,4 +94,4 @@ const bindSettingEvent = (contentElement: Element, data: INotebookConf) => {
});
});
});
-}
+};
diff --git a/app/src/mobile/menu/search.ts b/app/src/mobile/menu/search.ts
index 91880e973..447e74b00 100644
--- a/app/src/mobile/menu/search.ts
+++ b/app/src/mobile/menu/search.ts
@@ -107,10 +107,10 @@ const updateConfig = (element: Element, newConfig: ISearchOption, config: ISearc
}
const searchPathElement = element.querySelector("#searchPath");
if (newConfig.hPath) {
- searchPathElement.classList.remove("fn__none")
+ searchPathElement.classList.remove("fn__none");
searchPathElement.innerHTML = `
${escapeHtml(newConfig.hPath)}
`;
} else {
- searchPathElement.classList.add("fn__none")
+ searchPathElement.classList.add("fn__none");
}
if (config.group !== newConfig.group) {
if (newConfig.group === 0) {
@@ -152,7 +152,7 @@ const updateConfig = (element: Element, newConfig: ISearchOption, config: ISearc
};
const onRecentBlocks = (data: IBlock[], matchedRootCount?: number, matchedBlockCount?: number) => {
- const listElement = document.querySelector("#searchList")
+ const listElement = document.querySelector("#searchList");
let resultHTML = "";
data.forEach((item: IBlock, index: number) => {
const title = getNotebookName(item.box) + getDisplayName(item.hPath, false);
@@ -191,7 +191,7 @@ ${unicode2Emoji(childItem.ial.icon, false, "b3-list-item__graphic", true)}
`;
listElement.scrollTop = 0;
- let countHTML = ""
+ let countHTML = "";
if (matchedBlockCount) {
countHTML = `${window.siyuan.languages.findInDoc.replace("${x}", matchedRootCount).replace("${y}", matchedBlockCount)}
`;
}
@@ -242,8 +242,8 @@ const initSearchEvent = (element: Element, config: ISearchOption) => {
}
updateSearchResult(config, element);
});
- const replaceInputElement = element.querySelector(".toolbar .b3-text-field") as HTMLInputElement
- replaceInputElement.value = config.r || ""
+ const replaceInputElement = element.querySelector(".toolbar .b3-text-field") as HTMLInputElement;
+ replaceInputElement.value = config.r || "";
const criteriaData: ISearchOption[] = [];
initCriteriaMenu(element.querySelector("#criteria"), criteriaData);
@@ -285,7 +285,7 @@ const initSearchEvent = (element: Element, config: ISearchOption) => {
} else if (type === "remove-path") {
config.idPath = [];
config.hPath = "";
- element.querySelector("#searchPath").classList.add("fn__none")
+ element.querySelector("#searchPath").classList.add("fn__none");
updateSearchResult(config, element);
const includeElement = element.querySelector('[data-type="include"]');
includeElement.classList.remove("toolbar__icon--active");
@@ -333,7 +333,7 @@ const initSearchEvent = (element: Element, config: ISearchOption) => {
}
config.hPath = hPathList.join(" ");
- const searchPathElement = element.querySelector("#searchPath")
+ const searchPathElement = element.querySelector("#searchPath");
searchPathElement.classList.remove("fn__none");
element.querySelector("#searchPath").innerHTML = `${escapeHtml(config.hPath)}
`;
@@ -405,7 +405,7 @@ const initSearchEvent = (element: Element, config: ISearchOption) => {
embedBlock: window.siyuan.config.search.embedBlock,
}
}, config);
- })
+ });
window.siyuan.menus.menu.element.style.zIndex = "220";
window.siyuan.menus.menu.fullscreen();
event.stopPropagation();
@@ -413,14 +413,14 @@ const initSearchEvent = (element: Element, config: ISearchOption) => {
break;
} else if (type === "filter") {
filterMenu(config, () => {
- updateSearchResult(config, element)
+ updateSearchResult(config, element);
});
event.stopPropagation();
event.preventDefault();
break;
} else if (type === "query") {
queryMenu(config, () => {
- updateSearchResult(config, element)
+ updateSearchResult(config, element);
});
window.siyuan.menus.menu.element.style.zIndex = "220";
window.siyuan.menus.menu.fullscreen();
diff --git a/app/src/mobile/settings/appearance.ts b/app/src/mobile/settings/appearance.ts
index 7224dd493..33dd49b6b 100644
--- a/app/src/mobile/settings/appearance.ts
+++ b/app/src/mobile/settings/appearance.ts
@@ -1,7 +1,5 @@
import {fetchPost} from "../../util/fetch";
-import {setInlineStyle} from "../../util/assets";
import {genOptions} from "../../util/genOptions";
-import {reloadProtyle} from "../../protyle/util/reload";
import {openModel} from "../menu/model";
export const initAppearance = () => {
diff --git a/app/src/mobile/settings/editor.ts b/app/src/mobile/settings/editor.ts
index 2b651d00d..6b488ba28 100644
--- a/app/src/mobile/settings/editor.ts
+++ b/app/src/mobile/settings/editor.ts
@@ -7,7 +7,7 @@ const reloadEditor = (data: IEditor) => {
window.siyuan.config.editor = data;
reloadProtyle(window.siyuan.mobile.editor.protyle);
setInlineStyle();
-}
+};
export const initEditor = () => {
openModel({
@@ -32,16 +32,16 @@ export const initEditor = () => {
modelMainElement.querySelector("#fontSize").textContent = event.target.value + "px";
window.siyuan.config.editor.fontSize = parseInt(event.target.value);
fetchPost("/api/setting/setEditor", window.siyuan.config.editor, (response) => {
- reloadEditor(response.data)
+ reloadEditor(response.data);
});
});
const katexMacrosElement = modelMainElement.querySelector("#katexMacros") as HTMLTextAreaElement;
katexMacrosElement.addEventListener("blur", () => {
window.siyuan.config.editor.katexMacros = katexMacrosElement.value;
fetchPost("/api/setting/setEditor", window.siyuan.config.editor, (response) => {
- reloadEditor(response.data)
+ reloadEditor(response.data);
});
- })
+ });
}
});
};
diff --git a/app/src/mobile/util/MobileTags.ts b/app/src/mobile/util/MobileTags.ts
index f9fc29f53..5397c7d48 100644
--- a/app/src/mobile/util/MobileTags.ts
+++ b/app/src/mobile/util/MobileTags.ts
@@ -67,7 +67,7 @@ export class MobileTags {
}
} else {
const searchOption = Object.assign({}, window.siyuan.storage[Constants.LOCAL_SEARCHDATA]);
- searchOption.k = `#${element.getAttribute("data-label")}#`
+ searchOption.k = `#${element.getAttribute("data-label")}#`;
popSearch(searchOption);
}
},
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 58c21c554..f6271eab2 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -260,7 +260,7 @@ export const showKeyboardToolbar = (height: number) => {
toolbarElement.classList.remove("fn__none");
const searchPathElement = document.getElementById("searchPath");
if (searchPathElement) {
- (searchPathElement.nextElementSibling as HTMLElement).style.marginBottom = "42px"
+ (searchPathElement.nextElementSibling as HTMLElement).style.marginBottom = "42px";
}
const range = getSelection().getRangeAt(0);
if (!window.siyuan.mobile.editor ||
@@ -292,7 +292,7 @@ export const hideKeyboardToolbar = () => {
window.siyuan.mobile.editor.protyle.element.style.marginBottom = "";
const searchPathElement = document.getElementById("searchPath");
if (searchPathElement) {
- (searchPathElement.nextElementSibling as HTMLElement).style.marginBottom = ""
+ (searchPathElement.nextElementSibling as HTMLElement).style.marginBottom = "";
}
};
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index eeef83792..89feac8fd 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -166,7 +166,7 @@ ${unicode2Emoji(emoji.unicode, true)}`;
if (this.splitChar === "#" ) {
const blockElement = hasClosestBlock(protyle.toolbar.range.startContainer);
if (blockElement && blockElement.getAttribute("data-type") === "NodeHeading") {
- const blockIndex = getSelectionOffset(protyle.toolbar.range.startContainer, blockElement).start
+ const blockIndex = getSelectionOffset(protyle.toolbar.range.startContainer, blockElement).start;
if (blockElement.textContent.startsWith("#".repeat(blockIndex))) {
this.element.classList.add("fn__none");
clearTimeout(this.timeId);
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index 6e8b78d21..b177f5539 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -794,8 +794,8 @@ const getQueryTip = (method: number) => {
methodTip += window.siyuan.languages.regex;
break;
}
- return methodTip
-}
+ return methodTip;
+};
const updateConfig = (element: Element, item: ISearchOption, config: ISearchOption, edit: Protyle) => {
const dialogElement = hasClosestByClassName(element, "b3-dialog--open");
diff --git a/app/src/util/processMessage.ts b/app/src/util/processMessage.ts
index ab4732a3a..6faa9ff5a 100644
--- a/app/src/util/processMessage.ts
+++ b/app/src/util/processMessage.ts
@@ -1,7 +1,6 @@
/// #if !MOBILE
import {exportLayout} from "../layout/util";
/// #endif
-import {isWindow} from "./functions";
import {hideMessage, showMessage} from "../dialog/message";
export const processMessage = (response: IWebSocketData) => {
diff --git a/app/src/window/onWindowsMsg.ts b/app/src/window/onWindowsMsg.ts
index 04b817eb5..b29a3435e 100644
--- a/app/src/window/onWindowsMsg.ts
+++ b/app/src/window/onWindowsMsg.ts
@@ -1,7 +1,6 @@
import {exportLayout, getInstanceById} from "../layout/util";
import {Tab} from "../layout/Tab";
import {fetchPost} from "../util/fetch";
-import {isWindow} from "../util/functions";
const closeTab = (ipcData: IWebSocketData) => {
const tab = getInstanceById(ipcData.data);