Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added delay option for the review buttons #1049

Merged
merged 6 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/lang/locale/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
FLASHCARD_EASY_DESC: '"تخصيص التسمية للزر "سهل',
FLASHCARD_GOOD_DESC: '"تخصيص التسمية للزر "جيد',
FLASHCARD_HARD_DESC: '"تخصيص التسمية للزر "صعب',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "وُسوم البطاقات",
FLASHCARD_TAGS_DESC: "#2أدخل الوُسوم مفصولة بمسافات أو أسطر جديدة ، أي بطاقات# رزمة3# رزمة",
CONVERT_FOLDERS_TO_DECKS: "تحويل المجلدات إلى ملفات أصلية و ملفات الفرعية؟",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/cz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
FLASHCARD_EASY_DESC: 'Customize the label for the "Easy" Button',
FLASHCARD_GOOD_DESC: 'Customize the label for the "Good" Button',
FLASHCARD_HARD_DESC: 'Customize the label for the "Hard" Button',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "Tag pro kartičky",
FLASHCARD_TAGS_DESC:
"Zadete tagy oodělené mezerou nebo odřádkováním například. #kartičky #balíčke2 #balíček3.",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export default {
FLASHCARD_GOOD_DESC: 'Passe die Beschriftung für "Gut" Knopf an',
FLASHCARD_EASY_DESC: 'Passe die Beschriftung für "Einfach" Knopf an',
FLASHCARD_HARD_DESC: 'Passe die Beschriftung für "Schwer" Knopf an',
REVIEW_BUTTON_DELAY: "Druckknopfverzögerung (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Fügt den Überprüfungsschaltflächen („Einfach“, „Gut“, „Schwer“, „Antwort anzeigen“) eine Verzögerung hinzu, bevor sie erneut gedrückt werden können.",
FLASHCARD_TAGS: "Lernkarten Tags",
FLASHCARD_TAGS_DESC:
"Mehrere Tags mit Leerzeichen oder Zeilenumbrüchen getrennt angeben. Bsp. #karte #stapel2 #stapel3.",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
FLASHCARD_EASY_DESC: 'Customize the label for the "Easy" Button',
FLASHCARD_GOOD_DESC: 'Customize the label for the "Good" Button',
FLASHCARD_HARD_DESC: 'Customize the label for the "Hard" Button',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "Flashcard tags",
FLASHCARD_TAGS_DESC:
"Enter tags separated by spaces or newlines i.e. #flashcards #deck2 #deck3.",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
FLASHCARD_EASY_DESC: "Personalize la etiqueta para el botón: Fácil",
FLASHCARD_GOOD_DESC: "Personalize la etiqueta para el botón: Bien",
FLASHCARD_HARD_DESC: "Personalize la etiqueta para el botón: Difícil",
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "Etiquetas de las Tarjetas de Memorización",
FLASHCARD_TAGS_DESC:
"Escriba las etiquetas separadas por espacios o saltos de línea, por ejemplo, #memorizar #mazo2 #mazo3",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export default {
FLASHCARD_EASY_DESC: "Changez le texte du bouton Facile",
FLASHCARD_GOOD_DESC: "Changez le texte du bouton Correct",
FLASHCARD_HARD_DESC: "Changez le texte du bouton Difficile",
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "Tags des flashcards",
FLASHCARD_TAGS_DESC:
"Entrez les tags séparés par un espace ou une ligne i.e. #flashcards #paquet2 #paquet3.",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export default {
FLASHCARD_EASY_DESC: 'Personalizza il testo per il pulsante "Facile"',
FLASHCARD_GOOD_DESC: 'Personalizza il testo per il pulsante "Buono"',
FLASHCARD_HARD_DESC: 'Personalizza il testo per il pulsante "Difficile"',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "Etichette delle schede",
FLASHCARD_TAGS_DESC:
"Inserire etichette separate da spazi o a capi, per esempio #flashcards #deck2 #deck3.",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export default {
FLASHCARD_EASY_DESC: 'Customize the label for the "Easy" Button',
FLASHCARD_GOOD_DESC: 'Customize the label for the "Good" Button',
FLASHCARD_HARD_DESC: 'Customize the label for the "Hard" Button',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "フラッシュカードに使用するタグ",
FLASHCARD_TAGS_DESC:
'タグをスペースまたは改行で区切って入力してください。例: "#flashcards #deck2 #deck3"',
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
FLASHCARD_EASY_DESC: 'Customize the label for the "Easy" Button',
FLASHCARD_GOOD_DESC: 'Customize the label for the "Good" Button',
FLASHCARD_HARD_DESC: 'Customize the label for the "Hard" Button',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "플래시카드 태그",
FLASHCARD_TAGS_DESC:
"태그를 공백 또는 빈 줄로 구분해서 입력해주세요. 예) '#flashcards #deck2 #deck3'",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
FLASHCARD_EASY_DESC: 'Dostosuj etykietę dla przycisku "Łatwe"',
FLASHCARD_GOOD_DESC: 'Dostosuj etykietę dla przycisku "Średnio trudne"',
FLASHCARD_HARD_DESC: 'Dostosuj etykietę dla przycisku "Trudne"',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "Tagi fiszek",
FLASHCARD_TAGS_DESC:
"Wprowadź tagi oddzielone spacją lub nowymi liniami, np. #fiszki #talia2 #talia3.",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export default {
FLASHCARD_EASY_DESC: 'Customize o rótulo para o botão de "Fácil"',
FLASHCARD_GOOD_DESC: 'Customize o rótulo para o botão de "OK"',
FLASHCARD_HARD_DESC: 'Customize o rótulo para o botão de "Difícil"',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "Etiquetas dos Flashcards",
FLASHCARD_TAGS_DESC:
"Insira etiquetas separadas por espaços ou quebras de linha ex: #flashcards #baralho2 #baralho3.",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ export default {
FLASHCARD_EASY_DESC: 'Настроить ярлык для кнопки "Легко"',
FLASHCARD_GOOD_DESC: 'Настроить ярлык для кнопки "Нормально"',
FLASHCARD_HARD_DESC: 'Настроить ярлык для кнопки "Сложно"',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "Теги карточек",
FLASHCARD_TAGS_DESC:
"Укажите теги разделенные Enter-ом или пробелом, например: #flashcards #deck2 #deck3.",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
FLASHCARD_EASY_DESC: '"Kolay" butonunun metnini özelleştirin',
FLASHCARD_GOOD_DESC: '"Orta" butonunun metnini özelleştirin',
FLASHCARD_HARD_DESC: '"Zor" butonunun metnini özelleştirin',
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "Flash Kart Etiketleri",
FLASHCARD_TAGS_DESC:
"Etiketleri boşluklar veya yeni satırlarla ayırarak girin, örneğin: #flashcards #deck2 #deck3.",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
FLASHCARD_EASY_DESC: "自定义“简单”按钮的标签",
FLASHCARD_GOOD_DESC: "自定义“记得”按钮的标签",
FLASHCARD_HARD_DESC: "自定义“较难”按钮的标签",
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "卡片标签",
FLASHCARD_TAGS_DESC: "输入标签,用空格或新建行分隔,例如:#flashcards #deck2 #deck3.",
CONVERT_FOLDERS_TO_DECKS: "是否将文件夹内容转换为卡片组和子卡片组?",
Expand Down
3 changes: 3 additions & 0 deletions src/lang/locale/zh-tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
FLASHCARD_EASY_DESC: "自訂「簡單」按鈕的標籤",
FLASHCARD_GOOD_DESC: "自訂「記得」按鈕的標籤",
FLASHCARD_HARD_DESC: "自訂「較難」按鈕的標籤",
REVIEW_BUTTON_DELAY: "Button press delay (ms)",
REVIEW_BUTTON_DELAY_DESC:
"Add a delay to the review buttons('Easy', 'Good', 'Hard', 'Show answer') before they could be pressed again.",
FLASHCARD_TAGS: "卡片標籤",
FLASHCARD_TAGS_DESC: "輸入標籤(用空白或換行字元分隔),例如:#flashcards #deck2 #deck3.",
CONVERT_FOLDERS_TO_DECKS: "是否將資料夾內容轉換為牌組和子牌組?",
Expand Down
27 changes: 27 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface SRSettings {
flashcardEasyText: string;
flashcardGoodText: string;
flashcardHardText: string;
reviewButtonDelay: number;
flashcardTags: string[];
convertFoldersToDecks: boolean;
cardCommentOnSameLine: boolean;
Expand Down Expand Up @@ -58,6 +59,7 @@ export const DEFAULT_SETTINGS: SRSettings = {
flashcardEasyText: t("EASY"),
flashcardGoodText: t("GOOD"),
flashcardHardText: t("HARD"),
reviewButtonDelay: 0,
flashcardTags: ["#flashcards"],
convertFoldersToDecks: false,
cardCommentOnSameLine: false,
Expand Down Expand Up @@ -811,6 +813,31 @@ export class SRSettingTab extends PluginSettingTab {
this.display();
});
});

new Setting(containerEl)
.setName(t("REVIEW_BUTTON_DELAY"))
.setDesc(t("REVIEW_BUTTON_DELAY_DESC"))
.addSlider((slider) =>
slider
.setLimits(0, 5000, 100)
.setValue(this.plugin.data.settings.reviewButtonDelay)
.setDynamicTooltip()
.onChange(async (value) => {
this.plugin.data.settings.reviewButtonDelay = value;
await this.plugin.savePluginData();
}),
)
.addExtraButton((button) => {
button
.setIcon("reset")
.setTooltip(t("RESET_DEFAULT"))
.onClick(async () => {
this.plugin.data.settings.reviewButtonDelay =
DEFAULT_SETTINGS.reviewButtonDelay;
await this.plugin.savePluginData();
this.display();
});
});
}

private async tabAlgorithm(containerEl: HTMLElement): Promise<void> {
Expand Down
Loading