User:Mvolz/displayContributions

displayContributions is a user script by User:Mvolz that displays your edit count in the top toolbar next to the "Contributions" link.

This is what the top bar will look like after installation

Installation

edit

On English Wikipedia

edit

Add the following code to Special:MyPage/common.js or Special:MyPage/skin.js:

importScript("User:Mvolz/displayContributions.js");

Install globally on all wikis

edit

Add the following code to meta:Special:MyPage/global.js:

/* Show my contributions */

$(document).ready( function () { 
	mw.loader.using( 'mediawiki.user', function() {
	    ( new mw.Api() ).get( {
	        action: 'query',
	        meta: 'userinfo',
	        uiprop: 'editcount'
	    } ).done( function( result ) {
	    	var contribs = document.getElementById( 'pt-mycontris' )
	    	if ( contribs) contribs.append( ' (' + result.query.userinfo.editcount + ')' );
	    } );
	} );
} );

(importScript doesn't seem to be working properly on global.js for some reason!)

Source code

edit

The source code is available at User:Mvolz/displayContributions.js.

Any questions?

edit

If you have any questions, please leave a message on my talk page.