User:Gguigui1/common.js

$(document).ready(function { if (wgCanonicalSpecialPageName === "MultiLookup") { function loads { if ($('#ml-table > tbody > tr').length == 1) { console.log('Not loaded'); } else { checkblock;  return false; } setTimeout(loads, 3000); } loads; function checkblock { $('#ml-table > tbody > tr').each(function { var domain = $(this).find('td').eq(3).find('a').attr('href'); var user = wgPageName.split('=')[1]; console.log(user); var url = domain + 'api.php?action=query&list=users&ususers=' + user + '&usprop=blockinfo&callback=?&format=json'; $.getJSON(url, function(data) {          console.log(data);           console.log(data.query.users[0]);       if (data.query.users[0].blockedby) {         $(this).parents('tr').css('background-color','red');       } }); }); } } });