[request] Reorder Kanji Lesson Tabs


#1

Hi all. I have been searching the forums and web for a script that can change the order of tabs for kanji lessons, but no luck. I want the order to be:

  1. radicals
  2. examples
  3. meaning
  4. reading
Basically I want the example tab to be moved from the last tab to the second. Is there a script that can do this?

Use case: About 15% of the meanings I have encountered on WaniKani are either misleading or, according to Japanese friends of mine, incorrect, especially for kanji, so I prefer to see examples first so I can form my own opinion on the meaning of kanji before seeing the WaniKani interpretation. When learning 30 or so kanji at a time, it can be tedious to manually switch tabs and it breaks my train of thought. It would be better if I could just press Enter over and over as I do for radicals and vocabulary.

I am now using 10 scripts for WaniKani alone and I must say most of them have become integral to my process. I think this might be the final script I need to complete my leaning tower of functionality. =)

#2

I just inspected the lessons page and I think it’s doable. But not now. Now I’m going to sleep.


#3

@Mempo,

FYI…

I’ve looked at the tabs before.  Each tab (<li>) has an attribute “data-index”, with a value 0 to 3.
When you navigate, the WK code increments or decrements an internal index counter, then navigates to the tab with the corresponding data-index.

So, even if you rearrange the tabs, it will still navigate them according to the original order.
Also, it loads the tab content based on the data-index.  So, if you change the index values of the tabs to fix the navigation, then the content of each tab won’t match the tab itself.

I’m sure it’s still doable somehow, but not as easy as first glance would lead you to believe.  Hopefully this doesn’t discourage you from trying to find a solution, but maybe will save you some time figuring things out.

I’d look into this myself, but I’m trying to finish up a major overhaul of the stats site.


#4

What kanji are misleading or correct? Curious to know because the definitions match Jisho I think.


#5
rfindley said... @Mempo,

FYI...

I've looked at the tabs before.  Each tab (<li>) has an attribute "data-index", with a value 0 to 3.
When you navigate, the WK code increments or decrements an internal index counter, then navigates to the tab with the corresponding data-index.

So, even if you rearrange the tabs, it will still navigate them according to the original order.
Also, it loads the tab content based on the data-index.  So, if you change the index values of the tabs to fix the navigation, then the content of each tab won't match the tab itself.

I'm sure it's still doable somehow, but not as easy as first glance would lead you to believe.  Hopefully this doesn't discourage you from trying to find a solution, but maybe will save you some time figuring things out.

I'd look into this myself, but I'm trying to finish up a major overhaul of the stats site.
I wanted to change the order of the reading/meaning tabs a while ago, and found the same thing obviously.
Hacking it doesn't seem straigtforward at all, though I'm admittedly bad at JS :(

#6
bbucommander said...
Use case: About 15% of the meanings I have encountered on WaniKani are either misleading or, according to Japanese friends of mine, incorrect, especially for kanji, so I prefer to see examples first so I can form my own opinion on the meaning of kanji before seeing the WaniKani interpretation. When learning 30 or so kanji at a time, it can be tedious to manually switch tabs and it breaks my train of thought. It would be better if I could just press Enter over and over as I do for radicals and vocabulary.

 I totally understand your general problem here. I also often skip to the examples first then go back to the meaning/reading. I don't find it tedious switching tabs, though. Maybe you know this already, but just in case: You can use the arrow keys to move between tabs, which I find much easier than hitting enter.

#7
tomboy said...I wanted to change the order of the reading/meaning tabs a while ago, and found the same thing obviously.
Hacking it doesn't seem straigtforward at all, though I'm admittedly bad at JS :(
 Yeah, that's the same reason I looked into it originally.

#8

with jquery you can just…


.jStorage.listenKeyChange('l/currentLesson', function() {<br>(’#supplement-nav li:nth(3)’).attr(‘data-index’, 1);
('#supplement-nav li:nth(1)').attr('data-index', 2);<br>(’#supplement-nav li:nth(2)’).attr(‘data-index’, 3);
});

Something like that…  Of course it will only work pressing the arrow keys and such.

#9
xMunch said... with jquery you can just...

$.jStorage.listenKeyChange('l/currentLesson', function() {
$('#supplement-nav li:nth(3)').attr('data-index', 1);
$('#supplement-nav li:nth(1)').attr('data-index', 2);
$('#supplement-nav li:nth(2)').attr('data-index', 3);
});

Something like that...  Of course it will only work pressing the arrow keys and such.
If I recall correctly, I think you'll find that changing the data-index causes the tab contents to not match the tab title.

#10

Script delivery service: get your script within 24 hours or you get your money back! Well, technically it’s a little over 24 hours, but only because I’m too much of a perfectionist when writing a new thread. I posted it on greasyfork like almost an hour ago ;p

/t/Userscript-Wanikani-Lesson-Tab-Transmutation/12189/1

@developers:
Turns out it’s a ridiculously simple solution but crazy hard to find. I’m not really sure why it works but it does! I included my earlier attempts at the bottom of the script.