Greasy Fork

Greasy Fork is available in English.

Kongregate statuscolor

Shows a color to display the status of a poster instead of a symbol.

当前为 2016-03-06 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name          Kongregate statuscolor
// @description   Shows a color to display the status of a poster instead of a symbol.
// @include       http://www.kongregate.com/forums/*/topics/*
// @version 0.0.1.20160306133352
// @namespace http://greasyfork.icu/users/32649
// ==/UserScript==

var posts = document.getElementsByClassName("post hentry");
var cimg, i, span, op, link, ptitle, len = posts.length;
function getPostSpan(ind) {
	return posts[ind].getElementsByTagName("td")[0].getElementsByClassName("fn")[0];
}
function getPostLink() {
	return span.getElementsByTagName("a")[0];
}

for(i=0;i<len;i++) {
	span = getPostSpan(i);
	link = getPostLink();
	op = link.className.indexOf("post_creator") != -1;
	ptitle = (link.className.match(/[a-zA-Z_]+_icon/) || "null").toString().toLowerCase();
	switch(ptitle) {
		case "null":
		break;
		case "developer_icon":
			link.style.color = op ? "#9999FF" : "#0000FF";
		break;
		case "admin_icon":
			link.style.color = op ? "#FF9999" : "#FF0000";
		break;
		case "forummod_icon":
			link.style.color = op ? "#DDAA77" : "#CC6600";
		break;
		default:
			link.style.color = op ? "#FFCC99" : "#FF9900";
		break;
	}
	if(ptitle == "null") continue;
	link.className = null;
	link.title = ptitle.charAt(0).toUpperCase()+ptitle.split("_")[0].slice(1)+(op?" (OP)":"");
}