User:AVIosad/monobook.js

importScript('User:AzaToth/twinkle.js');

// install User:Cacycle/wikEd in-browser text editor document.write(' ');

addOnloadHook(function { var subpage = "/Status";  var scheme = "/StatusTemplate";  var subpagelink = mw.config.get('wgServer') + "/w/index.php?title=User:" + encodeURIComponent(wgUserName + subpage);  var logout = document.getElementById( 'pt-logout' );  //Add the links  mw.util.addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=online", "online", "pt-status-online", "", logout);  mw.util.addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=busy", "Busy", "pt-status-busy", "", logout);  mw.util.addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=offline", "offline", "pt-status-offline", "", logout);  if (location.href.indexOf("&action=edit&newstatus=") == -1) return; //Are we here to auto-edit the status?  //Get new status  var statusRegExp = /&action=edit&newstatus=(.*)/;  var 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; });

//