shawnlawson / The_Force

webGL live coding performance IDE
https://shawnlawson.github.io/The_Force/
MIT License
276 stars 53 forks source link

Prevent data loss on site reload #1

Closed diiigle closed 8 years ago

diiigle commented 8 years ago

I had the joy of loosing my whole code due to my browsers reaction on the backspace button (back in history) twice today.

Thus i made a little fix that stores the editors content on each successful build in javascripts localStorage if availiable. If the site is reloaded, it tries to load the previous code instead of the 'dummy' main.

Hope you accept it, to prevent such behaviour in the future.

shawnlawson commented 8 years ago

OH, this just happened to me last week.

That's brilliant, I'll merge it in, thanks!