User:Guanaco/monobook.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure of whether the code is safe, you can ask at the help desk.
topaz.statuschanger = new Object();

/* configuration */
// change these to whatever you'd like to show up on your status page.
topaz.statuschanger.statuscode = {
  online:'[[Image:In Icon.PNG|left|100px]]',
  busy:'[[Image:Around Icon.PNG|left|125px]]',
  offline:'[[Image:Out Icon.PNG|left|125px]]'
};
/* end configuration */

topaz.statuschanger.oldonload = window.onload;
window.onload = function() {
  if (typeof topaz.statuschanger.oldonload == "function") topaz.statuschanger.oldonload();
  topaz.wputil.addsidepanel("tz-statuschanger", "status changer");
  topaz.wputil.addsidepanelbutton("tz-statuschanger", "Online",
      'javascript:topaz.statuschanger.setstatus("online")'
  );
  topaz.wputil.addsidepanelbutton("tz-statuschanger", "Busy",
      'javascript:topaz.statuschanger.setstatus("busy")'
  );
  topaz.wputil.addsidepanelbutton("tz-statuschanger", "Offline",
      'javascript:topaz.statuschanger.setstatus("offline")'
  );
};

topaz.statuschanger.setstatus = function(statusname) {
  topaz.wputil.setpagecontent(
      "User:"+topaz.wputil.username()+"/Status",
      topaz.statuschanger.statuscode[statusname],
      statusname);
};