[Userscript] Summary Page: Revival

Is there an easy way to replicate? I forgot to screenshot. I think the radical in question is https://www.wanikani.com/radicals/cactus

I’ll see what I can do, but if you come across the issue again it would be great if you could send a screenshot of it :pray:

Should this be marked as a skull too since I got 2 wrong entries (on the same part)
image

Right now it seems to only be putting skulls on items where you got both the Meaning and Reading wrong

The skull was a specific request in this thread for getting both meaning and reading wrong, so no it’s not supposed to be there if you get the same question type wrong multiple times. But perhaps something can be added for this specific case too.

A little icon of a leech might be “cute”. :upside_down_face:

1 Like

As @LupoMikti says that is intentional, but if at some point I get around to adding a settings menu to the script then I can make that an option!

I was actually the one that gave the original feedback to have the skull when you get both reading and meaning wrong. I think the original behaviour was showing skull when you get the same question type wrong multiple times.

But to me, it makes sense to show it if you get 2+ incorrect, regardless of question type. Just an indicator of “hey, you really should pay attention to this thing you keep getting wrong” :skull:

1 Like

Heya, thought I’d pop in and pass along something I wanted to quickly implement for your consideration.

I wanted to add a section to the passed items that would tell me if I used Double Check undo on them. Looks like this when there are items, otherwise the section isn’t there at all.

Needed to fix Double Check firing off an event too often to get it to work, also change a little bit the css. If Double Check gets that fixed (not guaranteed of course, there could be unknown issues with my fix) and you think it’d be good to put in, I’d be happy to share the code changes.

1 Like

Great idea! If it does get fixed in Double Check send me the code changes and I’ll get them added in. Thanks!

The icons of the summary page have stopped working, presumably because of this update: Wanikani Icons Update. Probably not the highest priority problem, but it would still be nice if it got fixed at some point.

1 Like

Oh, that’s annoying. Thanks for letting me know, I’ll get a fix out asap.

I’ve pushed v0.5.6 which fixes most of the icons - I’m having trouble for some reason with the burned/warning item icons though, I’ll get a fix out for them once I work out what the issue is…

1 Like

Letting you know Book Club Tracker also has broken icons (but for now it seems like it’s fixed by adding the fa class to all of them).

1 Like

Oh I’d missed that, I’ll get it fixed. Thanks!

Not sure if this applies, but just want to point out my response here incase it has some bearing on your script(s)

In summary using fa classes wont work for much longer.

Yep, I assumed that would be the case, thank you for confirming!
I’m instead replicating the structure you’ve used, although I am unfortunately having issues with the icons not displaying even when using exactly the same structure as WK… But if in DevTools I edit the HTML to add a random span or something next to it and then delete it again the icon works :thinking: So it must be something to do with it failing to load in some cases… Hopefully I’ll work out what the issue is at some point…

function wkIcon(iconName) {
    let icon = document.createElement("svg");
    icon.classList = "wk-icon wk-icon--" + iconName;
    icon.setAttribute("viewBox", "0 0 512 512");

    let use = document.createElement("use");
    use.setAttribute("href", "#wk-icon__" + iconName);
    icon.appendChild(use);

    return icon;
}

Doesn’t display for some reason :frowning:
image
image

I don’t recommend trying to piggy back on the icons we provide. You may run into problems down the line. You really should “bring your own icons” if you want to reduce the chance future breakages.

N.B. I haven’t said this for a while, so just as a reminder, my advice / response here does not in any way indicate support for scripts. Scripts remain the responsibility of the script author.

3 Likes

Thanks for the advice! :saluting_face:

1 Like

Oh, I know you’re going to look into a different solution per Scott’s advice, but I believe it’s not working because <use> has a shadow-root like with custom components. Custom components cannot be made and inserted using document.createElement. You should write out the html and use insertAdjacementHTML or similar. This was the same issue I had when figuring out how to use the <wk-character-image> component for the radical SVGs.

1 Like

Ah, thank you for the info! As well as that, after much trying I eventually realised that apparently SVGs etc. are namespaced elements but mostly use non-namespaced attributes…
In any case, I now have it using custom icons and will update all the scripts with them now!

1 Like