mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-01 10:20:16 +01:00
This commit is contained in:
parent
83777a14ed
commit
a2dba45103
12 changed files with 228 additions and 163 deletions
|
|
@ -7,7 +7,7 @@ import {confirmDialog} from "../dialog/confirmDialog";
|
|||
import {hideElements} from "../protyle/ui/hideElements";
|
||||
import {viewCards} from "./viewCards";
|
||||
|
||||
export const genCardItem = (item: ICard) => {
|
||||
export const genCardItem = (item: ICardPackage) => {
|
||||
return `<li data-id="${item.id}" class="b3-list-item b3-list-item--narrow${isMobile() ? "" : " b3-list-item--hide-action"}">
|
||||
<span class="b3-list-item__text">${item.name}</span>
|
||||
<span class="counter b3-tooltips b3-tooltips__w${isMobile() ? "" : " fn__none"}" aria-label="${window.siyuan.languages.riffCard}">${item.size}</span>
|
||||
|
|
@ -48,7 +48,7 @@ export const makeCard = (nodeElement: Element[]) => {
|
|||
}
|
||||
ids.push(item.getAttribute("data-node-id"));
|
||||
});
|
||||
response.data.forEach((item: ICard) => {
|
||||
response.data.forEach((item: ICardPackage) => {
|
||||
html += genCardItem(item);
|
||||
});
|
||||
const dialog = new Dialog({
|
||||
|
|
@ -170,5 +170,19 @@ export const makeCard = (nodeElement: Element[]) => {
|
|||
});
|
||||
};
|
||||
|
||||
export const quickMakeCard = (nodeElement: Element[]) => {
|
||||
const ids: string[] = [];
|
||||
nodeElement.forEach(item => {
|
||||
if (item.getAttribute("data-type") === "NodeThematicBreak") {
|
||||
return;
|
||||
}
|
||||
ids.push(item.getAttribute("data-node-id"));
|
||||
});
|
||||
fetchPost("/api/riff/addRiffCards", {
|
||||
deckID: "20230218211946-2kw8jgx",
|
||||
blockIDs: ids
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue