There are currently two problems:
• When the back-button or navigation is used, the article keeps locked while the user left the page.
• When the article is edited and the user clicks another item in the navigation, the changes are lost.
• The script needs to monitor if changed have been made to the form.
• When a user tries to leave the page with a href link on the page outside of the form:
Are you sure you want to leave this page?”
• To leave the page the href action must be canceled, the href URL must be added to the form in a hidden form field named “returnurl” and the cancel button must be fired. This releases the lock and after that the user will be redirected.
• When a user tries to leave the page with the back button we want the same behavior as the href link, if possible (without setting return URL is also OK if that’s not available). Otherwise please disable the back button completely.
• When a user tries to leave the page by typing another URL AND the form had changes please add a browser beforeunload window: “You have unsaved changes. When you leave this page your changes will be lost.
Are you sure you want to leave this page?” (http://stackoverflow.com/questions/1102618/how-to-prevent-the-user-to-change-page-with-jquery). I think it’s not possible to release the lock in this case.