| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>My Playlists</title>
- <link rel="stylesheet" href="popup.css" />
- <script src="alpine.min.js" defer></script>
- <script src="../shared/playlist-utils.js"></script>
- <script src="popup.js"></script>
- </head>
- <body>
- <div id="app" x-data="playlistManager">
- <header x-bind="playlistsHeader">
- <h1>My Playlists</h1>
- </header>
- <header x-bind="historyHeader">
- <button class="back-btn-arrow" x-bind="backButton">←</button>
- <h1>History</h1>
- </header>
- <header x-bind="playlistViewHeader">
- <button class="back-btn-arrow" x-bind="backButton">←</button>
- <h1 x-text="currentPlaylistName"></h1>
- </header>
- <div class="playlists-container" x-bind="playlistsContainer">
- <template
- x-for="playlistData in playlistsForDisplay"
- :key="playlistData.name"
- >
- <div class="playlist">
- <h2
- class="playlist-name-clickable"
- x-text="playlistData.name"
- :data-playlist-name="playlistData.name"
- x-bind="playlistNameClick"
- ></h2>
- <div class="video-list">
- <!-- Truncated previous videos indicator -->
- <div
- class="truncated-videos"
- :data-playlist-name="playlistData.name"
- x-bind="truncatedVideosDisplay"
- >
- <span x-text="playlistData.truncationText"></span>
- </div>
- <template x-for="(video, index) in playlistData.visibleVideos" :key="index">
- <div
- class="video-item"
- :title="video.title"
- :data-playlist-name="playlistData.name"
- :data-playlist-index="video.originalIndex"
- x-bind="videoItemClass"
- >
- <a
- class="video-title"
- :href="video.url"
- x-text="video.title"
- x-bind="videoPlayLink"
- ></a>
- <div class="video-actions">
- <button
- :data-playlist-name="playlistData.name"
- :data-playlist-index="video.originalIndex"
- x-bind="moveUpButton"
- class="move-up-btn"
- title="Move up"
- >
- ↑
- </button>
- <button
- :data-playlist-name="playlistData.name"
- :data-playlist-index="video.originalIndex"
- x-bind="moveDownButton"
- class="move-down-btn"
- title="Move down"
- >
- ↓
- </button>
- <div class="more-menu-container">
- <button
- :data-playlist-name="playlistData.name"
- :data-playlist-index="video.originalIndex"
- x-bind="moreMenuButton"
- class="more-btn"
- title="More actions"
- >
- ⋯
- </button>
- <div
- class="more-menu"
- :data-playlist-name="playlistData.name"
- :data-playlist-index="video.originalIndex"
- x-bind="moreMenu"
- >
- <button
- :data-playlist-name="playlistData.name"
- :data-playlist-index="video.originalIndex"
- x-bind="toggleVideoDoneButton"
- class="menu-item done-item"
- x-text="video.doneButtonText"
- >
- </button>
- <button
- :data-playlist-name="playlistData.name"
- :data-playlist-index="video.originalIndex"
- x-bind="removeVideoButton"
- class="menu-item remove-item"
- >
- Remove
- </button>
- </div>
- </div>
- </div>
- </div>
- </template>
- <!--
- <div x-show="videos.length === 0" class="empty-playlist">
- No videos in this playlist
- </div>
- -->
- </div>
- </div>
- </template>
- </div>
- <!-- History view -->
- <div class="history-container" x-bind="historyContainer">
- <div class="history-list">
- <template x-for="videoHistory in sortedHistory" :key="videoHistory.videoId">
- <div class="history-item" :data-video-id="videoHistory.videoId">
- <div class="history-video-info">
- <div class="history-video-title" x-text="videoHistory.title"></div>
- <a
- class="history-video-id"
- :href="videoHistory.url"
- x-text="videoHistory.formattedVideoId"
- x-bind="videoPlayLink"
- ></a>
- <div class="history-tags">
- <button
- class="tag-chip"
- :data-video-id="videoHistory.videoId"
- data-tag="notable"
- x-bind="tagChip"
- >
- notable
- </button>
- </div>
- </div>
- <div class="history-events">
- <template x-for="event in videoHistory.processedEvents" :key="event.uniqueKey">
- <div class="history-event">
- <span class="event-action" x-text="event.formattedAction"></span>
- <span class="event-position" x-text="event.formattedPosition"></span>
- <span class="event-timestamp" x-text="event.formattedTimestamp"></span>
- </div>
- </template>
- </div>
- </div>
- </template>
- <div x-bind="historyEmptyState" class="empty-history">
- No video history yet
- </div>
- </div>
- </div>
- <!-- Individual playlist view -->
- <div class="playlist-view-container" x-bind="playlistViewContainer">
- <div class="playlist-full-view">
- <template x-for="(video, index) in currentPlaylistVideos" :key="index">
- <div
- class="video-item"
- :title="video.title"
- :data-playlist-name="currentPlaylistName"
- :data-playlist-index="index"
- x-bind="videoItemClass"
- >
- <a
- class="video-title"
- :href="video.url"
- x-text="video.title"
- x-bind="videoPlayLink"
- ></a>
- <div class="video-actions">
- <button
- :data-playlist-name="currentPlaylistName"
- :data-playlist-index="index"
- x-bind="moveUpButton"
- class="move-up-btn"
- title="Move up"
- >
- ↑
- </button>
- <button
- :data-playlist-name="currentPlaylistName"
- :data-playlist-index="index"
- x-bind="moveDownButton"
- class="move-down-btn"
- title="Move down"
- >
- ↓
- </button>
- <div class="more-menu-container">
- <button
- :data-playlist-name="currentPlaylistName"
- :data-playlist-index="index"
- x-bind="moreMenuButton"
- class="more-btn"
- title="More actions"
- >
- ⋯
- </button>
- <div
- class="more-menu"
- :data-playlist-name="currentPlaylistName"
- :data-playlist-index="index"
- x-bind="moreMenu"
- >
- <button
- :data-playlist-name="currentPlaylistName"
- :data-playlist-index="index"
- x-bind="toggleVideoDoneButton"
- class="menu-item done-item"
- x-text="video.doneButtonText"
- >
- </button>
- <button
- :data-playlist-name="currentPlaylistName"
- :data-playlist-index="index"
- x-bind="removeVideoButton"
- class="menu-item remove-item"
- >
- Remove
- </button>
- </div>
- </div>
- </div>
- </div>
- </template>
- <div x-bind="playlistViewEmptyState" class="empty-playlist">
- No videos in this playlist
- </div>
- </div>
- <!-- Add current page button -->
- <div class="add-current-page-container">
- <button
- class="add-current-page-btn"
- x-bind="addCurrentPageButton"
- x-text="addCurrentPageButtonText"
- ></button>
- </div>
- </div>
- <!-- Export/Import/History buttons -->
- <div class="export-container" x-bind="exportContainer">
- <button class="export-btn" x-bind="exportButton">
- Export Playlists
- </button>
- <button class="import-btn" x-bind="importButton">
- Import Playlists
- </button>
- <button class="history-btn" x-bind="historyButton">
- History
- </button>
- <input
- type="file"
- id="import-file-input"
- accept=".json"
- style="display: none"
- x-bind="importFileInput"
- />
- </div>
- </div>
- </body>
- </html>
|