import {Dialog} from "../dialog"; import {fetchPost} from "../util/fetch"; import {isMobile} from "../util/functions"; export const openCard = () => { let decksHTML = ''; fetchPost("/api/riff/getRiffDecks", {}, (response) => { response.data.forEach((deck:{id:string, name:string}) => { decksHTML += ``; }) fetchPost("/api/riff/getRiffDueCards", {deckID:""}, (cardsResponse) => { const dialog = new Dialog({ title: window.siyuan.languages.riffCard, content:`
${cardsResponse.data}
`, width: isMobile() ? "80vw" : "50vw", height: "70vh", }) dialog.element.setAttribute("data-key", window.siyuan.config.keymap.general.riffCard.custom) dialog.element.querySelector("select").addEventListener("change", (event) => { }) }) }) } export const matchCardKey = (event: KeyboardEvent) => { }