User:Kouhyar/common.js

mediaWiki.loader.using(['jquery.ui.dialog'], function {	// Add MediaWiki.org-link in the toolbox before the Print-link	var link = mw.util.addPortletLink('p-tb', '//www.mediawiki.org/',	'Open dialog', 't-mworg',	'Open a sample dialog',	'm', '#t-print')	var dt = { action:'query', list:'recentchanges', rclimit: 10, format:'json' };	$(link).click(function(event) { event.preventDefault; //$(' ').text('Hello world!').dialog; var jqxhr = $.getJSON('/w/api.php', dt, function(data) {			$dialog = $(' ').dialog;			$.each(data.query.recentchanges, function(i, item) { $(' ').text(item.title).appendTo($dialog); });			//$(' ').text(JSON.stringify(data)).dialog;		}) });	});