juliandescottes/piskel — pull request #111 by grosbouddha (2013-06-17 21:24:31+00:00)
Title: User settings implementation

Add persistent user settings to store user preferences between browser reload or several piskel masterpieces.

Persistence is based on pskl.UserSettings class. It's a set of static methods to get or set preferences. The persistence is based on web localstorage for now. But we could easily modify/enhance to support cloud based persistence if needed.
The UserSettings #set method notify the application using a global event (eg: USER_SETTINGS_CHANGED) and each controller can react to impact user preferences on the UI.
For now, UserSettings is only storing the preferred canvas background and grid display. Goal was to make UserSettings trivial to extend, so feel free to add some more user configuration after this commit.