WaniKani script to disable timeout

Automatically click the info button upon wrong review answer.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name          WaniKani script to disable timeout
// @namespace     https://www.wanikani.com
// @description   Automatically click the info button upon wrong review answer.
// @version       0.1
// @include       https://www.wanikani.com/review/session
// @include       http://www.wanikani.com/review/session
// @include       https://www.wanikani.com/lesson/session
// @include       http://www.wanikani.com/lesson/session
// @run-at        document-end
// @grant         none
// ==/UserScript==

/*global $, console*/

/*
hook wrongCount jStorage
upon field update with increased value
automatically click the show info button
after a slight delay (to avoid a display glitch)
*/

(function () 
 {
    'use strict';

    var lastWrongCount = 0;
    $.jStorage.listenKeyChange('questionCount', function (key, action) {
        var wrongCount;
        if (action === 'updated') {
            wrongCount = $.jStorage.get('questionCount');
            if (wrongCount > lastWrongCount) {
                setTimeout(function () 
                {
                    if (!$("#item-info").is(":visible"))
                       $('#option-item-info').click();
                }, 100);
            }
            lastWrongCount = wrongCount;
        }
    });

    setTimeout(function () 
    {
        idleTime.increment = function() 
          {
            /*var $related;
            $related = $("#timeout");
            t = 1;
            if (t > 9 && $related.is(":hidden")) 
            {
              return idleTime.view();
            }*/
          };
        console.log('Loaded timeout disable.');
    }, 100);
     
    console.log('WaniKani Review Wrong Info Click: script load end');
}());