mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-18 13:38:25 +03:00
Made submit times not appear when no end time was specified.
This commit is contained in:
@@ -49,7 +49,7 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<button id="submitTimes" class="smallButton">Submit Times</button>
|
<button id="submitTimes" style="display: none" class="smallButton">Submit Times</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
14
popup.js
14
popup.js
@@ -56,6 +56,8 @@ function loadTabData(tabs) {
|
|||||||
|
|
||||||
//show submission section
|
//show submission section
|
||||||
document.getElementById("submissionSection").style.display = "unset";
|
document.getElementById("submissionSection").style.display = "unset";
|
||||||
|
|
||||||
|
showSubmitTimesIfNecessary();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -136,6 +138,8 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
|
|||||||
|
|
||||||
//show submission section
|
//show submission section
|
||||||
document.getElementById("submissionSection").style.display = "unset";
|
document.getElementById("submissionSection").style.display = "unset";
|
||||||
|
|
||||||
|
showSubmitTimesIfNecessary();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -231,6 +235,16 @@ function resetStartTimeChosen() {
|
|||||||
document.getElementById("sponsorStart").innerHTML = "Sponsorship Starts Now";
|
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
|
//this is not a YouTube video page
|
||||||
function displayNoVideo() {
|
function displayNoVideo() {
|
||||||
document.getElementById("loadingIndicator").innerHTML = "This probably isn't a YouTube tab, or you clicked too early. " +
|
document.getElementById("loadingIndicator").innerHTML = "This probably isn't a YouTube tab, or you clicked too early. " +
|
||||||
|
|||||||
Reference in New Issue
Block a user