fnp
/
ReadingsJQM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ported to Web SQL
[ReadingsJQM.git]
/
js
/
app
/
Config.js
diff --git
a/js/app/Config.js
b/js/app/Config.js
index
87a99b7
..
19df0d1
100644
(file)
--- a/
js/app/Config.js
+++ b/
js/app/Config.js
@@
-1,3
+1,4
@@
+// Generated by CoffeeScript 1.3.3
(function() {
Readings.Config = (function() {
(function() {
Readings.Config = (function() {
@@
-6,10
+7,23
@@
this.opts = opts;
}
this.opts = opts;
}
+ Config.prototype.key = function(name) {
+ return "config." + name;
+ };
+
Config.prototype.get = function(name) {
Config.prototype.get = function(name) {
+ var v;
+ v = localStorage.getItem(this.key(name));
+ if (v != null) {
+ return JSON.parse(v);
+ }
return this.opts[name];
};
return this.opts[name];
};
+ Config.prototype.save = function(name, value) {
+ return localStorage.setItem(this.key(name), JSON.stringify(value));
+ };
+
return Config;
})();
return Config;
})();