Add back show notice button

This commit is contained in:
Ajay Ramachandran 2020-12-14 00:44:21 -05:00
parent 125a83ac3f
commit 03e34281f6
3 changed files with 20 additions and 11 deletions

View file

@ -343,11 +343,19 @@ label>p, #disableExtension>p, #usernameValue, #usernameElement > div > p,#sponso
/* footer */
#sbFooter {
margin-bottom: 28px;
}
#sbFooter > a {
color: var(--sb-main-fg-color);
text-decoration: none;
}
#showNoticeAgain {
margin-top: 30px;
color: var(--sb-main-fg-color);
background: none;
border: 1px solid white;
cursor: pointer;
padding: 5px;
border-radius: 5px;
}

View file

@ -137,6 +137,8 @@
<a href="https://matrix.to/#/+sponsorblock:ajay.app" target="_blank" rel="noopener">Matrix</a> |
<a id="helpButton" href="#">__MSG_help__</a>
</footer>
<button id="showNoticeAgain" style="display: none" class="dangerButton popupElement">__MSG_showNotice__</button>
</div>
<!-- Scripts that need to load after the html -->
<script src="./js/vendor.js" async></script>

View file

@ -59,7 +59,7 @@ async function runThePopup(messageListener?: MessageListener) {
"enableSkipping",
"toggleSwitch",
// Options
//"showNoticeAgain",
"showNoticeAgain",
"optionsButton",
"helpButton",
// More controls
@ -109,7 +109,7 @@ async function runThePopup(messageListener?: MessageListener) {
toggleSkipping(!this.checked);
});
PageElements.submitTimes.addEventListener("click", submitTimes);
//PageElements.showNoticeAgain.addEventListener("click", showNoticeAgain);
PageElements.showNoticeAgain.addEventListener("click", showNoticeAgain);
PageElements.setUsernameButton.addEventListener("click", setUsernameButton);
PageElements.usernameValue.addEventListener("click", setUsernameButton);
PageElements.submitUsername.addEventListener("click", submitUsername);
@ -151,9 +151,9 @@ async function runThePopup(messageListener?: MessageListener) {
//if the don't show notice again variable is true, an option to
// disable should be available
let dontShowNotice = Config.config.dontShowNotice;
/*if (dontShowNotice != undefined && dontShowNotice) {
if (dontShowNotice != undefined && dontShowNotice) {
PageElements.showNoticeAgain.style.display = "unset";
}*/
}
utils.sendRequestToServer("GET", "/api/getUsername?userID=" + Config.config.userID, (res) => {
if (res.status === 200) {
@ -227,7 +227,6 @@ async function runThePopup(messageListener?: MessageListener) {
}
PageElements.sponsorTimeSavedDisplay.innerText = getFormattedHours(Config.config.minutesSaved);
//PageElements.sponsorTimeSavedContainer.style.display = "unset";
}
// Must be delayed so it only happens once loaded
@ -782,11 +781,11 @@ async function runThePopup(messageListener?: MessageListener) {
}
}
/*function showNoticeAgain() {
function showNoticeAgain() {
Config.config.dontShowNotice = false;
PageElements.showNoticeAgain.style.display = "none";
}*/
}
function updateStartTimeChosen() {
//update startTimeChosen letiable