I've found various problems / bugs in the foxypal javascript file. I've also attached a patch that fixes all these problems.

1. Foxypal does not use Drupal Behaviors (see https://drupal.org/node/756722). This will render foxypal incompatible with content rendered via ajax. This has been fixed in the attached patch.

2. Utility functions are in gobal scope. This could cause conflicts with other javascript libraries using functions with the same name. The patch moves all utility functions into a properly namespaced location.

3. A JavaScript closure was not used to define `$`, causing `$` to be undefined in some situations.

4. Missing semicolons, causing javascript minification to break.

5. This ins't a bug, but I was a bit confused by the error I was getting when using an outdated version of jQuery, so I also added an explicit check for the correct jQuery version and throw an alert it is not compatible.

CommentFileSizeAuthor
fixJavascript.patch8.46 KBphayes
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kilogauss’s picture

Assigned: Unassigned » kilogauss

Thanks for submitting this! I'll dig into it this weekend and get a new build created.

phayes’s picture

Great thanks. Let me know if you have any questions.

  • Commit 973dabf on master by kilogauss:
    Fixed #2205145 by phayes: Fix and improve some javascript issues
    
kilogauss’s picture

Status: Needs review » Closed (fixed)