User:Assawyer/Scripts/Status switcher

Note: This module depends on the Add LI link function.

This module will add 3 new links beside the "log out" link. These will be "in", "busy" and "out" for quickly changing your current Wikipedia status. For this to work, you'll need two additional pages: Note: The exact names of the subpages can be configured in the script.
 * 1) Special:Mypage/Status
 * 2) Special:Mypage/StatusTemplate

The first one is the one modified by the script to hold  , where "STATUS" will be one of "in", "busy", "out". Then it is up to the "Template" to render it the way you wish. An example is: '''Example's status: ''' You can tweak it to look whatever you like.

Then all you need is to put   on whatever pages you want the status to be displayed on and add the following function to your monobook.js.

Any comments/praises/bug reports/flames go to the author, Misza 13 T C 16:48, 25 March 2006 (UTC).

//

// STATUS CHANGER addOnloadHook(function { var user = document.getElementById( 'pt-userpage' ).firstChild.firstChild.data;  var subpage = "/Status";  var scheme = "/StatusTemplate";  var linkprefix = "http://en.wikipedia.org/w/index.php?title=User:";  var contribs = document.getElementById( 'pt-mycontris' );  //Add the links  addlilink(contribs, linkprefix+user+subpage+"&action=edit&newstatus=in", "In", "pt-status-in", "I'm in!", "");  addlilink(contribs, linkprefix+user+subpage+"&action=edit&newstatus=busy", "Busy", "pt-status-busy", "I'm busy!", "");  addlilink(contribs, linkprefix+user+subpage+"&action=edit&newstatus=out", "Out", "pt-status-out", "I'm out!", "");  if (location.href.indexOf("&action=edit&newstatus=") == -1) return; //Are we here to auto-edit the status?  //Get new status  statusRegExp = /&action=edit&newstatus=(.*)/;  status = statusRegExp.exec(location.href)[1];  //Modify the form  document.getElementById('wpTextbox1').value = ""; document.getElementById('wpSummary').value = "Status: "+status; document.getElementById('wpMinoredit').checked = 'checked'; //Submit it! document.getElementById('editform').submit; });

//