MediaWiki:Gadget-imageForeignUseCheck.js

if (wgNamespaceNumber == 6) {

$('#filetoc').append('List Foreign Uses'); $('.foreignLink').click(function{

$('#mw-imagepage-section-linkstoimage').append('');

var $interUses = $('.interUses');

var langs = { 'Russian':'-ru', 'French': '-fr', 'Polish': '-pl', 'Portuguese': '-pt', 'Korean': '-ko', 'Chinese': '-zhtw' }

var requestl = { action:'query', list:'imageusage', iutitle:wgPageName };

$.each(langs, function(key, value) {			var currentLangCode = value;			$.getJSON('http://terraria' + currentLangCode + '.gamepedia.com/api.php?format=json&callback=?', requestl, function(response1) { var currentLangName = key; if (response1.query.imageusage.length > 0) { $interUses.append(' ' + currentLangName + ' '); }				$.each(response1.query.imageusage, function(index, value) {					$interUses.append('' + value.title + '');				}); });		});		setTimeout(function{$interUses[0].scrollIntoView(true)}, 1000); }); }