Skip to content

v0.4

Latest
Compare
Choose a tag to compare
@ccosse ccosse released this 16 Feb 05:34
· 58 commits to master since this release

Save and reload state: two new buttons at bottom of modepalette, "Save State" and "Reload State". Both save and reload functions are located towards top of colormyworld.js. The original structures contained (and still do) non-serializable objects, so they could not be serialized. Instead, we create a serializable object and use existing functionality to set the region, language, background and mode, then loop over all the features and apply two attributes, 1) whether the feature remains a candidate (if tour or interactive has already used it then candidate=false 2) apply saved style attributes (stroke color and width, fill color) to all features. After loading the saved structure is cleared.

At this point "Save State" only saves in memory, and "Reload State" loads the in-memory object. The state is JSON.stringified.