Jump to content

User:MJL/UserAbuseLogs.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by MJL (talk | contribs) at 23:36, 10 March 2019 (From suggestion Special:Diff/887158609#UserAbuseLogs). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
// UserAbuseLogs
// by MJL
// Documentation at [[User:MJL/UserAbuseLogs]]
// Script derived from [[User:Bellezzasolo/Scripts/subpages]]

var namespace = mw.config.get( 'wgCanonicalNamespace' );  //As suggested by [[User:DannyS712]]
if ( namespace === 'User' || namespace === 'User_talk' ) { 
$.when( mw.loader.using( ['mediawiki.util'] ), $.ready ).done( function() {
  mw.util.addPortletLink(
    'p-tb',
    mw.util.getUrl( 'Special:AbuseLog' ) + '?wpSearchUser=' + mw.config.get( 'wgRelevantUserName' ),
    'Abuse Logs',
    'pt-abuselogs',
    'Instances this user triggered an edit-filter',
    null,
    '#pt-preferences'
  );
});
}

//[[Category:Wikipedia scripts]]