popup.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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="../shared/playlist-utils.js"></script>
  10. <script src="popup.js"></script>
  11. </head>
  12. <body>
  13. <div id="app" x-data="playlistManager">
  14. <header x-bind="playlistsHeader">
  15. <h1>My Playlists</h1>
  16. </header>
  17. <header x-bind="historyHeader">
  18. <button class="back-btn-arrow" x-bind="backButton">←</button>
  19. <h1>History</h1>
  20. </header>
  21. <header x-bind="playlistViewHeader">
  22. <button class="back-btn-arrow" x-bind="backButton">←</button>
  23. <h1 x-text="currentPlaylistName"></h1>
  24. </header>
  25. <header x-bind="saveChannelHeader">
  26. <button class="back-btn-arrow" x-bind="backButton">←</button>
  27. <h1>Save Channel</h1>
  28. </header>
  29. <div class="playlists-container" x-bind="playlistsContainer">
  30. <template
  31. x-for="playlistData in playlistsForDisplay"
  32. :key="playlistData.name"
  33. >
  34. <div class="playlist">
  35. <h2
  36. class="playlist-name-clickable"
  37. x-text="playlistData.name"
  38. :data-playlist-name="playlistData.name"
  39. x-bind="playlistNameClick"
  40. ></h2>
  41. <div class="video-list">
  42. <!-- Truncated previous videos indicator -->
  43. <div
  44. class="truncated-videos"
  45. :data-playlist-name="playlistData.name"
  46. x-bind="truncatedVideosDisplay"
  47. >
  48. <span x-text="playlistData.truncationText"></span>
  49. </div>
  50. <template x-for="(video, index) in playlistData.visibleVideos" :key="index">
  51. <div
  52. class="video-item"
  53. :title="video.title"
  54. :data-playlist-name="playlistData.name"
  55. :data-playlist-index="video.originalIndex"
  56. x-bind="videoItemClass"
  57. >
  58. <a
  59. class="video-title"
  60. :href="video.url"
  61. x-text="video.title"
  62. x-bind="videoPlayLink"
  63. ></a>
  64. <div class="video-actions">
  65. <button
  66. :data-playlist-name="playlistData.name"
  67. :data-playlist-index="video.originalIndex"
  68. x-bind="moveUpButton"
  69. class="move-up-btn"
  70. title="Move up"
  71. >
  72. </button>
  73. <button
  74. :data-playlist-name="playlistData.name"
  75. :data-playlist-index="video.originalIndex"
  76. x-bind="moveDownButton"
  77. class="move-down-btn"
  78. title="Move down"
  79. >
  80. </button>
  81. <div class="more-menu-container">
  82. <button
  83. :data-playlist-name="playlistData.name"
  84. :data-playlist-index="video.originalIndex"
  85. x-bind="moreMenuButton"
  86. class="more-btn"
  87. title="More actions"
  88. >
  89. </button>
  90. <div
  91. class="more-menu"
  92. :data-playlist-name="playlistData.name"
  93. :data-playlist-index="video.originalIndex"
  94. x-bind="moreMenu"
  95. >
  96. <button
  97. :data-playlist-name="playlistData.name"
  98. :data-playlist-index="video.originalIndex"
  99. x-bind="toggleVideoDoneButton"
  100. class="menu-item done-item"
  101. x-text="video.doneButtonText"
  102. >
  103. </button>
  104. <button
  105. :data-playlist-name="playlistData.name"
  106. :data-playlist-index="video.originalIndex"
  107. x-bind="removeVideoButton"
  108. class="menu-item remove-item"
  109. >
  110. Remove
  111. </button>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </template>
  117. <!--
  118. <div x-show="videos.length === 0" class="empty-playlist">
  119. No videos in this playlist
  120. </div>
  121. -->
  122. </div>
  123. </div>
  124. </template>
  125. </div>
  126. <!-- History view -->
  127. <div class="history-container" x-bind="historyContainer">
  128. <div class="history-list">
  129. <template x-for="videoHistory in sortedHistory" :key="videoHistory.videoId">
  130. <div class="history-item" :data-video-id="videoHistory.videoId">
  131. <div class="history-video-info">
  132. <div class="history-video-title" x-text="videoHistory.title"></div>
  133. <a
  134. class="history-video-id"
  135. :href="videoHistory.url"
  136. x-text="videoHistory.formattedVideoId"
  137. x-bind="videoPlayLink"
  138. ></a>
  139. <div class="history-tags">
  140. <button
  141. class="tag-chip"
  142. :data-video-id="videoHistory.videoId"
  143. data-tag="notable"
  144. x-bind="tagChip"
  145. >
  146. notable
  147. </button>
  148. <button
  149. class="tag-chip"
  150. :data-video-id="videoHistory.videoId"
  151. data-tag="reference"
  152. x-bind="tagChip"
  153. >
  154. reference
  155. </button>
  156. <button
  157. class="tag-chip"
  158. :data-video-id="videoHistory.videoId"
  159. data-tag="to rewatch"
  160. x-bind="tagChip"
  161. >
  162. to rewatch
  163. </button>
  164. <button
  165. class="tag-chip"
  166. :data-video-id="videoHistory.videoId"
  167. data-tag="to save"
  168. x-bind="tagChip"
  169. >
  170. to save
  171. </button>
  172. </div>
  173. </div>
  174. <div class="history-events">
  175. <template x-for="event in videoHistory.processedEvents" :key="event.uniqueKey">
  176. <div class="history-event">
  177. <span class="event-action" x-text="event.formattedAction"></span>
  178. <span class="event-position" x-text="event.formattedPosition"></span>
  179. <span class="event-timestamp" x-text="event.formattedTimestamp"></span>
  180. </div>
  181. </template>
  182. </div>
  183. </div>
  184. </template>
  185. <div x-bind="historyEmptyState" class="empty-history">
  186. No video history yet
  187. </div>
  188. </div>
  189. </div>
  190. <!-- Save Channel view -->
  191. <div class="save-channel-container" x-bind="saveChannelContainer">
  192. <div class="save-channel-content">
  193. <div class="curl-command-section">
  194. <div class="curl-field-container">
  195. <textarea
  196. class="curl-command-field"
  197. x-text="curlCommand"
  198. readonly
  199. ></textarea>
  200. <button
  201. class="copy-curl-btn"
  202. x-bind="copyCurlButton"
  203. title="Copy to clipboard"
  204. >
  205. Copy
  206. </button>
  207. </div>
  208. </div>
  209. <div class="interval-section">
  210. <label for="check-interval-input" class="interval-label">Check Interval (days):</label>
  211. <input
  212. type="number"
  213. id="check-interval-input"
  214. class="interval-input"
  215. min="1"
  216. step="1"
  217. x-bind="intervalInput"
  218. />
  219. </div>
  220. <div class="category-section">
  221. <h3>Categories</h3>
  222. <div class="category-buttons">
  223. <template x-for="category in availableCategories" :key="category">
  224. <button
  225. class="category-btn"
  226. :data-category="category"
  227. x-bind="categoryButton"
  228. x-text="category"
  229. ></button>
  230. </template>
  231. </div>
  232. </div>
  233. <div class="save-channel-notice" x-bind="saveChannelNotice">
  234. <p>This feature is only available on YouTube channel pages (/videos).</p>
  235. </div>
  236. </div>
  237. </div>
  238. <!-- Individual playlist view -->
  239. <div class="playlist-view-container" x-bind="playlistViewContainer">
  240. <div class="playlist-full-view">
  241. <template x-for="(video, index) in currentPlaylistVideos" :key="index">
  242. <div
  243. class="video-item"
  244. :title="video.title"
  245. :data-playlist-name="currentPlaylistName"
  246. :data-playlist-index="index"
  247. x-bind="videoItemClass"
  248. >
  249. <a
  250. class="video-title"
  251. :href="video.url"
  252. x-text="video.title"
  253. x-bind="videoPlayLink"
  254. ></a>
  255. <div class="video-actions">
  256. <button
  257. :data-playlist-name="currentPlaylistName"
  258. :data-playlist-index="index"
  259. x-bind="moveUpButton"
  260. class="move-up-btn"
  261. title="Move up"
  262. >
  263. </button>
  264. <button
  265. :data-playlist-name="currentPlaylistName"
  266. :data-playlist-index="index"
  267. x-bind="moveDownButton"
  268. class="move-down-btn"
  269. title="Move down"
  270. >
  271. </button>
  272. <div class="more-menu-container">
  273. <button
  274. :data-playlist-name="currentPlaylistName"
  275. :data-playlist-index="index"
  276. x-bind="moreMenuButton"
  277. class="more-btn"
  278. title="More actions"
  279. >
  280. </button>
  281. <div
  282. class="more-menu"
  283. :data-playlist-name="currentPlaylistName"
  284. :data-playlist-index="index"
  285. x-bind="moreMenu"
  286. >
  287. <button
  288. :data-playlist-name="currentPlaylistName"
  289. :data-playlist-index="index"
  290. x-bind="toggleVideoDoneButton"
  291. class="menu-item done-item"
  292. x-text="video.doneButtonText"
  293. >
  294. </button>
  295. <button
  296. :data-playlist-name="currentPlaylistName"
  297. :data-playlist-index="index"
  298. x-bind="removeVideoButton"
  299. class="menu-item remove-item"
  300. >
  301. Remove
  302. </button>
  303. </div>
  304. </div>
  305. </div>
  306. </div>
  307. </template>
  308. <div x-bind="playlistViewEmptyState" class="empty-playlist">
  309. No videos in this playlist
  310. </div>
  311. </div>
  312. <!-- Add current page button -->
  313. <div class="add-current-page-container">
  314. <button
  315. class="add-current-page-btn"
  316. x-bind="addCurrentPageButton"
  317. x-text="addCurrentPageButtonText"
  318. ></button>
  319. </div>
  320. </div>
  321. <!-- Export/Import/History buttons -->
  322. <div class="export-container" x-bind="exportContainer">
  323. <button class="export-btn" x-bind="exportButton">
  324. Export Playlists
  325. </button>
  326. <button class="import-btn" x-bind="importButton">
  327. Import Playlists
  328. </button>
  329. <button class="history-btn" x-bind="historyButton">
  330. History
  331. </button>
  332. <button class="save-channel-btn" x-bind="saveChannelButton">
  333. Save Channel
  334. </button>
  335. <input
  336. type="file"
  337. id="import-file-input"
  338. accept=".json"
  339. style="display: none"
  340. x-bind="importFileInput"
  341. />
  342. </div>
  343. </div>
  344. </body>
  345. </html>