|
@@ -37,46 +37,46 @@ const branch = "develop"; // #DEBUG#
|
|
|
|
|
|
const featInfo = {
|
|
const featInfo = {
|
|
arrowKeySupport: {
|
|
arrowKeySupport: {
|
|
- desc: "Arrow keys should skip forwards and backwards by 10 seconds",
|
|
|
|
|
|
+ desc: "Arrow keys should skip forwards and backwards by 10 seconds?",
|
|
type: "toggle",
|
|
type: "toggle",
|
|
default: true,
|
|
default: true,
|
|
},
|
|
},
|
|
removeUpgradeTab: {
|
|
removeUpgradeTab: {
|
|
- desc: "Remove the \"Upgrade\" / YT Music Premium tab",
|
|
|
|
|
|
+ desc: "Remove the \"Upgrade\" / YT Music Premium tab?",
|
|
type: "toggle",
|
|
type: "toggle",
|
|
default: true,
|
|
default: true,
|
|
},
|
|
},
|
|
switchBetweenSites: {
|
|
switchBetweenSites: {
|
|
- desc: "Add F9 as a hotkey to switch between the YT and YTM sites on a video / song",
|
|
|
|
|
|
+ desc: "Add F9 as a hotkey to switch between the YT and YTM sites on a video / song?",
|
|
type: "toggle",
|
|
type: "toggle",
|
|
default: true,
|
|
default: true,
|
|
},
|
|
},
|
|
geniusLyrics: {
|
|
geniusLyrics: {
|
|
- desc: "Add a button to the media controls bar to search for the current song's lyrics on genius.com in a new tab",
|
|
|
|
|
|
+ desc: "Add a button to the media controls bar to search for the current song's lyrics on genius.com in a new tab?",
|
|
type: "toggle",
|
|
type: "toggle",
|
|
default: true,
|
|
default: true,
|
|
},
|
|
},
|
|
lyricsButtonsOnSongQueue: {
|
|
lyricsButtonsOnSongQueue: {
|
|
- desc: "TODO: Add a lyrics button to each song in the queue (\"up next\" tab)",
|
|
|
|
|
|
+ desc: "TODO: Add a lyrics button to each song in the queue (\"up next\" tab)?",
|
|
type: "toggle",
|
|
type: "toggle",
|
|
default: true,
|
|
default: true,
|
|
},
|
|
},
|
|
volumeSliderSize: {
|
|
volumeSliderSize: {
|
|
- desc: "Set the width of the volume slider",
|
|
|
|
|
|
+ desc: "The width of the volume slider in px",
|
|
type: "number",
|
|
type: "number",
|
|
min: 10,
|
|
min: 10,
|
|
max: 1000,
|
|
max: 1000,
|
|
default: 175,
|
|
default: 175,
|
|
},
|
|
},
|
|
volumeSliderStep: {
|
|
volumeSliderStep: {
|
|
- desc: "The smaller this number, the finer the volume control",
|
|
|
|
|
|
+ desc: "Volume slider sensitivity - the smaller this number, the finer the volume control",
|
|
type: "slider",
|
|
type: "slider",
|
|
min: 1,
|
|
min: 1,
|
|
max: 20,
|
|
max: 20,
|
|
default: 2,
|
|
default: 2,
|
|
},
|
|
},
|
|
removeWatermark: {
|
|
removeWatermark: {
|
|
- desc: "Remove the watermark under the YTM logo",
|
|
|
|
|
|
+ desc: "Remove the watermark under the YTM logo?",
|
|
type: "toggle",
|
|
type: "toggle",
|
|
default: false,
|
|
default: false,
|
|
},
|
|
},
|
|
@@ -237,7 +237,7 @@ function addMenu()
|
|
|
|
|
|
// title
|
|
// title
|
|
const titleCont = document.createElement("div");
|
|
const titleCont = document.createElement("div");
|
|
- titleCont.style.padding = "8px 20px";
|
|
|
|
|
|
+ titleCont.style.padding = "8px 20px 20px 8px";
|
|
titleCont.style.display = "flex";
|
|
titleCont.style.display = "flex";
|
|
titleCont.style.justifyContent = "space-between";
|
|
titleCont.style.justifyContent = "space-between";
|
|
titleCont.id = "betterytm-menu-titlecont";
|
|
titleCont.id = "betterytm-menu-titlecont";
|
|
@@ -257,12 +257,14 @@ function addMenu()
|
|
anchorElem.href = href;
|
|
anchorElem.href = href;
|
|
anchorElem.title = title;
|
|
anchorElem.title = title;
|
|
anchorElem.style.marginLeft = "10px";
|
|
anchorElem.style.marginLeft = "10px";
|
|
-
|
|
|
|
- const linkElem = document.createElement("img");
|
|
|
|
- linkElem.className = "betterytm-menu-img";
|
|
|
|
- linkElem.src = imgSrc;
|
|
|
|
-
|
|
|
|
- anchorElem.appendChild(linkElem);
|
|
|
|
|
|
+
|
|
|
|
+ const imgElem = document.createElement("img");
|
|
|
|
+ imgElem.className = "betterytm-menu-img";
|
|
|
|
+ imgElem.src = imgSrc;
|
|
|
|
+ imgElem.style.width = "32px";
|
|
|
|
+ imgElem.style.height = "32px";
|
|
|
|
+
|
|
|
|
+ anchorElem.appendChild(imgElem);
|
|
linksCont.appendChild(anchorElem);
|
|
linksCont.appendChild(anchorElem);
|
|
};
|
|
};
|
|
|
|
|
|
@@ -273,7 +275,9 @@ function addMenu()
|
|
closeElem.id = "betterytm-menu-close";
|
|
closeElem.id = "betterytm-menu-close";
|
|
closeElem.src = `https://raw.githubusercontent.com/Sv443/BetterYTM/${branch}/resources/icon/close.png`;
|
|
closeElem.src = `https://raw.githubusercontent.com/Sv443/BetterYTM/${branch}/resources/icon/close.png`;
|
|
closeElem.title = "Click to close the menu";
|
|
closeElem.title = "Click to close the menu";
|
|
- closeElem.style.marginLeft = "20px";
|
|
|
|
|
|
+ closeElem.style.marginLeft = "50px";
|
|
|
|
+ closeElem.style.width = "32px";
|
|
|
|
+ closeElem.style.height = "32px";
|
|
closeElem.addEventListener("click", closeMenu);
|
|
closeElem.addEventListener("click", closeMenu);
|
|
|
|
|
|
linksCont.appendChild(closeElem);
|
|
linksCont.appendChild(closeElem);
|
|
@@ -332,7 +336,7 @@ function addMenu()
|
|
{
|
|
{
|
|
const textElem = document.createElement("span");
|
|
const textElem = document.createElement("span");
|
|
textElem.style.display = "inline-block";
|
|
textElem.style.display = "inline-block";
|
|
- textElem.style.fontSize = "16px";
|
|
|
|
|
|
+ textElem.style.fontSize = "15px";
|
|
textElem.innerText = desc;
|
|
textElem.innerText = desc;
|
|
|
|
|
|
ftConfElem.appendChild(textElem);
|
|
ftConfElem.appendChild(textElem);
|
|
@@ -374,7 +378,7 @@ function addMenu()
|
|
if(type === "toggle")
|
|
if(type === "toggle")
|
|
inputElem.checked = initialVal;
|
|
inputElem.checked = initialVal;
|
|
|
|
|
|
- const fmtVal = v => typeof v === "number" ? `${v}px` : v;
|
|
|
|
|
|
+ const fmtVal = v => String(v);
|
|
|
|
|
|
let labelElem;
|
|
let labelElem;
|
|
if(type === "slider")
|
|
if(type === "slider")
|
|
@@ -416,6 +420,22 @@ function addMenu()
|
|
featuresCont.appendChild(ftConfElem);
|
|
featuresCont.appendChild(ftConfElem);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const footerElem = document.createElement("div");
|
|
|
|
+ footerElem.style.marginTop = "40px";
|
|
|
|
+ footerElem.style.fontSize = "17px";
|
|
|
|
+ footerElem.style.textDecoration = "underline";
|
|
|
|
+ footerElem.style.padding = "8px 20px";
|
|
|
|
+ footerElem.innerText = "You need to reload the page to apply changes.";
|
|
|
|
+
|
|
|
|
+ const reloadElem = document.createElement("button");
|
|
|
|
+ reloadElem.style.marginLeft = "20px";
|
|
|
|
+ reloadElem.innerText = "Reload now";
|
|
|
|
+ reloadElem.title = "Click to reload the page";
|
|
|
|
+ reloadElem.addEventListener("click", () => location.reload());
|
|
|
|
+
|
|
|
|
+ footerElem.appendChild(reloadElem);
|
|
|
|
+ featuresCont.appendChild(footerElem);
|
|
|
|
+
|
|
|
|
|
|
// finalize
|
|
// finalize
|
|
menuContainer.appendChild(titleCont);
|
|
menuContainer.appendChild(titleCont);
|
|
@@ -442,7 +462,7 @@ function addMenu()
|
|
display: inline-block;
|
|
display: inline-block;
|
|
position: fixed;
|
|
position: fixed;
|
|
width: 50vw;
|
|
width: 50vw;
|
|
- height: 50vh;
|
|
|
|
|
|
+ height: auto;
|
|
min-height: 500px;
|
|
min-height: 500px;
|
|
left: 25vw;
|
|
left: 25vw;
|
|
top: 25vh;
|
|
top: 25vh;
|
|
@@ -676,24 +696,22 @@ function removeUpgradeTab()
|
|
function addWatermark()
|
|
function addWatermark()
|
|
{
|
|
{
|
|
const watermark = document.createElement("a");
|
|
const watermark = document.createElement("a");
|
|
-
|
|
|
|
watermark.id = "betterytm-watermark";
|
|
watermark.id = "betterytm-watermark";
|
|
watermark.className = "style-scope ytmusic-nav-bar";
|
|
watermark.className = "style-scope ytmusic-nav-bar";
|
|
-
|
|
|
|
watermark.innerText = info.name;
|
|
watermark.innerText = info.name;
|
|
- watermark.title = `${info.name} v${info.version}`;
|
|
|
|
|
|
+ watermark.title = "Open menu";
|
|
|
|
+ watermark.href = "#";
|
|
|
|
|
|
- watermark.href = info.namespace;
|
|
|
|
- watermark.target = "_blank";
|
|
|
|
- watermark.rel = "noopener noreferrer";
|
|
|
|
|
|
+ watermark.addEventListener("click", () => openMenu());
|
|
|
|
|
|
|
|
|
|
const style = `\
|
|
const style = `\
|
|
#betterytm-watermark {
|
|
#betterytm-watermark {
|
|
|
|
+ font-size: 10px;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
position: absolute;
|
|
position: absolute;
|
|
left: 45px;
|
|
left: 45px;
|
|
- top: 43px;
|
|
|
|
|
|
+ top: 46px;
|
|
z-index: 10;
|
|
z-index: 10;
|
|
color: white;
|
|
color: white;
|
|
text-decoration: none;
|
|
text-decoration: none;
|