mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Add option to hide clutter in popup
This commit is contained in:
parent
14d50b9e70
commit
6d37180d00
6 changed files with 32 additions and 3 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 322a245df5b39875a0e30725b7b2980ed008aef1
|
Subproject commit 6ff5f86e9aca64c2ad51aa13e39db1a040506f9d
|
|
@ -359,6 +359,18 @@
|
||||||
<div class="small-description">__MSG_showTimeWithSkipsDescription__</div>
|
<div class="small-description">__MSG_showTimeWithSkipsDescription__</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div data-type="toggle" data-sync="cleanPopup" data-no-safari="true">
|
||||||
|
<div class="switch-container">
|
||||||
|
<label class="switch">
|
||||||
|
<input id="cleanPopup" type="checkbox" checked>
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
<label class="switch-label" for="cleanPopup">
|
||||||
|
__MSG_cleanPopup__
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div data-type="toggle" data-sync="darkMode">
|
<div data-type="toggle" data-sync="darkMode">
|
||||||
<div class="switch-container">
|
<div class="switch-container">
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
|
|
|
@ -130,6 +130,7 @@
|
||||||
top: 5px;
|
top: 5px;
|
||||||
right: 5px;
|
right: 5px;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sbCloseButton:hover {
|
.sbCloseButton:hover {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
__MSG_betaServerWarning__
|
__MSG_betaServerWarning__
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<header class="sbPopupLogo">
|
<header id="sbPopupLogo" class="sbPopupLogo">
|
||||||
<img src="icons/IconSponsorBlocker256px.png" alt="SponsorBlock" width="40" height="40" id="sponsorBlockPopupLogo">
|
<img src="icons/IconSponsorBlocker256px.png" alt="SponsorBlock" width="40" height="40" id="sponsorBlockPopupLogo">
|
||||||
<p class="u-mZ">SponsorBlock</p>
|
<p class="u-mZ">SponsorBlock</p>
|
||||||
</header>
|
</header>
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Your Work box -->
|
<!-- Your Work box -->
|
||||||
<div class="sbYourWorkBox">
|
<div id="sbYourWorkBox" class="sbYourWorkBox">
|
||||||
<h1 class="sbHeader" style="padding: 8px 15px;">
|
<h1 class="sbHeader" style="padding: 8px 15px;">
|
||||||
__MSG_yourWork__
|
__MSG_yourWork__
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
@ -77,6 +77,7 @@ interface SBConfig {
|
||||||
showDeArrowPromotion: boolean;
|
showDeArrowPromotion: boolean;
|
||||||
showDeArrowInSettings: boolean;
|
showDeArrowInSettings: boolean;
|
||||||
showZoomToFillError2: boolean;
|
showZoomToFillError2: boolean;
|
||||||
|
cleanPopup: boolean;
|
||||||
|
|
||||||
// Used to cache calculated text color info
|
// Used to cache calculated text color info
|
||||||
categoryPillColors: {
|
categoryPillColors: {
|
||||||
|
@ -320,6 +321,7 @@ const syncDefaults = {
|
||||||
showDeArrowPromotion: false,
|
showDeArrowPromotion: false,
|
||||||
showDeArrowInSettings: true,
|
showDeArrowInSettings: true,
|
||||||
showZoomToFillError2: true,
|
showZoomToFillError2: true,
|
||||||
|
cleanPopup: false,
|
||||||
|
|
||||||
categoryPillColors: {},
|
categoryPillColors: {},
|
||||||
|
|
||||||
|
|
14
src/popup.ts
14
src/popup.ts
|
@ -108,6 +108,10 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||||
const PageElements: PageElements = {};
|
const PageElements: PageElements = {};
|
||||||
|
|
||||||
[
|
[
|
||||||
|
"sbPopupLogo",
|
||||||
|
"sbYourWorkBox",
|
||||||
|
"videoInfo",
|
||||||
|
"sbFooter",
|
||||||
"sponsorBlockPopupBody",
|
"sponsorBlockPopupBody",
|
||||||
"sponsorblockPopup",
|
"sponsorblockPopup",
|
||||||
"sponsorStart",
|
"sponsorStart",
|
||||||
|
@ -198,6 +202,16 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||||
}
|
}
|
||||||
PageElements.sbDonate.addEventListener("click", () => Config.config.donateClicked = Config.config.donateClicked + 1);
|
PageElements.sbDonate.addEventListener("click", () => Config.config.donateClicked = Config.config.donateClicked + 1);
|
||||||
|
|
||||||
|
if (Config.config.cleanPopup) {
|
||||||
|
PageElements.sbPopupLogo.classList.add("hidden");
|
||||||
|
PageElements.sbYourWorkBox.classList.add("hidden");
|
||||||
|
PageElements.sbFooter.classList.add("hidden");
|
||||||
|
PageElements.sponsorTimesDonateContainer.classList.add("hidden");
|
||||||
|
PageElements.mainControls.classList.add("hidden");
|
||||||
|
|
||||||
|
PageElements.videoInfo.style.marginTop = "10px";
|
||||||
|
}
|
||||||
|
|
||||||
if (Config.config.testingServer) {
|
if (Config.config.testingServer) {
|
||||||
PageElements.sbBetaServerWarning.classList.remove("hidden");
|
PageElements.sbBetaServerWarning.classList.remove("hidden");
|
||||||
PageElements.sbBetaServerWarning.addEventListener("click", function () {
|
PageElements.sbBetaServerWarning.addEventListener("click", function () {
|
||||||
|
|
Loading…
Reference in a new issue