Skip to content

Commit

Permalink
Merge pull request #43 from ajayyy/experimental
Browse files Browse the repository at this point in the history
Updates to the video player controls
  • Loading branch information
ajayyy authored Jul 29, 2019
2 parents ff9badf + 622b2ea commit acb3c67
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ function videoIDChange(id) {
if (response != undefined) {
let sponsorTimes = response.sponsorTimes;
if (sponsorTimes != null && sponsorTimes.length > 0 && sponsorTimes[sponsorTimes.length - 1].length >= 2) {
document.getElementById("submitButton").style.display = "unset";
changeStartSponsorButton(true, true);
} else if (sponsorTimes != null && sponsorTimes.length > 0 && sponsorTimes[sponsorTimes.length - 1].length < 2) {
toggleStartSponsorButton();
changeStartSponsorButton(false, true);
} else {
changeStartSponsorButton(true, true);
document.getElementById("submitButton").style.display = "none";
}
}
});
Expand Down Expand Up @@ -304,6 +307,7 @@ function changeStartSponsorButton(showStartSponsor, uploadButtonVisible) {
if (showStartSponsor) {
showingStartSponsor = true;
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
document.getElementById("startSponsorButton").setAttribute("title", "Sponsor Starts Now");

if (document.getElementById("startSponsorImage").style.display != "none" && uploadButtonVisible) {
document.getElementById("submitButton").style.display = "unset";
Expand All @@ -314,6 +318,7 @@ function changeStartSponsorButton(showStartSponsor, uploadButtonVisible) {
} else {
showingStartSponsor = false;
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStopIconSponsorBlocker256px.png");
document.getElementById("startSponsorButton").setAttribute("title", "Sponsor Ends Now");

//disable submit button
document.getElementById("submitButton").style.display = "none";
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "SponsorBlock - YouTube Sponsorship Blocker",
"short_name": "SponsorBlock",
"version": "1.0.12",
"version": "1.0.13",
"description": "Skip over sponsorship on YouTube videos. Report sponsors on videos you watch to save the time of others.",
"content_scripts": [
{
Expand Down
4 changes: 4 additions & 0 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ SB.reportAnIssue = document.getElementById("reportAnIssue");
SB.sponsorTimesContributionsContainer = document.getElementById("sponsorTimesContributionsContainer");
SB.sponsorTimesContributionsDisplay = document.getElementById("sponsorTimesContributionsDisplay");
SB.sponsorTimesContributionsDisplayEndWord = document.getElementById("sponsorTimesContributionsDisplayEndWord");
// sponsorTimesViewsDisplay
SB.sponsorTimesViewsContainer = document.getElementById("sponsorTimesViewsDisplayContainer");
SB.sponsorTimesViewsDisplay = document.getElementById("sponsorTimesViewsDisplayDisplay");
SB.sponsorTimesViewsDisplayEndWord = document.getElementById("sponsorTimesViewsDisplayDisplayEndWord");

//setup click listeners
SB.sponsorStart.addEventListener("click", sendSponsorStartMessage);
Expand Down

0 comments on commit acb3c67

Please sign in to comment.