Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1213 closed enhancement (fixed)

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:


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 (1)

UnsavedChanges.diff (3.3 KB) - added by douglas 9 years ago.
Unsaved changes plugin

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by douglas

Unsaved changes plugin

comment:1 Changed 9 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...

comment:2 Changed 9 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 )

comment:3 Changed 9 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.

comment:4 Changed 9 years ago by douglas

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:5 Changed 9 years ago by douglas

r1003 fixes the double commit of r1002

Note: See TracTickets for help on using tickets.