[Userscript] Lesson/Review Count in Forums

Wow, thank you!

:point_right: [ v1.0.11 ] - Update to APIv2

2 Likes

Amazing! :tada:

I don’t know why we ever doubted you :bowing_woman:

Love the little input box for the API key when you first update/install too :ok_hand:

Now I just have to work out why the text in @Kumirei’s like counters appears different in dark mode :thinking:

1 Like

Had a look at it and it seems rfindley selects the text elements with .wanikani-app-nav ul li a whereas I use span instead of a because mine don’t need to be clickable. I’ll update my script to match rfindley’s styling.

edit: oh, I’m silly, it’s wk’s styling, not rfindley’s.

1 Like

Yeah, sorry Kumi… I knew there was another script that piggy-backed on this one, but I couldn’t remember what it was. As you saw, I modified my HTML structure a little.

Also, note that I added some CSS specifically for Dark Theme. Specifically, the ones starting with:

body[theme="dark"] 

The [theme="dark"] is something my javascript adds to <body> to make it easier to style anything in the Forums based on theme. It will take on the value ‘light’ or ‘dark’.

1 Like

I had help from a Ninjaneer! Viet added a “next_reviews_at” datapoint to APIv2. Saved me tons of work. :grin:

1 Like

Aaah, awesome! That was super helpful of them.

thank you Viet!

That’s all right. If I’m lazy and hitch a ride on your script I’ll have to deal with the consequences 295787090669469698

Just to confirm, you changed the “zero” class to a “data-highlight” attribute? Seems I’ll have to add and remove that attribute too, when appropriate.

I’ll update this tomorrow, @Radish8

edit: reminder to future Kumi to update themes too

2 Likes

Yeah… it was confusing before, because “zero” meant don’t highlight for the Lesson and Review counter, but it meant do highlight for the Next Review time (because zero minutes until next review).

Now, data-highlight is straight forward.

1 Like

Is there a way to make the words whiter when using the night theme?

:point_right: [ v1.0.12 ] - Slightly brighter text on Dark Theme.

Those were the forum’s default text colors for the Dark Theme. You’re right, it was pretty dim!
I’m not a Dark Theme user, so I didn’t scrutinize it very closely :slight_smile:

1 Like

Thank you so much! You are SO fast!

I think some recent update broke this script for me: It completely erases the “Dashboard, Lessons, Reviews” buttons.


The buttons reappear when I disable the script, so I am quite sure I have the right culprit. According to Tampermonkey there was an update seven days ago, might be it. I’m using Firefox 60.0.2 (64-bit), just in case it is relevant.

Have you tried inputting your APIv2 key in that input box? It was recently updated to use API2 instead, so you need to give it your new key.

Oh, that solved it! Thanks :slight_smile:

1 Like

No problem! Glad it’s working for you :blush:

I didn’t know I needed this until I read about it. Amazing!

@rfindley Myself and many others lately have been having issues with this script not functioning. In fact, I’m surprised I’m the first person to post about it here. Basically, the entire bar for the lesson/review counter doesn’t show up. If I reinstall the script it’ll come up for a few hours, but then it goes away again. This started last week, for me at least.

I’ve been using this script with Kumirei’s like counter, but I disabled that to check if it was causing the issue, and the bar still doesn’t appear as normal. I’ve reinstalled the script multiple times, to no avail. I don’t know much about scripts, but since I’m not the only person experiencing this issue, I’d say the problem isn’t specifically my computer at least. I was wondering if you had any tips on how to fix it, and just wanted to give you a heads up in case it’s the script itself and not my browser. (Chrome, tampermonkey). :grin:

Not sure what’s going on, but as I clicked on this thread (coming from an email notification), I see that the bar is missing on my screen.

Next time you see this happen, try scrolling to the top of the thread (using the side-bar thingy to get there quickly if necessary), and see if the Wanikani App bar, which is a built-in part of the forums, appears when you reach the top of the thread. That’s its normal behavior… which I had forgotten, since I wrote this script a few days after the new forums first appeared.

Anyway, I’ll need to determine whether the Wanikani App bar itself is messing up, or if there’s a timing issue where my script is looking for the Wanikani App bar before it actually appears.

1 Like