mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 10:52:20 +01:00
1 parent
1139110b98
commit
a9fc063242
1 file changed
+36
-5
@@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
const extConfig = {
|
const extConfig = {
|
||||||
// BEGIN USER OPTIONS
|
// BEGIN USER OPTIONS
|
||||||
// You may change the following variables to allowed values listed in the bracket (* means default). Keep the style and keywords intact.
|
// You may change the following variables to allowed values listed in the corresponding brackets (* means default). Keep the style and keywords intact.
|
||||||
showUpdatePopup: false, // [true, false*] Show popup tab after extension update (See what's new)
|
showUpdatePopup: false, // [true, false*] Show a popup tab after extension update (See what's new)
|
||||||
disableVoteSubmission: false, // [true, false*] Disable like/dislike submission (Stops counting your likes and dislikes)
|
disableVoteSubmission: false, // [true, false*] Disable like/dislike submission (Stops counting your likes and dislikes)
|
||||||
coloredThumbs: false, // [true, false*] Colorize thumbs (Use custom colors for thumb icons)
|
coloredThumbs: false, // [true, false*] Colorize thumbs (Use custom colors for thumb icons)
|
||||||
coloredBar: false, // [true, false*] Colorize ratio bar (Use custom colors for ratio bar)
|
coloredBar: false, // [true, false*] Colorize ratio bar (Use custom colors for ratio bar)
|
||||||
@@ -361,14 +361,45 @@ function numberFormat(numberState) {
|
|||||||
?.getAttribute("href")
|
?.getAttribute("href")
|
||||||
)?.searchParams?.get("locale");
|
)?.searchParams?.get("locale");
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
|
let numberDisplay;
|
||||||
|
if (extConfig.numberDisplayRoundDown === false) {
|
||||||
|
numberDisplay = numberState;
|
||||||
|
} else {
|
||||||
|
numberDisplay = roundDown(numberState);
|
||||||
|
}
|
||||||
|
return getNumberFormatter(extConfig.numberDisplayFormat).format(
|
||||||
|
numberDisplay
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNumberFormatter(optionSelect) {
|
||||||
|
let formatterNotation;
|
||||||
|
let formatterCompactDisplay;
|
||||||
|
|
||||||
|
switch (optionSelect) {
|
||||||
|
case "compactLong":
|
||||||
|
formatterNotation = "compact";
|
||||||
|
formatterCompactDisplay = "long";
|
||||||
|
break;
|
||||||
|
case "standard":
|
||||||
|
formatterNotation = "standard";
|
||||||
|
formatterCompactDisplay = "short";
|
||||||
|
break;
|
||||||
|
case "compactShort":
|
||||||
|
default:
|
||||||
|
formatterNotation = "compact";
|
||||||
|
formatterCompactDisplay = "short";
|
||||||
|
}
|
||||||
|
|
||||||
const formatter = Intl.NumberFormat(
|
const formatter = Intl.NumberFormat(
|
||||||
document.documentElement.lang || userLocales || navigator.language,
|
document.documentElement.lang || userLocales || navigator.language,
|
||||||
{
|
{
|
||||||
notation: "compact",
|
notation: formatterNotation,
|
||||||
|
compactDisplay: formatterCompactDisplay,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
return formatter;
|
||||||
return formatter.format(roundDown(numberState));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setEventListeners(evt) {
|
function setEventListeners(evt) {
|
||||||
|
|||||||
Reference in new issue
Block a user