[Userscript] Dashboard Progress Plus

On a different PC now, using latest version of Chrome, I also can’t toggle the icons at all.
My console shows the following error, does this tell you anything? Maybe it’s an unrelated issue.

‘Range.detach’ is now a no-op, as per DOM (http://dom.spec.whatwg.org/#dom-range-detach).

Working fine for me. Good work!!!XD
Chrome Version 42.0.2311.90

I can’t join because Elsinore etc is from an unidentified developer.

rfindley said...
dothack said... Rounding seems to be off in correct %




v1.0.5
Hopefully fixed.  I don’t have any odd percentages currently.
 Yes, fixed thanks.

Very cool! Thanks!

Console errors:

Empty string passed to getElementById(). application-6994b377bb75c131f35dfe9ed939afc5.js:14:0
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.


Empty string passed to getElementById().

Works for me on the latest version of Chrome. Thanks for this!

For those having trouble in Chrome, be sure to install something like Tampermonkey to run and manage scripts. I couldn’t install the script until I used that.

Aleithian said... Works for me on the latest version of Chrome. Thanks for this!

For those having trouble in Chrome, be sure to install something like Tampermonkey to run and manage scripts. I couldn't install the script until I used that.
 I was wondering if this might also be the problem on some people's Firefox (except GreaseMonkey instead of TamperMonkey).

infinitefluff said...That's on the $.Deferred() line 300
 That's pretty much the start of the entire script.  $ is jQuery, which means either the script is not running at the right time (after jQuery loads as part of normal WaniKani), or there is a security issue that doesn't allow me to access jQuery.

Are you using GreaseMonkey to run the script?  Or just installing the script directly into Firefox?

As for me (having problems on both Firefox and Chrome), I’m using the respective Monkey extensions and I’m making sure the script is enabled as well.
Is there a dedicated console for the scripts? Right now I only check the one I can call up by hitting F12.

marikaefer said... As for me (having problems on both Firefox and Chrome), I'm using the respective Monkey extensions and I'm making sure the script is enabled as well.
Is there a dedicated console for the scripts? Right now I only check the one I can call up by hitting F12.
F12 is the proper place to look.  But I'm not outputting anything unless I (or the browser) find an error.
rfindley said...
marikaefer said... As for me (having problems on both Firefox and Chrome), I'm using the respective Monkey extensions and I'm making sure the script is enabled as well.
Is there a dedicated console for the scripts? Right now I only check the one I can call up by hitting F12.
F12 is the proper place to look.  But I'm not outputting anything unless I (or the browser) find an error.
 Something I noticed, clicking the little arrow does change the CSS style of the <ul> from display:none to display:block and back, however the <li> items themselves always stay on display:none. The <li> items do contain information modified by your script (I see the next review time in the code, as well as a "wkdpp-progress" class being used), they're just not being displayed.

Does this help you?

Here’s something that you get if you have just done the lesson but not reviewed the item yet. The ‘days’ is undefined.




sglinert said…
Console errors:

Empty string passed to getElementById(). application-6994b377bb75c131f35dfe9ed939afc5.js:14:0
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.


Empty string passed to getElementById().


 I get these too, but they don’t seem related to this or any other userscript. They appear when I have all userscripts disabled.

marikaefer said...

 Something I noticed, clicking the little arrow does change the CSS style of the <ul> from display:none to display:block and back, however the <li> items themselves always stay on display:none. The <li> items do contain information modified by your script (I see the next review time in the code, as well as a “wkdpp-progress” class being used), they’re just not being displayed.

Does this help you?

 In a way, it helps.  There shouldn’t be any ‘display’ style on the <li> items.  My script doesn’t use ‘display’ attributes anywhere.  And as I’m testing here, I don’t see WaniKani adding or removing a ‘display’ style to the <li> items… only to the <ul> element.

Manually disabling the “display:none” via the console shows that the script does seem to work in general:



The display attribute does not seem to be inherited by anything, so I really don’t know where it’s coming from. Since the toggle on the <ul> works fine, how about you do set the display attribute, to override the none? Shouldn’t really break anything, or so I hope.

edit: for testing purposes I downgraded back to 1.0.2. I have found that some of the <li> elements do get the display:none attribute: those that are not apprentice level anymore (makes sense, no?). So, from 1.0.3 going onward, somehow all Kanji are being identified as being not apprentice anymore and thus hidden. 

This is very cool. Thank you!

marikaefer said... Manually disabling the "display:none" via the console shows that the script does seem to work in general:



The display attribute does not seem to be inherited by anything, so I really don’t know where it’s coming from. Since the toggle on the <ul> works fine, how about you do set the display attribute, to override the none? Shouldn’t really break anything, or so I hope.


 v1.0.7
Done.  Give it a try.  If still not working, could you post a snapshot of that portion of the DOM window?

EDIT: I see you already made a much better job of it that what I posted :smiley:

Thanks.

marikaefer said...So, from 1.0.3 going onward, somehow all Kanji are being identified as being not apprentice anymore and thus hidden. 
 Ahh, I think that answers it.  In order to keep any changes that the WK staff might make in the future, I start out by cloning the first existing item on the list, then just changing its attributes.  If the WK code has the first <li> display:none for some reason, then my script would duplicate it to all items.

Anyway, I now have a line to remove any 'display' attribute.

Did not work. But do check out the edit I made in my last post, this might be a clue. I guess some wanikani-side function is determining which Kanji to hide based on their level. Here are shots of the section with, and then without the script. 

With:



Without:


(As you can see, some are set to be hidden, these are kanji already at guru or higher)

The ids within the <li> might have something to do with it?

edit: okay, posting simultaneously sucks ^^ The removal did not seem to work though.

1.07 still doesn’t work in Firefox. Clicking to see Apprentice Kanji…nothing happens :frowning: