Add classes to BODY when site-scheme specific ids are detected. Works for Tropospherical, Celerity and Gradation.
当前为
// ==UserScript==
// @name Dreamwidth Site Scheme Detector
// @namespace dreamwidth
// @description Add classes to BODY when site-scheme specific ids are detected. Works for Tropospherical, Celerity and Gradation.
// @include http://*.dreamwidth.org/*
// @grant none
// @version 0.0.1.20141028174130
// ==/UserScript==
(function() {
var bodytag = document.getElementsByTagName("body")[0];
var alpha = document.getElementById("shim-alpha");
var horizontal = document.getElementsByClassName("horizontal-nav");
var vertical = document.getElementsByClassName("vertical-nav");
var deco = document.getElementById("page-decoration");
if (alpha) { bodytag.className += "tropo"; }
else if (deco) { bodytag.className += "celerity"; }
else if (horizontal) { bodytag.className += "gradation-horizontal"; }
else if (vertical) { bodytag.className += "gradation-vertical"; }
})();