This PR allows for auto saving the editor whilst a user is working on it. The way this works is that there is an interval set for every minute that compares the saved JSON to the page's current JSON, if different than it saves the current JSON into local storage. If editor is still not saved after the user refreshes the client, then the client will pop up with a modal asking if the user would like to overwrite their changes, to which they can either confirm or deny. Additionally, this PR implements a "Last saved Xm ago" text in the file toolbar after the user saves, indicating to the user that it has been X amount of time since they have saved the module.
The reasons for this PR being a WIP are:
1.) Testing was not complete
2.) A browser alert still pops up even after confirming to overwrite changes that indicates "changes may not be saved". This code lies within the checIfSaved function that would need a conditional to fix it.
All of the code written for this branch are in the visual-editor.js, editor-app.js, and their corresponding test files.
This PR allows for auto saving the editor whilst a user is working on it. The way this works is that there is an interval set for every minute that compares the saved JSON to the page's current JSON, if different than it saves the current JSON into local storage. If editor is still not saved after the user refreshes the client, then the client will pop up with a modal asking if the user would like to overwrite their changes, to which they can either confirm or deny. Additionally, this PR implements a "Last saved Xm ago" text in the file toolbar after the user saves, indicating to the user that it has been X amount of time since they have saved the module. The reasons for this PR being a WIP are: 1.) Testing was not complete 2.) A browser alert still pops up even after confirming to overwrite changes that indicates "changes may not be saved". This code lies within the
checIfSaved
function that would need a conditional to fix it.All of the code written for this branch are in the
visual-editor.js
,editor-app.js
, and their corresponding test files.