The New And Improved List Of API and Third Party Apps


#221

Thank you!

Edit : Wait… Is there a way to make it only do this when I answer correctly? Is that a separate userscript? I don’t want it to auto-expand if I answer incorrectly.


#222

Errr… that’s a good point. But I couldn’t find any other similar user script.


#223

That’s okay. Thanks for trying! I’ll keep looking and I’ll probably keep using this one for now. Thanks for your help.


#224

Oh wait, found it!


#225

OMG yay!! Thank you so much @plantron! <3


#226

Your welcome. But it’s not exactly 100% what you were looking for? You wanted the whole item info to expand, but that script only shows you the context sentence, if I read it correctly.


#227

Ah, I just saw that. Yeah, not exactly what I’m after but I do like the functionality of this one as well and I will still use it.

Would still prefer to also have a correct-answer-only-auto-expander, though.


#228

woah looks good


#229

Found the opposite of what you want LOL


#230

Haha. Poo.

On the bright side, I’ve done several reviews with the context sentence one that you provided that I wasn’t even looking for and it really is helping! So I fully appreciate your efforts nonetheless.


#231

Here’s a one-line fix in the code for the “Item Info AutoExpander” script to make it only open when the answer is correct:

    var oldEvaluate = answerChecker.evaluate;
    answerChecker.evaluate = function(e,t) {

        // Add the following line to make it only open when answer is correct
        if (!$('#answer-form fieldset').hasClass('correct')) return oldEvaluate(e,t);

        // add listener to disable scroll
        window.addEventListener('scroll', noscroll);

#232

Give this guy some catnip!


#233

My hero. :yellow_heart::green_heart::blue_heart::purple_heart:

有難うございました!

Edit : Of course, works flawlessly.


#234

As you can see from my previous post, it WAS working. When I went to do my next batch of reviews after that, it wasn’t working anymore (as in not expanding at all, regardless of whether I answered correctly or not). I couldn’t figure out why as I didn’t change anything. I thought maybe some of my other userscripts were messing with it, so I disabled every one of them except the Info AutoExpander. Still didn’t work. Is something wrong in my code? Anything else I can try?


#235

I see what I did wrong. Here’s a much cleaner version:

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.22
// @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) {
        var answer = oldEvaluate.call(this,e,t);

        if (answer.passed) {
            // 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 answer;
    };

    console.log('WaniKani Item Info Expander: script load end');
}());

[Script] Item Info AutoExpander
#236

@rfindley先輩、ありがとうございます!

Thank you so much for taking the time to do that for me. It will help me out a lot!


#237

Where’s that catnip?!?!


#238

D:

I don’t have! Waaaaah~

Maybe I can sneak him some of my burned turtles? Sounds risky. I’m sure the Crabigator would sense it…

Also, happy cake day!


#239

This was extremely helpful. I’ve a lot to gain from this.

Thank you for putting this together!


#240

Anyone know which is the most current ‘wrong answer override’ script right now?
Just got 告 wrong by inputting ‘announcement’ and realized I’m sick of this crap. :rage: