Greasy Fork

Greasy Fork is available in English.

PTH Colourful Sandbox

Give the different types of threads in the PTH sandbox different colours

当前为 2016-12-17 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         PTH Colourful Sandbox
// @version      0.1
// @description  Give the different types of threads in the PTH sandbox different colours
// @author       Chameleon
// @include      http*://*passtheheadphones.me/*forumid=8*
// @grant        none
// @namespace http://greasyfork.icu/users/87476
// ==/UserScript==

var colours = [
  {name:"user script", colour:"#888800"},
  {name:"userscript", colour:"#444400"},
  {name:"stylesheet", colour:"#880000"},
  {name:"tool", colour:"#008800"},
  {name:"application", colour:"#6666cc"},
  {name:"python", colour:"#008888"},
  {name:"gazelle", colour:"#880088"},
  {name:"user script / tool", colour:"white; background: linear-gradient(to right, #888800 0%,#008800 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;"},
  ];

(function() {
  'use strict';

  var as=document.getElementsByClassName("forum_index")[0].getElementsByClassName('tooltip');
  for(var i=0; i<as.length; i++)
  {
    var a=as[i];
    if(a.tagName != "A")
      continue;
    var split=a.innerHTML.split('[');
    if(split.length < 2)
      continue;
    split=split[1].split(']');
    if(split.length < 2)
      continue;
    for(var j=0; j<colours.length; j++)
    {
      if(split[0].toLowerCase() == colours[j].name)
      {
        a.innerHTML = a.innerHTML.replace('[', '[<span style="color: '+colours[j].colour+'">');
        a.innerHTML = a.innerHTML.replace(']', '</span>]');
        break;
      }
    }
  }
})();