[Userscript] Wanikani Wrap-up Button Enhancement

I only really use the wrap up button on my mobile (so it syncs with the server more often so I don’t lose progress if I get distracted), so I’m happy with the 10 limit.

Yay for cats!

Feature request: change the wrap up button to this…


JadeofDragons said... Oh jeeze, I've been wanting something like this. I think it would be preferable to having to 'solo' what I am working on when I don't have time to go through the whole stack. ;__; interleaving, I want youuuu.

Double clicking would be nice, instead of a pop up.  Being able to change the number would also be nice.

Cats! :D
 Maybe you misunderstood me, but the second version with the double clicking and number changing is already out ;p

I know tooltips now! Shall update soon-ish

Will also include an option to choose between an extra button (as it is now) or that tooltip.

This is cool, Mempo! I didn’t know about this script until today. This is fantastic, now I don’t have to try to count a certain amount of reviews before clicking the 10l, and I can focus more on the readings and meanings instead of the numbers.

You’re awesome. As always. ^ _^ :+1:

I know all people’s needs before they know them themselves.

That script that automatically orders pizza after every 100 correct answers? Already in the works, don’t worry! The one that let’s you hug a kitten after a brutal 300+ review session? Pffff, that’s gonna be a challenge tho…

Please, get to work on that one. I need cat hugs more than pizza. Those sessions are brutal…

1 Like

Thank you for linking to this user script in a post yesterday, and thanks also for creating it. Not sure how I missed the existence of this 'til now. Now I can balance out when my reviews are recurring :smiley:!

1 Like

Unfortunately, there are some (quite useful) scripts that get almost no initial attention and then sorta get lost in the vast ocean of all the other scripts here on WK :man_shrugging:. Helping others discover them can be difficult on a forum. I’m definitely not the only creator with scripts like these…

But hey, I’m glad I could still help someone with this old thing :grin:
And if you feel adventurous, I’d recommend scrolling through the Greasyfork profiles of script creators you like. Who knows what you might find :wink:

1 Like

Hey @Mempo, out of curiosity does this work for numbers smaller than 10? Could I make wrap up 5 or 3? I’m thinking about times I’m really crunched for time (like at work) and the review session times out because I have to answer the phone or a community member, or something, or do some actual work in another window.

EDIT: Basically, I forgot about this script. I’m not sure if I used it or not on my old machine(s)… but it certainly was forgotten when setting up my laptop in October.

1 Like

I happened to see your comment just as I was about to do some reviews, and yes, you can set it for a number lower than ten - I just did 5 reviews with the enhanced wrap-up. Good to know, thanks for asking!

1 Like

Thank you!

@mempo too!

2 Likes

Hey @Mempo, when I type a number in the wrap-up box, I can’t change the number without refreshing the page to clear it (as in, backspace doesn’t work in the box, nor can I select the numbers and type over them)… is this just a problem on my end?

Edit: It seems I can type over the numbers if I double click a couple times in the same spot in the box, but I still can’t backspace

I use the wrap-up button when my stop’s coming up, so I generally want two things from the wrap-up button: prioritise items that I’ve done half of, so I can at least bank some reviews, and, most importantly, be integrated into one of the mobile apps.

I made some edits to this script and ended up putting it on greasyfork. Check it out if you’d like!
https://greasyfork.org/en/scripts/389387-wanikani-wrap-up-button-enhancement

3 Likes

This is great! Just noticed one thing - backspace doesn’t function, so if you want to delete a digit you have to use the delete key. I can see that the onkeypress listener is listening for backspaces, so is it intentionally stopping them from functioning?

I believe the latter half of that onkeypress was my attempt to remedy the exact issue you’re describing (it’s completely superfluous, however). You may’ve noticed that in the description for the script I put that information there.
That being said, apparently sometime over 3 weeks ago it stopped working. So, I’m guessing they changed something on the WK side that broke the functionality this utilized.
I haven’t been keeping up with WaniKani in a long while, but there’s a chance I’ll look into finding a solution for the basic functionality sometime soon.

Ah yeah I missed that in the description! The basic functionality is working fine for me, it’s just the backspace thing. I’ve had a play around with the code and I can capture the backspace use onkeydown instead of onkeypress, but even if it recognises the key as code 8, it still won’t do the backspace functionality. Weird!

Okay @Inserio I’ve implemented a soluton to the backspace issue, but it required changing the input type to text. I’ve implemented up/down arrow key functionality in the same way as a standard number input, but my version doesn’t have the on-screen up/down arrow buttons of a number input. Also added functionality so that pressing enter/return will automatically click the wrap up button, so you only need to type the number and hit enter to start wrap up mode.

Shall I upload it as a new version or would you like me to send you the code so you can update your version on GreasyFork and continue to maintain it after this fix (unless you prefer to keep the on-screen up/down arrow buttons instead of a working backspace and enter to wrap up functionality)?


Pretty sure the reason the backspace doesn’t work is something to do with React. I played around with it a lot, and could only get backspaces to work in the original answer input element. I changed the type to number and it still worked, deleted basically all its attributes and it still worked, copied the element to positons above and below both inside and outside the current parent and only the original element worked, and tried all sorts of attribute modifications and place changes for the wrap up element but none of them would work. So the default backspace functionality must be restricted on this page (but seemingly not on script settings pages in the dashboard) and only work in the answer input React component.

My solution was to get the position of the cursor when backspace is hit then change the value based on this, but you can’t get the position of the cursor in a number input, sadly!

I really appreciate you asking! I think I’m gonna continue to try to find a way to keep the number input box functionality, however. Therefore, I would suggest going with the option of creating your own fork so that people can have that alternative if they want it. It’ll also make it easier if you notice something else that needs fixing.

That’s pretty interesting really, and at least gives me another avenue to pursue if/when I decide to attempt to continue debugging this.

1 Like

New version/fork: Wanikani Wrap-up Button Enhancement (Tofurky fork)

Differences from @Inserio’s version:

  • backspace works
  • enter/return immediately starts wrap-up with the specified queue length and return to the answer input
  • up/down are no longer on-screen buttons, but the up/down keys offer the same functionality

No problem! Feel free to borrow anything from my code if it’s useful!

Edit: also added both our updates/forks to The New And Improved List Of API and Third Party Apps