Files
make_video_site/views/op/editor.ejs
Claude c5faa8808c feat(folders): nested folder tree (max depth 2) + id-based mutations
- new storeDb.ts: DB+FS layer (folders w/ parent_id, videos w/ global id)
- depth cap: sub-folder cannot have children (enforced in createFolder)
- video id: editable anytime (changeVideoId), uniqueness via PK
- routes:
  - public /folder/:topName[/:subName], /video/:topName[/:subName]/:videoId
  - admin /op/folder/:topName[/:subName], id-based /op/folders/:id/*
    and /op/videos/:id/* (rename/changeId/delete/save + idAvailable check)
- views: breadcrumb + subFolder grid; 플레이리스트 추가 button shows at 2단계
- client JS: id-based mutation endpoints, share URL data attribute,
  in-site player pushes share URL to address bar
- store.ts slimmed to Account + readAccounts (FS layer moved to storeDb)
- pickIntId accepts numeric JSON bodies

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 23:36:02 +09:00

82 lines
4.1 KiB
Plaintext

<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>영상 편집 · <%= breadcrumb.join(' / ') %></title>
<link rel="stylesheet" href="/static/styles.css" />
</head>
<body class="siteBody">
<%
var folderPathEnc = breadcrumb.map(function (s) { return encodeURIComponent(s) }).join('/')
var folderHref = '/op/folder/' + folderPathEnc
var folderLabel = breadcrumb.join(' / ')
%>
<header class="editorNav">
<div class="editorNavLeft">
<a class="muted" href="<%= folderHref %>">← <%= folderLabel %></a>
<input type="text" id="titleInput" class="titleInput" placeholder="영상 제목" value="<%= video ? video.title : '' %>" />
</div>
<div class="editorNavRight">
<button type="button" class="primaryButton" id="saveBtn">저장</button>
</div>
</header>
<main class="editorMain">
<section class="editorStage">
<div id="dropZone" class="dropZone" <% if (video) { %>hidden<% } %>>
<p class="dropTitle">영상 추가</p>
<p class="muted">파일을 드래그&드롭하거나, 아래에서 직접 선택하거나, YouTube 주소를 붙여넣으세요.</p>
<input type="file" id="fileInput" accept="video/*" />
<div class="ytRow">
<input type="text" id="ytUrl" placeholder="https://www.youtube.com/watch?v=..." />
<button type="button" class="secondaryButton" id="ytProbeBtn">확인</button>
<button type="button" class="primaryButton" id="ytStartBtn" disabled>가져오기</button>
</div>
<p id="probeInfo" class="muted"></p>
<progress id="downloadProgress" value="0" max="100" hidden></progress>
<p id="uploadStatus" class="muted"></p>
</div>
<div id="videoPanel" class="videoPanel" <% if (!video) { %>hidden<% } %>>
<video id="editVideo" controls preload="metadata"
<% if (video) { %>src="/api/video/<%= encodeURIComponent(video.id) %>/file?edited=0"<% } %>></video>
<div class="trimTimeline">
<div class="trimTimelineHeader">
<span class="timeReadout" id="timeReadout">00:00.0 / 00:00.0</span>
<div class="trimTimelineActions">
<button type="button" data-mark="start" title="현재 시점을 시작점으로">[&nbsp;시작점</button>
<button type="button" data-mark="end" title="현재 시점을 끝점으로">끝점&nbsp;]</button>
<button type="button" data-action="playSelection" title="선택 구간만 재생">▶ 선택 재생</button>
<button type="button" data-action="reset" title="자르기 초기화">초기화</button>
</div>
</div>
<div class="trimBar" id="trimBar">
<div class="trimRangeFill" id="trimRangeFill"></div>
<div class="trimHandle trimHandleStart" id="trimHandleStart" data-handle="start" title="시작 핸들"></div>
<div class="trimHandle trimHandleEnd" id="trimHandleEnd" data-handle="end" title="끝 핸들"></div>
<div class="trimPlayhead" id="trimPlayhead"></div>
</div>
<div class="trimNumericRow">
<label>시작(초) <input type="number" id="startSec" step="0.1" min="0" value="<%= video && video.trim ? video.trim.startSec : 0 %>" /></label>
<span class="trimDuration" id="trimDuration">선택: 0.0초</span>
<label>끝(초, 비우면 끝까지) <input type="number" id="endSec" step="0.1" min="0" value="<%= video && video.trim && video.trim.endSec != null ? video.trim.endSec : '' %>" /></label>
</div>
<p class="muted">재생바의 양쪽 파란 핸들을 끌어 구간을 정합니다. 타임라인을 클릭하면 그 지점으로 이동. 저장하면 ffmpeg 가 원본을 보존한 채 편집본을 만듭니다.</p>
</div>
</div>
</section>
</main>
<script>
window.__EDITOR__ = {
folderPath: <%- jsonForScript(breadcrumb) %>,
folderId: <%- jsonForScript(folder.id) %>,
video: <%- jsonForScript(video) %>
}
</script>
<script src="/static/editor.js"></script>
</body>
</html>