The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Fix vBulletin JS to work with prototype/scriptaculous Details »» | |||||||||||||||||||||||||||
Fix vBulletin JS to work with prototype/scriptaculous
Developer Last Online: Dec 2011
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 Show Your Support
|
Comments |
#12
|
|||
|
|||
Mootools uses prototype =)
Thank you so much for this. You might consider releasing some diff patches instead? Perhaps with a patcher application. Using a patcher app you could make it so anyone can patch their clientscripts just by downloading them, run the patch, upload them. All fixed =) |
#13
|
|||
|
|||
Can FIND/REPLACE instructions or a PHP version (if that's possible) please be made? Not everyone has command line access.
I would really like to add some nice effects to my boards, but now I'm currently limited to what pages I can use the Mootools JS on. |
#14
|
|||
|
|||
I'm really stuck on this too, could you explain a little about what the script does pleaseand I'll do it manually?
Thankyou |
#15
|
|||
|
|||
Hi, i'd really like to be able to use this, but i do not know how to run the script via perl shell. Please provide a php version of this?
|
#16
|
||||
|
||||
For in is not the only incompatibility between vb and prototype, just the most noticeable. I'm about 1/3 of the way through the only truly workable approach to this problem - replacing the stock javascript entirely, and with it most of the vb templates that are laced to the gills with javascript calls.
For in also appears in a couple of templates - which this will not correct. (I don't remember which ones off hand but remember seeing them). |
#17
|
|||
|
|||
We ran this patch in an attempt to fix an issue with using Script.aculo.us (and Prototype). This fixed an issue with bad entries in Fonts and Sizes dropdown which occurred in FireFox.
But we still have an issue with problems switching to Standard Editor and problems Cancelling and Saving in QuickEdit... Problem only seems to occur in IE (both 6 and 7). FireFox appears to be working fine now. Any idea why FireFox 2 would be working but IE6 and IE7 is not working? |
#18
|
|||
|
|||
Has anyone managed to get this working on 3.7, as neither script seems to work on it
|
#19
|
|||
|
|||
Doesn't seem to work... I'd be willing to pay if somebody could find a solution.
|
#20
|
|||
|
|||
the only ajax api compatible to the rest is jQuery... i testet it on vb 3.7.0... it works and doesn't ++++ up the vbulletin scripts using YUI. the problematic issue here is namespaces and jquery got its own. the rest is using the same and this is whats killing your scripts.
use jQuery and your stuff runs fine... |
#21
|
|||
|
|||
3.7 they changed and made this edit I see you guys doing if I am mistaken let me know. But there is still issue with IE6 and IE7. Please I need this fixes asap as a portion of my mod requires prototype.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|