mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 16:13:58 -07:00
Removed some UI info from views. Added UI Config
This commit is contained in:
parent
7c1e81a70e
commit
5d7f6fb03b
16 changed files with 211 additions and 73 deletions
41
UI/Config.js
Normal file
41
UI/Config.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
"use strict";
|
||||
define(['app'], function () {
|
||||
|
||||
$.cookie.json = true;
|
||||
|
||||
NzbDrone.Config.SeriesView = function (value) {
|
||||
if (value) {
|
||||
NzbDrone.Config.SetValue('seriesView', value);
|
||||
}
|
||||
|
||||
else{
|
||||
return NzbDrone.Config.GetValue('seriesView', 0);
|
||||
}
|
||||
};
|
||||
|
||||
NzbDrone.Config.GetValue = function (key, defaultValue) {
|
||||
var cookie = NzbDrone.Config.GetCookie();
|
||||
var value = cookie[key];
|
||||
|
||||
if (!value) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
else {
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
NzbDrone.Config.SetValue = function (key, value) {
|
||||
var cookie = NzbDrone.Config.GetCookie();
|
||||
cookie[key] = value;
|
||||
};
|
||||
|
||||
NzbDrone.Config.GetCookie = function () {
|
||||
return $.cookie('NzbDroneConfig');
|
||||
};
|
||||
|
||||
NzbDrone.Config.SetCookie = function (cookie) {
|
||||
$.cookie('NzbDroneConfig', cookie, { expires: 7, path: '/' });
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue