mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 13:37:04 +03:00
Added small notice of how many submissions this user has made.
This commit is contained in:
@@ -131,6 +131,18 @@ function submitTimes(videoID, callback) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//add these to the storage log
|
||||||
|
chrome.storage.sync.get(["sponsorTimesContributed"], function(result) {
|
||||||
|
let currentContributionAmount = 0;
|
||||||
|
if (result.sponsorTimesContributed != undefined) {
|
||||||
|
//current contribution amount is known
|
||||||
|
currentContributionAmount = result.sponsorTimesContributed;
|
||||||
|
}
|
||||||
|
|
||||||
|
//save the amount contributed
|
||||||
|
chrome.storage.sync.set({"sponsorTimesContributed": currentContributionAmount + sponsorTimes.length});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ body {
|
|||||||
background-color: #ffd9d9;
|
background-color: #ffd9d9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.recordingSubtitle {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.voteButton {
|
.voteButton {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
|
|||||||
@@ -39,7 +39,11 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Record the times of a sponsorship</h2>
|
<h2 class="recordingSubtitle">Record the times of a sponsorship</h2>
|
||||||
|
|
||||||
|
<p id="sponsorTimesContributionsDisplay" style="display: none">
|
||||||
|
So far, you've submitted no sponsor times.
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Click the button below when the sponsorship starts and ends to record and
|
Click the button below when the sponsorship starts and ends to record and
|
||||||
|
|||||||
14
popup.js
14
popup.js
@@ -38,6 +38,20 @@ chrome.storage.sync.get(["hideVideoPlayerControls"], function(result) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//get the amount of times this user has contributed and display it to thank them
|
||||||
|
chrome.storage.sync.get(["sponsorTimesContributed"], function(result) {
|
||||||
|
if (result.sponsorTimesContributed != undefined) {
|
||||||
|
let sponsorTimesContributionsDisplay = document.getElementById("sponsorTimesContributionsDisplay");
|
||||||
|
|
||||||
|
if (result.sponsorTimesContributed > 1) {
|
||||||
|
sponsorTimesContributionsDisplay.innerText = "So far, you've submitted " + result.sponsorTimesContributed + " sponsor times.";
|
||||||
|
} else {
|
||||||
|
sponsorTimesContributionsDisplay.innerText = "So far, you've submitted " + result.sponsorTimesContributed + " sponsor time.";
|
||||||
|
}
|
||||||
|
sponsorTimesContributionsDisplay.style.display = "unset";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
chrome.tabs.query({
|
chrome.tabs.query({
|
||||||
active: true,
|
active: true,
|
||||||
currentWindow: true
|
currentWindow: true
|
||||||
|
|||||||
Reference in New Issue
Block a user