mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-26 00:03:01 +01:00
Merge pull request #560 from ErykDarnowski/main
Implemented option to show like/dislike percentage instead of full like/dislike count
This commit is contained in:
7 files changed
+229
-48
No files matched your search
@@ -23,6 +23,8 @@ let extConfig = {
|
||||
colorTheme: "classic",
|
||||
numberDisplayFormat: "compactShort",
|
||||
numberDisplayRoundDown: true,
|
||||
showTooltipPercentage: false,
|
||||
tooltipPercentageMode: "dash_like",
|
||||
numberDisplayReformatLikes: false,
|
||||
};
|
||||
|
||||
@@ -254,6 +256,8 @@ function initExtConfig() {
|
||||
initializeColorTheme();
|
||||
initializeNumberDisplayFormat();
|
||||
initializeNumberDisplayRoundDown();
|
||||
initializeTooltipPercentage();
|
||||
initializeTooltipPercentageMode();
|
||||
initializeNumberDisplayReformatLikes();
|
||||
}
|
||||
|
||||
@@ -317,6 +321,26 @@ function initializeNumberDisplayFormat() {
|
||||
});
|
||||
}
|
||||
|
||||
function initializeTooltipPercentage() {
|
||||
getBrowser().storage.sync.get(["showTooltipPercentage"], (res) => {
|
||||
if (res.showTooltipPercentage === undefined) {
|
||||
getBrowser().storage.sync.set({ showTooltipPercentage: false });
|
||||
} else {
|
||||
extConfig.showTooltipPercentage = res.showTooltipPercentage;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initializeTooltipPercentageMode() {
|
||||
getBrowser().storage.sync.get(["tooltipPercentageMode"], (res) => {
|
||||
if (res.tooltipPercentageMode === undefined) {
|
||||
getBrowser().storage.sync.set({ tooltipPercentageMode: "dash_like" });
|
||||
} else {
|
||||
extConfig.tooltipPercentageMode = res.tooltipPercentageMode;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initializeNumberDisplayReformatLikes() {
|
||||
getBrowser().storage.sync.get(["numberDisplayReformatLikes"], (res) => {
|
||||
if (res.numberDisplayReformatLikes === undefined) {
|
||||
|
||||
Reference in new issue
Block a user