User:Ultimate Dark Carnage/commands.js

/*   Test @ Command by Ultimate Dark Carnage Note: Some parts of   the code belong to    their respective users. // Adding an object var command = {}; // Command Trigger command.trigger = {}; command.trigger.white = "@whitetheme"; command.trigger.normal = "@normal"; command.trigger.translucent = "@translucent"; // Command Action command.action = {}; command.action.whitetheme = function{ $('.Write').append(      '' +           '.ChatWindow #WikiaPage {' +               'color: black !important;' +           '}' +           '.ChatWindow #WikiaPage .Chat,' +           '.ChatWindow #Rail,' +           '.ChatWindow #ChatHeader,' +           '.ChatWindow .Write .message {' +               'background: white !important;' +           '}' +       ' '); if ($('.Write style#translucent-theme-style').length > 1){ $('.Write style#translucent-theme-style').remove; } }; command.action.translucenttheme = function{ $('.Write').append(      '' +           '.ChatWindow #WikiaPage .Chat,' +           '.ChatWindow #Rail,' +           '.ChatWindow #ChatHeader,' +           '.ChatWindow .Write .message {' +               'background: rgba(0, 0, 0, 0.6) !important;' +           '}' +       ' '); if ($('.Write style#white-theme-style').length > 1){ $('.Write style#white-theme-style').remove; } }; command.action.defaulttheme = function{ if ($('.Write style#white-theme-style').length > 1){ $('.Write style#white-theme-style').remove; }  if ($('.Write style#translucent-theme-style').length > 1){ $('.Write style#translucent-theme-style').remove; } }; $('.ChatWindow').on('DOMNodeInserted', '#WikiaPage .Chat li.you', function(e){  if ($(e.target).children('.message').html == command.trigger.white){      setTimeout(function{ command.action.whitetheme; }, 150);  }   else if ($(e.target).children('.message').html == command.trigger.translucent){      setTimeout(function{ command.action.translucenttheme; }, 150);  }   else if ($(e.target).children('.message').html == command.trigger.normal){      setTimeout(function{ command.action.defaulttheme; }, 150);  } });