diff options
author | Ajay Ramachandran <[email protected]> | 2019-07-11 22:35:40 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2019-07-11 22:35:40 -0400 |
commit | c31efc2059a7b2f483712259a356499dff7a1542 (patch) | |
tree | 52094c2e7ceed03efb6156d44cc337501d767f61 | |
parent | 7ea2c2b974710c4ddbdcdf6a72dcbb32c66725db (diff) | |
download | SponsorBlock-c31efc2059a7b2f483712259a356499dff7a1542.tar.gz SponsorBlock-c31efc2059a7b2f483712259a356499dff7a1542.zip |
Made submit times not appear when no end time was specified.
-rw-r--r-- | popup.html | 2 | ||||
-rw-r--r-- | popup.js | 14 |
2 files changed, 15 insertions, 1 deletions
@@ -49,7 +49,7 @@ <br/> <br/> - <button id="submitTimes" class="smallButton">Submit Times</button> + <button id="submitTimes" style="display: none" class="smallButton">Submit Times</button> </div> <br/> @@ -56,6 +56,8 @@ function loadTabData(tabs) { //show submission section document.getElementById("submissionSection").style.display = "unset"; + + showSubmitTimesIfNecessary(); } }); @@ -136,6 +138,8 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) { //show submission section document.getElementById("submissionSection").style.display = "unset"; + + showSubmitTimesIfNecessary(); } }); @@ -231,6 +235,16 @@ function resetStartTimeChosen() { document.getElementById("sponsorStart").innerHTML = "Sponsorship Starts Now"; } +function showSubmitTimesIfNecessary() { + //check if an end time has been specified for the latest sponsor time + if (sponsorTimes.length > 0 && sponsorTimes[sponsorTimes.length - 1].length > 1) { + //show submit times button + document.getElementById("submitTimes").style.display = "unset"; + } else { + document.getElementById("submitTimes").style.display = "none"; + } +} + //this is not a YouTube video page function displayNoVideo() { document.getElementById("loadingIndicator").innerHTML = "This probably isn't a YouTube tab, or you clicked too early. " + |