Bugfixes, author name changed

This commit is contained in:
Dmitrii Selivanov
2022-03-21 01:26:42 +03:00
parent 00f03095c6
commit f5650fcc4e
12 changed files with 89 additions and 69 deletions
@@ -6,7 +6,7 @@
"message": "Returns ability to see dislikes"
},
"textDeveloper": {
"message": "by Dmitrii Selivanov & Community"
"message": "by Dmitry Selivanov & Community"
},
"linkWebsite": {
"message": "Website"
@@ -32,4 +32,4 @@
"textUpdate": {
"message": "update to"
}
}
}
@@ -6,7 +6,7 @@
"message": "Returns ability to see dislikes"
},
"textDeveloper": {
"message": "by Dmitrii Selivanov & Community"
"message": "by Dmitry Selivanov & Community"
},
"linkWebsite": {
"message": "Website"
@@ -32,4 +32,4 @@
"textUpdate": {
"message": "update to"
}
}
}
@@ -6,7 +6,7 @@
"message": "Returns ability to see dislikes"
},
"textDeveloper": {
"message": "by Dmitrii Selivanov & Community"
"message": "by Dmitry Selivanov & Community"
},
"linkWebsite": {
"message": "Website"
@@ -32,4 +32,4 @@
"textUpdate": {
"message": "update to"
}
}
}
@@ -6,7 +6,7 @@
"message": "Regresa la posibilidad de ver los dislikes"
},
"textDeveloper": {
"message": "por Dmitrii Selivanov y la Comunidad"
"message": "por Dmitry Selivanov y la Comunidad"
},
"linkWebsite": {
"message": "Página web"
@@ -32,4 +32,4 @@
"textUpdate": {
"message": "actualizar a"
}
}
}
@@ -6,7 +6,7 @@
"message": "Regresa la posibilidad de ver los dislikes"
},
"textDeveloper": {
"message": "por Dmitrii Selivanov y la Comunidad"
"message": "por Dmitry Selivanov y la Comunidad"
},
"linkWebsite": {
"message": "Página web"
@@ -32,4 +32,4 @@
"textUpdate": {
"message": "actualizar a"
}
}
}
@@ -6,7 +6,7 @@
"message": "Ré-affiche les pouces rouges/dislikes des vidées"
},
"textDeveloper": {
"message": "par Dmitrii Selivanov & Communauté"
"message": "par Dmitry Selivanov & Communauté"
},
"linkWebsite": {
"message": "Site web"
@@ -32,4 +32,4 @@
"textUpdate": {
"message": "mettre à jour vers"
}
}
}
@@ -6,7 +6,7 @@
"message": "A capacidade de ver os retornos de não gostos"
},
"textDeveloper": {
"message": "por Dmitrii Selivanov e a Comunidade"
"message": "por Dmitry Selivanov e a Comunidade"
},
"linkWebsite": {
"message": "Website"
@@ -32,4 +32,4 @@
"textUpdate": {
"message": "atualização para"
}
}
}
+32 -29
View File
@@ -102,10 +102,7 @@
>
</label>
<br />
<label class="switch" data-hover="Use custom colors in new pages.">
<input type="checkbox" id="colored_bar" />
</label>
<label class="switch">
<label class="switch" data-hover="Round down numbers (default YouTube behavior)">
<input type="checkbox" id="number_round_down" />
<span class="slider" />
<span class="switchLabel">Show rounded down numbers</span>
@@ -119,15 +116,15 @@
<option value="standard" id="number_format_standard"></option>
</select>
</div>
<!-- <br />
<label class="switch">
<input type="checkbox" id="color_ratio" />
<span class="slider" />
<span class="switchLabel">Colorize ratio bar</span>
</label>
<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" />
<span class="slider" />
<span class="switchLabel">Colorize thumbs</span>
@@ -137,26 +134,32 @@
<label for="color_theme">Color theme:</label>
<select name="color_theme" id="color_theme">
<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>
</select>
<span id="color_theme_example_like" style="display: inline-block; vertical-align: text-top; width: 1em; height: 1em;">&nbsp;</span>
<span id="color_theme_example_dislike" style="display: inline-block; vertical-align: text-top; width: 1em; height: 1em;">&nbsp;</span>
<span
id="color_theme_example_like"
style="
display: inline-block;
vertical-align: text-top;
width: 1em;
height: 1em;
"
>&nbsp;</span
>
<span
id="color_theme_example_dislike"
style="
display: inline-block;
vertical-align: text-top;
width: 1em;
height: 1em;
"
>&nbsp;</span
>
</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>
</body>
<script src="popup.js"></script>
+16
View File
@@ -55,17 +55,21 @@ function createLink(url, id) {
chrome.tabs.create({ url: url });
});
}
document
.getElementById("disable_vote_submission")
.addEventListener("click", (ev) => {
chrome.storage.sync.set({ disableVoteSubmission: ev.target.checked });
});
document.getElementById("colored_thumbs").addEventListener("click", (ev) => {
chrome.storage.sync.set({ coloredThumbs: ev.target.checked });
});
document.getElementById("colored_bar").addEventListener("click", (ev) => {
chrome.storage.sync.set({ coloredBar: ev.target.checked });
});
document.getElementById("color_theme").addEventListener("click", (ev) => {
chrome.storage.sync.set({ colorTheme: ev.target.value });
});
@@ -223,6 +227,9 @@ function handleColoredBarChangeEvent(value) {
}
function handleColorThemeChangeEvent(value) {
if (!value) {
value = "classic";
}
config.colorTheme = value;
document
.getElementById("color_theme")
@@ -236,6 +243,7 @@ function updateColorThemePreviewContent(themeName) {
document.getElementById("color_theme_example_dislike").style.backgroundColor =
getColorFromTheme(themeName, false);
}
function handleNumberDisplayRoundDownChangeEvent(value) {
config.numberDisplayRoundDown = value;
document.getElementById("number_round_down").checked = value;
@@ -251,6 +259,14 @@ function handleNumberDisplayFormatChangeEvent(value) {
function getNumberFormatter(optionSelect) {
let formatterNotation;
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) {
case "compactLong":
+3
View File
@@ -295,6 +295,9 @@ function handleColoredBarChangeEvent(value) {
}
function handleColorThemeChangeEvent(value) {
if (!value) {
value = "classic";
}
extConfig.colorTheme = value;
}
+23 -26
View File
@@ -13,7 +13,7 @@ function createRateBar(likes, dislikes) {
const widthPercent =
likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50;
if (!rateBar) {
if (!rateBar && !isMobile()) {
let colorLikeStyle = "";
let colorDislikeStyle = "";
if (extConfig.coloredBar) {
@@ -21,13 +21,12 @@ function createRateBar(likes, dislikes) {
colorDislikeStyle = "; background-color: " + getColorFromTheme(false);
}
if (!rateBar && !isMobile()) {
(
document.getElementById("menu-container") ||
document.querySelector("ytm-slim-video-action-bar-renderer")
).insertAdjacentHTML(
"beforeend",
`
(
document.getElementById("menu-container") ||
document.querySelector("ytm-slim-video-action-bar-renderer")
).insertAdjacentHTML(
"beforeend",
`
<div class="ryd-tooltip" style="width: ${widthPx}px">
<div class="ryd-tooltip-bar-container">
<div
@@ -45,26 +44,24 @@ function createRateBar(likes, dislikes) {
</tp-yt-paper-tooltip>
</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()}&nbsp;/&nbsp;${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);
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()}&nbsp;/&nbsp;${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);
}
}
+1
View File
@@ -145,6 +145,7 @@ function handleColoredBarChangeEvent(value) {
}
function handleColorThemeChangeEvent(value) {
if (!value) value = "classic";
extConfig.colorTheme = value;
}