mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 09:30:48 +08:00
This commit is contained in:
parent
883c08810e
commit
cae79fecd5
@ -34,8 +34,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__img {
|
&__img {
|
||||||
width: 96px;
|
width: 100px;
|
||||||
height: 96px;
|
height: 100px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
3
app/src/types/index.d.ts
vendored
3
app/src/types/index.d.ts
vendored
@ -632,6 +632,9 @@ declare interface IFile {
|
|||||||
hMtime: string;
|
hMtime: string;
|
||||||
hCtime: string;
|
hCtime: string;
|
||||||
hSize: string;
|
hSize: string;
|
||||||
|
dueFlashcardCount?: string;
|
||||||
|
newFlashcardCount?: string;
|
||||||
|
flashcardCount?: string;
|
||||||
id: string;
|
id: string;
|
||||||
count: number;
|
count: number;
|
||||||
subFileCount: number;
|
subFileCount: number;
|
||||||
|
@ -8,7 +8,7 @@ import {unicode2Emoji} from "../emoji";
|
|||||||
import {Constants} from "../constants";
|
import {Constants} from "../constants";
|
||||||
import {showMessage} from "../dialog/message";
|
import {showMessage} from "../dialog/message";
|
||||||
|
|
||||||
export const getIdZoomInByPath = () => {
|
export const getIdZoomInByPath = () => {
|
||||||
const searchParams = new URLSearchParams(window.location.search);
|
const searchParams = new URLSearchParams(window.location.search);
|
||||||
const PWAURL = searchParams.get("url");
|
const PWAURL = searchParams.get("url");
|
||||||
let id = "";
|
let id = "";
|
||||||
@ -128,7 +128,8 @@ export const moveToPath = (fromPaths: string[], toNotebook: string, toPath: stri
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void, paths?: string[], range?: Range, title?: string, flashcard = false) => {
|
export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void,
|
||||||
|
paths?: string[], range?: Range, title?: string, flashcard = false) => {
|
||||||
const exitDialog = window.siyuan.dialogs.find((item) => {
|
const exitDialog = window.siyuan.dialogs.find((item) => {
|
||||||
if (item.element.querySelector("#foldList")) {
|
if (item.element.querySelector("#foldList")) {
|
||||||
item.destroy();
|
item.destroy();
|
||||||
@ -161,6 +162,8 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// 文档树上引用数悬浮层不被遮挡
|
||||||
|
dialog.element.style.zIndex = "200";
|
||||||
if (paths && paths.length > 0) {
|
if (paths && paths.length > 0) {
|
||||||
fetchPost("/api/filetree/getHPathsByPaths", {paths}, (response) => {
|
fetchPost("/api/filetree/getHPathsByPaths", {paths}, (response) => {
|
||||||
dialog.element.querySelector(".b3-dialog__header .ft__smaller").innerHTML = escapeHtml(response.data.join(" "));
|
dialog.element.querySelector(".b3-dialog__header .ft__smaller").innerHTML = escapeHtml(response.data.join(" "));
|
||||||
@ -204,10 +207,25 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void,
|
|||||||
flashcard,
|
flashcard,
|
||||||
}, (data) => {
|
}, (data) => {
|
||||||
let fileHTML = "";
|
let fileHTML = "";
|
||||||
data.data.forEach((item: { boxIcon: string, box: string, hPath: string, path: string }) => {
|
data.data.forEach((item: {
|
||||||
|
boxIcon: string,
|
||||||
|
box: string,
|
||||||
|
hPath: string,
|
||||||
|
path: string,
|
||||||
|
newFlashcardCount: string,
|
||||||
|
dueFlashcardCount: string,
|
||||||
|
flashcardCount: string
|
||||||
|
}) => {
|
||||||
|
let countHTML = "";
|
||||||
|
if (flashcard) {
|
||||||
|
countHTML = `<span class="popover__block counter b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.flashcardNewCard}">${item.newFlashcardCount}</span>
|
||||||
|
<span class="popover__block counter b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.flashcardReviewCard}">${item.dueFlashcardCount}</span>
|
||||||
|
<span class="popover__block counter b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.flashcardCard}">${item.flashcardCount}</span>`;
|
||||||
|
}
|
||||||
fileHTML += `<li style="padding: 4px" class="b3-list-item${fileHTML === "" ? " b3-list-item--focus" : ""}" data-path="${item.path}" data-box="${item.box}">
|
fileHTML += `<li style="padding: 4px" class="b3-list-item${fileHTML === "" ? " b3-list-item--focus" : ""}" data-path="${item.path}" data-box="${item.box}">
|
||||||
${unicode2Emoji(item.boxIcon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-list-item__graphic", true)}
|
${unicode2Emoji(item.boxIcon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-list-item__graphic", true)}
|
||||||
<span class="b3-list-item__showall">${escapeHtml(item.hPath)}</span>
|
<span class="b3-list-item__showall">${escapeHtml(item.hPath)}</span>
|
||||||
|
${countHTML}
|
||||||
</li>`;
|
</li>`;
|
||||||
});
|
});
|
||||||
searchListElement.innerHTML = fileHTML;
|
searchListElement.innerHTML = fileHTML;
|
||||||
@ -435,7 +453,7 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void,
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getLeaf = (liElement: HTMLElement, flashcard:boolean) => {
|
const getLeaf = (liElement: HTMLElement, flashcard: boolean) => {
|
||||||
const toggleElement = liElement.querySelector(".b3-list-item__arrow");
|
const toggleElement = liElement.querySelector(".b3-list-item__arrow");
|
||||||
if (toggleElement.classList.contains("b3-list-item__arrow--open")) {
|
if (toggleElement.classList.contains("b3-list-item__arrow--open")) {
|
||||||
toggleElement.classList.remove("b3-list-item__arrow--open");
|
toggleElement.classList.remove("b3-list-item__arrow--open");
|
||||||
@ -463,7 +481,11 @@ const getLeaf = (liElement: HTMLElement, flashcard:boolean) => {
|
|||||||
let fileHTML = "";
|
let fileHTML = "";
|
||||||
response.data.files.forEach((item: IFile) => {
|
response.data.files.forEach((item: IFile) => {
|
||||||
let countHTML = "";
|
let countHTML = "";
|
||||||
if (item.count && item.count > 0) {
|
if (flashcard) {
|
||||||
|
countHTML = `<span class="popover__block counter b3-tooltips b3-tooltips__nw" aria-label="${window.siyuan.languages.flashcardNewCard}">${item.newFlashcardCount}</span>
|
||||||
|
<span class="popover__block counter b3-tooltips b3-tooltips__nw" aria-label="${window.siyuan.languages.flashcardReviewCard}">${item.dueFlashcardCount}</span>
|
||||||
|
<span class="popover__block counter b3-tooltips b3-tooltips__nw" aria-label="${window.siyuan.languages.flashcardCard}">${item.flashcardCount}</span>`;
|
||||||
|
} else if (item.count && item.count > 0) {
|
||||||
countHTML = `<span class="popover__block counter b3-tooltips b3-tooltips__nw" aria-label="${window.siyuan.languages.ref}">${item.count}</span>`;
|
countHTML = `<span class="popover__block counter b3-tooltips b3-tooltips__nw" aria-label="${window.siyuan.languages.ref}">${item.count}</span>`;
|
||||||
}
|
}
|
||||||
fileHTML += `<li title="${getDisplayName(item.name, true, true)} ${item.hSize}${item.bookmark ? "\n" + window.siyuan.languages.bookmark + " " + item.bookmark : ""}${item.name1 ? "\n" + window.siyuan.languages.name + " " + item.name1 : ""}${item.alias ? "\n" + window.siyuan.languages.alias + " " + item.alias : ""}${item.memo ? "\n" + window.siyuan.languages.memo + " " + item.memo : ""}${item.subFileCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", item.subFileCount) : ""}\n${window.siyuan.languages.modifiedAt} ${item.hMtime}\n${window.siyuan.languages.createdAt} ${item.hCtime}"
|
fileHTML += `<li title="${getDisplayName(item.name, true, true)} ${item.hSize}${item.bookmark ? "\n" + window.siyuan.languages.bookmark + " " + item.bookmark : ""}${item.name1 ? "\n" + window.siyuan.languages.name + " " + item.name1 : ""}${item.alias ? "\n" + window.siyuan.languages.alias + " " + item.alias : ""}${item.memo ? "\n" + window.siyuan.languages.memo + " " + item.memo : ""}${item.subFileCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", item.subFileCount) : ""}\n${window.siyuan.languages.modifiedAt} ${item.hMtime}\n${window.siyuan.languages.createdAt} ${item.hCtime}"
|
||||||
|
Loading…
Reference in New Issue
Block a user