WaniKani: I Don't know button

Adds an "I don't know the answer" button to reviews. When clicked it will submit an incorrect answer.

目前為 2015-01-21 提交的版本,檢視 最新版本

// ==UserScript==
// @name        WaniKani: I Don't know button
// @namespace   wk-wakaran
// @version     1.0
// @author Niklas Barsk
// @description Adds an "I don't know the answer" button to reviews. When clicked it will submit an incorrect answer.
// @include     https://www.wanikani.com/review/session*
// @run-at      document-end
// ==/UserScript==

function onDontKnowClick(e) {
    if (isMeaning()) {
        document.getElementById("user-response").value="Aargh! What does that even mean? (╯°□°)╯︵ ┻━┻";
    }
    else {
        document.getElementById("user-response").value="えぇぇ!。。。さっぱりわからないぃぃぃ。・゚゚・(≧д≦)・゚゚・。";
    }
}

function isMeaning() {
    return document.getElementById("question-type").className == "meaning";
}

function addDontKnowButton() {
  	var dontKnowButton = document.createElement("b");
  	dontKnowButton.innerHTML = "?";
  	dontKnowButton.setAttribute("style", "margin-left: 0.5em");
    dontKnowButton.onclick = onDontKnowClick;
  	document.getElementById("answer-form").getElementsByTagName("button")[0].appendChild(dontKnowButton);
}

addDontKnowButton();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址