diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts index e39a0929b..ad242fc0f 100644 --- a/app/src/config/bazaar.ts +++ b/app/src/config/bazaar.ts @@ -342,7 +342,7 @@ export const bazaar = { html += this._genUpdateItemHTML(item, "widgets"); }); - const allCount = response.data.themes.length + response.data.icons.length + response.data.widgets.length + response.data.plugins.length + response.data.templates.length + const allCount = response.data.themes.length + response.data.icons.length + response.data.widgets.length + response.data.plugins.length + response.data.templates.length; if (allCount === 0) { this.element.querySelector('[data-type="downloaded-update"]').innerHTML = ""; return; @@ -354,7 +354,7 @@ export const bazaar = {
${localPath.filePaths[0]}`, () => {
+ confirmDialog("🏗️ " + window.siyuan.languages.createWorkspace, window.siyuan.languages.createWorkspaceTip + `${localPath.filePaths[0]}`, () => {
openWorkspace(localPath.filePaths[0]);
});
}
diff --git a/app/src/mobile/menu/search.ts b/app/src/mobile/menu/search.ts
index 268d03551..4d62457bc 100644
--- a/app/src/mobile/menu/search.ts
+++ b/app/src/mobile/menu/search.ts
@@ -25,6 +25,7 @@ import {
} from "../../search/assets";
import {addClearButton} from "../../util/addClearButton";
import {checkFold} from "../../util/noRelyPCFunction";
+import {getDefaultType} from "../../search/util";
const replace = (element: Element, config: ISearchOption, isAll: boolean) => {
if (config.method === 1 || config.method === 2) {
@@ -484,21 +485,7 @@ const initSearchEvent = (app: App, element: Element, config: ISearchOption) => {
k: "",
r: "",
page: 1,
- types: {
- document: window.siyuan.config.search.document,
- heading: window.siyuan.config.search.heading,
- list: window.siyuan.config.search.list,
- listItem: window.siyuan.config.search.listItem,
- codeBlock: window.siyuan.config.search.codeBlock,
- htmlBlock: window.siyuan.config.search.htmlBlock,
- mathBlock: window.siyuan.config.search.mathBlock,
- table: window.siyuan.config.search.table,
- blockquote: window.siyuan.config.search.blockquote,
- superBlock: window.siyuan.config.search.superBlock,
- paragraph: window.siyuan.config.search.paragraph,
- embedBlock: window.siyuan.config.search.embedBlock,
- databaseBlock: window.siyuan.config.search.databaseBlock,
- },
+ types: getDefaultType(),
replaceTypes: Object.assign({}, Constants.SIYUAN_DEFAULT_REPLACETYPES),
}, config);
});
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index 2bf064b98..931ceeff9 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -317,13 +317,13 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
${window.siyuan.languages.insertRowBefore.replace("${x}", '')}
`,
bind(element) {
- const inputElement = element.querySelector("input")
+ const inputElement = element.querySelector("input");
inputElement.addEventListener("keydown", (event: KeyboardEvent) => {
if (!event.isComposing && event.key === "Enter") {
insertRows(blockElement, protyle, parseInt(inputElement.value), rowElements[0].previousElementSibling.getAttribute("data-id"));
menu.close();
}
- })
+ });
}
});
menu.addItem({
@@ -333,13 +333,13 @@ ${window.siyuan.languages.insertRowBefore.replace("${x}", '')}
`,
bind(element) {
- const inputElement = element.querySelector("input")
+ const inputElement = element.querySelector("input");
inputElement.addEventListener("keydown", (event: KeyboardEvent) => {
if (!event.isComposing && event.key === "Enter") {
insertRows(blockElement, protyle, parseInt(inputElement.value), rowElements[0].getAttribute("data-id"));
menu.close();
}
- })
+ });
}
});
menu.addSeparator();
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index 7fe978f14..0665c69d8 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -829,4 +829,4 @@ export const addDragFill = (cellElement: Element) => {
}
cellElement.classList.add("av__cell--active");
cellElement.insertAdjacentHTML("beforeend", ``);
-}
+};
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index 564b9dde2..ff26c1341 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -50,7 +50,7 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void, v
if (selectCellElement) {
selectCellId = (hasClosestByClassName(selectCellElement, "av__row") as HTMLElement).dataset.id + Constants.ZWSP + selectCellElement.getAttribute("data-col-id");
}
- let dragFillId = ""
+ let dragFillId = "";
const dragFillElement = e.querySelector(".av__drag-fill") as HTMLElement;
if (dragFillElement) {
dragFillId = (hasClosestByClassName(dragFillElement, "av__row") as HTMLElement).dataset.id + Constants.ZWSP + dragFillElement.parentElement.getAttribute("data-col-id");
@@ -58,7 +58,7 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void, v
const activeIds: string[] = [];
e.querySelectorAll(".av__cell--active").forEach((item: HTMLElement) => {
activeIds.push((hasClosestByClassName(item, "av__row") as HTMLElement).dataset.id + Constants.ZWSP + item.getAttribute("data-col-id"));
- })
+ });
const created = protyle.options.history?.created;
const snapshot = protyle.options.history?.snapshot;
let newViewID = e.getAttribute(Constants.CUSTOM_SY_AV_VIEW) || "";
@@ -288,11 +288,11 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value)}`;
}
}
if (dragFillId) {
- addDragFill(e.querySelector(`.av__row[data-id="${dragFillId.split(Constants.ZWSP)[0]}"] .av__cell[data-col-id="${dragFillId.split(Constants.ZWSP)[1]}"]`))
+ addDragFill(e.querySelector(`.av__row[data-id="${dragFillId.split(Constants.ZWSP)[0]}"] .av__cell[data-col-id="${dragFillId.split(Constants.ZWSP)[1]}"]`));
}
activeIds.forEach(activeId => {
- e.querySelector(`.av__row[data-id="${activeId.split(Constants.ZWSP)[0]}"] .av__cell[data-col-id="${activeId.split(Constants.ZWSP)[1]}"]`)?.classList.add("av__cell--active")
- })
+ e.querySelector(`.av__row[data-id="${activeId.split(Constants.ZWSP)[0]}"] .av__cell[data-col-id="${activeId.split(Constants.ZWSP)[1]}"]`)?.classList.add("av__cell--active");
+ });
if (getSelection().rangeCount > 0) {
// 修改表头后光标重新定位
const range = getSelection().getRangeAt(0);
diff --git a/app/src/protyle/render/av/row.ts b/app/src/protyle/render/av/row.ts
index ef7e5c079..62e4c7122 100644
--- a/app/src/protyle/render/av/row.ts
+++ b/app/src/protyle/render/av/row.ts
@@ -380,4 +380,4 @@ export const insertRows = (blockElement: HTMLElement, protyle: IProtyle, count:
}]);
insertAttrViewBlockAnimation(protyle, blockElement, srcIDs, previousID, avID);
blockElement.setAttribute("updated", newUpdated);
-}
+};
diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts
index 1c2877564..b462653d6 100644
--- a/app/src/protyle/util/insertHTML.ts
+++ b/app/src/protyle/util/insertHTML.ts
@@ -12,7 +12,7 @@ import {input} from "../wysiwyg/input";
import {objEquals} from "../../util/functions";
const processAV = (range: Range, html: string, protyle: IProtyle, blockElement: HTMLElement) => {
- const tempElement = document.createElement("template")
+ const tempElement = document.createElement("template");
tempElement.innerHTML = html;
let values: IAVCellValue[] = [];
if (html.endsWith("]") && html.startsWith("[")) {
@@ -27,9 +27,9 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
values.push({
text: {content: cell.textContent},
type: "text"
- })
- })
- })
+ });
+ });
+ });
}
if (values && Array.isArray(values) && values.length > 0) {
const cellElements: Element[] = Array.from(blockElement.querySelectorAll(".av__cell--active, .av__cell--select")) || [];
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index 5d5ca9159..065caebe4 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -51,6 +51,27 @@ import {addClearButton} from "../util/addClearButton";
import {checkFold} from "../util/noRelyPCFunction";
import {getUnRefList, openSearchUnRef, unRefMoreMenu} from "./unRef";
+export const getDefaultType = () => {
+ return {
+ audioBlock: window.siyuan.config.search.audioBlock,
+ videoBlock: window.siyuan.config.search.videoBlock,
+ iFrameBlock: window.siyuan.config.search.iFrameBlock,
+ widgetBlock: window.siyuan.config.search.widgetBlock,
+ document: window.siyuan.config.search.document,
+ heading: window.siyuan.config.search.heading,
+ list: window.siyuan.config.search.list,
+ listItem: window.siyuan.config.search.listItem,
+ codeBlock: window.siyuan.config.search.codeBlock,
+ htmlBlock: window.siyuan.config.search.htmlBlock,
+ mathBlock: window.siyuan.config.search.mathBlock,
+ table: window.siyuan.config.search.table,
+ blockquote: window.siyuan.config.search.blockquote,
+ superBlock: window.siyuan.config.search.superBlock,
+ paragraph: window.siyuan.config.search.paragraph,
+ embedBlock: window.siyuan.config.search.embedBlock,
+ databaseBlock: window.siyuan.config.search.databaseBlock,
+ };
+};
export const toggleReplaceHistory = (searchElement: Element) => {
const list = window.siyuan.storage[Constants.LOCAL_SEARCHKEYS];
if (!list.replaceKeys || list.replaceKeys.length === 0) {
@@ -506,25 +527,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
k: "",
r: "",
page: 1,
- types: {
- audioBlock: window.siyuan.config.search.audioBlock,
- videoBlock: window.siyuan.config.search.videoBlock,
- iFrameBlock: window.siyuan.config.search.iFrameBlock,
- widgetBlock: window.siyuan.config.search.widgetBlock,
- document: window.siyuan.config.search.document,
- heading: window.siyuan.config.search.heading,
- list: window.siyuan.config.search.list,
- listItem: window.siyuan.config.search.listItem,
- codeBlock: window.siyuan.config.search.codeBlock,
- htmlBlock: window.siyuan.config.search.htmlBlock,
- mathBlock: window.siyuan.config.search.mathBlock,
- table: window.siyuan.config.search.table,
- blockquote: window.siyuan.config.search.blockquote,
- superBlock: window.siyuan.config.search.superBlock,
- paragraph: window.siyuan.config.search.paragraph,
- embedBlock: window.siyuan.config.search.embedBlock,
- databaseBlock: window.siyuan.config.search.databaseBlock,
- },
+ types: getDefaultType(),
replaceTypes: Object.assign({}, Constants.SIYUAN_DEFAULT_REPLACETYPES),
}, config, edit);
element.querySelector(".b3-chip--current")?.classList.remove("b3-chip--current");
@@ -766,25 +769,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
k: "",
r: "",
page: 1,
- types: {
- audioBlock: window.siyuan.config.search.audioBlock,
- videoBlock: window.siyuan.config.search.videoBlock,
- iFrameBlock: window.siyuan.config.search.iFrameBlock,
- widgetBlock: window.siyuan.config.search.widgetBlock,
- document: window.siyuan.config.search.document,
- heading: window.siyuan.config.search.heading,
- list: window.siyuan.config.search.list,
- listItem: window.siyuan.config.search.listItem,
- codeBlock: window.siyuan.config.search.codeBlock,
- htmlBlock: window.siyuan.config.search.htmlBlock,
- mathBlock: window.siyuan.config.search.mathBlock,
- table: window.siyuan.config.search.table,
- blockquote: window.siyuan.config.search.blockquote,
- superBlock: window.siyuan.config.search.superBlock,
- paragraph: window.siyuan.config.search.paragraph,
- embedBlock: window.siyuan.config.search.embedBlock,
- databaseBlock: window.siyuan.config.search.databaseBlock,
- },
+ types: getDefaultType(),
replaceTypes: Object.assign({}, Constants.SIYUAN_DEFAULT_REPLACETYPES),
}, config, edit);
element.querySelector("#criteria .b3-chip--current")?.classList.remove("b3-chip--current");