#24145 closed enhancement (duplicate)
Confirm page close when writing on WordPress.org forums
Reported by: | Daedalon | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | WordPress.org Site | Keywords: | |
Focuses: | Cc: |
Description
When writing on WordPress.org forums, sometimes long and well thought-out replies are lost due to accidental page closing. This causes countless amounts of work lost within the WordPress community.
There should be a confirmation dialog to prevent accidental page closing after user has entered something in the new post form.
Change History (6)
#4
@
12 years ago
Forgot one key thing from that JS, to not ask this confirmation on form submission:
$('input#postformsub').click( function(){ requireCloseConfirmation = false; });
Also, #postform input[type=checkbox] could be added to the monitored elements.
Note: See
TracTickets for help on using
tickets.
Here's a jQuery solution for confirming page close when any of the new post fields have been modified.
This is triggered only if any one of these text areas has been changed and it has lost focus at least once. In other words this protects from most accidental closings except when user has changed only one field without clicking outside it or otherwise moving focus away from it. This should catch the vast majority of cases.
A timer-based script could cover even those that this does not. It would check every XX seconds if any of the fields are non-empty, and if, sets requireCloseConfirmation = true and terminates itself.