Dreamwidth Site Skin Detector

Add classes to BODY when site-skin specific ids are detected. Works for Tropospherical, Celerity and Gradation.

目前為 2014-10-28 提交的版本,檢視 最新版本

// ==UserScript==
// @name             Dreamwidth Site Skin Detector
// @namespace        dreamwidth
// @description      Add classes to BODY when site-skin specific ids are detected. Works for Tropospherical, Celerity and Gradation.
// @include          http://*.dreamwidth.org/*
// @grant            none
// @version 0.0.1.20141028180351
// ==/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"; }
})();