User:Falkirksnh/messages.js

function Welcome { var ONLINEpagetoedit = "http://minecraftwiki.net/index.php?title=User:&action=edit&message="; var OFFLINEpagetoedit = "http://minecraftwiki.net/index.php?title=User:" + encodeURIComponent(wgUserName) + "/Status&action=edit&newstatus=offline"; var hovertext = "Update Your Status!" //Topbar addPortletLink("p-personal", ONLINEpagetoedit, "Welcome", "mw-wel", hovertext, "", document.getElementById("pt-userpage")); addPortletLink("p-personal", OFFLINEpagetoedit, "Offline", "mw-wel", hovertext, "", document.getElementById("pt-userpage")); if (location.href.indexOf("&action=edit&newstatus=") == -1) return; //Get new status statusRegExp = /&action=edit&newstatus=(.*)/; var status = statusRegExp.exec(location.href)[1]; //Modify the form document.getElementById('wpTextbox1').value = status; document.getElementById('wpSummary').value = "Updating online status"; document.getElementById('wpMinoredit').checked = false; //Submit it! document.getElementById('editform').submit; } addOnloadHook(Welcome);