mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-01 18:31:24 +01:00
Bugfixes, author name changed
This commit is contained in:
1 parent
00f03095c6
commit
f5650fcc4e
12 files changed
+89
-69
No files matched your search
@@ -6,7 +6,7 @@
|
|||||||
"message": "Returns ability to see dislikes"
|
"message": "Returns ability to see dislikes"
|
||||||
},
|
},
|
||||||
"textDeveloper": {
|
"textDeveloper": {
|
||||||
"message": "by Dmitrii Selivanov & Community"
|
"message": "by Dmitry Selivanov & Community"
|
||||||
},
|
},
|
||||||
"linkWebsite": {
|
"linkWebsite": {
|
||||||
"message": "Website"
|
"message": "Website"
|
||||||
@@ -32,4 +32,4 @@
|
|||||||
"textUpdate": {
|
"textUpdate": {
|
||||||
"message": "update to"
|
"message": "update to"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"message": "Returns ability to see dislikes"
|
"message": "Returns ability to see dislikes"
|
||||||
},
|
},
|
||||||
"textDeveloper": {
|
"textDeveloper": {
|
||||||
"message": "by Dmitrii Selivanov & Community"
|
"message": "by Dmitry Selivanov & Community"
|
||||||
},
|
},
|
||||||
"linkWebsite": {
|
"linkWebsite": {
|
||||||
"message": "Website"
|
"message": "Website"
|
||||||
@@ -32,4 +32,4 @@
|
|||||||
"textUpdate": {
|
"textUpdate": {
|
||||||
"message": "update to"
|
"message": "update to"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"message": "Returns ability to see dislikes"
|
"message": "Returns ability to see dislikes"
|
||||||
},
|
},
|
||||||
"textDeveloper": {
|
"textDeveloper": {
|
||||||
"message": "by Dmitrii Selivanov & Community"
|
"message": "by Dmitry Selivanov & Community"
|
||||||
},
|
},
|
||||||
"linkWebsite": {
|
"linkWebsite": {
|
||||||
"message": "Website"
|
"message": "Website"
|
||||||
@@ -32,4 +32,4 @@
|
|||||||
"textUpdate": {
|
"textUpdate": {
|
||||||
"message": "update to"
|
"message": "update to"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"message": "Regresa la posibilidad de ver los dislikes"
|
"message": "Regresa la posibilidad de ver los dislikes"
|
||||||
},
|
},
|
||||||
"textDeveloper": {
|
"textDeveloper": {
|
||||||
"message": "por Dmitrii Selivanov y la Comunidad"
|
"message": "por Dmitry Selivanov y la Comunidad"
|
||||||
},
|
},
|
||||||
"linkWebsite": {
|
"linkWebsite": {
|
||||||
"message": "Página web"
|
"message": "Página web"
|
||||||
@@ -32,4 +32,4 @@
|
|||||||
"textUpdate": {
|
"textUpdate": {
|
||||||
"message": "actualizar a"
|
"message": "actualizar a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"message": "Regresa la posibilidad de ver los dislikes"
|
"message": "Regresa la posibilidad de ver los dislikes"
|
||||||
},
|
},
|
||||||
"textDeveloper": {
|
"textDeveloper": {
|
||||||
"message": "por Dmitrii Selivanov y la Comunidad"
|
"message": "por Dmitry Selivanov y la Comunidad"
|
||||||
},
|
},
|
||||||
"linkWebsite": {
|
"linkWebsite": {
|
||||||
"message": "Página web"
|
"message": "Página web"
|
||||||
@@ -32,4 +32,4 @@
|
|||||||
"textUpdate": {
|
"textUpdate": {
|
||||||
"message": "actualizar a"
|
"message": "actualizar a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"message": "Ré-affiche les pouces rouges/dislikes des vidées"
|
"message": "Ré-affiche les pouces rouges/dislikes des vidées"
|
||||||
},
|
},
|
||||||
"textDeveloper": {
|
"textDeveloper": {
|
||||||
"message": "par Dmitrii Selivanov & Communauté"
|
"message": "par Dmitry Selivanov & Communauté"
|
||||||
},
|
},
|
||||||
"linkWebsite": {
|
"linkWebsite": {
|
||||||
"message": "Site web"
|
"message": "Site web"
|
||||||
@@ -32,4 +32,4 @@
|
|||||||
"textUpdate": {
|
"textUpdate": {
|
||||||
"message": "mettre à jour vers"
|
"message": "mettre à jour vers"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"message": "A capacidade de ver os retornos de não gostos"
|
"message": "A capacidade de ver os retornos de não gostos"
|
||||||
},
|
},
|
||||||
"textDeveloper": {
|
"textDeveloper": {
|
||||||
"message": "por Dmitrii Selivanov e a Comunidade"
|
"message": "por Dmitry Selivanov e a Comunidade"
|
||||||
},
|
},
|
||||||
"linkWebsite": {
|
"linkWebsite": {
|
||||||
"message": "Website"
|
"message": "Website"
|
||||||
@@ -32,4 +32,4 @@
|
|||||||
"textUpdate": {
|
"textUpdate": {
|
||||||
"message": "atualização para"
|
"message": "atualização para"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,10 +102,7 @@
|
|||||||
>
|
>
|
||||||
</label>
|
</label>
|
||||||
<br />
|
<br />
|
||||||
<label class="switch" data-hover="Use custom colors in new pages.">
|
<label class="switch" data-hover="Round down numbers (default YouTube behavior)">
|
||||||
<input type="checkbox" id="colored_bar" />
|
|
||||||
</label>
|
|
||||||
<label class="switch">
|
|
||||||
<input type="checkbox" id="number_round_down" />
|
<input type="checkbox" id="number_round_down" />
|
||||||
<span class="slider" />
|
<span class="slider" />
|
||||||
<span class="switchLabel">Show rounded down numbers</span>
|
<span class="switchLabel">Show rounded down numbers</span>
|
||||||
@@ -119,15 +116,15 @@
|
|||||||
<option value="standard" id="number_format_standard"></option>
|
<option value="standard" id="number_format_standard"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <br />
|
|
||||||
<label class="switch">
|
|
||||||
<input type="checkbox" id="color_ratio" />
|
|
||||||
<span class="slider" />
|
|
||||||
<span class="switchLabel">Colorize ratio bar</span>
|
|
||||||
</label>
|
|
||||||
<br />
|
<br />
|
||||||
<label class="switch" data-hover="Use custom colors in new pages.">
|
<div class="custom-select">
|
||||||
|
<label class="switch" data-hover="Use custom colors for ratio bar.">
|
||||||
|
<input type="checkbox" id="colored_bar" />
|
||||||
|
<span class="slider" />
|
||||||
|
<span class="switchLabel">Colorize ratio bar</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<label class="switch" data-hover="Use custom colors for thumb icons.">
|
||||||
<input type="checkbox" id="colored_thumbs" />
|
<input type="checkbox" id="colored_thumbs" />
|
||||||
<span class="slider" />
|
<span class="slider" />
|
||||||
<span class="switchLabel">Colorize thumbs</span>
|
<span class="switchLabel">Colorize thumbs</span>
|
||||||
@@ -137,26 +134,32 @@
|
|||||||
<label for="color_theme">Color theme:</label>
|
<label for="color_theme">Color theme:</label>
|
||||||
<select name="color_theme" id="color_theme">
|
<select name="color_theme" id="color_theme">
|
||||||
<option value="classic" id="color_theme_classic">Classic</option>
|
<option value="classic" id="color_theme_classic">Classic</option>
|
||||||
<option value="accessible" id="color_theme_accessible">Accessible</option>
|
<option value="accessible" id="color_theme_accessible">
|
||||||
|
Accessible
|
||||||
|
</option>
|
||||||
<option value="neon" id="color_theme_neon">Neon</option>
|
<option value="neon" id="color_theme_neon">Neon</option>
|
||||||
</select>
|
</select>
|
||||||
<span id="color_theme_example_like" style="display: inline-block; vertical-align: text-top; width: 1em; height: 1em;"> </span>
|
<span
|
||||||
<span id="color_theme_example_dislike" style="display: inline-block; vertical-align: text-top; width: 1em; height: 1em;"> </span>
|
id="color_theme_example_like"
|
||||||
|
style="
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: text-top;
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
"
|
||||||
|
> </span
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
id="color_theme_example_dislike"
|
||||||
|
style="
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: text-top;
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
"
|
||||||
|
> </span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <br />
|
|
||||||
<label class="switch">
|
|
||||||
<input type="checkbox" id="star_ratio" />
|
|
||||||
<span class="slider" />
|
|
||||||
<span class="switchLabel">5-star Rating Bar</span>
|
|
||||||
</label>
|
|
||||||
<br /> -->
|
|
||||||
|
|
||||||
<!-- <label class="switch">
|
|
||||||
<input type="checkbox" id="disable_api_unlisted" />
|
|
||||||
<span class="slider" />
|
|
||||||
<span class="switchLabel">Lorem ipsum dolor sit amet</span> </label
|
|
||||||
><br /> -->
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</body>
|
</body>
|
||||||
<script src="popup.js"></script>
|
<script src="popup.js"></script>
|
||||||
|
|||||||
@@ -55,17 +55,21 @@ function createLink(url, id) {
|
|||||||
chrome.tabs.create({ url: url });
|
chrome.tabs.create({ url: url });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
document
|
document
|
||||||
.getElementById("disable_vote_submission")
|
.getElementById("disable_vote_submission")
|
||||||
.addEventListener("click", (ev) => {
|
.addEventListener("click", (ev) => {
|
||||||
chrome.storage.sync.set({ disableVoteSubmission: ev.target.checked });
|
chrome.storage.sync.set({ disableVoteSubmission: ev.target.checked });
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("colored_thumbs").addEventListener("click", (ev) => {
|
document.getElementById("colored_thumbs").addEventListener("click", (ev) => {
|
||||||
chrome.storage.sync.set({ coloredThumbs: ev.target.checked });
|
chrome.storage.sync.set({ coloredThumbs: ev.target.checked });
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("colored_bar").addEventListener("click", (ev) => {
|
document.getElementById("colored_bar").addEventListener("click", (ev) => {
|
||||||
chrome.storage.sync.set({ coloredBar: ev.target.checked });
|
chrome.storage.sync.set({ coloredBar: ev.target.checked });
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("color_theme").addEventListener("click", (ev) => {
|
document.getElementById("color_theme").addEventListener("click", (ev) => {
|
||||||
chrome.storage.sync.set({ colorTheme: ev.target.value });
|
chrome.storage.sync.set({ colorTheme: ev.target.value });
|
||||||
});
|
});
|
||||||
@@ -223,6 +227,9 @@ function handleColoredBarChangeEvent(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleColorThemeChangeEvent(value) {
|
function handleColorThemeChangeEvent(value) {
|
||||||
|
if (!value) {
|
||||||
|
value = "classic";
|
||||||
|
}
|
||||||
config.colorTheme = value;
|
config.colorTheme = value;
|
||||||
document
|
document
|
||||||
.getElementById("color_theme")
|
.getElementById("color_theme")
|
||||||
@@ -236,6 +243,7 @@ function updateColorThemePreviewContent(themeName) {
|
|||||||
document.getElementById("color_theme_example_dislike").style.backgroundColor =
|
document.getElementById("color_theme_example_dislike").style.backgroundColor =
|
||||||
getColorFromTheme(themeName, false);
|
getColorFromTheme(themeName, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleNumberDisplayRoundDownChangeEvent(value) {
|
function handleNumberDisplayRoundDownChangeEvent(value) {
|
||||||
config.numberDisplayRoundDown = value;
|
config.numberDisplayRoundDown = value;
|
||||||
document.getElementById("number_round_down").checked = value;
|
document.getElementById("number_round_down").checked = value;
|
||||||
@@ -251,6 +259,14 @@ function handleNumberDisplayFormatChangeEvent(value) {
|
|||||||
function getNumberFormatter(optionSelect) {
|
function getNumberFormatter(optionSelect) {
|
||||||
let formatterNotation;
|
let formatterNotation;
|
||||||
let formatterCompactDisplay;
|
let formatterCompactDisplay;
|
||||||
|
let userLocales;
|
||||||
|
try {
|
||||||
|
userLocales = new URL(
|
||||||
|
Array.from(document.querySelectorAll("head > link[rel='search']"))
|
||||||
|
?.find((n) => n?.getAttribute("href")?.includes("?locale="))
|
||||||
|
?.getAttribute("href")
|
||||||
|
)?.searchParams?.get("locale");
|
||||||
|
} catch {}
|
||||||
|
|
||||||
switch (optionSelect) {
|
switch (optionSelect) {
|
||||||
case "compactLong":
|
case "compactLong":
|
||||||
|
|||||||
@@ -295,6 +295,9 @@ function handleColoredBarChangeEvent(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleColorThemeChangeEvent(value) {
|
function handleColorThemeChangeEvent(value) {
|
||||||
|
if (!value) {
|
||||||
|
value = "classic";
|
||||||
|
}
|
||||||
extConfig.colorTheme = value;
|
extConfig.colorTheme = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function createRateBar(likes, dislikes) {
|
|||||||
const widthPercent =
|
const widthPercent =
|
||||||
likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50;
|
likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50;
|
||||||
|
|
||||||
if (!rateBar) {
|
if (!rateBar && !isMobile()) {
|
||||||
let colorLikeStyle = "";
|
let colorLikeStyle = "";
|
||||||
let colorDislikeStyle = "";
|
let colorDislikeStyle = "";
|
||||||
if (extConfig.coloredBar) {
|
if (extConfig.coloredBar) {
|
||||||
@@ -21,13 +21,12 @@ function createRateBar(likes, dislikes) {
|
|||||||
colorDislikeStyle = "; background-color: " + getColorFromTheme(false);
|
colorDislikeStyle = "; background-color: " + getColorFromTheme(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rateBar && !isMobile()) {
|
(
|
||||||
(
|
document.getElementById("menu-container") ||
|
||||||
document.getElementById("menu-container") ||
|
document.querySelector("ytm-slim-video-action-bar-renderer")
|
||||||
document.querySelector("ytm-slim-video-action-bar-renderer")
|
).insertAdjacentHTML(
|
||||||
).insertAdjacentHTML(
|
"beforeend",
|
||||||
"beforeend",
|
`
|
||||||
`
|
|
||||||
<div class="ryd-tooltip" style="width: ${widthPx}px">
|
<div class="ryd-tooltip" style="width: ${widthPx}px">
|
||||||
<div class="ryd-tooltip-bar-container">
|
<div class="ryd-tooltip-bar-container">
|
||||||
<div
|
<div
|
||||||
@@ -45,26 +44,24 @@ function createRateBar(likes, dislikes) {
|
|||||||
</tp-yt-paper-tooltip>
|
</tp-yt-paper-tooltip>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
document.getElementById("ryd-bar-container").style.width =
|
|
||||||
widthPx + "px";
|
|
||||||
document.getElementById("ryd-bar").style.width = widthPercent + "%";
|
|
||||||
document.querySelector(
|
|
||||||
"#ryd-dislike-tooltip > #tooltip"
|
|
||||||
).innerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}`;
|
|
||||||
if (extConfig.coloredBar) {
|
|
||||||
document.getElementById("ryd-bar-container").style.backgroundColor =
|
|
||||||
getColorFromTheme(false);
|
|
||||||
document.getElementById("ryd-bar").style.backgroundColor =
|
|
||||||
getColorFromTheme(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
cLog("removing bar");
|
document.getElementById("ryd-bar-container").style.width = widthPx + "px";
|
||||||
let ratebar = document.getElementById("ryd-bar-container");
|
document.getElementById("ryd-bar").style.width = widthPercent + "%";
|
||||||
ratebar.parentNode.removeChild(ratebar);
|
document.querySelector(
|
||||||
|
"#ryd-dislike-tooltip > #tooltip"
|
||||||
|
).innerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}`;
|
||||||
|
if (extConfig.coloredBar) {
|
||||||
|
document.getElementById("ryd-bar-container").style.backgroundColor =
|
||||||
|
getColorFromTheme(false);
|
||||||
|
document.getElementById("ryd-bar").style.backgroundColor =
|
||||||
|
getColorFromTheme(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
cLog("removing bar");
|
||||||
|
let ratebar = document.getElementById("ryd-bar-container");
|
||||||
|
ratebar.parentNode.removeChild(ratebar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ function handleColoredBarChangeEvent(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleColorThemeChangeEvent(value) {
|
function handleColorThemeChangeEvent(value) {
|
||||||
|
if (!value) value = "classic";
|
||||||
extConfig.colorTheme = value;
|
extConfig.colorTheme = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user