Bunpro Anki Mode

Anki mode for Bunpro

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Bunpro Anki Mode
// @namespace    ezhmd
// @version      1.10
// @description  Anki mode for Bunpro
// @author       Ezzat Chamudi
// @match        https://bunpro.jp/study*
// @match        http://bunpro.jp/study*
// @match        https://www.bunpro.jp/study*
// @match        http://www.bunpro.jp/study*
// @grant        none
// @license      GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// ==/UserScript==

document.getElementById("study-answer-input").disabled = true;

(function() {
    'use strict';

var css = `
    .anki-show {
        background-color: #000099;
    }
    .anki-yes {
        background-color: #009900;
    }
    .anki-no {
        background-color: #990000;
    }
    .anki-button {
        display: inline-block;
        font-size: 0.8125em;
        color: #FFFFFF;
        cursor: pointer;
        padding: 10px;
        width: 30%;
        max-width: 130px;
    }
    .review-padding-bottom {
        text-align: center;
        display: inline-flex;
        width: 100%;
        justify-content: center;
    }
`;

$(`<style>${css}</style>
<span class="anki-button anki-no" onclick='answerShow();'>Don't Know</span>
<span class="anki-button anki-show" onclick='answerShow();'>Show Answer</span>
<span class="anki-button anki-yes" onclick='answerCorrect();'>Know</span>`)
.appendTo(".review-padding-bottom");

$(".anki-show").click(function() {
    $("#show-answer").click();
    $("#study-answer-input").val($(".study-area-input").first().text());
});

$(".anki-yes").click(function() {
    $("#submit-study-answer").click();
});

$(".anki-no").click(function() {
    $("#study-answer-input").val("あああああああ");
    $("#submit-study-answer").click();
});

})();