您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Allow you to make a quick report to the news by pressing the "News report" link at the top-right.
当前为
// ==UserScript== // @name Report to news // @description Allow you to make a quick report to the news by pressing the "News report" link at the top-right. // @namespace HF // @author Hash G. // @include *hackforums.net* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js // @version 1 // @grant GM_getValue // @grant GM_setValue // @grant GM_xmlhttpRequest // ==/UserScript== window.onload = function() { postkey = $("head > script:contains('<!--')").html(); postkey = postkey.split("\n")[10]; postkey = postkey.split('"')[1]; console.log(postkey); $("body").append("<div id='popup_news' style='background-color: rgb(51, 51, 51); bottom: auto; border: 1px solid rgb(0, 0, 0); height: 30%; left: 182px; margin: 0px; max-height: 95%; max-width: 95%; opacity: 1; overflow: auto; padding: 0px; position: fixed; right: auto; top: 128px; width: 75%; z-index: 999; display: none;'><h4>Briefly describe the event: </h4><input id='step1' type='text'><br><h4>Any important links: </h4><input id='step2' type='text'><br><br><br><button class='bitButton' id='sendNews' onclick='sendNews()'>Send!</button> <button class='bitButton' id='closeNews'>Close</button><br><br><span id='status'></span></div>"); $(".links").append(" | <a href='#' id='showNews'>News report</a>"); $("#sendNews").on("click", function() { $("#status").html("Sending..."); step1 = $("#step1").val(); step2 = $("#step2").val(); report = "[b][color=#ffde98]Briefly describe the event: [/color][/b] " + step1 + "\n[b][color=#ffde98]Any important links: [/color][/b]" + step2; $.post("http://hackforums.net/newreply.php", { "my_post_key": postkey, "action": "do_newreply", "tid": "4992602", "message": report }, function (data, status) { console.log("Sent: " + status); $("#status").html("Sent!"); setTimeout(function() { $("#popup_news").css("display", "none"); }, 350); }); }); $("#showNews").on("click", function() { $("#popup_news").css("display", "block"); }); $("#closeNews").on("click", function() { $("#popup_news").css("display", "none"); }); };