User:Nerfmaster8/global1.js

/*Add hovers to mods/bots in chat when hovering their name/icon to tell the user what they mean*/

// Bot $('.bot').attr('title','This user is a bot');

// Get list of current admins then label chat mod/admins accordingly var adminList = [];

$.ajax({   url: mw.util.wikiScript('api'),    data: {      format: 'json',      action: 'query',      list: 'allusers',      augroup: 'sysop',      aulimit: 500    },    dataType: 'json',    type: 'POST',    success: function(d) {      var allusers = d.query.allusers;      for (var i in allusers) {        adminList.push(allusers[i].name);      }      // Chat moderators and admins      $('.modday,.modnight').each(function { if (adminList.indexOf($(this).text)!= -1) { $(this).attr('title','This user is an administrator'); }       else { $(this).attr('title','This user is a chat moderator'); }     });    },	error: function {      console.log('Failed to get admin list!');    } });