mirror of
https://github.com/ankitects/anki.git
synced 2026-01-09 03:53:55 -05:00
Added: Bury shortcut
This commit is contained in:
parent
40d7ce88aa
commit
f5c4b02609
2 changed files with 23 additions and 1 deletions
|
|
@ -779,6 +779,7 @@ exposed_backend_list = [
|
||||||
"get_optimal_retention_parameters",
|
"get_optimal_retention_parameters",
|
||||||
"simulate_fsrs_review",
|
"simulate_fsrs_review",
|
||||||
"simulate_fsrs_workload",
|
"simulate_fsrs_workload",
|
||||||
|
"bury_or_suspend_cards",
|
||||||
# DeckConfigService
|
# DeckConfigService
|
||||||
"get_ignored_before_count",
|
"get_ignored_before_count",
|
||||||
"get_retention_workload",
|
"get_retention_workload",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { CardAnswer, type NextCardDataResponse_NextCardData } from "@generated/anki/scheduler_pb";
|
|
||||||
import {
|
import {
|
||||||
|
BuryOrSuspendCardsRequest_Mode,
|
||||||
|
CardAnswer,
|
||||||
|
type NextCardDataResponse_NextCardData,
|
||||||
|
} from "@generated/anki/scheduler_pb";
|
||||||
|
import {
|
||||||
|
buryOrSuspendCards,
|
||||||
compareAnswer,
|
compareAnswer,
|
||||||
displayEditMenu,
|
displayEditMenu,
|
||||||
getConfigJson,
|
getConfigJson,
|
||||||
|
|
@ -95,6 +100,17 @@ export class ReviewerState {
|
||||||
displayEditMenu({ cid: this.currentCard?.card?.id });
|
displayEditMenu({ cid: this.currentCard?.card?.id });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public buryCurrentCard() {
|
||||||
|
if (this.currentCard?.card?.id) {
|
||||||
|
buryOrSuspendCards({
|
||||||
|
cardIds: [this.currentCard?.card?.id],
|
||||||
|
noteIds: [],
|
||||||
|
mode: BuryOrSuspendCardsRequest_Mode.BURY_USER,
|
||||||
|
});
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async handleKeyPress(key: string, ctrl: boolean, shift: boolean) {
|
async handleKeyPress(key: string, ctrl: boolean, shift: boolean) {
|
||||||
key = key.toLowerCase();
|
key = key.toLowerCase();
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
|
@ -136,6 +152,11 @@ export class ReviewerState {
|
||||||
}
|
}
|
||||||
case "e": {
|
case "e": {
|
||||||
this.displayEditMenu();
|
this.displayEditMenu();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "-": {
|
||||||
|
this.buryCurrentCard();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue