|
@@ -277,6 +277,12 @@ function storageChangeHandler(changes, area) {
|
|
changes.numberDisplayReformatLikes.newValue
|
|
changes.numberDisplayReformatLikes.newValue
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
+ if (changes.showTooltipPercentage !== undefined) {
|
|
|
|
+ handleShowTooltipPercentageChangeEvent(changes.showTooltipPercentage.newValue);
|
|
|
|
+ }
|
|
|
|
+ if (changes.numberDisplayReformatLikes !== undefined) {
|
|
|
|
+ handleNumberDisplayReformatLikesChangeEvent(changes.numberDisplayReformatLikes.newValue);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function handleDisableVoteSubmissionChangeEvent(value) {
|
|
function handleDisableVoteSubmissionChangeEvent(value) {
|
|
@@ -292,6 +298,17 @@ function handleNumberDisplayFormatChangeEvent(value) {
|
|
extConfig.numberDisplayFormat = value;
|
|
extConfig.numberDisplayFormat = value;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function handleShowTooltipPercentageChangeEvent(value) {
|
|
|
|
+ extConfig.showTooltipPercentage = value;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+function handleTooltipPercentageModeChangeEvent(value) {
|
|
|
|
+ if (!value) {
|
|
|
|
+ value = "dash_like";
|
|
|
|
+ }
|
|
|
|
+ extConfig.tooltipPercentageMode = value;
|
|
|
|
+};
|
|
|
|
+
|
|
function handleNumberDisplayRoundDownChangeEvent(value) {
|
|
function handleNumberDisplayRoundDownChangeEvent(value) {
|
|
extConfig.numberDisplayRoundDown = value;
|
|
extConfig.numberDisplayRoundDown = value;
|
|
}
|
|
}
|
|
@@ -333,6 +350,8 @@ function initExtConfig() {
|
|
initializeNumberDisplayFormat();
|
|
initializeNumberDisplayFormat();
|
|
initializeNumberDisplayRoundDown();
|
|
initializeNumberDisplayRoundDown();
|
|
initializeNumberDisplayReformatLikes();
|
|
initializeNumberDisplayReformatLikes();
|
|
|
|
+ initializeTooltipPercentage();
|
|
|
|
+ initializeTooltipPercentageMode();
|
|
}
|
|
}
|
|
|
|
|
|
function initializeDisableVoteSubmission() {
|
|
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() {
|
|
function initializeNumberDisplayReformatLikes() {
|
|
api.storage.sync.get(["numberDisplayReformatLikes"], (res) => {
|
|
api.storage.sync.get(["numberDisplayReformatLikes"], (res) => {
|
|
if (res.numberDisplayReformatLikes === undefined) {
|
|
if (res.numberDisplayReformatLikes === undefined) {
|