User:ReverieCode/common.js

// LookupUser fixes $(function {	if (mw.config.get('wgCanonicalSpecialPageName') !== 'LookupUser') return;	var prom = [];	$('div.lookup-user__table-wrapper > table > tbody > tr > td:nth-child(2) > a:first-child').each(function{ var baseUrl = $(this).text.trim; prom.push($.getJSON(baseUrl+'api.php?action=query&meta=siteinfo&sipropr=variables&format=json&callback=?')); });	Promise.allSettled(prom).then(function(res) { for (var i in res) { if (res[i].status !== 'rejected') continue; // just assume if we have an error the wiki is closed. // does not consider further in the event the wiki is *otherwise* unreachable, // possible exceptions: behind the VPN, some error state in the API, server error, etc.			$('div.lookup-user__table-wrapper > table > tbody > tr:eq('+i+') > td:nth-child(1)').wrapInner(' ').append(' Closed '); }	}); });