From 73b8d82b0fbefc2c20c157512e238e9f85912e13 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 15 Aug 2019 11:12:46 -0400 Subject: [PATCH 1/3] Made view count tracking work when the notice is disabled --- content.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/content.js b/content.js index c05cd9ad..c3715ad0 100644 --- a/content.js +++ b/content.js @@ -513,14 +513,16 @@ function skipToTime(v, index, sponsorTimes, openNotice) { setTimeout(() => closeSkipNotice(currentUUID), 7000); - //send telemetry that a this sponsor was skipped happened + //auto-upvote this sponsor if (trackViewCount) { - sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID); - - //upvote this vote(1, currentUUID, true); } } + + //send telemetry that a this sponsor was skipped happened + if (trackViewCount) { + sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID); + } } function goBackToPreviousTime(UUID) { From 628f1043fa612dea4849512ad57836b4092656be Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 15 Aug 2019 11:23:19 -0400 Subject: [PATCH 2/3] Added text to the report button. --- _locales/en/messages.json | 6 ++++++ content.css | 2 +- content.js | 11 ++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 954b309c..1759ba95 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -48,6 +48,12 @@ "noticeClosingMessage": { "message": "closes in 7s" }, + "reportButtonTitle": { + "message": "Report" + }, + "reportButtonInfo": { + "message": "Report this sponsor submission as incorrect." + }, "Dismiss": { "message": "Dismiss" }, diff --git a/content.css b/content.css index 074bca68..ac68fc27 100644 --- a/content.css +++ b/content.css @@ -178,7 +178,7 @@ } .voteButton { - height: 18px; + height: 17px; cursor: pointer; } .voteButton:hover { diff --git a/content.js b/content.js index c3715ad0..b22c2239 100644 --- a/content.js +++ b/content.js @@ -929,13 +929,22 @@ function openSkipNotice(UUID){ let voteButtonsContainer = document.createElement("td"); voteButtonsContainer.id = "sponsorTimesVoteButtonsContainer" + UUID; + let reportText = document.createElement("span"); + reportText.id = "sponsorTimesReportText" + UUID; + reportText.className = "sponsorTimesInfoMessage sponsorTimesVoteButtonMessage"; + reportText.innerText = chrome.i18n.getMessage("reportButtonTitle"); + reportText.style.marginRight = "5px"; + reportText.setAttribute("title", chrome.i18n.getMessage("reportButtonInfo")); + let downvoteButton = document.createElement("img"); downvoteButton.id = "sponsorTimesDownvoteButtonsContainer" + UUID; downvoteButton.className = "sponsorSkipObject voteButton"; downvoteButton.src = chrome.extension.getURL("icons/report.png"); downvoteButton.addEventListener("click", () => vote(0, UUID)); + downvoteButton.setAttribute("title", chrome.i18n.getMessage("reportButtonInfo")); - //add thumbs up and down buttons to the container + //add downvote and report text to container + voteButtonsContainer.appendChild(reportText); voteButtonsContainer.appendChild(downvoteButton); //add unskip button From c81d4cc2a1510d7a9e404d0b3fb842361c0f8d5d Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 15 Aug 2019 11:23:38 -0400 Subject: [PATCH 3/3] Update version number --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index cc8f81fb..1de4e824 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "__MSG_Name__", - "version": "1.0.37", + "version": "1.0.38", "default_locale": "en", "description": "__MSG_Description__", "content_scripts": [