popup.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>My Playlists</title>
  7. <link rel="stylesheet" href="popup.css" />
  8. <script src="alpine.min.js" defer></script>
  9. <script src="popup.js"></script>
  10. </head>
  11. <body>
  12. <div id="app" x-data="playlistManager">
  13. <header x-bind="playlistsHeader">
  14. <h1>My Playlists</h1>
  15. </header>
  16. <header x-bind="historyHeader">
  17. <button class="back-btn-arrow" x-bind="backButton">←</button>
  18. <h1>History</h1>
  19. </header>
  20. <header x-bind="playlistViewHeader">
  21. <button class="back-btn-arrow" x-bind="backButton">←</button>
  22. <h1 x-text="currentPlaylistName"></h1>
  23. </header>
  24. <div class="playlists-container" x-bind="playlistsContainer">
  25. <template
  26. x-for="playlistData in playlistsForDisplay"
  27. :key="playlistData.name"
  28. >
  29. <div class="playlist">
  30. <h2
  31. class="playlist-name-clickable"
  32. x-text="playlistData.name"
  33. :data-playlist-name="playlistData.name"
  34. x-bind="playlistNameClick"
  35. ></h2>
  36. <div class="video-list">
  37. <!-- Truncated previous videos indicator -->
  38. <div
  39. class="truncated-videos"
  40. :data-playlist-name="playlistData.name"
  41. x-bind="truncatedVideosDisplay"
  42. >
  43. <span x-text="playlistData.truncationText"></span>
  44. </div>
  45. <template x-for="(video, index) in playlistData.visibleVideos" :key="index">
  46. <div
  47. class="video-item"
  48. :title="video.title"
  49. :data-playlist-name="playlistData.name"
  50. :data-playlist-index="video.originalIndex"
  51. x-bind="videoItemClass"
  52. >
  53. <a
  54. class="video-title"
  55. :href="video.url"
  56. x-text="video.title"
  57. x-bind="videoPlayLink"
  58. ></a>
  59. <div class="video-actions">
  60. <button
  61. :data-playlist-name="playlistData.name"
  62. :data-playlist-index="video.originalIndex"
  63. x-bind="moveUpButton"
  64. class="move-up-btn"
  65. title="Move up"
  66. >
  67. ↑
  68. </button>
  69. <button
  70. :data-playlist-name="playlistData.name"
  71. :data-playlist-index="video.originalIndex"
  72. x-bind="moveDownButton"
  73. class="move-down-btn"
  74. title="Move down"
  75. >
  76. ↓
  77. </button>
  78. <div class="more-menu-container">
  79. <button
  80. :data-playlist-name="playlistData.name"
  81. :data-playlist-index="video.originalIndex"
  82. x-bind="moreMenuButton"
  83. class="more-btn"
  84. title="More actions"
  85. >
  86. ⋯
  87. </button>
  88. <div
  89. class="more-menu"
  90. :data-playlist-name="playlistData.name"
  91. :data-playlist-index="video.originalIndex"
  92. x-bind="moreMenu"
  93. >
  94. <button
  95. :data-playlist-name="playlistData.name"
  96. :data-playlist-index="video.originalIndex"
  97. x-bind="removeVideoButton"
  98. class="menu-item remove-item"
  99. >
  100. Remove
  101. </button>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </template>
  107. <!--
  108. <div x-show="videos.length === 0" class="empty-playlist">
  109. No videos in this playlist
  110. </div>
  111. -->
  112. </div>
  113. </div>
  114. </template>
  115. </div>
  116. <!-- History view -->
  117. <div class="history-container" x-bind="historyContainer">
  118. <div class="history-list">
  119. <template x-for="videoHistory in sortedHistory" :key="videoHistory.videoId">
  120. <div class="history-item" :data-video-id="videoHistory.videoId">
  121. <div class="history-video-info">
  122. <div class="history-video-title" x-text="videoHistory.title"></div>
  123. <a
  124. class="history-video-id"
  125. :href="videoHistory.url"
  126. x-text="videoHistory.formattedVideoId"
  127. x-bind="videoPlayLink"
  128. ></a>
  129. <div class="history-tags">
  130. <button
  131. class="tag-chip"
  132. :data-video-id="videoHistory.videoId"
  133. data-tag="notable"
  134. x-bind="tagChip"
  135. >
  136. notable
  137. </button>
  138. </div>
  139. </div>
  140. <div class="history-events">
  141. <template x-for="event in videoHistory.processedEvents" :key="event.uniqueKey">
  142. <div class="history-event">
  143. <span class="event-action" x-text="event.formattedAction"></span>
  144. <span class="event-position" x-text="event.formattedPosition"></span>
  145. <span class="event-timestamp" x-text="event.formattedTimestamp"></span>
  146. </div>
  147. </template>
  148. </div>
  149. </div>
  150. </template>
  151. <div x-bind="historyEmptyState" class="empty-history">
  152. No video history yet
  153. </div>
  154. </div>
  155. </div>
  156. <!-- Individual playlist view -->
  157. <div class="playlist-view-container" x-bind="playlistViewContainer">
  158. <div class="playlist-full-view">
  159. <template x-for="(video, index) in currentPlaylistVideos" :key="index">
  160. <div
  161. class="video-item"
  162. :title="video.title"
  163. :data-playlist-name="currentPlaylistName"
  164. :data-playlist-index="index"
  165. x-bind="videoItemClass"
  166. >
  167. <a
  168. class="video-title"
  169. :href="video.url"
  170. x-text="video.title"
  171. x-bind="videoPlayLink"
  172. ></a>
  173. <div class="video-actions">
  174. <button
  175. :data-playlist-name="currentPlaylistName"
  176. :data-playlist-index="index"
  177. x-bind="moveUpButton"
  178. class="move-up-btn"
  179. title="Move up"
  180. >
  181. ↑
  182. </button>
  183. <button
  184. :data-playlist-name="currentPlaylistName"
  185. :data-playlist-index="index"
  186. x-bind="moveDownButton"
  187. class="move-down-btn"
  188. title="Move down"
  189. >
  190. ↓
  191. </button>
  192. <div class="more-menu-container">
  193. <button
  194. :data-playlist-name="currentPlaylistName"
  195. :data-playlist-index="index"
  196. x-bind="moreMenuButton"
  197. class="more-btn"
  198. title="More actions"
  199. >
  200. ⋯
  201. </button>
  202. <div
  203. class="more-menu"
  204. :data-playlist-name="currentPlaylistName"
  205. :data-playlist-index="index"
  206. x-bind="moreMenu"
  207. >
  208. <button
  209. :data-playlist-name="currentPlaylistName"
  210. :data-playlist-index="index"
  211. x-bind="removeVideoButton"
  212. class="menu-item remove-item"
  213. >
  214. Remove
  215. </button>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </template>
  221. <div x-bind="playlistViewEmptyState" class="empty-playlist">
  222. No videos in this playlist
  223. </div>
  224. </div>
  225. </div>
  226. <!-- Export/Import/History buttons -->
  227. <div class="export-container" x-bind="exportContainer">
  228. <button class="export-btn" x-bind="exportButton">
  229. Export Playlists
  230. </button>
  231. <button class="import-btn" x-bind="importButton">
  232. Import Playlists
  233. </button>
  234. <button class="history-btn" x-bind="historyButton">
  235. History
  236. </button>
  237. <input
  238. type="file"
  239. id="import-file-input"
  240. accept=".json"
  241. style="display: none"
  242. x-bind="importFileInput"
  243. />
  244. </div>
  245. </div>
  246. </body>
  247. </html>