User:Tobes00/statuschanger.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.
topaz.statuschanger = new Object(); /* configuration */ // change these to whatever you'd like to show up on your status page. topaz.statuschanger.statuscode = { online:'{{User:Tobes00/StatusDiv|online}}', busy:'{{User:Tobes00/StatusDiv|busy}}', offline:'{{User:Tobes00/StatusDiv|offline}}', sleeping:'{{User:Tobes00/StatusDiv|sleeping}}' }; // true to use the personal bar, false to create a panel in the left column topaz.statuschanger.usepersonalbar = false; // true if you'd like your status page on your watchlist topaz.statuschanger.watchstatus = false; /* end configuration */ topaz.statuschanger.oldonload = window.onload; window.onload = function() { if (typeof topaz.statuschanger.oldonload == "function"){setTimeout('topaz.statuschanger.oldonload()',50);} if (topaz.statuschanger.usepersonalbar) { var a = topaz.wputil.addsidepanelbutton("p-personal", "Online", 'javascript:topaz.statuschanger.setstatus("online")' ); var b = topaz.wputil.addsidepanelbutton("p-personal", "Busy", 'javascript:topaz.statuschanger.setstatus("busy")' ); var b = topaz.wputil.addsidepanelbutton("p-personal", "Offline", 'javascript:topaz.statuschanger.setstatus("offline")' ); var c = topaz.wputil.addsidepanelbutton("p-personal", "Sleeping", 'javascript:topaz.statuschanger.setstatus("sleeping")' ); a.style.borderRight=b.style.borderRight="1px solid #aaaaaa"; b.style.marginLeft=c.style.marginLeft="0px"; a.style.paddingRight=b.style.paddingLeft=b.style.paddingRight=c.style.paddingLeft="2px"; } else { 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.wputil.addsidepanelbutton("tz-statuschanger", "Sleeping", 'javascript:topaz.statuschanger.setstatus("sleeping")' ); } }; topaz.statuschanger.setstatus = function(statusname) { topaz.wputil.setpagecontent( "User:"+topaz.wputil.username()+"/Status", topaz.statuschanger.statuscode[statusname], statusname, topaz.statuschanger.watchstatus); };