Skip to content

Conversation

@f3l1x
Copy link
Member

@f3l1x f3l1x commented Jan 9, 2026

Implements a proof of concept for warning users when leaving a page with unsaved form changes.

Features:

  • Vanilla JavaScript tracker with no dependencies
  • Automatic initialization via data attributes
  • Manual initialization with custom options
  • Nette Forms integration via UnsavedChangesControl helper
  • Works with Bootstrap renderers
  • Debug mode for development
  • Smart form submission handling

Added files:

  • assets/unsaved-changes.js - Core JavaScript tracker
  • src/Controls/UnsavedChangesControl.php - PHP helper for Nette Forms
  • examples/unsaved-changes-demo.html - HTML demo with multiple examples
  • examples/unsaved-changes-nette.php - Nette Forms integration example
  • UNSAVED_CHANGES_POC.md - Complete documentation

Resolves #2

Implements a proof of concept for warning users when leaving a page
with unsaved form changes.

Features:
- Vanilla JavaScript tracker with no dependencies
- Automatic initialization via data attributes
- Manual initialization with custom options
- Nette Forms integration via UnsavedChangesControl helper
- Works with Bootstrap renderers
- Debug mode for development
- Smart form submission handling

Added files:
- assets/unsaved-changes.js - Core JavaScript tracker
- src/Controls/UnsavedChangesControl.php - PHP helper for Nette Forms
- examples/unsaved-changes-demo.html - HTML demo with multiple examples
- examples/unsaved-changes-nette.php - Nette Forms integration example
- UNSAVED_CHANGES_POC.md - Complete documentation

Resolves #2
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.

JavaScript - show alert before leaving page

3 participants