Gamekit SeeAll

Add a button to reveal all quests in GameKit

  1. // ==UserScript==
  2. // @name Gamekit SeeAll
  3. // @namespace fr.mrcraftcod
  4. // @version 0.9
  5. // @description Add a button to reveal all quests in GameKit
  6. // @author MrCraftCod
  7. // @match https://gamekit.com/*/*
  8. // @match https://dogry.pl/*/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. $(document).ready(function(){
  15. $("#others-tab-basic").append('<a href="javascript:void(0);" id="revealAll" done="false">Reveal quests</a>');
  16. $('#revealAll').click(function(){
  17. revealAll();
  18. });
  19. });
  20. })();
  21.  
  22. function revealAll(){
  23. if($('#revealAll').attr("done") === "true")
  24. return;
  25. $(".item").each(function(){
  26. var active = $(this).hasClass("active");
  27. $(this).find(".pad").each(function(){
  28. $(this).find("p:not([style],[class])").each(function(){
  29. appendText($(this).clone().children().remove().end().text(), active);
  30. $('#revealAll').attr("done", true);
  31. $('#revealAll').hide();
  32. });
  33. });
  34. });
  35. }
  36.  
  37. function appendText(text, active){
  38. $("article>.game>.row>ul").append("<li" + (active ? ' style="color:green;"' : "") + ">" + text + "</li>");
  39. }