挖矿记录页翻页

在挖矿记录页显示翻页按钮

  1. // ==UserScript==
  2. // @name 挖矿记录页翻页
  3. // @namespace https://fang.blog.miri.site
  4. // @version 0.2
  5. // @description 在挖矿记录页显示翻页按钮
  6. // @author Mr_Fang
  7. // @match https://www.mcbbs.net/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. var storage = window.localStorage;
  13. if(storage.getItem('wkjl_del') != true){
  14. showDialog('<style>.alert_right {background-image: none;padding-right: 0px;padding-left: 0px;} .m_c{background: #e74b3c url(https://s1.ax1x.com/2020/05/28/tVeOhQ.jpg) -100px 15px no-repeat; background-size:80%} .m_c .o{ background: #ffffff00;} .alert_right{margin-left: 25%; color: #fff;}</style><font size="4"><b>挖矿记录页翻页脚本已弃用</b></font><p>挖矿记录页显示信息不正确的问题已在<a>11月更新</a>修复,为防止冲突,请禁用或删除此脚本。</p>',
  15. 'right',
  16. '<font color="#fff">提示</font>',
  17. function() {
  18. storage["wkjl_del"] = true;
  19. },
  20. true,
  21. {},
  22. '<span onclick="showWindow(\'mbg_box\', \'https://www.mcbbs.net/home.php?mod=space&uid=1970274\')" style="color: #fff;" title="点击打开">开发者</span>'
  23. );
  24. }
  25. /*
  26. var log = (m) => {
  27. console.log("[UserScrip] " + m);
  28. }
  29. var filename = window.location.href.split("/").slice(window.location.href.split("/").length - 1,window.location.href.split("/").length).toString(String).split(".")[0];
  30. function GetQueryValue(queryName) {
  31. var query = decodeURI(window.location.search.substring(1));
  32. var vars = query.split("&");
  33. for (var i = 0; i < vars.length; i++) {
  34. var pair = vars[i].split("=");
  35. if (pair[0] == queryName) { return pair[1]; }
  36. }
  37. return null;
  38. }
  39.  
  40. var page = parseInt(GetQueryValue('page'));
  41. var prev;
  42. var nxt;
  43. var ft = GetQueryValue('ft');
  44.  
  45. log('本页表格行数:'+jq('table.dt.mtm>tbody').children('tr').length);
  46. log('首页第一条挖矿记录时间:' + ft);
  47. log('本页第一条挖矿记录时间:' + jq("table.dt.mtm>tbody>tr:nth-child(2)>td:last-child").text());
  48.  
  49. if(GetQueryValue('page') == null || GetQueryValue('page') < 1){
  50. nxt = 2;
  51. page = 1;
  52. }else{
  53. prev = page - 1;
  54. nxt = page + 1;
  55. }
  56.  
  57.  
  58. if(page == 1 && ft == null){
  59. ft = jq("table.dt.mtm>tbody>tr:nth-child(2)>td:last-child").text();
  60. }else if(page != 1 && ft == null){
  61. window.location.href = "plugin.php?id=mcbbs_lucky_card:prize_pool&action=log&page=1";
  62. }
  63.  
  64. var prev_html = "";
  65. var nxt_html = "";
  66. if(page > 1){
  67. prev_html = '<a href="plugin.php?id=mcbbs_lucky_card:prize_pool&action=log&page=' + prev + '&ft=' + ft + '" class="prev">上一页</a>'
  68. }
  69. if(jq('table.dt.mtm>tbody').children('tr').length == 21){
  70. nxt_html = '<a href="plugin.php?id=mcbbs_lucky_card:prize_pool&action=log&page=' + nxt + '&ft=' + ft + '" class="nxt">下一页</a>';
  71. }
  72.  
  73. if(page != 1 && ft == jq("table.dt.mtm>tbody>tr:nth-child(2)>td:last-child").text()){
  74. prev_html = "";
  75. page = 1;
  76. nxt = page + 1;
  77. nxt_html = '<a href="plugin.php?id=mcbbs_lucky_card:prize_pool&action=log&page=' + nxt + '&ft=' + ft + '" class="nxt">下一页</a>';
  78. }
  79.  
  80. if(GetQueryValue('id') == "mcbbs_lucky_card:prize_pool" && GetQueryValue('action') == "log"){
  81. jq('.bm.bw0').append(`
  82. <div class="pg">` + prev_html + `<strong>` + page + `</strong>` + nxt_html + `</div>
  83. `);
  84. }
  85. */
  86.  
  87. })();

QingJ © 2025

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