popup.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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" x-bind="backButton">← Back</button>
  18. <h1>History</h1>
  19. </header>
  20. <div class="playlists-container" x-bind="playlistsContainer">
  21. <template
  22. x-for="(videos, playlistName) in playlists"
  23. :key="playlistName"
  24. >
  25. <div class="playlist">
  26. <h2 x-text="playlistName"></h2>
  27. <div class="video-list">
  28. <template x-for="(video, index) in videos" :key="index">
  29. <div
  30. class="video-item"
  31. :title="video.title"
  32. :data-playlist-name="playlistName"
  33. :data-playlist-index="index"
  34. x-bind="videoItemClass"
  35. >
  36. <a
  37. class="video-title"
  38. :href="video.url"
  39. x-text="video.title"
  40. x-bind="videoPlayLink"
  41. ></a>
  42. <div class="video-actions">
  43. <button
  44. :data-playlist-name="playlistName"
  45. :data-playlist-index="index"
  46. x-bind="moveUpButton"
  47. class="move-up-btn"
  48. title="Move up"
  49. >
  50. </button>
  51. <button
  52. :data-playlist-name="playlistName"
  53. :data-playlist-index="index"
  54. x-bind="moveDownButton"
  55. class="move-down-btn"
  56. title="Move down"
  57. >
  58. </button>
  59. <div class="more-menu-container">
  60. <button
  61. :data-playlist-name="playlistName"
  62. :data-playlist-index="index"
  63. x-bind="moreMenuButton"
  64. class="more-btn"
  65. title="More actions"
  66. >
  67. </button>
  68. <div
  69. class="more-menu"
  70. :data-playlist-name="playlistName"
  71. :data-playlist-index="index"
  72. x-bind="moreMenu"
  73. >
  74. <button
  75. :data-playlist-name="playlistName"
  76. :data-playlist-index="index"
  77. x-bind="removeVideoButton"
  78. class="menu-item remove-item"
  79. >
  80. Remove
  81. </button>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </template>
  87. <!--
  88. <div x-show="videos.length === 0" class="empty-playlist">
  89. No videos in this playlist
  90. </div>
  91. -->
  92. </div>
  93. </div>
  94. </template>
  95. </div>
  96. <!-- History view -->
  97. <div class="history-container" x-bind="historyContainer">
  98. <div class="history-list">
  99. <template x-for="videoHistory in sortedHistory" :key="videoHistory.videoId">
  100. <div class="history-item" :data-video-id="videoHistory.videoId">
  101. <div class="history-video-info">
  102. <a
  103. class="history-video-title"
  104. :href="videoHistory.url"
  105. x-text="videoHistory.title"
  106. x-bind="videoPlayLink"
  107. ></a>
  108. <div class="history-video-id" x-text="videoHistory.formattedVideoId"></div>
  109. </div>
  110. <div class="history-events">
  111. <template x-for="event in videoHistory.processedEvents" :key="event.uniqueKey">
  112. <div class="history-event">
  113. <span class="event-action" x-text="event.formattedAction"></span>
  114. <span class="event-position" x-text="event.formattedPosition"></span>
  115. <span class="event-timestamp" x-text="event.formattedTimestamp"></span>
  116. </div>
  117. </template>
  118. </div>
  119. </div>
  120. </template>
  121. <div x-bind="historyEmptyState" class="empty-history">
  122. No video history yet
  123. </div>
  124. </div>
  125. </div>
  126. <!-- Export/Import/History buttons -->
  127. <div class="export-container" x-bind="exportContainer">
  128. <button class="export-btn" x-bind="exportButton">
  129. Export Playlists
  130. </button>
  131. <button class="import-btn" x-bind="importButton">
  132. Import Playlists
  133. </button>
  134. <button class="history-btn" x-bind="historyButton">
  135. History
  136. </button>
  137. <input
  138. type="file"
  139. id="import-file-input"
  140. accept=".json"
  141. style="display: none"
  142. @change="importFile($event)"
  143. />
  144. </div>
  145. </div>
  146. </body>
  147. </html>