User:Falkirksnh/status.js

// // THIS SCRIPT IS FOR THE USERONLINE TEMPLATE // SEE THE DOCUMENTATION FOR ITS USE // function CustomizeLinkModifications { var ONLINEpagetoedit = "http://minecraftwiki.net/index.php?title=User:" + encodeURIComponent(wgUserName) + "/Status&action=edit&newstatus=online"; var OFFLINEpagetoedit = "http://minecraftwiki.net/index.php?title=User:" + encodeURIComponent(wgUserName) + "/Status&action=edit&newstatus=offline"; var hovertext = "Update Your Status!" //Sidebar addPortletLink("p-navigation", ONLINEpagetoedit, "Online", "pt-statusnav", hovertext, "", ""); addPortletLink("p-navigation", OFFLINEpagetoedit, "Offline", "pt-statusnav", hovertext, "", ""); //Topbar addPortletLink("p-personal", ONLINEpagetoedit, "Online", "pt-statuspers", hovertext, "", document.getElementById("pt-userpage")); addPortletLink("p-personal", OFFLINEpagetoedit, "Offline", "pt-statuspers", 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 = true; //Submit it! document.getElementById('editform').submit; } addOnloadHook(CustomizeLinkModifications);