Jump to content

User:Harsh4101991/common.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
No edit summary
Line 13: Line 13:
// alert(data.query.users[0].editcount);
// alert(data.query.users[0].editcount);
})
})
var link = mw.util.addPortletLink(
'p-tb',
'#',
'Edit Count',
't-prettylinkwidget',
'Show Edit Count of User',
null,
'#t-whatlinkshere'
);
$(link).click( function( e ) {
// Avoid the browser going to '#'
e.preventDefault();
//Adding Dialog
mw.loader.using( 'jquery.ui.dialog', function () {
$dialog = $('<div></div>')
.html('Your Edit Count is : '+ x)
.dialog({
autoOpen: true,
title: 'Thanks For Your Contribution',
width: '70%',
modal: true,
});
});
//END
});
})
})



Revision as of 03:22, 15 March 2015

mw.loader.using('mediawiki.api', function(){
	var api = new mw.Api();
	///w/api.php?action=query&list=users&format=json&usprop=editcount&ususers=Harsh4101991
	api.get({
		action:'query',
		list: 'users',
		format:'json',
		usprop:'editcount',
		ususers:'Harsh4101991'
	})
	.done(function(data){
		console.log(data);
		// alert(data.query.users[0].editcount);
	})
	
	var link = mw.util.addPortletLink(
		'p-tb',
		'#',
		'Edit Count',
		't-prettylinkwidget',
		'Show Edit Count of User',
		null,
		'#t-whatlinkshere'
	);
 
	$(link).click( function( e ) {
		// Avoid the browser going to '#'
		e.preventDefault();
		//Adding Dialog
		mw.loader.using( 'jquery.ui.dialog', function () {
  			$dialog = $('<div></div>')
			.html('Your Edit Count is : '+ x)
			.dialog({
				autoOpen: true,
				title: 'Thanks For Your Contribution',
				width: '70%',
				modal: true,
			});
		});
		//END
	});
})

//importScript('User:Harsh4101991/EditCount.js');
/*
var link = mw.util.addPortletLink(
			'p-tb',
			'#',
			'Language Support',
			't-prettylinkwidget',
			'Show Edit Count of User',
			null,
			'#t-whatlinkshere'
		);
*/