Installing Wanikani Open Framework

Which one?

1 Like

Which one?

hey! it’s wanikani golden burn. i think i can make it selectively disable when i visit the wanikani community, but haven’t gotten around to trying that out yet. thanks for the fast response!

That one is supposed to be active on the forums. It makes level 60 level circles gold, like mine. In case you don’t know, this is what the circle looks like by default
image

1 Like

Well, that’s what I get for using wildcards. Whoops.

2 Likes

thanks so much for explaining that! that makes me feel better. :grin:

Thanks for this

Bug Report: Backspace doesn’t work when typing a number in a settings menu.

2 Likes

Is this in a review session?

1 Like

Yes, it only seems to happen in a review session. Sorry.

2 Likes

I have experienced this as well

2 Likes

@est_fills_cando @Kumirei

Is it just backspace that isn’t working? How about Delete? Can you move the cursor before the offending character and use Delete?

How do you know this is a Framework problem? At first sight anything messing with the keyboard could be the cause.

1 Like

I’m not entirely sure, but when I looked into this a few months ago I think I reached the conclusion that WK’s native code was catching the keypress and didn’t let it bubble

1 Like

If it occurs in the Self-Study Quiz setting dialog, I could see where that might be the case:

        } else if (code === 'Backspace') {
            // Prevent backspace from navigating away from the page.
            if (quiz.mode !== 'question') return false;
            if (input_readonly) quiz.ask(true /* erase_old_answer */);
            return true;

As the comment in the code says, I am preventing backspace from navigating a way from the page, which I’ve had happen before. But the check for quiz.mode is probably not considering whether the user entered the Settings dialog. Keys are captured on the <body> tag, so it makes sense that backspace might be blocked under some circumstances unrelated to entering answers.

2 Likes

This happens for me in every settings dialog (with a number entry field) that is accessed from the reviews page, not just any one script’s.

1 Like

I think this pretty much excludes Self Study Quiz from being the culprit.

@rfindley @prouleau
I have confirmed the issue appears to be solely with WKOF. I tested by disabling all scripts except WKOF and the following test script which does nothing except create a settings menu with a number entry field.

// ==UserScript==
// @name          WK Broken Backspace Test
// @namespace     est_fills_cando
// @description   Test
// @author        est_fills_cando
// @version       1.0.0
// @include       https://www.wanikani.com/review/session*
// @run-at        document-end
// @grant         none
// ==/UserScript==

(function (wkof) {
    'use strict';

    function main() {
        wkof.include('Settings,Menu');
        wkof.ready('Menu').then(install_menu);
    }


    //
    // Settings and Menu
    //
    function install_menu() {
        let menu_meta =
            {name: 'test_settings',
             submenu: 'Settings',
             title: 'Test Settings',
             on_click: () => (new wkof.Settings(settings_schema)).open(),
            };
        wkof.Menu.insert_script_link(menu_meta);
    }

    let settings_schema =
        {script_id: 'test_settings',
         title: 'Settings Test',
         content: {
             num: {
                 type: 'number',
                 label: 'Number Input',
             },
         },
        };


    //
    // Invoke main()
    //
    main();
})(window.wkof);

This rules out other scripts from being the culprit. It doesn’t rule out @Kumirei hypothesis that some native WK code doesn’t let keypresses bubble.

1 Like

Yes, sorry, my comment was a follow up to the comment that it might be an issue with Self-Study quiz. I just tested with all scripts disabled and created an input that is a child of body on the reviews page. Backspace also doesn’t work for that. So it is probably some issue with WK’s native code that will need to be worked around. Does anyone know how they still manage to get backspace to work in their own input field on the reviews page?

1 Like

I don’t really know but if they are catching the keypresses they can do what they want in their event driver. The fact they don’t let the keypress bubble doesn’t stop them from reacting to it.

I find it strange that they block only keypresses in a number type input. There is no use for numbers in the review page that I can think of. The input is all kana generated by an IME.

Perhaps this is a bug on their side that can be fixed with an email to Viet. You should provide the code for the single input injection to demonstrate the problem. This will help them debugging.

The input I tested with (when all scripts were disabled) was a generic input that could contain anything. It didn’t have the type attribute set. So I think they are probably just calling preventDefault() or something similar on all backspace keyboard events.

1 Like