Ver código fonte

ref: rename resources

Sv443 1 ano atrás
pai
commit
18f418fcbc

+ 0 - 0
assets/icons/add_circle_small.svg → assets/icons/plus_circle_small.svg


+ 13 - 15
assets/resources.json

@@ -1,22 +1,20 @@
 {
-  "img-arrow_down": "icons/arrow_down.svg",
-  "img-delete": "icons/delete.svg",
-  "img-error": "icons/error.svg",
-  "img-globe": "icons/globe.svg",
-  "img-help": "icons/help.svg",
-  "img-lyrics": "icons/lyrics.svg",
-  "img-skip_to": "icons/skip_to.svg",
-  "img-spinner": "icons/spinner.svg",
-  "img-add_circle_small": "icons/add_circle_small.svg",
+  "css-fix_spacing": "style/fixSpacing.css",
+  "css-anchor_improvements": "style/anchorImprovements.css",
+  "doc-changelog": "/changelog.md",
+  "icon-arrow_down": "icons/arrow_down.svg",
+  "icon-delete": "icons/delete.svg",
+  "icon-error": "icons/error.svg",
+  "icon-globe": "icons/globe.svg",
+  "icon-help": "icons/help.svg",
+  "icon-lyrics": "icons/lyrics.svg",
+  "icon-skip_to": "icons/skip_to.svg",
+  "icon-spinner": "icons/spinner.svg",
+  "icon-advanced_mode": "icons/plus_circle_small.svg",
   "img-logo": "logo/logo_48.png",
   "img-close": "icons/close.png",
   "img-discord": "external/discord.png",
   "img-github": "external/github.png",
   "img-greasyfork": "external/greasyfork.png",
-  "img-openuserjs": "external/openuserjs.png",
-
-  "css-fix_spacing": "style/fixSpacing.css",
-  "css-anchor_improvements": "style/anchorImprovements.css",
-
-  "doc-changelog": "/changelog.md"
+  "img-openuserjs": "external/openuserjs.png"
 }

+ 7 - 7
assets/translations/README.md

@@ -30,7 +30,7 @@ This means you need to manually check against the base translations for missing
 | Key | English text |
 | --- | ------------ |
 | `trigger_btn_action` | `Trigger` |
-| `advanced_mode_tooltip` | `Advanced mode` |
+| `advanced_mode` | `Advanced mode` |
 | `lyrics_clear_cache_confirm_prompt-1` | `The lyrics cache currently has %1 entry.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_confirm_prompt-n` | `The lyrics cache currently has %1 entries.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_success` | `Lyrics cache was cleared successfully.` |
@@ -67,7 +67,7 @@ This means you need to manually check against the base translations for missing
 | Key | English text |
 | --- | ------------ |
 | `trigger_btn_action` | `Trigger` |
-| `advanced_mode_tooltip` | `Advanced mode` |
+| `advanced_mode` | `Advanced mode` |
 | `lyrics_clear_cache_confirm_prompt-1` | `The lyrics cache currently has %1 entry.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_confirm_prompt-n` | `The lyrics cache currently has %1 entries.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_success` | `Lyrics cache was cleared successfully.` |
@@ -104,7 +104,7 @@ This means you need to manually check against the base translations for missing
 | Key | English text |
 | --- | ------------ |
 | `trigger_btn_action` | `Trigger` |
-| `advanced_mode_tooltip` | `Advanced mode` |
+| `advanced_mode` | `Advanced mode` |
 | `lyrics_clear_cache_confirm_prompt-1` | `The lyrics cache currently has %1 entry.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_confirm_prompt-n` | `The lyrics cache currently has %1 entries.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_success` | `Lyrics cache was cleared successfully.` |
@@ -141,7 +141,7 @@ This means you need to manually check against the base translations for missing
 | Key | English text |
 | --- | ------------ |
 | `trigger_btn_action` | `Trigger` |
-| `advanced_mode_tooltip` | `Advanced mode` |
+| `advanced_mode` | `Advanced mode` |
 | `lyrics_clear_cache_confirm_prompt-1` | `The lyrics cache currently has %1 entry.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_confirm_prompt-n` | `The lyrics cache currently has %1 entries.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_success` | `Lyrics cache was cleared successfully.` |
@@ -178,7 +178,7 @@ This means you need to manually check against the base translations for missing
 | Key | English text |
 | --- | ------------ |
 | `trigger_btn_action` | `Trigger` |
-| `advanced_mode_tooltip` | `Advanced mode` |
+| `advanced_mode` | `Advanced mode` |
 | `lyrics_clear_cache_confirm_prompt-1` | `The lyrics cache currently has %1 entry.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_confirm_prompt-n` | `The lyrics cache currently has %1 entries.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_success` | `Lyrics cache was cleared successfully.` |
@@ -215,7 +215,7 @@ This means you need to manually check against the base translations for missing
 | Key | English text |
 | --- | ------------ |
 | `trigger_btn_action` | `Trigger` |
-| `advanced_mode_tooltip` | `Advanced mode` |
+| `advanced_mode` | `Advanced mode` |
 | `lyrics_clear_cache_confirm_prompt-1` | `The lyrics cache currently has %1 entry.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_confirm_prompt-n` | `The lyrics cache currently has %1 entries.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_success` | `Lyrics cache was cleared successfully.` |
@@ -252,7 +252,7 @@ This means you need to manually check against the base translations for missing
 | Key | English text |
 | --- | ------------ |
 | `trigger_btn_action` | `Trigger` |
-| `advanced_mode_tooltip` | `Advanced mode` |
+| `advanced_mode` | `Advanced mode` |
 | `lyrics_clear_cache_confirm_prompt-1` | `The lyrics cache currently has %1 entry.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_confirm_prompt-n` | `The lyrics cache currently has %1 entries.\nDo you really want to delete them?` |
 | `lyrics_clear_cache_success` | `Lyrics cache was cleared successfully.` |

+ 1 - 1
assets/translations/en_US.json

@@ -49,7 +49,7 @@
     "scroll_to_bottom": "Click to scroll to the bottom",
     "volume_tooltip": "Volume: %1% (Sensitivity: %2%)",
     "middle_click_open_tab": "Middle-click to open in a new tab",
-    "advanced_mode_tooltip": "Advanced mode",
+    "advanced_mode": "Advanced mode",
 
     "open_current_lyrics": "Open the current song's lyrics in a new tab",
     "open_lyrics": "Open this song's lyrics in a new tab",

+ 2 - 2
src/features/index.ts

@@ -326,7 +326,7 @@ export const featInfo = {
     default: getPreferredLocale(),
     enable: () => void "TODO",
     // TODO: to be reworked or removed in the big menu rework
-    textAdornment: async () => await resourceToHTMLString("img-globe") ?? "",
+    textAdornment: async () => await resourceToHTMLString("icon-globe") ?? "",
   },
   versionCheck: {
     type: "toggle",
@@ -357,5 +357,5 @@ export const featInfo = {
 } as const satisfies FeatureInfo;
 
 async function getAdvancedModeAdornment() {
-  return `<span class="advanced-mode-icon" title="${t("advanced_mode_tooltip")}">${await resourceToHTMLString("img-add_circle_small") ?? ""}</span>`;
+  return `<span class="bytm-advanced-mode-icon" title="${t("advanced_mode")}">${await resourceToHTMLString("icon-advanced_mode") ?? ""}</span>`;
 }

+ 1 - 1
src/features/layout.ts

@@ -493,7 +493,7 @@ export async function addScrollToActiveBtn() {
 
       const imgElem = document.createElement("img");
       imgElem.className = "bytm-generic-btn-img";
-      imgElem.src = await getResourceUrl("img-skip_to");
+      imgElem.src = await getResourceUrl("icon-skip_to");
 
       linkElem.addEventListener("click", (e) => {
         const activeItem = document.querySelector<HTMLElement>("#side-panel .ytmusic-player-queue ytmusic-player-queue-item[play-button-state=\"loading\"], #side-panel .ytmusic-player-queue ytmusic-player-queue-item[play-button-state=\"playing\"], #side-panel .ytmusic-player-queue ytmusic-player-queue-item[play-button-state=\"paused\"]");

+ 4 - 4
src/features/lyrics.ts

@@ -161,9 +161,9 @@ async function addActualMediaCtrlLyricsBtn(likeContainer: HTMLElement) {
 
   currentSongTitle = songTitleElem.title;
 
-  const spinnerIconUrl = await getResourceUrl("img-spinner");
-  const lyricsIconUrl = await getResourceUrl("img-lyrics");
-  const errorIconUrl = await getResourceUrl("img-error");
+  const spinnerIconUrl = await getResourceUrl("icon-spinner");
+  const lyricsIconUrl = await getResourceUrl("icon-lyrics");
+  const errorIconUrl = await getResourceUrl("icon-error");
 
   const onMutation = async (mutations: MutationRecord[]) => {
     for await(const mut of mutations) {
@@ -494,7 +494,7 @@ export async function createLyricsBtn(geniusUrl?: string, hideIfLoading = true)
 
   const imgElem = document.createElement("img");
   imgElem.className = "bytm-generic-btn-img";
-  imgElem.src = await getResourceUrl("img-lyrics");
+  imgElem.src = await getResourceUrl("icon-lyrics");
 
   linkElem.appendChild(imgElem);
 

+ 4 - 4
src/features/songLists.ts

@@ -93,8 +93,8 @@ async function addQueueButtons(
   const queueBtnsCont = document.createElement("div");
   queueBtnsCont.classList.add("bytm-queue-btn-container", ...classes);
 
-  const lyricsIconUrl = await getResourceUrl("img-lyrics");
-  const deleteIconUrl = await getResourceUrl("img-delete");
+  const lyricsIconUrl = await getResourceUrl("icon-lyrics");
+  const deleteIconUrl = await getResourceUrl("icon-delete");
 
   //#SECTION lyrics btn
   let lyricsBtnElem: HTMLAnchorElement | undefined;
@@ -162,7 +162,7 @@ async function addQueueButtons(
         if(!cachedLyricsEntry) {
           queueItem.setAttribute("data-bytm-loading", "");
 
-          imgEl.src = await getResourceUrl("img-spinner");
+          imgEl.src = await getResourceUrl("icon-spinner");
           imgEl.classList.add("bytm-spinner");
         }
 
@@ -256,7 +256,7 @@ async function addQueueButtons(
           if(!removeFromQueueBtn) {
             warn("Couldn't find 'remove from queue' button in queue item three dots menu");
             dotsBtnElem.click();
-            imgElem.src = await getResourceUrl("img-error");
+            imgElem.src = await getResourceUrl("icon-error");
             if(deleteBtnElem)
               deleteBtnElem.ariaLabel = deleteBtnElem.title = (listType === "currentQueue" ? t("couldnt_remove_from_queue") : t("couldnt_delete_from_list"));
           }

+ 1 - 1
src/menu/welcomeMenu.ts

@@ -97,7 +97,7 @@ export async function addWelcomeMenu() {
   const localeImg = document.createElement("img");
   localeImg.id = "bytm-welcome-menu-locale-img";
   localeImg.classList.add("bytm-no-select");
-  localeImg.src = await getResourceUrl("img-globe");
+  localeImg.src = await getResourceUrl("icon-globe");
 
   const localeSelectElem = document.createElement("select");
   localeSelectElem.id = "bytm-welcome-menu-locale-select";