Greasy Fork

Greasy Fork is available in English.

Show answer by typing "あ"

When making a mistake, while reviewing, also show the correct answer, when "あ" is pressed.

当前为 2022-05-16 提交的版本,查看 最新版本

// ==UserScript==
// @name         Show answer by typing "あ"
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  When making a mistake, while reviewing, also show the correct answer, when "あ" is pressed.
// @author       You
// @match        https://bunpro.jp/study
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bunpro.jp
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    var input_field = document.getElementById("study-answer-input")
    var show_answer_label = document.getElementById("show-answer")

    function on_japanese_a(event)
    {
        if (show_answer_label.style.display == "block" && event.data.endsWith("あ"))
        {
            input_field.value = event.data.substring(0, event.data.length - 1)
            show_answer_label.click();
        }
    }

    input_field.addEventListener("input", on_japanese_a)
})();