Extend autosave to use the browser's local storage in addition to saving to the server
|Reported by:||azaozz||Owned by:|
There are several types of local (DOM) storage in the modern browsers. Most suitable is the localStorage as it's persistent and supported in all browsers back to IE8.
The idea is to save the content in local storage every 10 seconds and push to the server every two minutes. When the server responds and there are no errors, we empty the local storage and start again. The local storage will also be emptied when the user saves the post. Then every time the user visits the admin we can check if the local storage is not empty and offer to recover from there or show a revision diff.