X-Git-Url: https://git.mdrn.pl/ReadingsJQM.git/blobdiff_plain/b2dcc4cec0edb145ed13c26537c94b593691954f..45f8b33043d9aad64b1f89906323bc477efda0f3:/js/app/Config.coffee diff --git a/js/app/Config.coffee b/js/app/Config.coffee index 00df4a1..0aa420e 100644 --- a/js/app/Config.coffee +++ b/js/app/Config.coffee @@ -2,5 +2,14 @@ class Readings.Config constructor: (@opts) -> + key: (name) -> + "config.#{name}" + get: (name) -> + v = localStorage.getItem @key(name) + if v? + return JSON.parse(v) @opts[name] + + save: (name, value) -> + localStorage.setItem @key(name), JSON.stringify(value) \ No newline at end of file