User:Shodai Tsuchi/chat.js

importScriptPage("ChatOptions/code.js", "dev"); importScriptPage("ChatNotifications/code.js", "dev"); var sfNotifications = {}; sfNotifications.options = { audio: 'http://images.wikia.com/monchbox/images/0/01/Beep-sound.ogg', caseInsensitive: true, highlight: true, highlightColor: 'red', notification: true, ping: true, pings: ["Shodai", "Tsuchi", "Kiddo", "Elias"], regex: false, window: false };

/* if (mw.config.get('wgPageName') == "Special:Log/chatconnect") { $('#WikiaArticle').prepend(' '); var details = [], IPs = [], names = [], dupeIPs = [], count = 0, summary; $('.mw-logline-chatconnect').each(function {   var IP = $(this).text.match(/((?:\d{1,3}\.){3}\d{1,3})/)[0], //IP    name = decodeURIComponent($(this).children('a.mw-userlink,a.new mw-userlink').attr('href').split(':')[1]), //Username    line = IP + ' ' + name,    ug = mw.config.get('wgUserGroups'),    connectUser = ' | connect';    if (document.URL.split('?user=').length == 1)      $(this).children('.mw-usertoollinks').find('a').last.after(connectUser);    if (ug.indexOf('vstf') + ug.indexOf('staff') + ug.indexOf('helper') == -3) {      var IPdetails = '(lookup | contribs | block16 | Check)'; $(this).append(IPdetails); }   if ($.inArray(line, details) == -1) { if ($.inArray(IP, IPs) == -1) { details.push(line); IPs.push(IP); }     else { if ($.inArray(name, names) == -1) { details.push(line + ' ALT ACCOUNT'); names.push(name); count++; }       if ($.inArray(IP, dupeIPs) == -1) { dupeIPs.push(IP); }         }          }  });  $('.mw-logline-chatconnect').each(function { var IP = $(this).text.match(/((?:\d{1,3}\.){3}\d{1,3})/)[0]; if (dupeIPs.indexOf(IP) != -1) $(this).css("border","solid red"); }); if (count === 0) {    summary = '0 alt accounts found!\n-\n';  }  else if (count == 1) {    summary = '1 alt account found!\n-\n' + dupeIPs.sort.join('\n').trim + '\n-\n' + names.sort.join('\n').trim  + '\n-\n';  }  else {    summary = count+' alt accounts found!\n-\n' + dupeIPs.sort.join('\n').trim + '\n-\n' + names.sort.join('\n').trim  + '\n-\n';  }  $('#output-box').val(summary + details.sort.join('\n').trim);  /* @todo make this work with a more recursive account output thingy  //Add duplicate account notice to output  $.each(dupeIPs, function(i) { $('#output-box').val.replace(dupeIPs[i],'ALT ACCOUNT: ' + dupeIPs[i]); }); */  if (count > 0)    document.title = '('+count+') ' + document.title;  if (document.URL.split('?').length == 1) {    setTimeout(function { location.reload(1); }, 60000); } } }) (this.jQuery, this.mediaWiki);
 * Advanced chatconnect log interface
 * @description Filter all unique IPs to users in chat in a textbox + IP lookup, contribs and block links; highlights and notifies of duplicates
 * @author Ozuzanna
 * (function($, mw) {