{I" class:ETI"ProcessedAsset;FI"logical_path;TI"type_station/lib/models.js;FI" pathname;TI"e/Users/richardadams/github/type_station/app/assets/javascripts/type_station/lib/models.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+³ùÔTI" length;Ti¶I" digest;TI"%816423f1d0cb24920356d08931d27b72;FI" source;TI"¶(function() { var __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, __hasProp = {}.hasOwnProperty; window.TS.Store = (function() { function Store(_at_id) { this.id = _at_id != null ? _at_id : null; this.STORE = {}; } Store.prototype.get = function(key) { return this.STORE[key]; }; Store.prototype.set = function(key, value) { return this.STORE[key] = value; }; Store.prototype.each = function(callback) { var key, value, _ref, _results; _ref = this.STORE; _results = []; for (key in _ref) { value = _ref[key]; _results.push(typeof callback === "function" ? callback(key, value) : void 0); } return _results; }; return Store; })(); window.TS.Model = (function(_super) { __extends(Model, _super); function Model(_at_id) { this.id = _at_id != null ? _at_id : null; Model.__super__.constructor.apply(this, arguments); this.DIRTY = {}; } Model.prototype.set = function(key, value) { Model.__super__.set.call(this, key, value); return this.DIRTY[key] = 1; }; Model.prototype.changedKeys = function() { return Object.keys(this.DIRTY); }; Model.prototype.isChanged = function() { return this.changedKeys().length > 0; }; Model.prototype.save = function(callback) { var data, key, self, value, _ref; if (callback == null) { callback = function() {}; } self = this; data = []; _ref = this.STORE; for (key in _ref) { value = _ref[key]; data.push(value); } return $.ajax({ type: "PATCH", url: self.id, dataType: 'json', contentType: 'application/json', data: JSON.stringify({ contents: data }), success: function(data) { return callback(data); } }); }; return Model; })(window.TS.Store); }).call(this); ;TI"dependency_digest;TI"%33d71dde49aa8ef165666ebd8e9e65f2;FI"required_paths;T[I"e/Users/richardadams/github/type_station/app/assets/javascripts/type_station/lib/models.js.coffee;FI"dependency_paths;T[{I" path;TI"e/Users/richardadams/github/type_station/app/assets/javascripts/type_station/lib/models.js.coffee;FI" mtime;TI"2015-02-06T17:28:19+00:00;TI" digest;TI"%7ac214a0a22c9f7615a775e09cb1e79d;FI" _version;TI"%64e62ddc273c2f5847f30d698ca14b67;F