From eeaaf2f158b874101d8c72c0855f55fafa81c395 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Sun, 14 Jul 2024 22:50:24 +0900 Subject: [PATCH] fix: fix album actions - fix #2202 --- src/plugins/album-actions/index.ts | 9 +- .../album-actions/templates/dislike.html | 106 +++++++++--------- src/plugins/album-actions/templates/like.html | 106 +++++++++--------- .../album-actions/templates/undislike.html | 106 +++++++++--------- .../album-actions/templates/unlike.html | 106 +++++++++--------- 5 files changed, 223 insertions(+), 210 deletions(-) diff --git a/src/plugins/album-actions/index.ts b/src/plugins/album-actions/index.ts index d258541f..c9bf1864 100644 --- a/src/plugins/album-actions/index.ts +++ b/src/plugins/album-actions/index.ts @@ -112,8 +112,13 @@ export default createPlugin< i++; } } - const menu = document.querySelector('.detail-page-menu'); - if (menu && !document.querySelector('.like-menu')) { + const menuParent = document.querySelector('#action-buttons')?.parentElement; + if (menuParent && !document.querySelector('.like-menu')) { + const menu = document.createElement('div'); + menu.id = 'ytmd-album-action-buttons'; + menu.className = 'action-buttons style-scope ytmusic-responsive-header-renderer'; + + menuParent.insertBefore(menu, menuParent.children[menuParent.children.length - 1]); for (const button of buttons) { menu.appendChild(button); button.addEventListener('click', this.loadFullList); diff --git a/src/plugins/album-actions/templates/dislike.html b/src/plugins/album-actions/templates/dislike.html index 289812d3..1d00412c 100644 --- a/src/plugins/album-actions/templates/dislike.html +++ b/src/plugins/album-actions/templates/dislike.html @@ -1,40 +1,58 @@ - +
+
+ + + + diff --git a/src/plugins/album-actions/templates/like.html b/src/plugins/album-actions/templates/like.html index d7fd78a9..9de2cfbe 100644 --- a/src/plugins/album-actions/templates/like.html +++ b/src/plugins/album-actions/templates/like.html @@ -1,40 +1,58 @@ - +
+
+ + + + diff --git a/src/plugins/album-actions/templates/undislike.html b/src/plugins/album-actions/templates/undislike.html index 83d1295d..9716a3ca 100644 --- a/src/plugins/album-actions/templates/undislike.html +++ b/src/plugins/album-actions/templates/undislike.html @@ -1,40 +1,58 @@ - +
+
+ + + + diff --git a/src/plugins/album-actions/templates/unlike.html b/src/plugins/album-actions/templates/unlike.html index 6f93dbaf..5ca2952a 100644 --- a/src/plugins/album-actions/templates/unlike.html +++ b/src/plugins/album-actions/templates/unlike.html @@ -1,40 +1,58 @@ - +
+
+ + + +