fix: redirection when navigating between frameset
This commit is contained in:
parent
49cba9fe7c
commit
559893ed64
|
|
@ -79,13 +79,14 @@ window.addEventListener('DOMContentLoaded', function() {
|
||||||
// Set initial quality display to match the selected stream
|
// Set initial quality display to match the selected stream
|
||||||
const selector = document.getElementById('stream-quality');
|
const selector = document.getElementById('stream-quality');
|
||||||
const streamBaseUrl = document.getElementById('stream-base-url');
|
const streamBaseUrl = document.getElementById('stream-base-url');
|
||||||
const config = getStreamConfig(streamBaseUrl.value, selector.value);
|
if (streamBaseUrl && selector) {
|
||||||
document.getElementById('stream-url').textContent = config.url;
|
const config = getStreamConfig(streamBaseUrl.value, selector.value);
|
||||||
document.getElementById('stream-format').textContent = config.format;
|
document.getElementById('stream-url').textContent = config.url;
|
||||||
|
document.getElementById('stream-format').textContent = config.format;
|
||||||
const statusQuality = document.querySelector('[data-text="stream-quality"]');
|
const statusQuality = document.querySelector('[data-text="stream-quality"]');
|
||||||
if (statusQuality) {
|
if (statusQuality) {
|
||||||
statusQuality.textContent = config.format;
|
statusQuality.textContent = config.format;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Update playing information right after load
|
// Update playing information right after load
|
||||||
updateNowPlaying();
|
updateNowPlaying();
|
||||||
|
|
@ -185,14 +186,28 @@ function disableFramesetMode() {
|
||||||
window.location.href = '/asteroid/';
|
window.location.href = '/asteroid/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function redirectWhenFrame() {
|
||||||
|
const path = window.location.pathname;
|
||||||
|
const isFramesetPage = window.parent !== window.self;
|
||||||
|
const isContentFrame = path.includes('asteroid/content');
|
||||||
|
|
||||||
|
if (isFramesetPage && !isContentFrame) {
|
||||||
|
window.location.href = '/asteroid/content';
|
||||||
|
}
|
||||||
|
if (!isFramesetPage && isContentFrame) {
|
||||||
|
window.location.href = '/asteroid';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if user prefers frameset mode on page load
|
// Check if user prefers frameset mode on page load
|
||||||
window.addEventListener('DOMContentLoaded', function() {
|
window.addEventListener('DOMContentLoaded', function() {
|
||||||
const path = window.location.pathname;
|
const path = window.location.pathname;
|
||||||
const isFramesetPage = path.includes('/frameset') || path.includes('/content') ||
|
const isFramesetPage = window.parent !== window.self;
|
||||||
path.includes('/audio-player-frame') || path.includes('/player-content');
|
|
||||||
|
if (localStorage.getItem('useFrameset') === 'true' && !isFramesetPage && path.includes('/asteroid')) {
|
||||||
if (localStorage.getItem('useFrameset') === 'true' && !isFramesetPage && path === '/asteroid/') {
|
|
||||||
// User wants frameset but is on regular front page, redirect
|
// User wants frameset but is on regular front page, redirect
|
||||||
window.location.href = '/asteroid/frameset';
|
window.location.href = '/asteroid/frameset';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
redirectWhenFrame();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ let filteredLibraryTracks = [];
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
audioPlayer = document.getElementById('audio-player');
|
audioPlayer = document.getElementById('audio-player');
|
||||||
|
redirectWhenFrame();
|
||||||
loadTracks();
|
loadTracks();
|
||||||
loadPlaylists();
|
loadPlaylists();
|
||||||
setupEventListeners();
|
setupEventListeners();
|
||||||
|
|
@ -28,6 +29,19 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function redirectWhenFrame () {
|
||||||
|
const path = window.location.pathname;
|
||||||
|
const isFramesetPage = window.parent !== window.self;
|
||||||
|
const isContentFrame = path.includes('player-content');
|
||||||
|
|
||||||
|
if (isFramesetPage && !isContentFrame) {
|
||||||
|
window.location.href = '/asteroid/player-content';
|
||||||
|
}
|
||||||
|
if (!isFramesetPage && isContentFrame) {
|
||||||
|
window.location.href = '/asteroid/player';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setupEventListeners() {
|
function setupEventListeners() {
|
||||||
// Search
|
// Search
|
||||||
document.getElementById('search-tracks').addEventListener('input', filterTracks);
|
document.getElementById('search-tracks').addEventListener('input', filterTracks);
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>🎛️ ADMIN DASHBOARD</h1>
|
<h1>🎛️ ADMIN DASHBOARD</h1>
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<a href="/asteroid/content" target="content-frame">Home</a>
|
<a href="/asteroid" target="content-frame">Home</a>
|
||||||
<a href="/asteroid/player-content" target="content-frame">Player</a>
|
<a href="/asteroid/player" target="content-frame">Player</a>
|
||||||
<a href="/asteroid/profile" target="content-frame">Profile</a>
|
<a href="/asteroid/profile" target="content-frame">Profile</a>
|
||||||
<a href="/asteroid/admin/users">👥 Users</a>
|
<a href="/asteroid/admin/users">👥 Users</a>
|
||||||
<a href="/asteroid/logout" class="btn-logout">Logout</a>
|
<a href="/asteroid/logout" class="btn-logout">Logout</a>
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
<div class="live-stream">
|
<div class="live-stream">
|
||||||
<h2 style="color: #00ff00;">🟢 LIVE STREAM</h2>
|
<h2 style="color: #00ff00;">🟢 LIVE STREAM</h2>
|
||||||
<p><em>The live stream player is now in the persistent bar at the bottom of the page.</em></p>
|
<p><em>The live stream player is now in the persistent bar at the bottom of the page.</em></p>
|
||||||
|
<input type="hidden" id="stream-base-url" lquery="(val stream-base-url)">
|
||||||
<p><strong>Stream URL:</strong> <code id="stream-url" lquery="(text default-stream-url)"></code></p>
|
<p><strong>Stream URL:</strong> <code id="stream-url" lquery="(text default-stream-url)"></code></p>
|
||||||
<p><strong>Format:</strong> <span id="stream-format" lquery="(text default-stream-encoding-desc)"></span></p>
|
<p><strong>Format:</strong> <span id="stream-format" lquery="(text default-stream-encoding-desc)"></span></p>
|
||||||
<p><strong>Status:</strong> <span id="stream-status" style="color: #00ff00;">● BROADCASTING</span></p>
|
<p><strong>Status:</strong> <span id="stream-status" style="color: #00ff00;">● BROADCASTING</span></p>
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@
|
||||||
|
|
||||||
<!-- Stream Quality Selector -->
|
<!-- Stream Quality Selector -->
|
||||||
<div class="live-stream-quality">
|
<div class="live-stream-quality">
|
||||||
<input type="hidden" id="stream-base-url" lquery="(val stream-base-url)">
|
|
||||||
<label for="stream-quality" ><strong>Quality:</strong></label>
|
<label for="stream-quality" ><strong>Quality:</strong></label>
|
||||||
<select id="stream-quality" onchange="changeStreamQuality()">
|
<select id="stream-quality" onchange="changeStreamQuality()">
|
||||||
<option value="aac">AAC 96kbps (Recommended)</option>
|
<option value="aac">AAC 96kbps (Recommended)</option>
|
||||||
|
|
@ -56,6 +55,7 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" id="stream-base-url" lquery="(val stream-base-url)">
|
||||||
<p><strong>Stream URL:</strong> <code id="stream-url" lquery="(text default-stream-url)"></code></p>
|
<p><strong>Stream URL:</strong> <code id="stream-url" lquery="(text default-stream-url)"></code></p>
|
||||||
<p><strong>Format:</strong> <span id="stream-format" lquery="(text default-stream-encoding-desc)"></span></p>
|
<p><strong>Format:</strong> <span id="stream-format" lquery="(text default-stream-encoding-desc)"></span></p>
|
||||||
<p><strong>Status:</strong> <span id="stream-status" style="color: #00ff00;">● BROADCASTING</span></p>
|
<p><strong>Status:</strong> <span id="stream-status" style="color: #00ff00;">● BROADCASTING</span></p>
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>👤 USER PROFILE</h1>
|
<h1>👤 USER PROFILE</h1>
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<a href="/asteroid/content" target="content-frame">Home</a>
|
<a href="/asteroid" target="content-frame">Home</a>
|
||||||
<a href="/asteroid/player-content" target="content-frame">Player</a>
|
<a href="/asteroid/player" target="content-frame">Player</a>
|
||||||
<a href="/asteroid/admin" target="content-frame" data-show-if-admin>Admin</a>
|
<a href="/asteroid/admin" target="content-frame" data-show-if-admin>Admin</a>
|
||||||
<a href="/asteroid/logout" class="btn-logout">Logout</a>
|
<a href="/asteroid/logout" class="btn-logout">Logout</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>👥 USER MANAGEMENT</h1>
|
<h1>👥 USER MANAGEMENT</h1>
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<a href="/asteroid/content" target="content-frame">Home</a>
|
<a href="/asteroid" target="content-frame">Home</a>
|
||||||
<a href="/asteroid/admin" target="content-frame">Admin</a>
|
<a href="/asteroid/admin" target="content-frame">Admin</a>
|
||||||
<a href="/asteroid/logout" class="btn-logout">Logout</a>
|
<a href="/asteroid/logout" class="btn-logout">Logout</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue