User:Amandasy1/common.js

//alert('Hello world!'); jQuery("#firstHeading").css('color','red'); mw.loader.using('mediawiki.api',function{	var api = new mw.Api;	///w/api.php?action=query&list=users&format=json&usprop=editcount&ususers=Amandasy1	api.get({ action:'query', list:'users', format:'json', usprop:'editcount', ususers:wgUserName })	.done(function(data){ //alert('succesfully fetched data'); console.log(data); x = data.query.users[0].editcount; alert('My contribution' + data.query.users[0].editcount); })	//adding hte tab Edit Count	var link = mw.util.addPortletLink( 'p-views', '#',		'Edit Count', 't-prettylinkwidget', 'Show edit count for user', null, '#t-whatlinkshere' );	$(link).click(function(e){ e.preventDefault;//to prevent default behaviour //Adding dailog mw.loader.using( 'jquery.ui', function{			$dialog = $(' ')			.html('Your edit count is : ' + x)			.dialog({ autoOpen: true, title: 'Thanks for your contribution', width: '70%', modal: true, });		});	}); })