Jump to content

User:PrimeHunter/Deleted contribs.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* Add a "Deleted contribs" link under "Tools" in userspace.
   The link only works for admins.
   To use the script, add the following line to [[Special:MyPage/common.js]]:
 
importScript('User:PrimeHunter/Deleted contribs.js'); // Linkback: [[User:PrimeHunter/Deleted contribs.js]]

*/

addOnloadHook(function () {
if (mw.config.get('wgNamespaceNumber') != "2" && mw.config.get('wgNamespaceNumber') != "3")
  return;  // restrict to User and User talk

mw.loader.using(['mediawiki.util'], function () {
  mw.util.addPortletLink(
    'p-tb',
    'https://en.wikipedia.org/w/index.php?title=Special:DeletedContributions&target=' +
    encodeURIComponent(mw.config.get('wgTitle').split('/')[0]),
    'Deleted contribs',
     'pt-deletedcontribs',
    'Deleted user contributions',
    null,
    '#t-contributions'
  );
});
})