harshilsharma63 / TDF Improved Dark Skin

// ==UserScript==
// @name    TDF  Improved Dark Skin
// @namespace   TDF
// @include http://www.digit.in/forum/
// @copyright   harshilsharma63
// @author  harshilsharma63
// @downloadURL https://openuserjs.org/install/harshilsharma63/TDF_Improved_Dark_Skin.user.js
// @updateURL https://openuserjs.org/install/harshilsharma63/TDF_Improved_Dark_Skin.user.js
// @grant none
// @version 0.2
// ==/UserScript==

// changing forum header background color
    //header class name: "floatcontainer doc_header"
    //property modified: background color

var forumHeader = document.getElementsByClassName("floatcontainer doc_header")[0];
forumHeader.setAttribute("style", "background-color:#105275;");
//forumHeader.style.color = "#FFFFFF";

forumHeader = document.getElementsByClassName("floatcontainer")[2];
forumHeader.setAttribute("style", "background-color:#105275;");

forumHeader = document.getElementsByClassName("navtabs floatcontainer")[0];
forumHeader.setAttribute("style", "background-color:#303030;");

// changing navtab background color
// random test comment
 
var navtabs = document.getElementsByClassName("navtab");

for(var i = 0; i < navtabs.length; ++i)
    {
        navtabs[i].setAttribute("style", "background-color:#5D5D5D; color:black");
    }

// changing ond and new forum icons
    //original old forum icon src: http://www.digit.in/forum/images/statusicon/forum_old-48.png
    //original new forum icon src: http://www.digit.in/forum/images/statusicon/forum_new-48.png

    //modified old forum icon src: http://s30.postimg.org/byee52lyl/forum_old_48.png
    //modified new forum icon src: http://s30.postimg.org/4twkw1ep9/forum_new_48.png

    // forum icon class name: forumicon

var forumicons = document.getElementsByClassName("forumicon");sd
for(var i = 0; i < forumicons.length; ++i)
    {
        //get forumicon's image source
        var src = forumicons[i].getAttribute("src");
        
        if(src == "images/statusicon/forum_old-48.png") //old forum
            forumicons[i].setAttribute("src", "http://s30.postimg.org/byee52lyl/forum_old_48.png");
    
        else if(src == "images/statusicon/forum_new-48.png") // new forum
            forumicons[i].setAttribute("src", "http://s30.postimg.org/4twkw1ep9/forum_new_48.png");
    }

// changing subforum description background and text color

var subforumDescBackground = document.getElementsByClassName("subforumdescription");

for(var i = 0; i < subforumDescBackground.length; ++i)
    {
        subforumDescBackground[i].setAttribute("style", "background-color:#105275; color: #FFFFFF;");
        
        var inner = subforumDescBackground[i].innerHTML;
        if(inner.substr(0,3) != "<b>")
           subforumDescBackground[i].innerHTML = "<b>" + inner + "</b>";
    }

// changing subforum title


// changing forum-category background color

var forumCategories = document.getElementsByClassName("forumrow table");
for(var i=0; i<forumCategories.length; ++i)
    {
       forumCategories[i].setAttribute("style", "background-color:#303030;")
    }
    
// changing background color and text color of search textbox at upper-right
    // defined in: css_002.css, line number 3459, ".textbox, textarea, select {"
    // original background color: #252525
    // changed background color: #ADADAD
    // original text color: #FFFFFF
    // changed text color: #000000
    //class name: textbox

var searchTextbox= document.getElementsByClassName("textbox")[0]; // there is only one class="textbox" element
searchTextbox.setAttribute("style", "background-color:#BDBDBD; color:#000000;");

// changing subforum title color. Making it darker
    // original color: #AFDFFF
    // new color: #7A9CB2

//var subforumTitles = document.querySelectorAll(".forumtitle a");
var subforumTitles = document.querySelectorAll(".titleline .forumtitle a");

for(var i = 0; i < subforumTitles.length; ++i)
    {
       subforumTitles[i].setAttribute("style", "color:#7A9CB2");
    }

//introducing line break between subforum title and subforum description

var subForum = document.querySelectorAll(".forumdescription");

for(var i=0; i<subForum.length; ++i)
    {
        var innerHtml = subForum[i].innerHTML;
        if(innerHtml.substr(0, 4) != "<br>")
           subForum[i].innerHTML = "<br>" + innerHtml;
        
        subForum[i].setAttribute("style", "color: #CCCCCC;");
    }

//changing threadtitle text color
    // original color: #AFDFFF
    // new color: #8CB2CC

var threadTitles = document.querySelectorAll(".threadtitle");

for(var i=0; i<threadTitles.length; ++i)
    {
        threadTitles[i].setAttribute("style", "color: #8CB2CC");
    }

// setting bottom navlinks backgruound color to #373737
document.querySelectorAll(".navlinks")[0].setAttribute("style", "background-color: #191919;");



// fixing bottom" whats going on" div

document.querySelectorAll(".blockhead")[0].setAttribute("style", "background-color: #191919;");
document.querySelectorAll(".blocksubhead")[0].setAttribute("style", "background-color: #383838;");
document.querySelectorAll("#wgo_onlineusers")[0].setAttribute("style", "background-color: #191919;");
document.querySelectorAll("#wgo_birthdays")[0].setAttribute("style", "background-color: #191919;");
document.querySelectorAll("#wgo_stats")[0].setAttribute("style", "background-color: #191919;");
document.querySelectorAll("#wgo_legend")[0].setAttribute("style", "background-color: #191919;");