feat: migrate player.html to wd-* design system
This commit is contained in:
parent
9ff80f8cc1
commit
6176791174
1 changed files with 480 additions and 430 deletions
|
|
@ -3,29 +3,29 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Wild Dragon - Asset Player</title>
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
<link rel="stylesheet" href="/css/common.css">
|
<title>Player — Dragonflight</title>
|
||||||
|
<link rel="stylesheet" href="/dist/app.css">
|
||||||
<style>
|
<style>
|
||||||
.player-container {
|
.player-container {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 300px;
|
grid-template-columns: 1fr 300px;
|
||||||
gap: var(--spacing-lg);
|
gap: 16px;
|
||||||
height: calc(100vh - 110px);
|
height: calc(100vh - 110px);
|
||||||
padding: var(--spacing-lg);
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.player-main {
|
.player-main {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--spacing-lg);
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-container {
|
.video-container {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background-color: var(--color-bg-tertiary);
|
background-color: var(--bg-surface);
|
||||||
border: 1px solid var(--color-border);
|
border: 1px solid var(--border);
|
||||||
border-radius: var(--radius-lg);
|
border-radius: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -35,38 +35,39 @@
|
||||||
.video-player {
|
.video-player {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: var(--color-bg-primary);
|
background-color: var(--bg-base);
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-panel {
|
.metadata-panel {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--spacing-md);
|
gap: 12px;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-section {
|
.metadata-section {
|
||||||
padding: var(--spacing-md);
|
padding: 12px;
|
||||||
background-color: var(--color-bg-tertiary);
|
background-color: var(--bg-surface);
|
||||||
border: 1px solid var(--color-border);
|
border: 1px solid var(--border);
|
||||||
border-radius: var(--radius-lg);
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-section-title {
|
.metadata-section-title {
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: var(--color-text-secondary);
|
color: var(--text-secondary);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
margin-bottom: var(--spacing-md);
|
margin-bottom: 12px;
|
||||||
letter-spacing: 0.3px;
|
letter-spacing: 0.3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-row {
|
.metadata-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--spacing-xs);
|
gap: 4px;
|
||||||
margin-bottom: var(--spacing-sm);
|
margin-bottom: 8px;
|
||||||
padding-bottom: var(--spacing-sm);
|
padding-bottom: 8px;
|
||||||
border-bottom: 1px solid var(--color-border);
|
border-bottom: 1px solid var(--border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-row:last-child {
|
.metadata-row:last-child {
|
||||||
|
|
@ -77,30 +78,30 @@
|
||||||
|
|
||||||
.metadata-label {
|
.metadata-label {
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
color: var(--color-text-tertiary);
|
color: var(--text-tertiary);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.2px;
|
letter-spacing: 0.2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-value {
|
.metadata-value {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
color: var(--color-text-primary);
|
color: var(--text-primary);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-editable {
|
.metadata-editable {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: var(--spacing-sm);
|
gap: 8px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-textarea {
|
.metadata-textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: var(--spacing-sm);
|
padding: 8px;
|
||||||
background-color: var(--color-bg-primary);
|
background-color: var(--bg-base);
|
||||||
border: 1px solid var(--color-border);
|
border: 1px solid var(--border);
|
||||||
border-radius: var(--radius-md);
|
border-radius: 6px;
|
||||||
color: var(--color-text-primary);
|
color: var(--text-primary);
|
||||||
font-family: 'Courier New', monospace;
|
font-family: 'Courier New', monospace;
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
|
|
@ -109,38 +110,34 @@
|
||||||
|
|
||||||
.metadata-textarea:focus {
|
.metadata-textarea:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
border-color: var(--color-accent-primary);
|
border-color: var(--accent);
|
||||||
box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
|
box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar {
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tags-list {
|
.tags-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: var(--spacing-sm);
|
gap: 8px;
|
||||||
margin-bottom: var(--spacing-md);
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag-badge {
|
.tag-badge {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: var(--spacing-xs);
|
gap: 4px;
|
||||||
padding: 4px 10px;
|
padding: 4px 10px;
|
||||||
background-color: var(--color-bg-primary);
|
background-color: var(--bg-base);
|
||||||
border: 1px solid var(--color-border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
color: var(--color-text-secondary);
|
color: var(--text-secondary);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all var(--transition-fast);
|
transition: all 120ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag-badge:hover {
|
.tag-badge:hover {
|
||||||
border-color: var(--color-accent-primary);
|
border-color: var(--accent);
|
||||||
color: var(--color-accent-primary);
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag-remove {
|
.tag-remove {
|
||||||
|
|
@ -153,26 +150,8 @@
|
||||||
|
|
||||||
.edit-controls {
|
.edit-controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: var(--spacing-sm);
|
gap: 8px;
|
||||||
margin-top: var(--spacing-md);
|
margin-top: 12px;
|
||||||
}
|
|
||||||
|
|
||||||
.back-button {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: var(--spacing-sm);
|
|
||||||
padding: var(--spacing-sm) var(--spacing-md);
|
|
||||||
background-color: var(--color-bg-tertiary);
|
|
||||||
border: 1px solid var(--color-border);
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
color: var(--color-text-secondary);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all var(--transition-fast);
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-button:hover {
|
|
||||||
border-color: var(--color-accent-primary);
|
|
||||||
color: var(--color-accent-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
|
@ -193,28 +172,81 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="app-container">
|
|
||||||
<!-- Header -->
|
<div class="wd-shell" style="display:flex;min-height:100vh;">
|
||||||
<header class="header">
|
<nav class="wd-sidebar" aria-label="Main navigation">
|
||||||
<div class="header-logo">
|
<div class="wd-sidebar-header">
|
||||||
<div class="header-logo-icon">D</div>
|
<img src="img/dragon-logo.png?v=1" alt="Dragonflight" style="width:18px;height:18px;">
|
||||||
<span>WILD DRAGON</span>
|
<span class="wd-sidebar-brand">Dragonflight</span>
|
||||||
|
</div>
|
||||||
|
<div class="wd-sidebar-nav">
|
||||||
|
<a href="home.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 7l6-5 6 5v7a1 1 0 0 1-1 1h-3v-5H6v5H3a1 1 0 0 1-1-1z"/></svg>
|
||||||
|
Home
|
||||||
|
</a>
|
||||||
|
<a href="index.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="1" width="6" height="6" rx="1"/><rect x="9" y="1" width="6" height="6" rx="1"/><rect x="1" y="9" width="6" height="6" rx="1"/><rect x="9" y="9" width="6" height="6" rx="1"/></svg>
|
||||||
|
Library
|
||||||
|
</a>
|
||||||
|
<a href="projects.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M1 4a1 1 0 0 1 1-1h4l2 2h5a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"/></svg>
|
||||||
|
Projects
|
||||||
|
</a>
|
||||||
|
<a href="upload.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 11V3M5 6l3-3 3 3"/><path d="M2 13h12"/></svg>
|
||||||
|
Ingest
|
||||||
|
</a>
|
||||||
|
<a href="recorders.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="4" width="10" height="8" rx="1"/><path d="M11 7l4-2v6l-4-2"/></svg>
|
||||||
|
Recorders
|
||||||
|
</a>
|
||||||
|
<a href="capture.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="3"/><circle cx="8" cy="8" r="6.5"/></svg>
|
||||||
|
Capture
|
||||||
|
</a>
|
||||||
|
<a href="jobs.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 4h12M2 8h8M2 12h5"/></svg>
|
||||||
|
Jobs
|
||||||
|
</a>
|
||||||
|
<a href="edit.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 13l1.5-3.5L11 2l3 3-7.5 7.5L3 14zM10 3l3 3"/></svg>
|
||||||
|
Editor
|
||||||
|
</a>
|
||||||
|
<div class="wd-sidebar-section">Admin</div>
|
||||||
|
<a href="users.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="6" cy="5" r="2.5"/><path d="M1 13c0-2.8 2.2-5 5-5s5 2.2 5 5"/><circle cx="12" cy="5" r="2"/><path d="M15 12c0-1.9-1.3-3.5-3-4"/></svg>
|
||||||
|
Users
|
||||||
|
</a>
|
||||||
|
<a href="tokens.html" class="wd-nav-item">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="6" cy="10" r="3.5"/><path d="M8.7 7.3L13 3M11.5 3.5l1.5 1.5M13.5 2.5l1 1"/></svg>
|
||||||
|
Tokens
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="wd-sidebar-footer">
|
||||||
|
<div class="wd-sidebar-user">
|
||||||
|
<div class="wd-sidebar-user-avatar" id="userAvatar">?</div>
|
||||||
|
<div class="wd-sidebar-user-info">
|
||||||
|
<div class="wd-sidebar-user-name" id="userName">—</div>
|
||||||
|
<div class="wd-sidebar-user-role" id="userRole"></div>
|
||||||
|
</div>
|
||||||
|
<button class="wd-btn wd-btn--ghost wd-btn--sm wd-btn--icon wd-sidebar-user-logout" id="logoutBtn" title="Sign out">
|
||||||
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" width="14" height="14"><path d="M10 8H3M6 5l-3 3 3 3"/><path d="M7 3h5a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H7"/></svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<nav class="header-nav">
|
|
||||||
<div class="nav-item" data-page="assets">Assets</div>
|
|
||||||
<div class="nav-item" data-page="capture">Capture</div>
|
|
||||||
<div class="nav-item" data-page="projects">Projects</div>
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<div style="flex:1;display:flex;flex-direction:column;">
|
||||||
|
<header class="wd-topbar">
|
||||||
|
<div class="wd-topbar-left">
|
||||||
|
<span class="page-title">Player</span>
|
||||||
|
</div>
|
||||||
|
<div class="wd-topbar-right">
|
||||||
|
<button class="wd-btn wd-btn--ghost wd-btn--sm" onclick="goBack()">← Back to Library</button>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<!-- Main Content -->
|
<div style="flex:1;overflow:auto;padding:16px;">
|
||||||
<div class="main-content">
|
|
||||||
<div class="content-area">
|
|
||||||
<div class="content-main">
|
|
||||||
<button class="back-button" onclick="goBack()">
|
|
||||||
<span>←</span> Back to Assets
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div class="player-container">
|
<div class="player-container">
|
||||||
<!-- Main Player -->
|
<!-- Main Player -->
|
||||||
<div class="player-main">
|
<div class="player-main">
|
||||||
|
|
@ -224,7 +256,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
<div class="sidebar">
|
<div class="metadata-panel">
|
||||||
<!-- File Info -->
|
<!-- File Info -->
|
||||||
<div class="metadata-section">
|
<div class="metadata-section">
|
||||||
<div class="metadata-section-title">File Information</div>
|
<div class="metadata-section-title">File Information</div>
|
||||||
|
|
@ -277,7 +309,7 @@
|
||||||
placeholder="Add tag..."
|
placeholder="Add tag..."
|
||||||
style="font-size: 0.85rem;"
|
style="font-size: 0.85rem;"
|
||||||
>
|
>
|
||||||
<button class="btn btn-secondary btn-sm" style="width: 100%; margin-top: var(--spacing-sm);" onclick="addTag()">Add Tag</button>
|
<button class="wd-btn wd-btn--secondary wd-btn--sm" style="width: 100%; margin-top: 8px;" onclick="addTag()">Add Tag</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Notes -->
|
<!-- Notes -->
|
||||||
|
|
@ -285,8 +317,8 @@
|
||||||
<div class="metadata-section-title">Notes</div>
|
<div class="metadata-section-title">Notes</div>
|
||||||
<textarea id="notesInput" class="metadata-textarea" placeholder="Add notes about this asset..."></textarea>
|
<textarea id="notesInput" class="metadata-textarea" placeholder="Add notes about this asset..."></textarea>
|
||||||
<div class="edit-controls">
|
<div class="edit-controls">
|
||||||
<button class="btn btn-primary btn-sm" style="flex: 1;" onclick="saveMetadata()">Save</button>
|
<button class="wd-btn wd-btn--primary wd-btn--sm" style="flex: 1;" onclick="saveMetadata()">Save</button>
|
||||||
<button class="btn btn-secondary btn-sm" style="flex: 1;" onclick="resetMetadata()">Reset</button>
|
<button class="wd-btn wd-btn--secondary wd-btn--sm" style="flex: 1;" onclick="resetMetadata()">Reset</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -295,17 +327,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Status Bar -->
|
|
||||||
<footer class="status-bar">
|
|
||||||
<div class="status-item">
|
|
||||||
<span class="status-indicator" id="statusIndicator"></span>
|
|
||||||
<span id="statusText">Connected</span>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="/js/api.js?v=6"></script>
|
<script src="/js/api.js?v=6"></script>
|
||||||
<script src="/js/topbar-strip.js?v=1"></script>
|
<script src="/js/topbar-strip.js?v=1"></script>
|
||||||
|
<script src="js/auth-guard.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// STATE MANAGEMENT
|
// STATE MANAGEMENT
|
||||||
|
|
@ -320,6 +344,48 @@
|
||||||
originalNotes: '',
|
originalNotes: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ============================================================
|
||||||
|
// HELPERS
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
|
function formatDuration(seconds) {
|
||||||
|
if (!seconds) return '—';
|
||||||
|
const h = Math.floor(seconds / 3600);
|
||||||
|
const m = Math.floor((seconds % 3600) / 60);
|
||||||
|
const s = Math.floor(seconds % 60);
|
||||||
|
if (h > 0) return `${h}:${String(m).padStart(2,'0')}:${String(s).padStart(2,'0')}`;
|
||||||
|
return `${m}:${String(s).padStart(2,'0')}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatFileSize(bytes) {
|
||||||
|
if (!bytes) return '—';
|
||||||
|
const units = ['B','KB','MB','GB','TB'];
|
||||||
|
let i = 0;
|
||||||
|
let val = bytes;
|
||||||
|
while (val >= 1024 && i < units.length - 1) { val /= 1024; i++; }
|
||||||
|
return `${val.toFixed(1)} ${units[i]}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStatusBadgeClass(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 'recording': return 'wd-badge wd-badge--bad';
|
||||||
|
case 'ready': return 'wd-badge wd-badge--good';
|
||||||
|
case 'processing':return 'wd-badge wd-badge--warn';
|
||||||
|
case 'error': return 'wd-badge wd-badge--bad';
|
||||||
|
default: return 'wd-badge';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStatusLabel(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 'recording': return 'Recording';
|
||||||
|
case 'ready': return 'Ready';
|
||||||
|
case 'processing': return 'Processing';
|
||||||
|
case 'error': return 'Error';
|
||||||
|
default: return status || '—';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// INITIALIZATION
|
// INITIALIZATION
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
@ -331,8 +397,6 @@
|
||||||
|
|
||||||
if (playerState.assetId) {
|
if (playerState.assetId) {
|
||||||
loadAsset();
|
loadAsset();
|
||||||
} else {
|
|
||||||
document.getElementById('statusText').textContent = 'No asset selected';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -343,10 +407,6 @@
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
document.querySelectorAll('[data-page]').forEach(el => {
|
|
||||||
el.addEventListener('click', (e) => navigateTo(e.target.dataset.page));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadAsset() {
|
async function loadAsset() {
|
||||||
|
|
@ -367,12 +427,9 @@
|
||||||
if (streamResult.success) {
|
if (streamResult.success) {
|
||||||
document.getElementById('videoPlayer').src = streamResult.data.url;
|
document.getElementById('videoPlayer').src = streamResult.data.url;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
document.getElementById('statusText').textContent = 'Failed to load asset';
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error loading asset:', error);
|
console.error('Error loading asset:', error);
|
||||||
document.getElementById('statusText').textContent = 'Error loading asset';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -391,13 +448,13 @@
|
||||||
document.getElementById('metaDuration').textContent = formatDuration(asset.duration);
|
document.getElementById('metaDuration').textContent = formatDuration(asset.duration);
|
||||||
document.getElementById('metaFileSize').textContent = formatFileSize(asset.file_size || 0);
|
document.getElementById('metaFileSize').textContent = formatFileSize(asset.file_size || 0);
|
||||||
document.getElementById('metaStatus').innerHTML =
|
document.getElementById('metaStatus').innerHTML =
|
||||||
`<span class="badge ${getStatusBadgeClass(asset.status)}">${getStatusLabel(asset.status)}</span>`;
|
`<span class="${getStatusBadgeClass(asset.status)}">${getStatusLabel(asset.status)}</span>`;
|
||||||
document.getElementById('metaCreated').textContent = new Date(asset.created_at).toLocaleDateString();
|
document.getElementById('metaCreated').textContent = new Date(asset.created_at).toLocaleDateString();
|
||||||
|
|
||||||
renderTags();
|
renderTags();
|
||||||
document.getElementById('notesInput').value = playerState.notes;
|
document.getElementById('notesInput').value = playerState.notes;
|
||||||
|
|
||||||
document.title = `${asset.filename} - Wild Dragon Player`;
|
document.title = `${asset.filename} — Dragonflight Player`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderTags() {
|
function renderTags() {
|
||||||
|
|
@ -456,16 +513,9 @@
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
playerState.originalTags = [...playerState.tags];
|
playerState.originalTags = [...playerState.tags];
|
||||||
playerState.originalNotes = playerState.notes;
|
playerState.originalNotes = playerState.notes;
|
||||||
document.getElementById('statusText').textContent = 'Changes saved';
|
|
||||||
setTimeout(() => {
|
|
||||||
document.getElementById('statusText').textContent = 'Connected';
|
|
||||||
}, 2000);
|
|
||||||
} else {
|
|
||||||
document.getElementById('statusText').textContent = 'Failed to save changes';
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error saving metadata:', error);
|
console.error('Error saving metadata:', error);
|
||||||
document.getElementById('statusText').textContent = 'Error saving changes';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue