User:Shahadat/UserAbuseLogs.js

From Justapedia, unleashing the power of collective wisdom
Jump to navigation Jump to search
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 Justapedia:Bypass your cache.
// UserAbuseLogs

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:Justapedia scripts]]