-
Notifications
You must be signed in to change notification settings - Fork 535
[Draft] Autorestore
I believe you could easily save the content with any key stroke to localstorage because it’s all in memory, no requests, reliable JS functions. Though we need a “smartContentChanged” Event for the semantic Annotation plugin as well. So you could listen to that once implemented. Meanwhile just use “keypress”. For further usage you should store some additional information like: timestamp, contentID, editableID, saved.
An AJAX call should be sufficient to save. An interval of 2min is enough in my opinion, because you can give an extra save button an ask to save when the user leaves the site. When saving in the background you of course should update the “saved” attribute in localstorage. We handle the blur Even and use a confirm message box to block the loading process and ask for saveing. GENTICS.Aloha.GCN.openURL.
That way you could the stored content when the browser crashes and the user comes back you could ask that you have a newer version of the content and if you should restore the lost work.