Nifty!
And why doesnât WK have this by default?
LOL, glad I waited⌠I was just about to write a similar script.
EDIT:  Are you interested in also doing the Kanji, not just vocab?  E.g. âYounger BrâŚâ
Since the Kanji are in tiles instead of rows, I was going to use tooltips (e.g. <li title=âYounger Brotherâ> ), so hovering would bring up the full meaning.
I have posted a new version.
It should now add tooltips for kanji and radical tiles.
kobayashi said... I have posted a new version.Tested on Chrome.... Looks great!
It should now add tooltips for kanji and radical tiles.
Indispensable!
Guys, I feel like this is a stupid question - but chrome wonât let me install it. I get a message saying âApps, extensions and user scripts cannot be added from this websiteâ and some really perfunctory google-fu tells me that you can no longer add scripts from outside of the chrome app-store (or whatever itâs called)??
What am I doing wrong?
Thank you.
Chalky, instead of clicking âInstall this script,â try this:
- Right click on âInstall this scriptâ and select âSave Link AsâŚâ
- Save the .js file where you can find it again
- In the Chrome address bar, go to chrome://extensions
- Drag and drop the user script you saved onto the window
It should ask you for confirmation and then youâll be good to go!
Breadstickninja, thank you so much for that! Really appreciate you taking the time to spell out the steps for me. Working brilliantly!Â
All the best.
Iâm a bit concerned about this script.
A cursory glance at this script looks like this script doesnât dynamically expand the items on the fly.
So if the list changes the script wonât work properly or only work on some of the items.
Like if thereâs more levels or new items added.
Any insights?
aragonsr said...I'm a bit concerned about this script.Side note... It seems WaniKani has removed the "..." from vocabulary, except in search results.
A cursory glance at this script looks like this script doesn't dynamically expand the items on the fly.
So if the list changes the script won't work properly or only work on some of the items.
Like if there's more levels or new items added.
Any insights?
But they didn't add the hover tooltips to radicals and kanji like this script does.
aragonsr said... I'm a bit concerned about this script.Just updated it.
A cursory glance at this script looks like this script doesn't dynamically expand the items on the fly.
So if the list changes the script won't work properly or only work on some of the items.
Like if there's more levels or new items added.
Any insights?
~10 items had changed since my last update ~7-months ago.
The possibility (certainty) of changing items is indeed an issue with this script.
It requires database updates.
If new items are added or old items are changed it will not work on those items.
It expands items only if both the Japanese full-text and the English partial-text match the database, so it has with previous WK-content updates only very rarely displayed incorrect expansion.
Usually it will just not work for new items or changes and leave their ...'s alone.
rfindley said...Side note... It seems WaniKani has removed the "..." from vocabulary, except in search results.That's nice.
But they didn't add the hover tooltips to radicals and kanji like this script does.
I just checked and that does seem to be the case.
Now if they could remove the ...'s on search results and maybe add those tooltips, this script would no longer be needed.
If they really want ...'s for small screens, maybe they could use CSS 'text-overflow: ellipsis' to trim locally.
kobayashi said...If they really want ...'s for small screens, maybe they could use CSS 'text-overflow: ellipsis' to trim locally.That would be nice!
As of a week or so ago, I started seeing ââŚâ again on /level/ pages and /vocabulary pages (such as the L1-10 vocabulary page).
Adding some logging to the dot dot expander script (via tampermonkey, if that matters) suggests that the contents of âitemâ (such as in dotExpandMulti) arenât matching anything in the dotItem list (or hash, or whatever you call them in JS).
I tried adding an entry to dotItem (which apparently wasnât already in the list) where I copied/pasted the kanji from the /vocabulary page, but some logging showed that, despite being an entry that matched the ⌠regex, the dotItem[item] was returning something undefined. (Or, at least, âundefinedâ is what was being logged.)
SpecificallyâŚ
I added this line to the top of dotItem:
âä¸ăăâ : âPlease Give Meâ,
Then added some logging to dotExpandMulti:
if (en.match('[\\.]{3}$')) { //Added it inside this block
...
item = $(elem).find('span').html();
console.log('current item: ' + item); //added line
...
enFull = dotItem[item];
console.log('enFull: ' + enFull); //another added line
So, when I refresh the page and look at the console, I see:
current item:
ä¸ăă
enFull: undefined
When I reload the L1-10 vocabulary page, thereâs 110 or so entries just like this. enFull is always âundefined.â Now that I think about it, I didnât actually check to see if the entries that appear to have a ââŚâ on the page are in dotItem or not. (I suppose that changes to WKâs vocabulary may introduce undefined entries as wellâŚalthough that wouldnât explain why ä¸ăăâs enFull is undefined, as far as I know.)
Youâll have to forgive me if Iâm talking about this incorrectly â Iâm no programmerâŚor so Iâm told. (But seriously, Iâve done very little with JS and the like.)
Anyhow, my uninformed conjecture is âunicode problem.â If Iâm not mistaken, I started seeing this when the fix to the âone reviewâ bug was rolled out last week.
@stevebrown0804,
Notice ä¸ăă is down on the next line in your console output. It looks like youâre picking up a newline character when calling html()
, so item
is probably â\nä¸ăăâ instead of âä¸ăăâ, and itâs not finding it in dotItem. Youâd need to trim any whitespace and newline characters.
For starters, Iâd use text()
instead of html()
, then filter item
:
item = $(elem).find('span').text().replace(/[\n ]+/g,'');
Hello,
Does this script still work? I installed it but nothing changed.
Iâm guessing itâs related to @stevebrown0804âs reported problem a few posts up. I donât think the scriptâs owner integrated the changes.
If I get some time later, Iâll see if I can patch it and rehost.
Ah ok, thanks. Yeah, on the chrome extension page it says it may be corrupted.
Chrome extension page?
A lot of scripts donât work without a script host plugin like TamperMonkey. I donât know if this is one of them. Iâve personally never learned what features are different in order to support installation directly as a browser extensions.