2013-04-07 23:15:04 +00:00
|
|
|
"use strict";
|
|
|
|
define(['app'], function () {
|
|
|
|
|
|
|
|
NzbDrone.Config.GetValue = function (key, defaultValue) {
|
2013-04-10 03:17:41 +00:00
|
|
|
|
2013-05-24 05:58:49 +00:00
|
|
|
var storeValue = localStorage.getItem(key);
|
2013-04-10 03:17:41 +00:00
|
|
|
|
2013-05-24 05:58:49 +00:00
|
|
|
if (!storeValue) {
|
2013-04-07 23:15:04 +00:00
|
|
|
return defaultValue;
|
|
|
|
}
|
|
|
|
|
2013-05-24 05:58:49 +00:00
|
|
|
return storeValue;
|
2013-04-07 23:15:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
NzbDrone.Config.SetValue = function (key, value) {
|
2013-04-26 06:00:55 +00:00
|
|
|
console.log('Config: [{0}] => [{1}] '.format(key, value));
|
2013-05-24 05:58:49 +00:00
|
|
|
localStorage.setItem(key, value);
|
2013-04-07 23:15:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
});
|