Quest Table - Kappa Mod

Adds a column to quest tables that show whether task is Kappa or not

  1. // ==UserScript==
  2. // @name Quest Table - Kappa Mod
  3. // @namespace quest-eft-gamepedia
  4. // @version 0.21
  5. // @description Adds a column to quest tables that show whether task is Kappa or not
  6. // @author PlatinumLyfe
  7. // @match https://escapefromtarkov.gamepedia.com/Quests
  8. // @match https://escapefromtarkov.fandom.com/wiki/Quests
  9. // @grant GM_addStyle
  10. // @grant GM_addElement
  11. // @grant GM_xmlhttpRequest
  12. // @grant none
  13. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. // We find the quests tables on the Quests page (there is one table for each trader)
  18. $('.mw-parser-output .wikitable').each(function(idx, itm) {
  19. // In each Table we:
  20.  
  21. // Add a column heading for Kappa AFTER Quest
  22. $(itm).find('tr:nth-child(2) th:first-child').after('<th>Kappa</th>');
  23.  
  24. // Find each row in the table ('tr' aka tablerow element)
  25. $(itm).find('tr').each(function (idxi, tr) {
  26.  
  27. // Find each table header cell in the tablerow
  28. $(tr).find('th').each(function(id, th) {
  29. var thx = $(th);
  30.  
  31. if (!thx.attr('colspan')) {
  32. // If this isn't a cell that has a column span
  33. thx.find('a').each(function(i, a) {
  34. // Find each hyperlink (so we can get the subpages off the wiki)
  35. window.jQuery.get($(a).attr('href')).then(function (data) {
  36. // Load the sub-pages for each task and find the table on the right that has whether it is kappa or not
  37. thx.after($('<td>' + $(data).find('.mw-parser-output .va-infobox-group:nth-child(3) tr:last-child .va-infobox-content').html() + '</td>'));
  38. // We insert it into the table
  39. });
  40. });
  41. } else if (thx.attr('colspan') == 10) {
  42. // If this is the big column span cell that says things like "Prapor's quests", "Therapists Quests", etc.
  43. // We need to make it go one bigger to accomodate the added Kappa cells
  44. thx.attr('colspan', '11');
  45. }
  46. });
  47. });
  48. });
  49. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址