Add routine to transfer list Firefox

firefox

  1. // ==UserScript==
  2. // @name Add routine to transfer list Firefox
  3. // @version 0.3
  4. // @author Jhonatan Bianchi
  5. // @include http://trophymanager.com/transfer/*
  6. // @grant none
  7. // @description firefox
  8. // @namespace https://gf.qytechs.cn/users/68506
  9. // ==/UserScript==
  10.  
  11. jQuery.noConflict(true);
  12.  
  13. unsafeWindow.jQuery(document).ajaxComplete(function(event, xhr, settings)
  14. {
  15. rebindClicks();
  16. if (settings.url === "/ajax/transfer.ajax.php")
  17. {
  18. calcularRotinas();
  19. }
  20. });
  21.  
  22. function rebindClicks()
  23. {
  24. $.each($('#pages').find('span'), function(index, span)
  25. {
  26. var clickAntigo = $(span).attr('onclick');
  27. $(span).removeAttr('onclick');
  28. $(span).off('click');
  29. $(span).on('click', function()
  30. {
  31. eval(clickAntigo);
  32. calcularRotinas();
  33. rebindClicks();
  34. });
  35. });
  36. }
  37.  
  38. function calcularRotinas()
  39. {
  40. $('.routine').remove();
  41. $("tr.header").append("<th class='routine' title='' style='width: 40px; cursor: pointer;''>XP</th>");
  42.  
  43. var params = "";
  44. $("div.player_name > a").each(function(e, player)
  45. {
  46. params = "player_id="+$(player).attr("player_link");
  47.  
  48. var xhr = new XMLHttpRequest();
  49. xhr.open("POST", "http://trophymanager.com/ajax/tooltip.ajax.php", true);
  50. xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  51. xhr.onreadystatechange = function()
  52. {
  53. if (xhr.readyState == 4)
  54. {
  55. var resultado = JSON.parse(xhr.responseText);
  56.  
  57. $("a[player_link=" + resultado.player.player_id + "]").closest("tr").append("<td class='right align_right routine' style='padding-right:5px;'><span>" + resultado.player.routine + "</span></td>");
  58. }
  59. }
  60. xhr.send(params);
  61. });
  62. }

QingJ © 2025

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