mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
This commit is contained in:
parent
780e030ae0
commit
44d8d49851
2 changed files with 14 additions and 14 deletions
|
|
@ -1054,7 +1054,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", "enter"].includes(event.key.toLowerCase())) {
|
||||
["0", "1", "2", "3", "4", "j", "k", "l", ";", "s", " ", "p", "enter", "a", "s", "d", "f", "q", "x"].includes(event.key.toLowerCase())) {
|
||||
let cardElement: Element;
|
||||
window.siyuan.dialogs.find(item => {
|
||||
if (item.element.getAttribute("data-key") === Constants.DIALOG_OPENCARD) {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ ${window.siyuan.config.flashcard.list ? "card__block--hideli" : ""}" data-type="
|
|||
<div class="fn__flex card__action${options.cardsData.cards.length === 0 ? " fn__none" : ""}">
|
||||
<button class="b3-button b3-button--cancel" disabled="disabled" data-type="-2" style="width: 25%;min-width: 86px;display: flex">
|
||||
<svg><use xlink:href="#iconLeft"></use></svg>
|
||||
(p)
|
||||
(p / q)
|
||||
</button>
|
||||
<span class="fn__space"></span>
|
||||
<button data-type="-1" class="b3-button fn__flex-1">${window.siyuan.languages.cardShowAnswer} (${window.siyuan.languages.space} / Enter)</button>
|
||||
|
|
@ -85,35 +85,35 @@ ${window.siyuan.config.flashcard.list ? "card__block--hideli" : ""}" data-type="
|
|||
<div class="fn__flex card__action fn__none">
|
||||
<div>
|
||||
<span>${window.siyuan.languages.nextRound}</span>
|
||||
<button data-type="-3" aria-label="0" class="b3-button b3-button--cancel b3-tooltips__n b3-tooltips">
|
||||
<button data-type="-3" aria-label="0 / x" class="b3-button b3-button--cancel b3-tooltips__n b3-tooltips">
|
||||
<div>💤</div>
|
||||
${window.siyuan.languages.skip} (0)
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<span></span>
|
||||
<button data-type="1" aria-label="1 / j" class="b3-button b3-button--error b3-tooltips__n b3-tooltips">
|
||||
<button data-type="1" aria-label="1 / j / a" class="b3-button b3-button--error b3-tooltips__n b3-tooltips">
|
||||
<div>🙈</div>
|
||||
${window.siyuan.languages.cardRatingAgain} (1)
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<span></span>
|
||||
<button data-type="2" aria-label="2 / k" class="b3-button b3-button--warning b3-tooltips__n b3-tooltips">
|
||||
<button data-type="2" aria-label="2 / k / s" class="b3-button b3-button--warning b3-tooltips__n b3-tooltips">
|
||||
<div>😬</div>
|
||||
${window.siyuan.languages.cardRatingHard} (2)
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<span></span>
|
||||
<button data-type="3" aria-label="3 / l / ${window.siyuan.languages.space} / Enter" class="b3-button b3-button--info b3-tooltips__n b3-tooltips">
|
||||
<button data-type="3" aria-label="3 / l / d / ${window.siyuan.languages.space} / Enter" class="b3-button b3-button--info b3-tooltips__n b3-tooltips">
|
||||
<div>😊</div>
|
||||
${window.siyuan.languages.cardRatingGood} (3)
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<span></span>
|
||||
<button data-type="4" aria-label="4 / ;" class="b3-button b3-button--success b3-tooltips__n b3-tooltips">
|
||||
<button data-type="4" aria-label="4 / ; / f" class="b3-button b3-button--success b3-tooltips__n b3-tooltips">
|
||||
<div>🌈</div>
|
||||
${window.siyuan.languages.cardRatingEasy} (4)
|
||||
</button>
|
||||
|
|
@ -214,19 +214,19 @@ export const bindCardEvent = async (options: {
|
|||
const target = event.target as HTMLElement;
|
||||
let type = "";
|
||||
if (typeof event.detail === "string") {
|
||||
if (event.detail === "1" || event.detail === "j") {
|
||||
if (["1", "j", "a"].includes(event.detail)) {
|
||||
type = "1";
|
||||
} else if (event.detail === "2" || event.detail === "k") {
|
||||
} else if (["2", "k", "s"].includes(event.detail)) {
|
||||
type = "2";
|
||||
} else if (event.detail === "3" || event.detail === "l") {
|
||||
} else if (["3", "l", "d"].includes(event.detail)) {
|
||||
type = "3";
|
||||
} else if (event.detail === "4" || event.detail === ";") {
|
||||
} else if (["4", ";", "f"].includes(event.detail)) {
|
||||
type = "4";
|
||||
} else if (event.detail === " " || event.detail === "enter") {
|
||||
} else if ([" ", "enter"].includes(event.detail)) {
|
||||
type = "-1";
|
||||
} else if (event.detail === "p") {
|
||||
} else if (["p", "q"].includes(event.detail)) {
|
||||
type = "-2";
|
||||
} else if (event.detail === "0") {
|
||||
} else if (["0", "x"].includes(event.detail)) {
|
||||
type = "-3";
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue