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