// ==UserScript==
// @name SG Needs Jide
// @namespace http://tampermonkey.net/
// @version 0.51
// @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/home.php*
// @include https://bbs.sgamer.com/forum.php?mod=post*
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
// 是否隐藏勋章,默认为true隐藏,改为false为不隐藏
var hideMedal = true;
// 是否开启护眼模式,默认为true开启,改为false关闭该模式
var shieldEyesMode = 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 atags = document.getElementById("um").getElementsByTagName("a");
if(atags.length > 0) {
var k;
for (k = 1; k < atags.length; k ++) {
atags[k].style.color="white";
}
}
var plc = document.getElementsByClassName("plc");
if (shieldEyesMode) {
// 通用div背景颜色修改
document.getElementById("wp").style.backgroundColor='#F6F6F6';
// 消息界面背景颜色修改
var ct = document.getElementById("ct");
if (ct != null) {
ct.style.backgroundColor='#F6F6F6';
}
if (plc.length == 0) {
// 首页背景颜色修改
document.getElementById("threadlist").style.backgroundColor='#F6F6F6';
document.getElementById("subforum_283").style.backgroundColor='#F6F6F6';
document.getElementsByClassName("bm bml pbn")[0].style.backgroundColor='#F6F6F6';
} else {
// 贴子详情页面背景颜色修改
document.getElementById("postlist").style.backgroundColor='#F6F6F6';
}
}
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 += " 复制伐木";
}
}
})();