Advertisement
Guest User

Chat Dark Code

a guest
Jul 30th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. __dark = false;
  2.  
  3. __t = document.createElement("input");
  4. __t.type = "button";
  5. __t.value = "Dark";
  6. tag("#chatbox_header").appendChild(__t);
  7.  
  8. __s = document.createElement("style");
  9. __s.innerHTML = ".chatDark { background-color: #333!important; }"+
  10.                 ".chatDark * { background-color: #333!important; color: #CCC!important;}";
  11. tag("#chatbox_header").appendChild(__s);
  12.  
  13. __t.onclick = function(){
  14.     if(__dark){
  15.         tag("#chatbox_members").setAttribute("class", "chatbox-members");
  16.         tag("#chatbox").setAttribute("class", "teste");
  17.         __dark = false;
  18.     } else {
  19.         tag("#chatbox_members").setAttribute("class", "chatDark");
  20.         tag("#chatbox").setAttribute("class", "chatDark");
  21.         __dark = true;
  22.     }
  23. };
  24.  
  25. function tag(t){
  26.     var r;
  27.     if(t.substr(0, 1) == "@"){
  28.         r = document.getElementsByName( t.substring(1, t.length) );
  29.     }
  30.     else{
  31.         r = document.querySelectorAll(t);
  32.     }
  33.     var teste = t.split(" ");
  34.     teste = teste[teste.length-1].indexOf("#");
  35.     if(teste != -1){
  36.         return r[0];
  37.     }else{ return r; }
  38.    
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement