This commit is contained in:
Vanessa 2023-04-22 15:12:38 +08:00
parent 91f3ff61c8
commit 0476c8d48d
9 changed files with 11 additions and 15 deletions

View file

@ -317,8 +317,7 @@ export const about = {
}); });
about.element.querySelector("#purgeRepo").addEventListener("click", () => { about.element.querySelector("#purgeRepo").addEventListener("click", () => {
confirmDialog("♻️ " + window.siyuan.languages.dataRepoPurge, window.siyuan.languages.dataRepoPurgeConfirm, () => { confirmDialog("♻️ " + window.siyuan.languages.dataRepoPurge, window.siyuan.languages.dataRepoPurgeConfirm, () => {
fetchPost("/api/repo/purgeRepo", {}, () => { fetchPost("/api/repo/purgeRepo");
});
}); });
}); });
const networkServeElement = about.element.querySelector("#networkServe") as HTMLInputElement; const networkServeElement = about.element.querySelector("#networkServe") as HTMLInputElement;

View file

@ -168,7 +168,7 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string
if (item.typesCount) { if (item.typesCount) {
item.typesCount.forEach(subItem => { item.typesCount.forEach(subItem => {
statHTML += `<span class="fn__space"></span>${subItem.type} ${subItem.count}`; statHTML += `<span class="fn__space"></span>${subItem.type} ${subItem.count}`;
}) });
} }
statHTML+="</div>"; statHTML+="</div>";
@ -183,7 +183,7 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string
<span class="fn__space"></span> <span class="fn__space"></span>
${window.siyuan.languages.fileSize} ${item.hSize} ${window.siyuan.languages.fileSize} ${item.hSize}
</span> </span>
</div>${statHTML}` </div>${statHTML}`;
/// #if MOBILE /// #if MOBILE
repoHTML += `<li class="b3-list-item" data-type="repoitem" data-id="${item.id}" data-tag="${item.tag}"> repoHTML += `<li class="b3-list-item" data-type="repoitem" data-id="${item.id}" data-tag="${item.tag}">
<div class="fn__flex-1"> <div class="fn__flex-1">
@ -204,7 +204,7 @@ ${actionHTML}
}; };
const renderRepo = (element: Element, currentPage: number) => { const renderRepo = (element: Element, currentPage: number) => {
const selectValue = (element.querySelector(".b3-select") as HTMLSelectElement).value const selectValue = (element.querySelector(".b3-select") as HTMLSelectElement).value;
element.lastElementChild.innerHTML = '<li style="position: relative;height: 100%;"><div class="fn__loading"><img width="64px" src="/stage/loading-pure.svg"></div></li>'; element.lastElementChild.innerHTML = '<li style="position: relative;height: 100%;"><div class="fn__loading"><img width="64px" src="/stage/loading-pure.svg"></div></li>';
const previousElement = element.querySelector('[data-type="previous"]'); const previousElement = element.querySelector('[data-type="previous"]');
const nextElement = element.querySelector('[data-type="next"]'); const nextElement = element.querySelector('[data-type="next"]');

View file

@ -12,7 +12,6 @@ import {replaceFileName} from "../../editor/rename";
import {escapeHtml} from "../../util/escape"; import {escapeHtml} from "../../util/escape";
import {unicode2Emoji} from "../../emoji"; import {unicode2Emoji} from "../../emoji";
import {Constants} from "../../constants"; import {Constants} from "../../constants";
import {isMobile} from "../../util/functions";
export class Inbox extends Model { export class Inbox extends Model {
private element: Element; private element: Element;

View file

@ -217,7 +217,7 @@ const updateSearchResult = (config: ISearchOption, element: Element) => {
}); });
} else { } else {
if (!config.page) { if (!config.page) {
config.page = 1 config.page = 1;
} }
if (config.page > 1) { if (config.page > 1) {
previousElement.removeAttribute("disabled"); previousElement.removeAttribute("disabled");

View file

@ -253,8 +253,7 @@ export const initAbout = () => {
break; break;
} else if (target.id === "purgeRepo") { } else if (target.id === "purgeRepo") {
confirmDialog("♻️ " + window.siyuan.languages.dataRepoPurge, window.siyuan.languages.dataRepoPurgeConfirm, () => { confirmDialog("♻️ " + window.siyuan.languages.dataRepoPurge, window.siyuan.languages.dataRepoPurgeConfirm, () => {
fetchPost("/api/repo/purgeRepo", {}, () => { fetchPost("/api/repo/purgeRepo");
});
}); });
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();

View file

@ -24,7 +24,7 @@ const popSide = (render = true) => {
}; };
export const handleTouchEnd = (event: TouchEvent) => { export const handleTouchEnd = (event: TouchEvent) => {
const editor = getCurrentEditor() const editor = getCurrentEditor();
if (editor) { if (editor) {
document.querySelectorAll(".protyle-breadcrumb__bar--hide").forEach(item => { document.querySelectorAll(".protyle-breadcrumb__bar--hide").forEach(item => {
item.classList.remove("protyle-breadcrumb__bar--hide"); item.classList.remove("protyle-breadcrumb__bar--hide");
@ -36,7 +36,7 @@ export const handleTouchEnd = (event: TouchEvent) => {
target.tagName === "SPAN" && window.webkit?.messageHandlers && target.tagName === "SPAN" && window.webkit?.messageHandlers &&
!hasClosestByAttribute(target, "data-type", "NodeBlockQueryEmbed")) { !hasClosestByAttribute(target, "data-type", "NodeBlockQueryEmbed")) {
// ios 长按行内元素弹出菜单 // ios 长按行内元素弹出菜单
const types = (target.getAttribute("data-type") || "").split(" ") const types = (target.getAttribute("data-type") || "").split(" ");
if (types.includes("inline-memo")) { if (types.includes("inline-memo")) {
editor.protyle.toolbar.showRender(editor.protyle, target); editor.protyle.toolbar.showRender(editor.protyle, target);
} }

View file

@ -488,7 +488,7 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
tempElement.innerHTML = value.replace(/<mark>/g, "").replace(/<\/mark>/g, ""); tempElement.innerHTML = value.replace(/<mark>/g, "").replace(/<\/mark>/g, "");
tempElement = tempElement.firstElementChild as HTMLDivElement; tempElement = tempElement.firstElementChild as HTMLDivElement;
if (refIsS) { if (refIsS) {
const staticText = range.toString().replace(this.splitChar, "") const staticText = range.toString().replace(this.splitChar, "");
if (staticText) { if (staticText) {
tempElement.setAttribute("data-subtype", "s"); tempElement.setAttribute("data-subtype", "s");
tempElement.innerText = staticText; tempElement.innerText = staticText;

View file

@ -63,7 +63,6 @@ import {BlockPanel} from "../../block/Panel";
import * as dayjs from "dayjs"; import * as dayjs from "dayjs";
import {highlightRender} from "../markdown/highlightRender"; import {highlightRender} from "../markdown/highlightRender";
import {countBlockWord} from "../../layout/status"; import {countBlockWord} from "../../layout/status";
import {openMobileFileById} from "../../mobile/editor";
import {moveToDown, moveToUp} from "./move"; import {moveToDown, moveToUp} from "./move";
import {pasteAsPlainText} from "../util/paste"; import {pasteAsPlainText} from "../util/paste";
import {preventScroll} from "../scroll/preventScroll"; import {preventScroll} from "../scroll/preventScroll";

View file

@ -286,7 +286,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
let target = event.target as HTMLElement; let target = event.target as HTMLElement;
const searchPathInputElement = element.querySelector("#searchPathInput"); const searchPathInputElement = element.querySelector("#searchPathInput");
while (target && !target.isSameNode(element)) { while (target && !target.isSameNode(element)) {
const type = target.getAttribute("data-type") const type = target.getAttribute("data-type");
if (type === "next") { if (type === "next") {
if (!target.getAttribute("disabled")) { if (!target.getAttribute("disabled")) {
config.page++; config.page++;
@ -1074,7 +1074,7 @@ const inputEvent = (element: Element, config: ISearchOption, inputTimeout: numbe
page: config.page || 1, page: config.page || 1,
}, (response) => { }, (response) => {
if (!config.page) { if (!config.page) {
config.page = 1 config.page = 1;
} }
if (config.page < response.data.pageCount) { if (config.page < response.data.pageCount) {
nextElement.removeAttribute("disabled"); nextElement.removeAttribute("disabled");