Greasy Fork is available in English.

TagPro Report Submit Button

Show a submit button in the Report popup.

Pasang skrip ini?
Sugesti pemilik skrip

Kamu mungkin juga suka TagPro RL Chat.

Pasang skrip ini

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         TagPro Report Submit Button
// @description  Show a submit button in the Report popup.
// @author       Ko
// @version      1.2
// @include      *.koalabeast.com:*
// @include      *.koalabeast.com/game
// @include      *.jukejuice.com:*
// @include      *.newcompte.fr:*
// @supportURL   https://www.reddit.com/message/compose/?to=Wilcooo
// @license      MIT
// @namespace https://greasyfork.org/users/152992
// ==/UserScript==

tagpro.ready(function() {

    // Find the existing popup, selection dropdown and cancel button.
    var player = () => $("div#kick").attr("data-id"),
        select = $("#kickSelect"),
        cancel = $("#kickCancelButton");

    // Remove the event handler that votes on selecting a reason
    select.unbind("change");

    // Clone the "Cancel" button right above it.
    var submit = cancel.clone(true).insertBefore(cancel)

    // Change the ID and text to "Submit" of the cloned button.
    submit.prop("id", "kickSubmitButton").text("Submit");

    // Make a click on the button send a report
    submit.click(function(t) {
        tagpro.socket.emit("kick", {
            playerId: parseInt(player()),
            reason: parseInt(select.val())
        });
    });
});