[Userscript]: Hide Context Sentence Translation

hi rfindley,

Similarly, I thought there used to be a script to hide the main-info.meaning element from the lesson pages.
Could you please help to find this script back?

Thanks & Cordially,

dfa4b5036a

…halp

@Nenad,
Yours appears to be a problem with the dark theme script.

image

I’m not familiar with that one.
But if “meaning-info.meaning” is the correct CSS selector, then you can simply add that to the CSS in this script.

Thanks,
indeed this script’s code seems straightforward enough for me to give this a try :slight_smile:

ps: found the expected script-name back : “Lesson Spoiler Removal” :

I am also using the Dark-Breeze theme, and I feel the white area is too bright to my eyes.

I added the ‘opacity’ property to tone down the redacted areas :

       var css =
        '.context-sentence-group p:not([lang="ja"]):not(:hover) {'+
       '  background-color:#ccc;'+
       '  color:#ccc;'+
        '  opacity:0.1;'+
        '  text-shadow:none;'+
        '}';

result:
image

1 Like

Thanks, that’s exactly what I needed! Though mine is lighter than yours, so I had to tweak the opacity to 0.03.

fb7418b80e

1 Like

It’s still working for me. Try disabling your other scripts and see if this one starts working. If it does, turn your other scripts back on one at a time until you find a script that interferes.

If that doesn’t solve it, try opening the Javascript console (press F12 and click on the Console tab) and post any errors you see there.

1 Like

I did nothing and suddenly it’s working again (maybe after reboot idk? Weird.) Thanks.

1 Like

Anyway the reason why I bump threads for scripts I install is so that others may stumble upon the same script on the top of the forum through serendipity, which is how I found some of the scripts I use.

Wholehartedly agree with this :slight_smile: So let me give it another bump (although it hadn’t been to long).

Thanks a lot @rfindley for making this!

Now the example sentences can become actual reading practice (I tried to not look at the translations, but that’s just not possible)

1 Like

This is perfect! Exactly what I was looking for, thanks a ton @rfindley :high_touch:

2 Likes

thank you! @rfindley
Very useful in practicing use of the word within the sentence!

1 Like

Encountering an error that I’m not sure is on my end or not. It affects 3 scripts so I’m posting it on each of their pages in the hopes that someone will be able to fix it for me. (Though apparently I can’t post the exact same thing on each or it flags it)

Pitch Info, Cherry Picker, and Hide Context Sentences all fail to load/work correctly when I load up a vocabulary page. Here’s the console errors:

Sometimes I look at Tampermonkey and see that they’re not even showing up in the list of scripts on the page, othertimes they show up but seem to do nothing. Any ideas?

Wanikani website changed CSS classes, and removed jQuery $. (So, removing the need for jQuery isn’t enough.)

Anyway, this is the fix.

CSS selectors seem fragile here.

2 Likes

Wanikani has been changing a lot of their pages (mostly behind-the-scenes changes), which includes removing jQuery, which explains the “$ is not defined”. Most scripts have been making use of jQuery for years, so they’ll be broken without a fix.

I’ve just posted an update to this one to fix it. (It’s not tested since I’m away from my PC, but it’s a very simple change, so it’s probably okay. I’ll test it later.)

[edit: @polv, I’ll also check the css selectors to see if they can be cleaned up now.)

1 Like

@rfindley @polv

Polv, yours worked for me, though it also does this:
image

rfindley, yours didn’t seem to change anything when I refreshed.

But if you’re gonna test it later I can just wait.

1 Like

I’ve updated mine to fix the vocab pages.

@polv, as you discovered, there’s no robust to do it with CSS alone, so I added some JS to find the Context Sentences section and add a ‘.context-sentence-group’ class, which is then used by the original CSS of this script.

2 Likes

hi, i saw you’re busy with the WKOF currently, which is of course of higher priority.

but the new update also broke this script. it would be great if we could have a fix, if you’d be so kind.

thanks for all your work, i really appreciate it!

2 Likes

Change @match to

// @match       https://www.wanikani.com/*
// @match       https://preview.wanikani.com/*

And add this to the end of Line 17 of the script.

, a.page-nav__anchor#context ~ section.subject-section__content .subject-section__text--grouped :not([lang="ja"]):not(:hover)
5 Likes

thanks

however, i am very much not a coder. so before messing with stuff i don’t understand, i prefer to wait at least until rfindlay gives a reply ^^

that said, this is not an urgent thing


also, because i’m not always good at formulating what i mean: my previous post is not a “please fix this”, it is an “it would be awesome if you fixed this, but i know you’re doing all this voluntarily and for free, and am mostly just glad this even exists, thank you, really!”

1 Like