enkimute / ganja.js

:triangular_ruler: Javascript Geometric Algebra Generator for Javascript, c++, c#, rust, python. (with operator overloading and algebraic literals) -
MIT License
1.52k stars 108 forks source link

Store backup of last 3 runs #125

Open tionkje opened 3 years ago

tionkje commented 3 years ago

Create a backup of the last 3 runs of each sample. So that at least everything is not lost on a crash.

Retrieve last backup by pasting this in the console

copy(JSON.parse(localStorage.ganjaBackup)[document.location.hash.slice(1)][0].data)
kungfooman commented 3 years ago

I like the idea, but to remember such a snippet or trying to find this PR again and again to do such a simple action is very user unfriendly.

Maybe integrate it into my stash tab? Or adding a simple function to window for something like copy(lastBackup())

tionkje commented 3 years ago

I completely agree. This was just a first step to already have the data. Since its 3 backups for each script i was thinking somewhere near the thumbnails? next to the delete button? Now that i think about it the delete button should also delete the backups.

I also think there should be something of a warning/reminder when opening a script and the last saved version is older than a backup. For that a timestamp will need to be saved on backups and on saves.