npm jquery.dirtyforms 2.0.0-beta00003

latest releases: 2.0.0, 2.0.0-beta00008, 2.0.0-beta00006...
8 years ago

Dirty Forms 2.0 BETA is Here!

What's New

  1. Advanced state management - if a user undoes their edits to a form, it is considered clean.
  2. New dirty.dirtyforms and clean.dirtyforms events to enable/disable the submit button when the form is dirty or clean.
  3. The default dialog has been changed to be the browser dialog, not Facebox. The default dialog configuration was so confusing it caused some people to write their own plugin (hope it was worth it!).
  4. Simpler dialog configuration - just implementing the dialog.open method is all that is required and events can be bound using a jQuery selector.
  5. New pre-fabricated dialog packages for BlockUI, Bootstrap Modal, Facebox, jQuery UI, and PNotify (complete with legacy support for Dirty Forms version < 2.0).
  6. More consistent (and shorter) method and event names.
  7. Customizable event binding (useful for working with IFrames).
  8. Better documentation and examples.

Breaking Changes

If upgrading from previous versions of Dirty Forms, there are several breaking changes to be mindful of.

  1. $.DirtyForms.onFormCheck() has been removed. Use the dirty.dirtyforms and clean.dirtyforms events for similar functionality.
  2. Facebox is no longer the default dialog. But if you need it, you can install the Facebox dialog module (a separate plugin).
  3. Support for the deprecated helper.isNodeDirty() has been removed.
  4. Support for the deprecated .setDirty(), .isDirty(), and .cleanDirty() jQuery methods has been removed.
  5. Automatic binding for top IFrames has been removed. This covered only 1 use case of many desired ways to configure IFrame support including event binding and target IFrame for refiring the event. You can now customize the event binding to get the desired result.
  6. Support for the deprecated $.DirtyForms.disable() function has been removed. Use $('html').addClass($.DirtyForms.ignoreClass) instead.
  7. The state behavior has been changed to store the initial state of each form input and to use this value to determine whether the input is dirty or clean. Editing an input back to its original state will automatically revert back to a clean state.
  8. The .dirtyForms('setDirty') method has been removed. This method doesn't fit with the new state management model. Use the helper.isDirty() method to provide dirty/clean status to Dirty Forms instead.
  9. The default setting for $.DirtyForms.ignoreClass has been changed from ignoredirty to dirtyignore for consistency with the other classes.
  10. The $.DirtyForms.isDirty() method has been removed. Use $('selector').dirtyForms('isDirty') instead.
  11. The beforeRefire.dirtyforms event has been removed (duplicate functionality). Use the proceed.dirtyforms event instead.
  12. The choicecommit.dirtyforms and choicecommitAfter.dirtyforms events have been removed. You can get similar behavior of choicecommit.dirtyforms by binding both the proceed.dirtyforms and stay.dirtyforms events. Also, you can get the same behavior of choiceCommitAfter.dirtyforms event by binding to the afterstay.dirtyforms event.
  13. The decidingcontinued.dirtyforms event has been renamed to proceed.dirtyforms.
  14. The decidingcancelled.dirtyforms event has been renamed to stay.dirtyforms.
  15. The decidingcancelledAfter.dirtyforms event has been renamed to afterstay.dirtyforms.
  16. The $.DirtyForms.title property has been moved to be an optional part of each dialog module rather than a part of the core module. It can be set at $.DirtyForms.dialog.title = 'The title' or .dirtyForms({ dialog: { title: 'The title' } }).
  17. The public method $.DirtyForms.isDeciding() has been removed. It is now safe to call choice.commit(event) (within the dialog.open() method) multiple times, so accessing it publicly is no longer necessary.
  18. The public method $.DirtyForms.decidingContinue() has been removed. You can either use the choice.proceedSelector to bind click events automatically, or set choice.proceed = true followed by a call to choice.commit(event) within the dialog.open() method.
  19. The public method $.DirtyForms.decidingCancel() has been removed. You can either use the choice.staySelector to bind click events automatically, or call choice.commit(event) (with choice.proceed set to the default of false).
  20. The public method $.DirtyForms.choiceCommit() and $.DirtyForms.choiceContinue property have been removed. Use choice.commit(event) and choice.proceed within the dialog.open() method instead.
  21. The dialog.fire(message, title) method has been renamed and signature changed to dialog.open(choice, message, ignoreClass). Now it is possible to use custom dialogs without any calls to the public $.DirtyForms object.
  22. Support for dialog.bind() has been removed. Bind dialog events in the dialog.open() method after the dialog has been added to the DOM instead. Note that you can now optionally use jQuery selectors for binding click events.
  23. The dialog.refire(content, event) method has been renamed and signature changed to dialog.unstash(stash, event). The stash is now a user-defined variable that can be any JavaScript type including jQuery object or JavaScript object.
  24. The dialog.selector property has been renamed to dialog.stashSelector to indicate that it is related to stashing. This should still be the selector of a form or parent container of a form that is hosted inside of another dialog.

Don't miss a new jquery.dirtyforms release

NewReleases is sending notifications on new releases.