TagPro Report Submit Button

Show a submit button in the Report popup.

安裝腳本?
作者推薦腳本

您可能也會喜歡 TagPro RL Chat

安裝腳本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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())
        });
    });
});