[Userscript] WaniKani Lesson Hover Details


#1

What is it?

This script lets you see the lesson breakdown by type (radicals, kanji, vocab) when you hover over the Lessons circle in the menu bar.

image

How to Install?

  1. As always, make sure you have a script manager installed. If you don’t, follow these instructions.
  2. This script depends on the WaniKani Open Framework. Make sure you have that installed by following these instructions.
  3. Get the script here: https://greasyfork.org/en/scripts/39245-wanikani-lesson-hover-details

Support

  • This script has only been tested in Chrome using Tampermonkey, but will likely work in Firefox as well.
  • Please post any bugs/requests and I’ll get back to you as soon as I can.

Revision History

1.0.2 - Only redirect users to install the Open Framework if they want to.
1.0.1 - Fixed a layout issue.
1.0.0 - Initial release.


The New And Improved List Of API and Third Party Apps
"42+" - why?
Wanikani Open Framework discussion
Get the details of items in lesson queue
Wanikani Open Framework discussion
Let's praise these USERSCRIPTS and their awesome CREATORS
#2

Thank you so much, seanblue! I can’t wait to use this!


#3

Why do I have the impression that people will release a bunch of crazy awesome scripts these coming days?? :heart:


#4

I feel like this website is 95% CS majors.


#5

I don’t know why, but when your script is active, it does this to the layout:

Edit: Seems to only happen with the breeze dark skin, so it’s probably not your fault.


#6

That would definitely be odd since I didn’t change anything on the page other than when you hover. So the layout shouldn’t change when the script is active. Does this not happen with the dark layout when my script is disabled?


#7

The layout does indeed seem to shift a little when the script is active. I am using Mozilla Firefox!


#8

It shifts on mine as well, using the default layout on chrome. It shifted to the left by about 30 pixels. Doesn’t bother me but I figured I would chime in as well.

Awesome script regardless. I’m getting get a lot of use out of it.


#9

It only happens when your script is enabled, yes. And as @chrisjwelly said, the entire site body shifts a little to the right. For some reason it shifts before the script is even loaded, though, and the shift doesn’t happen when the script is diasbled. :thinking:

Edit: It actually shifts to the right.
Edit2: Made some screenshots showing the script enabled and disabled:

Enabled

Disabled


#10

@seanblue in case you haven’t figured it out already it’s the display: table-row on .row which causes it.

If anyone wants a temporary manual fix change line 23 to

			'.lessonHoverDetails .row { display: table-row; margin: 0; padding: 0; }' +

and line 82 to

		return `<div class="table lessonHoverDetails">

#11

Thanks, I’ll look into it more when I’m done work. I want to make sure the hover box is formatted nicely, but obviously I don’t want to change the rest of layout at all.

I’m open to suggestions if you have css that formats the hover box nicely and doesn’t have any side effects. My main goal is to have the numbers lined up nicely.


#12

This should make sure the css doesn’t affect anything else. Using the class you already put on the popover (which I missed in my previous post):

	var style =
		'<style>' +
			'.review-time .table { display: table; margin: 0; padding: 0; }' +
			'.review-time .row { display: table-row; margin: 0; padding: 0; }' +
			'.review-time .cell { display: table-cell; margin: 0; }' +
			'.review-time .cell-title { font-weight: bold; padding: 0 10px 0 0; text-align: right; }' +
			'.review-time .cell-value { text-align: left; }' +
		'</style>';

#13

Ah, finally. The script I never knew I needed.


#14

Ah, I see now. That’s a big shame on me. When I made my lesson filter script I made sure all class names would be unique. But I grabbed this html from some sample code online and forgot to clean it up.


#15

I have an update ready, but greasyfork is having trouble syncing from github for some reason. I’ll post an update when it’s available.


#16

Version 1.0.1 is available to fix the issue with the layout shifting to the right. Greasyfork is still being weird, but you should be able to get the update. You may have to update manually from greasyfork to get the latest changes.

CC: @Powerpuncher @chrisjwelly @musera @Kumirei


#17

完璧だ!ありがとう。

Layout’s all good now. Will keep reporting if I find anything else.


#18

Thank you seanblue