mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Merge pull request #118 from ajayyy/experimental-ajay
Report button additions
This commit is contained in:
commit
096bf0d750
4 changed files with 24 additions and 7 deletions
|
@ -48,6 +48,12 @@
|
|||
"noticeClosingMessage": {
|
||||
"message": "closes in 7s"
|
||||
},
|
||||
"reportButtonTitle": {
|
||||
"message": "Report"
|
||||
},
|
||||
"reportButtonInfo": {
|
||||
"message": "Report this sponsor submission as incorrect."
|
||||
},
|
||||
"Dismiss": {
|
||||
"message": "Dismiss"
|
||||
},
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
}
|
||||
|
||||
.voteButton {
|
||||
height: 18px;
|
||||
height: 17px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.voteButton:hover {
|
||||
|
|
21
content.js
21
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) {
|
||||
|
@ -927,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
|
||||
|
|
|
@ -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": [
|
||||
|
|
Loading…
Reference in a new issue