This commit is contained in:
parent
81d57bfd0f
commit
0e1f99463e
6 changed files with 26 additions and 13 deletions
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"resetCardTip": "Are you sure reset ${x} flashcards?",
|
||||
"freezeCol": "Freeze column",
|
||||
"unfreezeCol": "Unfreeze column",
|
||||
"snippetsTip": "The code snippet has been updated, do you want to save it?",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"resetCardTip": "¿Estás seguro de restablecer ${x} tarjetas?",
|
||||
"freezeCol": "Congelar columna",
|
||||
"unfreezeCol": "Descongelar columna",
|
||||
"snippetsTip": "El fragmento de código ha sido actualizado, ¿quieres guardarlo?",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"resetCardTip": "Êtes-vous sûr de réinitialiser ${x} flashcards ?",
|
||||
"freezeCol": "Geler la colonne",
|
||||
"unfreezeCol": "Dégeler la colonne",
|
||||
"snippetsTip": "L'extrait de code a été mis à jour, voulez-vous le sauvegarder ?",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"resetCardTip": "確定重設 ${x} 條閃卡?",
|
||||
"freezeCol": "固定列",
|
||||
"unfreezeCol": "取消列固定",
|
||||
"snippetsTip": "程式碼片段已更新,是否儲存?",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"resetCardTip": "确定重置 ${x} 条闪卡?",
|
||||
"freezeCol": "固定列",
|
||||
"unfreezeCol": "取消列固定",
|
||||
"snippetsTip": "代码片段已更新,是否保存?",
|
||||
|
|
|
@ -11,6 +11,7 @@ import {addLoading} from "../protyle/ui/initUI";
|
|||
import {Constants} from "../constants";
|
||||
import {onGet} from "../protyle/util/onGet";
|
||||
import {App} from "../index";
|
||||
import {confirmDialog} from "../dialog/confirmDialog";
|
||||
|
||||
export const viewCards = (app: App, deckID: string, title: string, deckType: "Tree" | "" | "Notebook", cb?: (response: IWebSocketData) => void) => {
|
||||
let pageIndex = 1;
|
||||
|
@ -24,7 +25,7 @@ export const viewCards = (app: App, deckID: string, title: string, deckType: "Tr
|
|||
<div class="block__icons">
|
||||
<span class="fn__flex-1 fn__flex-center resize__move">${escapeHtml(title)}</span>
|
||||
<span class="fn__space"></span>
|
||||
<span data-type="resetAll" class="block__icon block__icon--show b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.reset}"><svg><use xlink:href='#iconUndo'></use></svg></span>
|
||||
<span data-type="resetAll" class="block__icon block__icon--show b3-tooltips b3-tooltips__w${(deckType === "" && deckID === "") ? " fn__none" : ""}" aria-label="${window.siyuan.languages.reset}"><svg><use xlink:href='#iconUndo'></use></svg></span>
|
||||
<span class="fn__space"></span>
|
||||
<span data-type="previous" class="block__icon block__icon--show b3-tooltips b3-tooltips__w" disabled="disabled" aria-label="${window.siyuan.languages.previousLabel}"><svg><use xlink:href='#iconLeft'></use></svg></span>
|
||||
<span class="fn__space"></span>
|
||||
|
@ -156,18 +157,25 @@ export const viewCards = (app: App, deckID: string, title: string, deckType: "Tr
|
|||
deckID: deckType === "" ? deckID : Constants.QUICK_DECK_ID,
|
||||
id: deckID,
|
||||
blockIDs: [target.getAttribute("data-id")],
|
||||
}, (removeResponse) => {
|
||||
|
||||
}, () => {
|
||||
target.parentElement.querySelector(".ariaLabel.b3-list-item__meta").textContent = dayjs().format("YYYY-MM-DD")
|
||||
});
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
break;
|
||||
} else if (type === "resetAll") {
|
||||
fetchPost("/api/riff/resetRiffCards", {
|
||||
deckID: deckType === "" ? deckID : Constants.QUICK_DECK_ID,
|
||||
}, (removeResponse) => {
|
||||
|
||||
});
|
||||
confirmDialog(window.siyuan.languages.reset,
|
||||
window.siyuan.languages.resetCardTip.replace("${x}", dialog.element.querySelector(".counter").textContent), () => {
|
||||
fetchPost("/api/riff/resetRiffCards", {
|
||||
type: deckType === "" ? "deck" : deckType.toLowerCase(),
|
||||
deckID: deckType === "" ? deckID : Constants.QUICK_DECK_ID,
|
||||
id: deckID,
|
||||
}, () => {
|
||||
dialog.element.querySelectorAll(".ariaLabel.b3-list-item__meta").forEach(item => {
|
||||
item.textContent = dayjs().format("YYYY-MM-DD")
|
||||
})
|
||||
});
|
||||
})
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
break;
|
||||
|
@ -238,12 +246,12 @@ const renderViewItem = (blocks: IBlock[], title: string, deckType: string) => {
|
|||
${unicode2Emoji(item.ial.icon, "b3-list-item__graphic", true)}
|
||||
<span class="b3-list-item__text">${item.content || Constants.ZWSP}</span>
|
||||
<span class="${(isMobile() || !hPath) ? "fn__none " : ""}b3-list-item__meta b3-list-item__meta--ellipsis" title="${escapeAttr(hPath)}">${escapeHtml(hPath)}</span>
|
||||
<span aria-label="${window.siyuan.languages.nextDue}" class="ariaLabel b3-list-item__meta${!item.riffCard?.due ? " fn__none" : ""}">${dayjs(item.riffCard?.due).format("YYYY-MM-DD")}</span>
|
||||
<span aria-label="${window.siyuan.languages.revisionCount}" class="ariaLabel counter${item.riffCard?.reps === 0 ? " fn__none" : ""}">${item.riffCard?.reps}</span>
|
||||
<span data-type="reset" data-id="${item.id}" class="b3-list-item__action ariaLabel" aria-label="${window.siyuan.languages.reset}">
|
||||
<span data-position="parentE" aria-label="${window.siyuan.languages.revisionCount}" class="ariaLabel counter${item.riffCard?.reps === 0 ? " fn__none" : ""}">${item.riffCard?.reps}</span>
|
||||
<span data-position="parentE" aria-label="${window.siyuan.languages.nextDue}" class="ariaLabel b3-list-item__meta${!item.riffCard?.due ? " fn__none" : ""}">${dayjs(item.riffCard?.due).format("YYYY-MM-DD")}</span>
|
||||
<span data-position="parentE" data-type="reset" data-id="${item.id}" class="b3-list-item__action ariaLabel" aria-label="${window.siyuan.languages.reset}">
|
||||
<svg><use xlink:href="#iconUndo"></use></svg>
|
||||
</span>
|
||||
<span data-type="remove" data-id="${item.id}" class="b3-list-item__action ariaLabel" aria-label="${window.siyuan.languages.removeDeck}">
|
||||
<span data-position="parentE" data-type="remove" data-id="${item.id}" class="b3-list-item__action ariaLabel" aria-label="${window.siyuan.languages.removeDeck}">
|
||||
<svg><use xlink:href="#iconTrashcan"></use></svg>
|
||||
</span>
|
||||
</div>`;
|
||||
|
@ -252,7 +260,7 @@ ${unicode2Emoji(item.ial.icon, "b3-list-item__graphic", true)}
|
|||
// 块被删除的情况
|
||||
listHTML += `<div data-type="card-item" class="b3-list-item${isMobile() ? "" : " b3-list-item--hide-action"}">
|
||||
<span class="b3-list-item__text">${item.content}</span>
|
||||
<span data-type="remove" data-id="${item.id}" class="b3-list-item__action ariaLabel" aria-label="${window.siyuan.languages.removeDeck}">
|
||||
<span data-position="parentE" data-type="remove" data-id="${item.id}" class="b3-list-item__action ariaLabel" aria-label="${window.siyuan.languages.removeDeck}">
|
||||
<svg><use xlink:href="#iconTrashcan"></use></svg>
|
||||
</span>
|
||||
</div>`;
|
||||
|
|
Loading…
Add table
Reference in a new issue