From d375a97e996431963b569fa7d5f5cf6a0dd29abc Mon Sep 17 00:00:00 2001 From: FlorianZahn Date: Fri, 15 Oct 2021 20:52:15 +0200 Subject: [PATCH] Vip Warning also in popup --- manifest/manifest.json | 1 + public/icons/thumbs_down_locked.svg | 58 +++++++++++++++++++++++++++++ src/popup.ts | 3 +- 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 public/icons/thumbs_down_locked.svg diff --git a/manifest/manifest.json b/manifest/manifest.json index c9350235..5f640277 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -37,6 +37,7 @@ "icons/upvote.png", "icons/downvote.png", "icons/thumbs_down.svg", + "icons/thumbs_down_locked.svg", "icons/thumbs_up.svg", "icons/help.svg", "icons/report.png", diff --git a/public/icons/thumbs_down_locked.svg b/public/icons/thumbs_down_locked.svg new file mode 100644 index 00000000..57672e2d --- /dev/null +++ b/public/icons/thumbs_down_locked.svg @@ -0,0 +1,58 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/src/popup.ts b/src/popup.ts index 680e0779..2cdbab04 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -381,6 +381,7 @@ async function runThePopup(messageListener?: MessageListener): Promise { for (let i = 0; i < segmentTimes.length; i++) { const UUID = segmentTimes[i].UUID; + const locked = segmentTimes[i].locked; const sponsorTimeButton = document.createElement("button"); sponsorTimeButton.className = "segmentTimeButton popupElement"; @@ -430,7 +431,7 @@ async function runThePopup(messageListener?: MessageListener): Promise { const downvoteButton = document.createElement("img"); downvoteButton.id = "sponsorTimesDownvoteButtonsContainer" + UUID; downvoteButton.className = "voteButton"; - downvoteButton.src = chrome.runtime.getURL("icons/thumbs_down.svg"); + downvoteButton.src = locked ? chrome.runtime.getURL("icons/thumbs_down_locked.svg") : chrome.runtime.getURL("icons/thumbs_down.svg"); downvoteButton.addEventListener("click", () => vote(0, UUID)); //uuid button