Greasy Fork镜像 还支持 简体中文。

Display Bounty Amounts

Merges hover over label text for bounty reports with the default table body

  1. // ==UserScript==
  2. // @name Display Bounty Amounts
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Merges hover over label text for bounty reports with the default table body
  6. // @author Luvaboy
  7. // @license MIT
  8. // @grant GM_addStyle
  9. // @match *.travian.com/position_details.php?*
  10. // @match *.travian.com/build.php?id=39&gid=16&tt=99
  11. // ==/UserScript==
  12.  
  13. GM_addStyle(`#center #contentOuterContainer.contentPage {
  14. width: 650px !important;
  15. translate: -20px;
  16. }`);
  17.  
  18. GM_addStyle("#raidList .villageWrapper .dropContainer .raidList .raidListContent table td.troops { width: 0px !important; }");
  19.  
  20. (function() {
  21. 'use strict';
  22.  
  23. if (window.location.href.indexOf("build.php") !== -1) {
  24. setTimeout(exposeLabelTextOnFarmLists, 1000);
  25. }
  26. if (window.location.href.indexOf("position_details.php") !== -1) {
  27. exposeLabelText();
  28. }
  29.  
  30. function exposeLabelText() {
  31. let reportIcons = document.querySelectorAll(".reportInfoIcon");
  32.  
  33. if (reportIcons) {
  34. for (let i = 0; i < reportIcons.length; i++) {
  35. // New Element
  36. const span = document.createElement("span");
  37. span.innerText = reportIcons[i].alt;
  38.  
  39. var colour = "rgb(255 210 210)";
  40.  
  41. if (span.innerText.indexOf("/") !== -1) {
  42. colour = "rgb(109 235 107 / 56%)";
  43. }
  44.  
  45. span.style.background = colour;
  46. span.style["border-radius"] = "5px"
  47. span.style.padding = "2px"
  48. span.style.margin = "2px 4px"
  49.  
  50. // Insert
  51. reportIcons[i].parentElement.after(span);
  52.  
  53. // Tidy up
  54. reportIcons[i].style.margin = "0px 4px 0px 8px";
  55. reportIcons[i].style.float = "none";
  56. }
  57. }
  58. }
  59.  
  60. function exposeLabelTextOnFarmLists() {
  61. let carryIcons = document.querySelectorAll(".carry");
  62.  
  63. console.log("carryIcons", carryIcons);
  64.  
  65. if (carryIcons) {
  66. for (let i = 0; i < carryIcons.length; i++) {
  67. // New Element
  68. if (carryIcons[i].alt) {
  69. console.log("carryIcons[i].alt", carryIcons[i].alt);
  70.  
  71. const span = document.createElement("span");
  72. let matches = carryIcons[i].alt.match(/\d+/g);
  73.  
  74. if (matches) {
  75. span.innerText = matches.map(Number).join("/");
  76. }
  77.  
  78. var colour = "rgb(255 210 210)";
  79.  
  80. if (span.innerText.indexOf("/") === -1) {
  81. colour = "rgb(109 235 107 / 56%)";
  82. }
  83.  
  84. span.style.background = colour;
  85. span.style["border-radius"] = "5px";
  86. span.style.padding = "2px";
  87. span.style.margin = "2px 4px";
  88.  
  89. // Insert
  90. carryIcons[i].after(span);
  91. }
  92.  
  93. // Tidy up
  94. carryIcons[i].style.margin = "0px 4px 0px 8px";
  95. carryIcons[i].style.float = "none";
  96. }
  97. }
  98. }
  99.  
  100. })();

QingJ © 2025

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