Adds a shortcut to the reported player's appeals page.
当前为
// ==UserScript==
// @name Reports - Appeals link
// @namespace Violentmonkey Scripts
// @match https://reports.cubecraft.net/report
// @grant none
// @version 1.1
// @author Caliditas
// @description Adds a shortcut to the reported player's appeals page.
// ==/UserScript==
$('tr td:nth-child(2)').each(function(i) {
var names = $.trim($(this).find('a').first().html());
if (!names.includes(",")) {
$(this).append($('<a href="https://appeals.cubecraft.net/find_appeals/'
+ $.trim($(this).find('a').first().html())
+ '"> ?</a>'));
} else {
$(this).append($('<a 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 href="https://appeals.cubecraft.net/find_appeals/'
+ names.slice(0, names.indexOf(","))
+ '"> ?</a>'));
} else {
$(this).append($('<a 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;
}