User:Ajraddatz/common.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
// Stolen from the nuke on contribs gadget by Grunny and SVG.
if( wgCanonicalSpecialPageName === 'Contributions' ) {
$( contribLinks );
}
function contribLinks() {
var ug = wgUserGroups.join(' '),
ctype,
targ = $( 'input[name="target"]' ).val();
// poorman contribs type finder. -1 = existing user
try {
ctype = $( '#contentSub > a:first' ).attr( 'href' ).indexOf( 'User_talk' );
} catch(e) {
ctype = -1;
}
if( !targ ) {
return;
}
insertContentSubContribLink( '//meta.wikimedia.org/wiki/Special:Userrights/' + targ + '@' + wgDBname, 'user rights management' );
insertContentSubContribLink( '//meta.wikimedia.org/wiki/Special:CentralAuth?target=' + targ.replace( ' ', '+' ), 'CentralAuth' );
insertContentSubContribLink( '//meta.wikimedia.org/wiki/Special:CheckUser/' + targ.replace( ' ', '_' ), 'CheckUser' );
insertContentSubContribLink( '//meta.wikimedia.org/wiki/Special:GlobalBlock/' + targ.replace( ' ', '+' ), 'globally block' );
insertContentSubContribLink( '//tools.wmflabs.org/guc/?user=' + targ.replace( ' ', '+' ), 'lookup contribs' );
}
//jQuery version of Splarka's insertContentSubContribLink, by Grunny
function insertContentSubContribLink( link, text ) {
$( '#contentSub > a:last' ).after( ' | <a href="' + link + '" title="' + link + '">' + text + '</a>' );
}
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Glaisher/cuCAMultiLock.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Erwin/stewardlinks.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript');