mirror of
https://github.com/ankitects/anki.git
synced 2026-01-10 12:33:55 -05:00
Added: Answer on enter
This commit is contained in:
parent
cc043dbf0b
commit
43484e9201
4 changed files with 7 additions and 1 deletions
|
|
@ -319,6 +319,10 @@ message NextCardDataResponse {
|
||||||
bool marked = 13;
|
bool marked = 13;
|
||||||
optional TypedAnswer typed_answer = 12;
|
optional TypedAnswer typed_answer = 12;
|
||||||
optional TimerPreferences timer = 14;
|
optional TimerPreferences timer = 14;
|
||||||
|
// TODO: Is it worth setting up some sort of "ReviewerPreferences" endpoint
|
||||||
|
// akin to GetGraphPreferences Also should this reviewer setting be moved to
|
||||||
|
// a config bool rather than config.meta
|
||||||
|
bool accept_enter = 15;
|
||||||
|
|
||||||
repeated card_rendering.AVTag question_av_tags = 8;
|
repeated card_rendering.AVTag question_av_tags = 8;
|
||||||
repeated card_rendering.AVTag answer_av_tags = 9;
|
repeated card_rendering.AVTag answer_av_tags = 9;
|
||||||
|
|
|
||||||
|
|
@ -701,6 +701,7 @@ def next_card_data() -> bytes:
|
||||||
# Night mode is handled by the frontend so that it works with the browsers theme if used outside of anki.
|
# Night mode is handled by the frontend so that it works with the browsers theme if used outside of anki.
|
||||||
# Perhaps the OS class should be handled this way too?
|
# Perhaps the OS class should be handled this way too?
|
||||||
data.next_card.body_class = theme_manager.body_classes_for_card_ord(card.ord, False)
|
data.next_card.body_class = theme_manager.body_classes_for_card_ord(card.ord, False)
|
||||||
|
data.next_card.accept_enter = aqt.mw.pm.spacebar_rates_card()
|
||||||
|
|
||||||
return data.SerializeToString()
|
return data.SerializeToString()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -501,6 +501,7 @@ impl crate::services::SchedulerService for Collection {
|
||||||
timer,
|
timer,
|
||||||
|
|
||||||
// Filled by python
|
// Filled by python
|
||||||
|
accept_enter: true,
|
||||||
front: "".to_string(),
|
front: "".to_string(),
|
||||||
back: "".to_string(),
|
back: "".to_string(),
|
||||||
body_class: "".to_string(),
|
body_class: "".to_string(),
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,7 @@ export class ReviewerState {
|
||||||
case "enter": {
|
case "enter": {
|
||||||
if (!get(this.answerShown)) {
|
if (!get(this.answerShown)) {
|
||||||
this.showAnswer();
|
this.showAnswer();
|
||||||
} else {
|
} else if (this._cardData?.acceptEnter ?? true) {
|
||||||
this.easeButtonPressed(2);
|
this.easeButtonPressed(2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue