popup.html 14 KB

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