Page 1 of 1

Buggy user-specific behavior in AniDB js code

Posted: Thu May 25, 2006 3:20 am
by windmage
There seems to be a bug in the following javascript code:

http://www.anidb.net/js/anidbscript.js

specifically in lines 41-51:

isWindy = false;
spanlist = document.getElementsByTagName('span');
for (var i = 0; i < spanlist.length; i++)
{ if (spanlist[i].className == "user" && spanlist[i].firstChild.nodeValue.indexOf("windmage") != -1) isWindy = true; }
for (var i = 0; i < linklist.length; i++)
{
var relstring = linklist[i].getAttribute("rel") || "";
if (isWindy)
{
linklist[i].onclick = Confirm;
}

The bug causes an annoying confirmation box to appear whenever any link on anidb is clicked. Oddly it only affects certain users.

Posted: Thu May 25, 2006 3:55 am
by dark
this is amusingly horrible. I guess the real question, Windmage, is which mod hates you ;p

Posted: Thu May 25, 2006 8:22 am
by Rar
It's a feature! That he asked for! ...well, kinda. I figured I'd go the whole way and watch out for *all* his accidental clicks, as a free added bonus. :D
Anyway, I knew I'd have completely forgotten I'd done this by the time windy realised, he uses a JS browser so seldom. I'm sure he'll make sure he uses it much more now, for this special feature.

Rar

Posted: Thu May 25, 2006 12:36 pm
by fahrenheit
lol, service with a smile :P