forked from MediaBrowser/emby-web-defaultskin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
skinsettings.js
107 lines (77 loc) · 3.13 KB
/
skinsettings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
define(['userSettings', './skininfo'], function (userSettings, skininfo) {
'use strict';
var settingsPrefix = skininfo.id + '-';
var obj = function () {
var self = this;
self.set = function (name, value) {
userSettings.set(settingsPrefix + name, value);
};
self.get = function (name) {
return userSettings.get(settingsPrefix + name);
};
self.enableAntiSpoliers = function (val) {
if (val != null) {
self.set('antispoilers', val.toString());
}
return self.get('antispoilers') !== 'false';
};
self.dimUnselectedPosters = function (val) {
if (val != null) {
self.set('dimunselectedposters', val.toString());
}
return self.get('dimunselectedposters') === 'true';
};
self.enableMovieDetailScenes = function (val) {
if (val != null) {
self.set('moviedetailscenes', val.toString());
}
return self.get('moviedetailscenes') === 'true';
};
self.enableEpisodeDetailScenes = function (val) {
if (val != null) {
self.set('episodedetailscenes', val.toString());
}
return self.get('episodedetailscenes') === 'true';
};
self.enableOtherDetailScenes = function (val) {
if (val != null) {
self.set('otherdetailscenes', val.toString());
}
return self.get('otherdetailscenes') === 'true';
};
self.skinColor = function (val) {
if (val != null) {
self.set('skincolor', val.toString());
}
return self.get('skincolor');
};
self.apply = function () {
// if (self.dimUnselectedPosters()) {
// document.body.classList.add('dimunselected');
// } else {
// document.body.classList.remove('dimunselected');
// }
if (self.skinColor()) {
document.body.classList.remove('theme-default');
document.body.classList.remove('theme-brown');
document.body.classList.remove('theme-charcoal');
document.body.classList.remove('theme-chartreuse');
document.body.classList.remove('theme-concrete');
document.body.classList.remove('theme-gold');
document.body.classList.remove('theme-green');
document.body.classList.remove('theme-maroon');
document.body.classList.remove('theme-midnight');
document.body.classList.remove('theme-orange');
document.body.classList.remove('theme-pink');
document.body.classList.remove('theme-rose');
document.body.classList.remove('theme-teal');
document.body.classList.remove('theme-violet');
document.body.classList.add(self.skinColor());
}
};
self.unload = function () {
document.body.classList.remove('dimunselected');
};
};
return new obj();
});