Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding optional parameters to ouibounce.disable() #20

Merged
merged 3 commits into from
May 13, 2014
Merged

Adding optional parameters to ouibounce.disable() #20

merged 3 commits into from
May 13, 2014

Conversation

mcg88
Copy link
Contributor

@mcg88 mcg88 commented Apr 29, 2014

Added 2 optional parameters to the .disable() function which allow:

  • To change the scope of the cookie between site wide or only the current page.
  • To modify the cookie expiration length. (This would allow a user to use the disable function in different contexts. ie successful form submision and modal exit would have different expiration lengths etc.

Added in a demo for the less aggressive behavior and modified readme.md to include the two parameters along with example code.

mcg88 added 3 commits April 28, 2014 22:55
This file sets a custom cookie on modal exit that has a shorter lifetime than the default cookie. The reverse could also be used where a short default cookie is set and when the disable function is called after successful form submit, it would drop a longer dated cookie.
add example of optional parameters for disable function
@jescalan
Copy link
Contributor

Hey @mcgwebdesign - this looks fantastic, nice work! Is there any chance you would take a crack at writing a test for this? https://github.com/carlsednaoui/ouibounce/blob/master/test/test.js

@mcg88
Copy link
Contributor Author

mcg88 commented Apr 29, 2014

Thanks @Jenius! I will give it a shot.

@carlsednaoui
Copy link
Owner

@Jenius, tried to clarify that gnarly ternary logic. Thoughts? 2ff8c3d

@carlsednaoui
Copy link
Owner

@mcgwebdesign, let us know if you'll be writing tests for this 😃

@mcg88
Copy link
Contributor Author

mcg88 commented May 3, 2014

@carlsednaoui I have no experience writing tests, but I will attempt today/tomorrow and let you know :)

thanks!

@carlsednaoui carlsednaoui merged commit 5e48cf9 into carlsednaoui:master May 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants