Some fixes for catalogue loading
[ReadingsJQM.git] / js / app / Config.js
1 // Generated by CoffeeScript 1.3.3
2 (function() {
3
4   Readings.Config = (function() {
5
6     function Config(opts) {
7       this.opts = opts;
8     }
9
10     Config.prototype.key = function(name) {
11       return "config." + name;
12     };
13
14     Config.prototype.get = function(name) {
15       var v;
16       v = localStorage.getItem(this.key(name));
17       if (v != null) {
18         return JSON.parse(v);
19       }
20       return this.opts[name];
21     };
22
23     Config.prototype.save = function(name, value) {
24       return localStorage.setItem(this.key(name), JSON.stringify(value));
25     };
26
27     return Config;
28
29   })();
30
31 }).call(this);