Clean up stage persistence API

This commit is contained in:
Shaunak Kishore
2015-10-01 01:20:40 -04:00
parent c9204d5f5b
commit 00ef0b3310
5 changed files with 32 additions and 28 deletions

View File

@ -2,10 +2,11 @@ if (this.stages !== undefined) throw new Error('Redifining stages global!');
this.stages = {};
stages.AbstractStage = class AbstractStage {
// Initialize this stage's internal state. The glyph may already include
// output from this stage. If the internal state can be initialized in such
// a way to achieve that output, it should be; doing so allows users to make
// some edits, switch to another glyph, and later resume where they left off.
// This method should fill in this stage's field in glyph.stages. The glyph
// may already have a value for this stage set. If so, this stage's internal
// state should be initialized in such a way to achieve that output, if that
// is possible; doing so allows users to make some edits, switch to another
// glyph, and then switch back and continue where they left off.
constructor(glyph) {
// Session variables the interface by which the stage interacts with UI:
// - type - String type of this stage.
@ -27,8 +28,8 @@ stages.AbstractStage = class AbstractStage {
this.colors = ['#0074D9', '#2ECC40', '#FFDC00', '#FF4136', '#7FDBFF',
'#001F3F', '#39CCCC', '#3D9970', '#01FF70', '#FF851B'];
}
// Update the stage's internal state and the editor.glyph Session variable
// based on the event.
// Update the stage's internal state and possibly update this stage's field
// in glyph.stages based on the event.
handleEvent(glyph, event, template) {
assert(false, 'handleEvent was not implemented!');
}