diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts
index bb26491f9..d30f1b8f9 100644
--- a/app/src/card/openCard.ts
+++ b/app/src/card/openCard.ts
@@ -1,3 +1,44 @@
+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) => {
}
diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts
index 2d5ca94e4..2b4720f45 100644
--- a/app/src/util/globalShortcut.ts
+++ b/app/src/util/globalShortcut.ts
@@ -43,7 +43,7 @@ import {editor} from "../config/editor";
import {hintMoveBlock} from "../protyle/hint/extend";
import {Backlink} from "../layout/dock/Backlink";
import {openHistory} from "../history/history";
-import {openCard} from "../card/openCard";
+import {matchCardKey, openCard} from "../card/openCard";
const getRightBlock = (element: HTMLElement, x: number, y: number) => {
let index = 1;
@@ -343,6 +343,19 @@ export const globalShortcut = () => {
return;
}
+ if (!event.ctrlKey && !event.metaKey && !event.shiftKey && !event.altKey && event.key === "s") {
+ const openCardDialog = window.siyuan.dialogs.find(item => {
+ if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.riffCard.custom) {
+ return true;
+ }
+ });
+ if (openCardDialog) {
+ event.preventDefault();
+ matchCardKey(event);
+ return;
+ }
+ }
+
// 仅处理以下快捷键操作
if (!event.ctrlKey && !isCtrl(event) && event.key !== "Escape" && !event.shiftKey && !event.altKey &&
!/^F\d{1,2}$/.test(event.key) && event.key.indexOf("Arrow") === -1 && event.key !== "Enter" && event.key !== "Backspace" && event.key !== "Delete") {
@@ -460,6 +473,7 @@ export const globalShortcut = () => {
return;
}
}
+
if (matchHotKey(window.siyuan.config.keymap.general.recentDocs.custom, event)) {
const openRecentDocsDialog = window.siyuan.dialogs.find(item => {
if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.recentDocs.custom) {
diff --git a/app/src/util/onGetConfig.ts b/app/src/util/onGetConfig.ts
index 97e0b6a7e..ca16e149f 100644
--- a/app/src/util/onGetConfig.ts
+++ b/app/src/util/onGetConfig.ts
@@ -179,7 +179,7 @@ const initBar = () => {
-