User:Phatom87/monobook.js

// adds a 'logs for this page' link to the toolbox bar // if the page is a user's page, talk page or subpage, the link will go to logs for the user instead // if the page is a special page, then no link is displayed

$(function { // if this is a user, show the logs for the user rather than the page if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) {  url = wgServer + "/w/index.php?title=Special:Log&user=" + wgTitle.split("/")[0]; } else if ( wgCanonicalNamespace == "Special" ) {  // don't display link for special pages  return; } else {  url = wgServer + "/w/index.php?title=Special:Log&page=" + wgPageName; } mw.util.addPortletLink("p-tb", url, "Logs", "pt-logs"); //Begin user link code   if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history     return;  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {     var username = encodeURIComponent( wgTitle );     mw.util.addPortletLink("p-cactions", wgServer + "/wiki/Special:Contributions/" + username, "Contribs", "ca-contrib", "User contributions");     mw.util.addPortletLink("p-cactions", "http://tools.wikimedia.de/~interiot/cgi-bin/Tool1/wannabe_kate?username=" + username + "&site=en.wikipedia.org", "Edit count", "ca-editcount", "Edit count from Interiot's Tool1"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=move&user=" + username, "Page moves", "ca-pagemoves", "Page moves by this user"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=block&page=User:" + username, "Blocks received", "ca-blog", "Blocks received by this user"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Prefixindex&from=" + username + "&namespace=2", "Userspace", "", "List of pages in this user's userspace"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=block&user=" + username, "Blocks given", "", "Blocks by this user"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=protect&user=" + username, "Protections", "", "Protections by this user"); mw.util.addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=delete&user=" + username, "Deletions", "", "Deletions by this user"); } });

//