Add tooltips to vote buttons in popup

This commit is contained in:
Ajay 2022-04-22 22:17:25 -04:00
parent b075116502
commit 1a908b5038
2 changed files with 22 additions and 6 deletions

View file

@ -164,6 +164,9 @@
"copyPublicID": {
"message": "Copy Public UserID"
},
"copySegmentID": {
"message": "Copy Segment ID"
},
"discordAdvert": {
"message": "Come join the official discord server to give suggestions and feedback!"
},
@ -867,18 +870,27 @@
"CopyDownvoteButtonInfo": {
"message": "Downvotes and creates a local copy for you to resubmit"
},
"OpenCategoryWikiPage": {
"message": "Open this category's wiki page."
},
"CopyAndDownvote": {
"OpenCategoryWikiPage": {
"message": "Open this category's wiki page."
},
"CopyAndDownvote": {
"message": "Copy and downvote"
},
"ContinueVoting": {
"ContinueVoting": {
"message": "Continue Voting"
},
"ChangeCategoryTooltip": {
"ChangeCategoryTooltip": {
"message": "This will instantly apply to your segments"
},
"downvote": {
"message": "Downvote"
},
"upvote": {
"message": "Upvote"
},
"hideSegment": {
"message": "Hide segment"
},
"SponsorTimeEditScrollNewFeature": {
"message": "Use your mousewheel while hovering over the edit box to quickly adjust the time. Combinations of the ctrl or shift key can be used to fine tune the changes."
},

View file

@ -451,12 +451,14 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
const upvoteButton = document.createElement("img");
upvoteButton.id = "sponsorTimesUpvoteButtonsContainer" + UUID;
upvoteButton.className = "voteButton";
upvoteButton.title = chrome.i18n.getMessage("upvote");
upvoteButton.src = chrome.runtime.getURL("icons/thumbs_up.svg");
upvoteButton.addEventListener("click", () => vote(1, UUID));
const downvoteButton = document.createElement("img");
downvoteButton.id = "sponsorTimesDownvoteButtonsContainer" + UUID;
downvoteButton.className = "voteButton";
downvoteButton.title = chrome.i18n.getMessage("downvote");
downvoteButton.src = locked && isVip ? chrome.runtime.getURL("icons/thumbs_down_locked.svg") : chrome.runtime.getURL("icons/thumbs_down.svg");
downvoteButton.addEventListener("click", () => vote(0, UUID));
@ -464,6 +466,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
uuidButton.id = "sponsorTimesCopyUUIDButtonContainer" + UUID;
uuidButton.className = "voteButton";
uuidButton.src = chrome.runtime.getURL("icons/clipboard.svg");
uuidButton.title = chrome.i18n.getMessage("copySegmentID");
uuidButton.addEventListener("click", () => {
navigator.clipboard.writeText(UUID);
const stopAnimation = AnimationUtils.applyLoadingAnimation(uuidButton, 0.3);
@ -473,6 +476,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
const hideButton = document.createElement("img");
hideButton.id = "sponsorTimesCopyUUIDButtonContainer" + UUID;
hideButton.className = "voteButton";
hideButton.title = chrome.i18n.getMessage("hideSegment");
if (segmentTimes[i].hidden === SponsorHideType.Hidden) {
hideButton.src = chrome.runtime.getURL("icons/not_visible.svg");
} else {