Greasy Fork 支持简体中文。

WaniKani script to disable timeout

Automatically click the info button upon wrong review answer.

  1. // ==UserScript==
  2. // @name WaniKani script to disable timeout
  3. // @namespace https://www.wanikani.com
  4. // @description Automatically click the info button upon wrong review answer.
  5. // @version 0.1
  6. // @include https://www.wanikani.com/review/session
  7. // @include http://www.wanikani.com/review/session
  8. // @include https://www.wanikani.com/lesson/session
  9. // @include http://www.wanikani.com/lesson/session
  10. // @run-at document-end
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. /*global $, console*/
  15.  
  16. /*
  17. hook wrongCount jStorage
  18. upon field update with increased value
  19. automatically click the show info button
  20. after a slight delay (to avoid a display glitch)
  21. */
  22.  
  23. (function ()
  24. {
  25. 'use strict';
  26.  
  27. var lastWrongCount = 0;
  28. $.jStorage.listenKeyChange('questionCount', function (key, action) {
  29. var wrongCount;
  30. if (action === 'updated') {
  31. wrongCount = $.jStorage.get('questionCount');
  32. if (wrongCount > lastWrongCount) {
  33. setTimeout(function ()
  34. {
  35. if (!$("#item-info").is(":visible"))
  36. $('#option-item-info').click();
  37. }, 100);
  38. }
  39. lastWrongCount = wrongCount;
  40. }
  41. });
  42.  
  43. setTimeout(function ()
  44. {
  45. idleTime.increment = function()
  46. {
  47. /*var $related;
  48. $related = $("#timeout");
  49. t = 1;
  50. if (t > 9 && $related.is(":hidden"))
  51. {
  52. return idleTime.view();
  53. }*/
  54. };
  55. console.log('Loaded timeout disable.');
  56. }, 100);
  57. console.log('WaniKani Review Wrong Info Click: script load end');
  58. }());