drastik/civicrm_stripe — pull request #61 by Swingline0 (2014-10-02 14:43:43+00:00)
Title: Revised JS logic

Lets take time to make sure this change works for all use cases.

This PR addresses several things:

1. #60 - Form was not submitting due to non-specific selector
2. Assign `stripe-payment-form` class when building form in `stripe.php` rather than trying to target on document ready
3. More caching of jQuery selectors for readability and performance
4. Clear `onbeforeunload` which was triggering 'Are you sure you want to leave this page' dialog when form submits
5. Remove `onclick` from submit button -- this was also proposed in #54.
By default, Civi adds the following to the submit button: `onclick="return submitOnce(this,'Main','Processing');"`
This was cause the form to submit before the `$.submit()` function could suppress it. Thus the stripeToken was created and the form would submit to Civi. This PR clears this attribute but recreates its functionality by disabling the button and changing its text where appropriate.

Thoughts?