|
Fix vBulletin JS to work with prototype/scriptaculous
This modification is in the archives.
There is a problem with some of the for loops in vBulletin's javascript (or it's a problem with prototype.js, depends who you talk to
) The problem is vB's use of the for/in loop: for (var i in array_var) { } When you alter the array prototype, those new values show up as i. For example: Code:
Array.prototype.wtf = function() { }
var s = new Array("1", "2", "3");
for (var i in s) {
alert(i);
}
The solution is to add a little line of code in each of these loops to test the typeof on array_var[i] and see if it == 'function'. If so, continue. I wrote a perl script that will scan all the js files in your client script directory and insert this check. Unzip the attached zip file and there is a perl script inside. Upload the script to your server and edit the line at the top that read: Code:
my $dir = "CHANGEME" Hopefully some will find this helpfull ![]() Download
This modification is archived, downloads are still allowed. |
|||||||||
Similar Mods
| Board Optimization Scriptaculous Effects for vBulletin with User Dialogs | Modification Graveyard |