User:CWii/statusChanger.js

//--- //////////STATUS CHANGER // Creator: Misza13 // Credits: Voyagerfan5761 for some minor improvements $(function { var subpage = "/Status"; var scheme = "/StatusTemplate"; var linkprefix = mw.config.get('wgServer')+mw.config.get('wgScript')+"?title=User:"; //Add the links addLink("p-personal", linkprefix+wgUserName+subpage+"&action=edit&newstatus=in", "In", "pt-status-in", "I'm in!", "", "pt-logout"); addLink("p-personal", linkprefix+wgUserName+subpage+"&action=edit&newstatus=busy", "Busy", "pt-status-busy", "I'm busy!", "", "pt-logout"); addLink("p-personal", linkprefix+wgUserName+subpage+"&action=edit&newstatus=out", "Out", "pt-status-out", "I'm not here!", "", "pt-logout"); addLink("p-personal", linkprefix+wgUserName+subpage+"&action=edit&newstatus=custom", "Cus.", "pt-status-cus", "Custom", "", "pt-logout"); /* //Are we here to auto-edit the status? //Modify the form document.getElementById('wpTextbox1').value = ""; document.getElementById('wpSummary').value = "Status update: Custom"; document.getElementById('wpMinoredit').checked = true; //Submit it! //document.getElementById('editform').submit;

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 update: "+status; document.getElementById('wpMinoredit').checked = true; if (status == "custom") return; //Submit it! document.getElementById('editform').submit; }); // //-