WaniKani One-Page Lesson View

Show all pages of lessons on one screen!

  1. // ==UserScript==
  2. // @name WaniKani One-Page Lesson View
  3. // @version 0.1.2
  4. // @description Show all pages of lessons on one screen!
  5. // @author Matthew Benedict
  6. // @include /^https://(www|preview).wanikani.com/lesson/session$/
  7. // @grant none
  8. // @run-at document-end
  9. // @namespace https://greasyfork.org/users/149329
  10. // ==/UserScript==
  11.  
  12. function onePageView() {
  13. let elementID = ""
  14. if (document.getElementById("supplement-rad").style.display == "block") {
  15. elementID = "#supplement-rad"
  16. } else if (document.getElementById("supplement-kan").style.display == "block") {
  17. elementID = "#supplement-kan"
  18. } else if (document.getElementById("supplement-voc").style.display == "block") {
  19. elementID = "#supplement-voc"
  20. }
  21. window.$(elementID).children().css("display", "block");
  22. window.$(elementID).children().css("margin-bottom", "50px");
  23. }
  24.  
  25. (function() {
  26. 'use strict';
  27. var intervalFunction = setInterval(function(){
  28. if(window.$('#loading-screen').css('display') !== 'none'){
  29. console.log('Lessons loading...');
  30. } else {
  31. onePageView()
  32. }
  33. }, 250);
  34. })();