Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/9878

Vanessa06ef184c3023
diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts
index 3447466567..d403868ebc 100644
--- a/app/src/boot/globalEvent/keydown.ts
+++ b/app/src/boot/globalEvent/keydown.ts
@@ -1042,7 +1042,7 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
const target = event.target as HTMLElement;
if (isNotCtrl(event) && !event.shiftKey && !event.altKey &&
!["INPUT", "TEXTAREA"].includes(target.tagName) &&
- ["0", "1", "2", "3", "4", "j", "k", "l", ";", "s", " ", "p"].includes(event.key.toLowerCase())) {
+ ["0", "1", "2", "3", "4", "j", "k", "l", ";", "s", " ", "p", "enter"].includes(event.key.toLowerCase())) {
let cardElement: Element;
window.siyuan.dialogs.find(item => {
if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.riffCard.custom) {
diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts
index cc2f96e7be..c93d2fd87f 100644
--- a/app/src/card/openCard.ts
+++ b/app/src/card/openCard.ts
@@ -73,7 +73,7 @@ ${window.siyuan.config.flashcard.list ? "card__block--hideli" : ""}" data-type="
(p)
</button>
<span class="fn__space"></span>
- <button data-type="-1" class="b3-button fn__flex-1">${window.siyuan.languages.cardShowAnswer} (${window.siyuan.languages.space})</button>
+ <button data-type="-1" class="b3-button fn__flex-1">${window.siyuan.languages.cardShowAnswer} (${window.siyuan.languages.space} / Enter)</button>
</div>
<div class="fn__flex card__action fn__none">
<div>
@@ -99,7 +99,7 @@ ${window.siyuan.config.flashcard.list ? "card__block--hideli" : ""}" data-type="
</div>
<div>
<span></span>
- <button data-type="3" aria-label="3 / l" class="b3-button b3-button--info b3-tooltips__n b3-tooltips">
+ <button data-type="3" aria-label="3 / l / ${window.siyuan.languages.space} / Enter" class="b3-button b3-button--info b3-tooltips__n b3-tooltips">
<div>😊</div>
${window.siyuan.languages.cardRatingGood} (3)
</button>
@@ -201,7 +201,7 @@ export const bindCardEvent = (options: {
type = "3";
} else if (event.detail === "4" || event.detail === ";") {
type = "4";
- } else if (event.detail === " ") {
+ } else if (event.detail === " " || event.detail === "enter") {
type = "-1";
} else if (event.detail === "p") {
type = "-2";
@@ -336,17 +336,17 @@ export const bindCardEvent = (options: {
hideElements(["toolbar", "hint", "util"], editor.protyle);
if (type === "-1") { // 显示答案
if (actionElements[0].classList.contains("fn__none")) {
+ type = "3"
+ } else {
+ editor.protyle.element.classList.remove("card__block--hidemark", "card__block--hideli", "card__block--hidesb", "card__block--hideh");
+ actionElements[0].classList.add("fn__none");
+ actionElements[1].querySelectorAll(".b3-button").forEach((element, btnIndex) => {
+ element.previousElementSibling.textContent = options.blocks[index].nextDues[btnIndex];
+ });
+ actionElements[1].classList.remove("fn__none");
return;
}
- editor.protyle.element.classList.remove("card__block--hidemark", "card__block--hideli", "card__block--hidesb", "card__block--hideh");
- actionElements[0].classList.add("fn__none");
- actionElements[1].querySelectorAll(".b3-button").forEach((element, btnIndex) => {
- element.previousElementSibling.textContent = options.blocks[index].nextDues[btnIndex];
- });
- actionElements[1].classList.remove("fn__none");
- return;
- }
- if (type === "-2") { // 上一步
+ } else if (type === "-2") { // 上一步
if (actionElements[0].classList.contains("fn__none")) {
return;
}