application/js/state.js in spontaneous-0.2.0.alpha2 vs application/js/state.js in spontaneous-0.2.0.alpha3

- old
+ new

@@ -32,10 +32,21 @@ active_slot: function() { return this.state.slot; }, toString: function() { return JSON.stringify(this.state); + }, + setFieldMetadata: function(field, key, value) { + var s = this.state; + s.fields = s.fields || {}; + s.fields[field.schema_id()] = s.fields[field.schema_id()] || {}; + s.fields[field.schema_id()][key] = value; + this.save(); + }, + getFieldMetadata: function(field, key) { + var s = this.state, f = (s.fields || {})[field.schema_id()] || {}; + return f[key] } }); var State = new JS.Singleton({ get: function(content) { var s = new ContentState(content); @@ -48,17 +59,17 @@ }, active_box: function(content) { var s = this.get(content); return s.active_box(); }, - activate_slot: function(content, slot) { - var s = this.get(content); - s.activate_slot(slot); - s.save(); - }, - active_slot: function(content) { - var s = this.get(content); - return s.active_slot(); - } + // activate_slot: function(content, slot) { + // var s = this.get(content); + // s.activate_slot(slot); + // s.save(); + // }, + // active_slot: function(content) { + // var s = this.get(content); + // return s.active_slot(); + // } }); return State; }(jQuery, Spontaneous));