Compare commits

...

5 Commits

Author SHA1 Message Date
Ajay Ramachandran
096bf0d750 Merge pull request #118 from ajayyy/experimental-ajay
Report button additions
2019-08-15 11:26:01 -04:00
Ajay Ramachandran
c81d4cc2a1 Update version number 2019-08-15 11:23:38 -04:00
Ajay Ramachandran
628f1043fa Added text to the report button. 2019-08-15 11:23:19 -04:00
Ajay Ramachandran
73b8d82b0f Made view count tracking work when the notice is disabled 2019-08-15 11:12:46 -04:00
Ajay Ramachandran
d6ba6c83e8 Update README.md 2019-08-15 00:54:45 -04:00
5 changed files with 25 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ SponsorBlock is an extension that will skip over sponsored segments of YouTube v
# Available for Chrome and Firefox # Available for Chrome and Firefox
Chrome: https://chrome.google.com/webstore/detail/ajjollijmimolcncegpgkbilohbhjnhi Chrome: https://chrome.google.com/webstore/detail/mnjggcdmjocbbbhaepdhchncahnbgone
Firefox: https://addons.mozilla.org/addon/sponsorblock/ Firefox: https://addons.mozilla.org/addon/sponsorblock/

View File

@@ -48,6 +48,12 @@
"noticeClosingMessage": { "noticeClosingMessage": {
"message": "closes in 7s" "message": "closes in 7s"
}, },
"reportButtonTitle": {
"message": "Report"
},
"reportButtonInfo": {
"message": "Report this sponsor submission as incorrect."
},
"Dismiss": { "Dismiss": {
"message": "Dismiss" "message": "Dismiss"
}, },

View File

@@ -178,7 +178,7 @@
} }
.voteButton { .voteButton {
height: 18px; height: 17px;
cursor: pointer; cursor: pointer;
} }
.voteButton:hover { .voteButton:hover {

View File

@@ -513,14 +513,16 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
setTimeout(() => closeSkipNotice(currentUUID), 7000); setTimeout(() => closeSkipNotice(currentUUID), 7000);
//send telemetry that a this sponsor was skipped happened //auto-upvote this sponsor
if (trackViewCount) { if (trackViewCount) {
sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
//upvote this
vote(1, currentUUID, true); vote(1, currentUUID, true);
} }
} }
//send telemetry that a this sponsor was skipped happened
if (trackViewCount) {
sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
}
} }
function goBackToPreviousTime(UUID) { function goBackToPreviousTime(UUID) {
@@ -927,13 +929,22 @@ function openSkipNotice(UUID){
let voteButtonsContainer = document.createElement("td"); let voteButtonsContainer = document.createElement("td");
voteButtonsContainer.id = "sponsorTimesVoteButtonsContainer" + UUID; 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"); let downvoteButton = document.createElement("img");
downvoteButton.id = "sponsorTimesDownvoteButtonsContainer" + UUID; downvoteButton.id = "sponsorTimesDownvoteButtonsContainer" + UUID;
downvoteButton.className = "sponsorSkipObject voteButton"; downvoteButton.className = "sponsorSkipObject voteButton";
downvoteButton.src = chrome.extension.getURL("icons/report.png"); downvoteButton.src = chrome.extension.getURL("icons/report.png");
downvoteButton.addEventListener("click", () => vote(0, UUID)); 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); voteButtonsContainer.appendChild(downvoteButton);
//add unskip button //add unskip button

View File

@@ -1,7 +1,7 @@
{ {
"name": "__MSG_fullName__", "name": "__MSG_fullName__",
"short_name": "__MSG_Name__", "short_name": "__MSG_Name__",
"version": "1.0.37", "version": "1.0.38",
"default_locale": "en", "default_locale": "en",
"description": "__MSG_Description__", "description": "__MSG_Description__",
"content_scripts": [ "content_scripts": [