Ticket #1213 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Would be nice to protect unsaved changes from accidental loss when navigating away

Reported by: douglas Owned by: douglas
Priority: normal Milestone: 0.96
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc:

Description

Our users (mostly non-technical) seem to have a fairly high right of losing posts because of accidentally closing their browser or navigating away form the page, so I developed a plugin that checks if the contents of the editor have changed, and if so, warns the user before the page is unloaded.

This has been tested working in IE 5.5 -> 7, Firefox 2 and 3beta5. Safari doesn't support the unload hooks necessary for this plugin to work there.

The attached plugin works as far back as 0.92beta...

Attachments

UnsavedChanges.diff (3.3 kB) - added by douglas 4 years ago.
Unsaved changes plugin

Change History

Changed 4 years ago by douglas

Unsaved changes plugin

Changed 4 years ago by douglas

Gah.. I'm sorry, this does NOT work in 0.92beta, since 0.92beta does not support the onBeforeSubmit hook... I'm investigating this now...

Changed 4 years ago by douglas

Okay, so since we're moving up to 0.95, our (temporary) solution has been to backport the onBeforeSubmit hook (one line of code located at source:/branches/0.95_stable/XinhaCore.js#L2280 )

Changed 4 years ago by douglas

  • owner changed from gogo to douglas
  • status changed from new to assigned

r1002 is a commit of the diff included here. This functionality is provided as a plugin so that users can choose whether or not to take advantage.

Changed 4 years ago by douglas

  • status changed from assigned to closed
  • resolution set to fixed

Changed 4 years ago by douglas

r1003 fixes the double commit of r1002

Note: See TracTickets for help on using tickets.