diff options
author | Ajay <[email protected]> | 2022-04-22 22:17:25 -0400 |
---|---|---|
committer | Ajay <[email protected]> | 2022-04-22 22:17:25 -0400 |
commit | 1a908b5038bc9ed242d5622f38abb0e26e7d9962 (patch) | |
tree | f3a9962bb5e8882cd57c3a4428ab0fb842f51775 | |
parent | b075116502e38e783b14a7299fa0e86251de049e (diff) | |
download | SponsorBlock-1a908b5038bc9ed242d5622f38abb0e26e7d9962.tar.gz SponsorBlock-1a908b5038bc9ed242d5622f38abb0e26e7d9962.zip |
Add tooltips to vote buttons in popup
-rw-r--r-- | public/_locales/en/messages.json | 24 | ||||
-rw-r--r-- | src/popup.ts | 4 |
2 files changed, 22 insertions, 6 deletions
diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index c63626eb..c2782048 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -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." }, diff --git a/src/popup.ts b/src/popup.ts index 5957f651..ccb8a36d 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -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 { |