1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-15 07:22:35 +01:00
Radarr/UI/Config.js

40 lines
964 B
JavaScript
Raw Normal View History

2013-06-22 08:24:24 +02:00
'use strict';
2013-06-21 03:43:58 +02:00
define(
[
'app'
], function (App) {
return {
2013-06-21 03:43:58 +02:00
Events: {
ConfigUpdatedEvent: 'ConfigUpdatedEvent'
},
Keys : {
DefaultQualityProfileId: 'DefaultQualityProfileId'
},
GetValue: function (key, defaultValue) {
var storeValue = localStorage.getItem(key);
if (!storeValue) {
return defaultValue;
}
return storeValue.toString();
},
SetValue: function (key, value) {
console.log('Config: [{0}] => [{1}] '.format(key, value));
if (this.GetValue(key) === value.toString()) {
return;
}
localStorage.setItem(key, value);
App.vent.trigger(this.Events.ConfigUpdatedEvent, {key: key, value: value});
}
2013-06-21 03:43:58 +02:00
};
2013-06-21 03:43:58 +02:00
});