Skip to content

Commit 501c0ea

Browse files
Refactor code structure for improved readability and maintainability
1 parent c60fd68 commit 501c0ea

7 files changed

Lines changed: 496 additions & 1205 deletions

File tree

build/author-signature.xml

Lines changed: 0 additions & 597 deletions
This file was deleted.

build/browse.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<link rel="stylesheet" href="css/legacy-compat.css">
8080
<link rel="stylesheet" href="css/navbar.css">
8181
<link rel="stylesheet" href="css/browse.css">
82+
<link rel="stylesheet" href="css/update-modal.css">
8283
<script src="js/tizen-adapter.js" charset="utf-8"></script>
8384
<script src="js/polyfills.js" charset="utf-8"></script>
8485
<script src="js/storage.js" charset="utf-8"></script>
@@ -92,6 +93,7 @@
9293
<script src="js/multi-server-rows.js" charset="utf-8"></script>
9394
<script src="js/navbar.js" charset="utf-8"></script>
9495
<script src="js/theme-music-player.js"></script>
96+
<script src="js/version-checker.js" charset="utf-8"></script>
9597
<script src="js/browse.js" charset="utf-8"></script>
9698
</head>
9799
<body>

build/css/update-modal.css

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/* Update Modal Styles */
2+
.update-modal {
3+
position: fixed;
4+
top: 0;
5+
left: 0;
6+
width: 100%;
7+
height: 100%;
8+
background: rgba(0, 0, 0, 0.85);
9+
display: flex;
10+
align-items: center;
11+
justify-content: center;
12+
z-index: 99999;
13+
animation: fadeIn 0.3s ease-out;
14+
}
15+
16+
@keyframes fadeIn {
17+
from {
18+
opacity: 0;
19+
}
20+
to {
21+
opacity: 1;
22+
}
23+
}
24+
25+
.update-modal-content {
26+
background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
27+
border-radius: 12px;
28+
padding: 40px;
29+
max-width: 800px;
30+
width: 80%;
31+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
32+
border: 2px solid rgba(255, 255, 255, 0.1);
33+
animation: slideIn 0.3s ease-out;
34+
}
35+
36+
@keyframes slideIn {
37+
from {
38+
transform: translateY(-50px);
39+
opacity: 0;
40+
}
41+
to {
42+
transform: translateY(0);
43+
opacity: 1;
44+
}
45+
}
46+
47+
.update-modal-title {
48+
font-size: 36px;
49+
font-weight: 600;
50+
color: #ffffff;
51+
margin: 0 0 20px 0;
52+
text-align: center;
53+
}
54+
55+
.update-modal-version {
56+
font-size: 24px;
57+
color: #e0e0e0;
58+
text-align: center;
59+
margin: 0 0 30px 0;
60+
line-height: 1.5;
61+
}
62+
63+
.update-modal-current {
64+
font-size: 20px;
65+
color: #999;
66+
}
67+
68+
.update-modal-notes {
69+
background: rgba(0, 0, 0, 0.3);
70+
border-radius: 8px;
71+
padding: 20px;
72+
margin: 0 0 30px 0;
73+
max-height: 300px;
74+
overflow-y: auto;
75+
font-size: 18px;
76+
line-height: 1.6;
77+
color: #ddd;
78+
border: 1px solid rgba(255, 255, 255, 0.05);
79+
}
80+
81+
.update-modal-notes::-webkit-scrollbar {
82+
width: 8px;
83+
}
84+
85+
.update-modal-notes::-webkit-scrollbar-track {
86+
background: rgba(0, 0, 0, 0.2);
87+
border-radius: 4px;
88+
}
89+
90+
.update-modal-notes::-webkit-scrollbar-thumb {
91+
background: rgba(255, 255, 255, 0.2);
92+
border-radius: 4px;
93+
}
94+
95+
.update-modal-notes::-webkit-scrollbar-thumb:hover {
96+
background: rgba(255, 255, 255, 0.3);
97+
}
98+
99+
.update-modal-notes strong {
100+
color: #fff;
101+
font-weight: 600;
102+
}
103+
104+
.update-modal-notes em {
105+
color: #bbb;
106+
font-style: italic;
107+
}
108+
109+
.update-modal-buttons {
110+
display: flex;
111+
justify-content: center;
112+
gap: 20px;
113+
}
114+
115+
.update-modal-button {
116+
background: linear-gradient(135deg, #00a4dc 0%, #008bb8 100%);
117+
color: #ffffff;
118+
border: 2px solid transparent;
119+
border-radius: 8px;
120+
padding: 12px 40px;
121+
font-size: 22px;
122+
font-weight: 600;
123+
cursor: pointer;
124+
transition: all 0.2s ease;
125+
outline: none;
126+
}
127+
128+
.update-modal-button:hover,
129+
.update-modal-button:focus,
130+
.update-modal-button-focused {
131+
background: linear-gradient(135deg, #00b8f0 0%, #009fd0 100%);
132+
border-color: #ffffff;
133+
box-shadow: 0 0 20px rgba(0, 164, 220, 0.5);
134+
transform: scale(1.05);
135+
}
136+
137+
.update-modal-button:active {
138+
transform: scale(0.98);
139+
}
140+
141+
/* Accessibility */
142+
.update-modal[aria-modal="true"] {
143+
outline: none;
144+
}
145+
146+
/* Animation for TV focus ring */
147+
@keyframes pulseGlow {
148+
0%, 100% {
149+
box-shadow: 0 0 20px rgba(0, 164, 220, 0.5);
150+
}
151+
50% {
152+
box-shadow: 0 0 30px rgba(0, 164, 220, 0.8);
153+
}
154+
}
155+
156+
.update-modal-button:focus {
157+
animation: pulseGlow 2s ease-in-out infinite;
158+
}

build/discover.html

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,44 @@
1111
if (!logDiv) {
1212
logDiv = document.createElement('div');
1313
logDiv.id = 'screenLog';
14-
logDiv.style.cssText = 'position:fixed;top:0;left:0;right:0;background:#000;color:#0f0;font-family:monospace;font-size:14px;padding:10px;z-index:999999;max-height:50%;overflow-y:auto;white-space:pre-wrap;';
15-
document.body ? document.body.appendChild(logDiv) : document.addEventListener('DOMContentLoaded', function() { document.body.appendChild(logDiv); });
14+
logDiv.style.cssText = 'position:fixed;top:0;left:0;right:0;bottom:0;background:#000;color:#0f0;font-family:monospace;font-size:24px;padding:20px;z-index:999999;overflow-y:auto;white-space:pre-wrap;';
15+
if (document.body) {
16+
document.body.innerHTML = '';
17+
document.body.appendChild(logDiv);
18+
}
1619
}
17-
logDiv.innerHTML += msg + '<br>';
20+
logDiv.innerHTML += msg + '\n';
1821
};
1922
window.onerror = function(msg, url, line) {
2023
window.logToScreen('ERROR: ' + msg + ' at line ' + line);
2124
return false;
2225
};
23-
window.logToScreen('Page starting...');
26+
document.addEventListener('DOMContentLoaded', function() {
27+
var logDiv = document.createElement('div');
28+
logDiv.id = 'screenLog';
29+
logDiv.style.cssText = 'position:fixed;top:0;left:0;right:0;bottom:0;background:#000;color:#0f0;font-family:monospace;font-size:24px;padding:20px;z-index:999999;overflow-y:auto;white-space:pre-wrap;';
30+
document.body.innerHTML = '';
31+
document.body.appendChild(logDiv);
32+
window.logToScreen('=== DISCOVER PAGE DEBUG ===');
33+
window.logToScreen('DOM is ready');
34+
window.logToScreen('storage: ' + (typeof storage));
35+
window.logToScreen('JellyfinAPI: ' + (typeof JellyfinAPI));
36+
window.logToScreen('JellyseerrAPI: ' + (typeof JellyseerrAPI));
37+
window.logToScreen('DiscoverController: ' + (typeof DiscoverController));
38+
if (typeof storage !== 'undefined') {
39+
var settings = storage.get('jellyfin_settings');
40+
window.logToScreen('settings: ' + (settings ? 'found' : 'null'));
41+
if (settings) {
42+
try {
43+
var p = JSON.parse(settings);
44+
window.logToScreen('jellyseerrUrl: ' + (p.jellyseerrUrl || 'NOT SET'));
45+
window.logToScreen('jellyseerrApiKey: ' + (p.jellyseerrApiKey ? 'SET (' + p.jellyseerrApiKey.length + ' chars)' : 'NOT SET'));
46+
} catch(e) {
47+
window.logToScreen('settings parse error: ' + e);
48+
}
49+
}
50+
}
51+
});
2452
</script>
2553
<style>
2654
#debugPanel {

build/js/browse.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2892,6 +2892,11 @@ console.log('[BROWSE] BrowseController defined, adding load listener');
28922892
window.addEventListener('load', function() {
28932893
console.log('[BROWSE] Window load event fired, calling init');
28942894
BrowseController.init();
2895+
2896+
// Initialize version checker after page loads
2897+
if (typeof VersionChecker !== 'undefined') {
2898+
VersionChecker.init();
2899+
}
28952900
});
28962901

28972902
window.addEventListener('visibilitychange', function() {

0 commit comments

Comments
 (0)