您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a shortcut to the reported player's appeals page and removes the unnecessary alerts. Also has a page selector.
当前为
// ==UserScript== // @name Reports - Appeals link // @namespace Violentmonkey Scripts // @match https://reports.cubecraft.net/report // @grant none // @version 1.2 // @author Caliditas // @description Adds a shortcut to the reported player's appeals page and removes the unnecessary alerts. Also has a page selector. // ==/UserScript== $('tr td:nth-child(2)').each(function(i) { var names = $.trim($(this).find('a').first().html()); if (!names.includes(",")) { $(this).append($('<a target="_blank" href="https://appeals.cubecraft.net/find_appeals/' + $.trim($(this).find('a').first().html()) + '"> ???</a>')); } else { $(this).append($('<a target="_blank" href="https://appeals.cubecraft.net/find_appeals/' + names.slice(0, names.indexOf(",")) + '"> ???</a>')); names = names.slice(names.indexOf(",") + 1).trim(); for (var i = 0; i < amountOfAppearances($.trim($(this).find('a').first().html()), ","); i++) { if (i != amountOfAppearances($.trim($(this).find('a').first().html()), ",") - 1) { $(this).append($('<a target="_blank" href="https://appeals.cubecraft.net/find_appeals/' + names.slice(0, names.indexOf(",")) + '"> ???</a>')); } else { $(this).append($('<a target="_blank" href="https://appeals.cubecraft.net/find_appeals/' + names + '"> ???</a>')); } names = names.slice(names.indexOf(",") + 1).trim(); } } }); function amountOfAppearances(string, substring) { return string.split(substring).length - 1; } var alerts = document.getElementsByClassName("text-center"); for (i = 0; i < 2; i++) { if (alerts[i].firstElementChild.childNodes.length >= 6) { if (alerts[i].firstElementChild.childNodes[5].textContent.includes("Reports for chat offences must have a screenshot of chat open.")) { alerts[i].firstElementChild.remove(); } } else if (alerts[i].firstElementChild.childNodes.length >= 4) { if (alerts[i].firstElementChild.childNodes[2].textContent.includes("Need help using this site?")) { alerts[i].firstElementChild.remove(); } } } var currentPage if (document.baseURI.includes("page=")) { currentPage = parseInt(document.baseURI.slice(document.baseURI.indexOf("page=") + 5)) } else { currentPage = 1 } var existingSelector = document.getElementsByClassName("pagination")[0]; existingSelector.insertAdjacentHTML("beforeend", '<li><div style="color:white; cursor: default;" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;-o-user-select:none;" unselectable="on" onselectstart="return false;" onmousedown="return false;">-----</div></li><ul class=\"pagination\"><input class="pagination" type="number" id="myNumber" oninput="processInput()" value="' + currentPage + '"><li class="page-item"><a id="JumpButton" href="https://reports.cubecraft.net/report?page=1" class="page-link">Jump</a></li></ul>'); var script = document.createElement("script"); var text = document.createTextNode('function processInput() {var input = document.getElementsByClassName("pagination")[1].children[0].value; console.log(input); var jumpButton = document.getElementById("JumpButton"); var html = jumpButton.outerHTML; jumpButton.outerHTML = html.slice(0, html.indexOf("page=") + 5) + input + html.slice(html.indexOf(\'" class="page\')); var inputElem = document.getElementById("myNumber"); inputElem.addEventListener("keyup", function(event) {if (event.keyCode === 13) {event.preventDefault();document.getElementById("JumpButton").click();}});};'); script.appendChild(text); document.body.appendChild(script); // $('head').append('<script>function processInput() {var input = document.getElementsByClassName("pagination")[1].value; console.log(input) var jumpButton = document.getElementById("JumpButton"); var html = jumpButton.outerHTML; jumpButton.outerHTML = html.slice(0, html.indexOf("page=") + 5) + input + html.slice(html.indexOf(\'" class="page\'));};<\/script>');