You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Radarr/UI/Config.js

43 lines
1007 B

'use strict';
11 years ago
define(
[
'app'
], function () {
11 years ago
NzbDrone.Config = {
Events: {
ConfigUpdatedEvent: 'ConfigUpdatedEvent'
},
Keys : {
DefaultQualityProfileId: 'DefaultQualityProfileId'
}
};
11 years ago
NzbDrone.Config.GetValue = function (key, defaultValue) {
11 years ago
var storeValue = localStorage.getItem(key);
11 years ago
if (!storeValue) {
return defaultValue;
}
11 years ago
return storeValue.toString();
};
11 years ago
NzbDrone.Config.SetValue = function (key, value) {
11 years ago
console.log('Config: [{0}] => [{1}] '.format(key, value));
11 years ago
if (NzbDrone.Config.GetValue(key) === value.toString()) {
return;
}
11 years ago
localStorage.setItem(key, value);
NzbDrone.vent.trigger(NzbDrone.Config.Events.ConfigUpdatedEvent, {key: key, value: value});
11 years ago
};
11 years ago
return NzbDrone.Config;
});