Jump to content

User:MJL/UserAbuseLogs.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.
// 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]]