User:Alexav8/editcountutil.js

/* Doesn't work in IE; window.onclick doesn't fire for right clicks.

topaz.editcountutil = new Object;

/* configuration */ // this should be a cgi script to go to instead when User: or User_talk: links are double-clicked. the username will be appended, so that variable should be last in the query string. topaz.editcountutil.toolurl = "http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user="; /* end configuration */

topaz.editcountutil.oldonclick = document.onclick; document.onclick = function(e) { if (typeof topaz.editcountutil.oldonclick == "function") topaz.editcountutil.oldonclick; var b = e ? topaz.util.mousebtnmap.ns[e.which] : topaz.util.mousebtnmap.ie[event.button]; if (b != 2) return; var realtarg = e ? e.target : event.srcElement; var username; if (realtarg.nodeName.toLowerCase != "a") realtarg = realtarg.parentNode; if (realtarg.nodeName.toLowerCase == "a") { var a = realtarg.href.split("/wiki/User:"); if (!a[1]) {a = realtarg.href.split("/wiki/User_talk:");} if (a[1]) { var b = a[1].split("/"); username = b[0]; }  }  if (username) { location.href = topaz.editcountutil.toolurl + username; return false; } };