mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-29 19:03:44 +00:00
feat: Add toggle to swap the order of like/dislike buttons (#4221)
This commit is contained in:
@ -29,6 +29,7 @@ export interface DefaultConfig {
|
|||||||
autoResetAppCache: boolean;
|
autoResetAppCache: boolean;
|
||||||
resumeOnStart: boolean;
|
resumeOnStart: boolean;
|
||||||
likeButtons: string;
|
likeButtons: string;
|
||||||
|
swapLikeButtonsOrder: boolean;
|
||||||
proxy: string;
|
proxy: string;
|
||||||
startingPage: string;
|
startingPage: string;
|
||||||
backgroundMaterial?: 'none' | 'mica' | 'acrylic' | 'tabbed';
|
backgroundMaterial?: 'none' | 'mica' | 'acrylic' | 'tabbed';
|
||||||
@ -66,6 +67,7 @@ export const defaultConfig: DefaultConfig = {
|
|||||||
autoResetAppCache: false,
|
autoResetAppCache: false,
|
||||||
resumeOnStart: true,
|
resumeOnStart: true,
|
||||||
likeButtons: '',
|
likeButtons: '',
|
||||||
|
swapLikeButtonsOrder: false,
|
||||||
proxy: '',
|
proxy: '',
|
||||||
startingPage: '',
|
startingPage: '',
|
||||||
overrideUserAgent: false,
|
overrideUserAgent: false,
|
||||||
|
|||||||
@ -154,6 +154,7 @@
|
|||||||
"default": "Default",
|
"default": "Default",
|
||||||
"force-show": "Force show",
|
"force-show": "Force show",
|
||||||
"hide": "Hide",
|
"hide": "Hide",
|
||||||
|
"swap": "Swap like buttons order",
|
||||||
"label": "Like buttons"
|
"label": "Like buttons"
|
||||||
},
|
},
|
||||||
"custom-window-title": {
|
"custom-window-title": {
|
||||||
|
|||||||
13
src/menu.ts
13
src/menu.ts
@ -285,6 +285,19 @@ export const mainMenuTemplate = async (
|
|||||||
config.set('options.likeButtons', 'hide');
|
config.set('options.likeButtons', 'hide');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t(
|
||||||
|
'main.menu.options.submenu.visual-tweaks.submenu.like-buttons.swap',
|
||||||
|
),
|
||||||
|
type: 'checkbox',
|
||||||
|
checked: config.get('options.swapLikeButtonsOrder'),
|
||||||
|
click(item: MenuItem) {
|
||||||
|
config.setMenuOption(
|
||||||
|
'options.swapLikeButtonsOrder',
|
||||||
|
item.checked,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -406,6 +406,18 @@ async function onApiLoaded() {
|
|||||||
|
|
||||||
document.head.appendChild(style);
|
document.head.appendChild(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Swap like button order
|
||||||
|
if (window.mainConfig.get('options.swapLikeButtonsOrder')) {
|
||||||
|
const style = document.createElement('style');
|
||||||
|
style.textContent = `
|
||||||
|
#like-button-renderer {
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
}`;
|
||||||
|
|
||||||
|
document.head.appendChild(style);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user