Displays the specific category of apprentice or guru when getting an SRS popup.
This means that instead of
you will get
This is a rewrite of the old script from @seanblue that does the same thing, but no longer works after recent updates. (The example images are also shamelessly stolen). It also does the same thing as the script from @Kumirei, who was also working on this in parallel. I am still publishing this because at the time of writing, this version is the only one that is compatible with doublecheck, although I expect that to change soon.
I canāt resist offering a bit of unsolicited code review:
let value;
switch (e) {
case 1:
value = "Apprentice 1";
break;
case 2:
value = "Apprentice 2";
break;
case 3:
value = "Apprentice 3";
break;
case 4:
value = "Apprentice 4";
break;
case 5:
value = "Guru 1";
break;
case 6:
value = "Guru 2";
break;
case 7:
value = "Master";
break;
case 8:
value = "Enlighten";
break;
case 9:
value = "Burn";
break;
}
// console.log('obtained srs value:',value);
return value;
That could be refactored into a simple table lookup:
This was my first foray in both userscripts and javascript in general, so I am not aware of any best-practices and just went with whatever worked first. I think this was actually the only piece of the old script I adapted that I could reuse, so I saw no need to change what was already working. I am always happy to hear feedback on how to improve though.
After some testing, it looks like the problem is actually not with this script, but with doublecheck. Some change in the wanikani backend caused srs popups to stop working entirely if doublecheck is installed, and this script canāt modify what is not there in the first place. I am afraid the doublecheck script is too large and complicated for me to fix, so we will have to wait for a fix from their side.
Doublecheck got fixed, and now this script is also working again. I did have to manually get tampermonkey to update the scripts as it only checks once every so often by default.
Since the latest big WK update (the whole Turbo thing), this script was working fine after opening the review page, then refreshing (just like Jisho for example), but since today for some reason it breaks when submitting a review that should update an itemās SRS.
Iāve tested reviews with disabling exclusively this script and it works fine, but with the script enabled, when submitting the āfinalā review on an item (the one that should update its SRS and get the little popup) I have to submit the answer several times, at which point it becomes āundefinedā and I lose connection and have to refresh the page, and this error appears in the browserās console:
Iām not sure if something has changed today on WK side or whatā¦ It was working fine since the last big update (after refreshing the page) until today.
As of this afternoon, this is the only WaniKani userscript I use that I can still get working. I really like Show Specific SRS 2 and am grateful for it, but to be totally honest it isnāt exactly the one that, when it stops working, really impacts the way I use WaniKaniā¦ I wasnāt sure where to post my question, so Iāll just link to it here in case it sets off any lightbulbs, Iām desperateā¦
Now that some of the larger scripts have been updated to deal with the whole turbo page load business, I can apply the good old computer science technique of looking over the shoulder of someone who knows what they are doing and copying their code. As a result, this script should now work both with and without manual page reloads. This did introduce a dependency on WKOF, but I figured almost everyone would have already installed that anyway.