Update 2017-04-29: version 0.21
New
- now will also expand item info in lesson reviews.
Description
This is a very simple script for reviews that always expands the Item Info section. I use it because I realized I was clicking Item Info all the time, either because I got an answer wrong, or to review a mnemonic when I just foggily remembered the answer but not the mnemonic, or to review the stroke order (which WaniKani doesn’t quiz me on). That’s all it does, but it saves a bunch of clicks on every review.
It is based on Wanikani Review Wrong Info Click by Takuya Kobayashi, and I couldn’t have done it without the directions of @Mempo and @rfindley, who took me 95% there. Thank you!
Installation
- requires greasemonkey or a similar extension for your browser.
- install from WaniKani Item Info Expander (recommended, auto-updates)
Current version
0.21 (2017-04-29)
New
- now will also expand item info in lesson reviews.
Code
// ==UserScript==
// @name WaniKani Item Info Expander
// @namespace mvi
// @description Expands item info automatically without scrolling. Based on script by Takuya Kobayashi, with help from Mempo and rfindley.
// @include https://www.wanikani.com/review/session
// @include https://www.wanikani.com/lesson/session
// @version 0.21
// @run-at document-end
// @grant none
// ==/UserScript==
(function () {
'use strict';
function noscroll() {
window.scrollTo( 0, 0 );
}
var oldEvaluate = answerChecker.evaluate;
answerChecker.evaluate = function(e,t) {
// add listener to disable scroll
window.addEventListener('scroll', noscroll);
// expand item info
setTimeout(function () {
$('#option-item-info').click();
}, 100);
// Remove listener to disable scroll
setTimeout(function () {
window.removeEventListener('scroll', noscroll);
}, 1000);
return oldEvaluate(e,t);
};
console.log('WaniKani Item Info Expander: script load end');
}());
Old versions
[details=click to expand]
0.2 (2017-04-25)
New
- now with scroll blocker! stays on top of the page when expanding.
Other
- Refactor. much cleaner code, based on @rfindley’s suggestion to use answerChecker.
// ==UserScript==
// @name WaniKani Item Info Expander
// @namespace mvi. Thanks to Takuya Kobayashi, Mempo and rfindley
// @description Expands item info automatically without scrolling
// @include https://www.wanikani.com/review/session
// @version 0.20
// @run-at document-end
// @grant none
// ==/UserScript==
(function () {
'use strict';
function noscroll() {
window.scrollTo( 0, 0 );
}
var oldEvaluate = answerChecker.evaluate;
answerChecker.evaluate = function(e,t) {
// add listener to disable scroll
window.addEventListener('scroll', noscroll);
// expand item info
setTimeout(function () {
$('#option-item-info').click();
}, 100);
// Remove listener to disable scroll
setTimeout(function () {
window.removeEventListener('scroll', noscroll);
}, 1000);
return oldEvaluate(e,t);
};
console.log('WaniKani Item Info Expander: script load end');
}());
0.1
// ==UserScript==
// @name WaniKani Item Info Expander
// @namespace mvi, based on script by Takuya Kobayashi, with help from Mempo
// @include https://www.wanikani.com/review/session
// @version 0.1
// @run-at document-end
// @grant none
// ==/UserScript==
(function () {
'use strict';
$.jStorage.listenKeyChange('questionCount', function (key, action) {
if (action === 'updated') {
setTimeout(function () {
$('#option-item-info').click();
}, 100);
}
});
$.jStorage.listenKeyChange('wrongCount', function (key, action) {
if (action === 'updated') {
setTimeout(function () {
$('#option-item-info').click();
}, 100);
}
});
console.log('WaniKani Item Info Expander: script load end');
}());
```[/details]