Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Fix vBulletin JS to work with prototype/scriptaculous Details »»
Fix vBulletin JS to work with prototype/scriptaculous
Version: 1.00, by YogiTW YogiTW is offline
Developer Last Online: Dec 2011 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.6.4 Rating:
Released: 02-11-2007 Last Update: 02-11-2007 Installs: 11
Code Changes  
No support by the author.

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);
}
you will get pop ups that say 1, 2, 3, and wtf.

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"
set this variable to be the ABSOLUTE path to your clientscript directory. It will create backup files.

Hopefully some will find this helpfull

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 05-22-2007, 10:06 AM
liquidx liquidx is offline
 
Join Date: Nov 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 =)
Reply With Quote
  #13  
Old 07-20-2007, 03:22 AM
TheMilkCarton TheMilkCarton is offline
 
Join Date: Jan 2007
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 10-16-2007, 12:50 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm really stuck on this too, could you explain a little about what the script does pleaseand I'll do it manually?

Thankyou
Reply With Quote
  #15  
Old 10-25-2007, 10:07 AM
Ventrixius Ventrixius is offline
 
Join Date: Jul 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #16  
Old 10-29-2007, 04:59 AM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #17  
Old 01-06-2008, 01:45 AM
rezilient rezilient is offline
 
Join Date: Mar 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #18  
Old 02-08-2008, 02:24 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone managed to get this working on 3.7, as neither script seems to work on it
Reply With Quote
  #19  
Old 02-09-2008, 10:17 PM
PyroNET PyroNET is offline
 
Join Date: Aug 2004
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't seem to work... I'd be willing to pay if somebody could find a solution.
Reply With Quote
  #20  
Old 05-01-2008, 08:02 PM
testes testes is offline
 
Join Date: Jun 2002
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #21  
Old 05-09-2008, 04:08 AM
AWJunkies AWJunkies is offline
 
Join Date: Jan 2005
Location: San Diego
Posts: 947
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:04 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05212 seconds
  • Memory Usage 2,297KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete