Wanikani Open Framework [developer thread]

FYI, there’s been a big update to Open Framework. WK has been modifying a lot of pages lately, including Jquery no longer running on a lot of them, so things have been breaking.

I removed a lot of the dependencies on jquery, but the Settings and Progress modules still require it because they are based on Jquery UI. So, I also added a new Jquery module (wkof.Jquery) that loads jquery if it’s not already included in the WK page you’re running on.

If your script needs jquery to run, you can simply do this:

wkof.include('Jquery');
wkof.ready('Jquery').then(do_something);

function do_something() {
   // By the time it reaches this point, Jquery will be already loaded,
   // so you are safe to run any jquery stuff from here on.
}

That ensures that only one copy and version of jquery is running on a page.

If you are already using the wkof.Settings module in your scripts, it will load Jquery for you (if it’s not still included in the WK page). But if your script actually calls jquery, I’d still recommend including Jquery directly in your script, because there’s a chance I’ll fully remove the Settings module’s dependency on jquery someday.

By the way, the pages WK has changed so far are:
/level/*
/radicals
/kanji
/vocabulary

6 Likes