Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Anarios/return-youtube-dislike.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErykDarnowski <github@erykdarnowski.pl>2022-05-04 01:09:37 +0300
committerErykDarnowski <github@erykdarnowski.pl>2022-05-04 01:09:37 +0300
commita5375bae2acb2aa551a77f414b93e7aa1e005234 (patch)
tree58a18e66712bda3ba39eeab08f6392973cba774a /Extensions/combined/ryd.background.js
parent94cc5734cb08d489bc55080b694e539bdbbe636c (diff)
Feat #211 (implementation in ryd.background.js)
Diffstat (limited to 'Extensions/combined/ryd.background.js')
-rw-r--r--Extensions/combined/ryd.background.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/Extensions/combined/ryd.background.js b/Extensions/combined/ryd.background.js
index 75f22ae..c1f7e1c 100644
--- a/Extensions/combined/ryd.background.js
+++ b/Extensions/combined/ryd.background.js
@@ -277,6 +277,12 @@ function storageChangeHandler(changes, area) {
changes.numberDisplayReformatLikes.newValue
);
}
+ if (changes.showTooltipPercentage !== undefined) {
+ handleShowTooltipPercentageChangeEvent(changes.showTooltipPercentage.newValue);
+ }
+ if (changes.numberDisplayReformatLikes !== undefined) {
+ handleNumberDisplayReformatLikesChangeEvent(changes.numberDisplayReformatLikes.newValue);
+ }
}
function handleDisableVoteSubmissionChangeEvent(value) {
@@ -292,6 +298,17 @@ function handleNumberDisplayFormatChangeEvent(value) {
extConfig.numberDisplayFormat = value;
}
+function handleShowTooltipPercentageChangeEvent(value) {
+ extConfig.showTooltipPercentage = value;
+};
+
+function handleTooltipPercentageModeChangeEvent(value) {
+ if (!value) {
+ value = "dash_like";
+ }
+ extConfig.tooltipPercentageMode = value;
+};
+
function handleNumberDisplayRoundDownChangeEvent(value) {
extConfig.numberDisplayRoundDown = value;
}
@@ -333,6 +350,8 @@ function initExtConfig() {
initializeNumberDisplayFormat();
initializeNumberDisplayRoundDown();
initializeNumberDisplayReformatLikes();
+ initializeTooltipPercentage();
+ initializeTooltipPercentageMode();
}
function initializeDisableVoteSubmission() {
@@ -396,6 +415,26 @@ function initializeNumberDisplayFormat() {
});
}
+function initializeTooltipPercentage() {
+ api.storage.sync.get(["showTooltipPercentage"], (res) => {
+ if (res.showTooltipPercentage === undefined) {
+ api.storage.sync.set({ showTooltipPercentage: false });
+ } else {
+ extConfig.showTooltipPercentage = res.showTooltipPercentage;
+ }
+ });
+}
+
+function initializeTooltipPercentageMode() {
+ api.storage.sync.get(["tooltipPercentageMode"], (res) => {
+ if (res.tooltipPercentageMode === undefined) {
+ api.storage.sync.set({ tooltipPercentageMode: "dash_like" });
+ } else {
+ extConfig.tooltipPercentageMode = res.tooltipPercentageMode;
+ }
+ });
+}
+
function initializeNumberDisplayReformatLikes() {
api.storage.sync.get(["numberDisplayReformatLikes"], (res) => {
if (res.numberDisplayReformatLikes === undefined) {