// ==UserScript==
// @name SG Needs Jide
// @namespace http://tampermonkey.net/
// @version 0.5.2
// @description 一个基德的脚本
// @author 文爱
// @include https://bbs.sgamer.com/thread*
// @include https://bbs.sgamer.com/forum.php?mod=viewthread*
// @include https://bbs.sgamer.com/forum-283-1.html
// @include https://bbs.sgamer.com/forum.php?mod=post*
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
// 是否隐藏勋章,默认为true隐藏,改为false为不隐藏
var hideMedal = true;
window.jide = function (id) {
var post_id = "postmessage_" + id;
var post_msg = document.getElementById(post_id).innerText.replace( /^\s/, '');
document.getElementById("fastpostmessage").innerText = post_msg;
document.getElementById("fastpostform").submit();
}
window.randomReply = function() {
var reply = new Array("基德基德", "好贴,我顶", "纯路人,支持lz", "伐木伐木")
document.getElementById("fastpostmessage").innerHTML = reply[Math.floor((Math.random()*reply.length))];
document.getElementById("fastpostform").submit();
}
if (hideMedal) {
var mds = document.getElementsByClassName("md_ctrl");
var j;
for (j = mds.length - 1; j >= 0; j --) {
mds[j].innerHTML = "";
}
}
var plc = document.getElementsByClassName("plc");
var i,pi,line;
for (i = 2; i < plc.length; i ++) {
pi = plc[i].getElementsByClassName("pi");
if (pi.length == 0) continue;
var msg_id = plc[i].parentElement.parentElement.parentElement.id.substring(3);
line = pi[0].getElementsByClassName("pti")[0].getElementsByClassName("authi")[0];
if (i == 2) {
line.innerHTML += " 随机回复 复制伐木";
} else {
line.innerHTML += " 复制伐木";
}
}
})();