simsalabim/sisyphus — pull request #16 by biosflasher (2012-01-29 12:03:24+00:00)
Title: Added "autoRelease" option and manual release method. Fixes Issue #12

Here is an example use case with client side validation and ajax submitting data providing a "soft fail" if user has lost Internet connection (useful for e.g. mobile applications).

1) Validate form. Here using jquery.validation plugin
2) Ajax submit form.
3) Release local storage data if 1 & 2 successful.

Code example:

```javascript
self.sisyphus = $('form').sisyphus({autoRelease: false});

// Using jquery.validation plugin
$('form').validate({submitHandler: function(form)
{
var jqxhr = $.post(window.location.href, $(form).serialize());

jqxhr.success(function(data)
{
// Successfully submitted data, release local storage
self.sisyphus.manuallyReleaseData();
console.log('Successfully submitted');
});
jqxhr.error(function(data)
{
// Failed to submit, keep local storage
console.log('Failed to submit');
});
}});
```