您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Prevents you from accidentially creating multiple reports at once on reports.cubecraft.net
// ==UserScript== // @name CubeCraft PreventMultiReports // @namespace de.rasmusantons // @description Prevents you from accidentially creating multiple reports at once on reports.cubecraft.net // @include https://reports.cubecraft.net/report/create // @version 1 // @grant none // ==/UserScript== var isBlocked = false; $(document).off('click', '.create-report'); $(document).on('click', '.create-report', function(e) { var form = $('#report_form'); var formData = new FormData($("#report_form")[0]); console.log(formData); if (!isBlocked) { isBlocked = true; $.ajax({ type: "POST", url: '/validate_report', type: 'POST', data: formData, contentType: false, processData: false, success: function(data) { if(data == 'true'){ form.submit(); } else { $('#validation_message').html(data); $('html, body').animate({ scrollTop: $("#validation_message").offset().top-250 }, 500); } }, error: function(data) { isBlocked = false; } }); } e.preventDefault(); });