WaniKani Fast Abridged Wrong Answer

try to take over the world!

当前为 2017-10-08 提交的版本,查看 最新版本

// ==UserScript==
// @name         WaniKani Fast Abridged Wrong Answer
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  try to take over the world!
// @author       You
// @match        https://www.wanikani.com/review/session
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    $('#user-response').after("<label id='lblCorrect' style='background-color: orange; display: none; height: 50px; line-height: 2em; font-size: 1.5em; font-weight: bold; color: white; text-shadow: 2px 2px 0 rgba(0,0,0,0.2) !important;'></label>");
    $('#lblCorrect').css('width',$('#user-response').css('width'));
    $.jStorage.listenKeyChange('currentItem', function (key, action) {
        if (action === 'updated') {
            $('#lblCorrect').text('').css('display','none');
        }
    });
    $.jStorage.listenKeyChange('wrongCount', function (key, action) {
        if (action === 'updated' && $.jStorage.get("wrongCount") > 0) {
        $('#lblCorrect').text('').css('display','block');
            switch($('#question-type h1').text().toLowerCase()){
                case "vocabulary reading":
                    $('#lblCorrect').text($.jStorage.get("currentItem").kana.join(", "));
                    break;
                case "vocabulary meaning":
                case "kanji meaning":
                case "radical name":
                    $('#lblCorrect').text($.jStorage.get("currentItem").en.join(", "));
                    break;
                case "kanji reading":
                    switch($.jStorage.get("currentItem").emph.toLowerCase()){
                        case "onyomi":
                            $('#lblCorrect').text($.jStorage.get("currentItem").on.join(", "));
                            break;
                        case "kunyomi":
                            $('#lblCorrect').text($.jStorage.get("currentItem").kun.join(", "));
                            break;
                    }
                    break;
            }
        }
    });
})();