Content deleted Content added
m indentation |
m Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 5:
function CustomizeLinkModifications() {
var un = mw.config.get('wgUserName')
var ONLINEpagetoedit = " var OFFLINEpagetoedit = "
var HUGGLEpagetoedit = "
var hovertext = "Update Your Status!"
// Sidebar
mw.util.addPortletLink("p-navigation", ONLINEpagetoedit, "Online", "pt-statusnav", hovertext, "", "");
mw.util.addPortletLink("p-navigation", OFFLINEpagetoedit, "Offline", "pt-statusnav", hovertext, "", "");
mw.util.addPortletLink("p-navigation", HUGGLEpagetoedit, "Huggle", "pt-statusnav", hovertext, "", "");
// Topbar
mw.util.addPortletLink("p-personal", ONLINEpagetoedit, "Online", "pt-statuspers", hovertext, "", document.getElementById("pt-userpage"));
mw.util.addPortletLink("p-personal", OFFLINEpagetoedit, "Offline", "pt-statuspers", hovertext, "", document.getElementById("pt-userpage"));
mw.util.addPortletLink("p-personal", HUGGLEpagetoedit, "Huggle", "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();
}
|