Quick LQP Report

http://hackforums.net/showthread.php?tid=5193528

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Quick LQP Report
// @namespace   HF
// @description http://hackforums.net/showthread.php?tid=5193528
// @author      Hash G.
// @include     *hackforums.net/showthread.php?tid=*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @version     0.1
// @grant       GM_getValue
// ==/UserScript==


post_key = $("a.one_star").attr("href").substr(50);

$("a[href*='javascript:Thread.reportPost']").each(function() {
	pid = $(this).attr("href").substr(29);
	pid = pid.slice(0, -2);
	$(this).after(' <a class="bitButton" style="cursor: pointer;" data-btn="lqpreport" data-pid="'+pid+'">LQP</a>');
});


$("a[data-btn='lqpreport']").on("click", function() {
	$(this).attr("data-clicked", "true");
	$.post("report.php", {
		my_post_key: post_key, 
        reason: "low quality",
		action: "do_report",
		pid: $(this).attr("data-pid")
	},
	function (data, status) {
		if (status == "success") {
			$("a[data-clicked='true']").html("Done");
		}
	})
});