From 2f54311e729c841e436497e43481b88e54cd3a0b Mon Sep 17 00:00:00 2001 From: Marvin Alexander Krebber Date: Mon, 30 Oct 2023 15:02:45 +0100 Subject: [PATCH] shorter code --- chrome/popup/popup.html | 10 +++++----- chrome/popup/settings.html | 10 +++++----- chrome/popup/settings.js | 24 ++---------------------- firefox/popup/popup.html | 10 +++++----- firefox/popup/settings.html | 10 +++++----- firefox/popup/settings.js | 12 +----------- 6 files changed, 23 insertions(+), 53 deletions(-) diff --git a/chrome/popup/popup.html b/chrome/popup/popup.html index 3cd52002..6ef9a7b4 100644 --- a/chrome/popup/popup.html +++ b/chrome/popup/popup.html @@ -283,23 +283,23 @@

StatisticPageTitle

SkippedTime

StatisticAd;Amazon

-

0s

+

0s

StatisticAd;Netflix

-

0s

+

0s

StatisticIntro

-

0s

+

0s

StatisticRecap

-

0s

+

0s

StatisticSegments

-

0

+

0

diff --git a/chrome/popup/settings.html b/chrome/popup/settings.html index a472a6f8..11b57965 100644 --- a/chrome/popup/settings.html +++ b/chrome/popup/settings.html @@ -608,31 +608,31 @@

PageSpecificTitle;Disney+

SkippedTime

StatisticAd;Amazon

-

0s

+

0s

AmazonAdDescription


StatisticAd;Netflix

-

0s

+

0s

NetflixAdDescription


StatisticIntro

-

0s

+

0s

StatisticIntroDescription


StatisticRecap

-

0s

+

0s

StatisticRecapDescription


StatisticSegments

-

0

+

0

StatisticSegmentsDescription

diff --git a/chrome/popup/settings.js b/chrome/popup/settings.js index f779fa2b..97d91c5a 100644 --- a/chrome/popup/settings.js +++ b/chrome/popup/settings.js @@ -174,8 +174,6 @@ function setCheckboxesToSettings() { setCheckboxesOfService("Amazon"); // ------------- Netflix --------------------------------------- setCheckboxesOfService("Netflix"); - button = document.querySelector("#NetflixAds"); - if (button) button.checked = settings?.Netflix.NetflixAds; button = document.querySelector("#profileName"); if (button) button.textContent = settings?.General.profileName; @@ -185,17 +183,9 @@ function setCheckboxesToSettings() { button.style.display = "block"; } // ------------- Disney --------------------------------------- + setCheckboxesOfService("Disney"); button = document.querySelector("#DisneySkipIntro"); if (button) button.checked = settings?.Disney.skipIntro; - button = document.querySelector("#DisneySkipCredits"); - if (button) button.checked = settings?.Disney.skipCredits; - button = document.querySelector("#DisneyWatchCredits"); - if (button) button.checked = settings?.Disney.watchCredits; - button = document.querySelector("#DisneySpeedSlider"); - if (button) button.checked = settings?.Disney.speedSlider; - button = document.querySelector("#DisneyShowRating"); - if (button) button.checked = settings?.Disney.showRating; - // ------------- Slider Options --------------------------------------- button = document.querySelector("#SliderSteps"); if (button) button.value = settings?.General.sliderSteps; @@ -213,17 +203,7 @@ function setCheckboxesToSettings() { if (button) button.textContent = sliderValue / 10 + "x"; // Statistics - button = document.querySelector("#AmazonAdTime"); - if (button) button.textContent = getTimeFormatted(settings?.Statistics.AmazonAdTimeSkipped); - button = document.querySelector("#NetflixAdTime"); - if (button) button.textContent = getTimeFormatted(settings?.Statistics.NetflixAdTimeSkipped); - button = document.querySelector("#IntroTimeSkipped"); - if (button) button.textContent = getTimeFormatted(settings?.Statistics.IntroTimeSkipped); - button = document.querySelector("#RecapTimeSkipped"); - if (button) button.textContent = getTimeFormatted(settings?.Statistics.RecapTimeSkipped); - button = document.querySelector("#SegmentsSkipped"); - if (button) button.textContent = settings?.Statistics.SegmentsSkipped; - + setCheckboxesOfService("Statistics"); // import/export buttons button = document.querySelector("#save"); if (button) { diff --git a/firefox/popup/popup.html b/firefox/popup/popup.html index b3c490af..ad620ca7 100644 --- a/firefox/popup/popup.html +++ b/firefox/popup/popup.html @@ -278,23 +278,23 @@

StatisticPageTitle

SkippedTime

StatisticAd;Amazon

-

0s

+

0s

StatisticAd;Netflix

-

0s

+

0s

StatisticIntro

-

0s

+

0s

StatisticRecap

-

0s

+

0s

StatisticSegments

-

0

+

0

diff --git a/firefox/popup/settings.html b/firefox/popup/settings.html index 529aaa16..53bcdc44 100644 --- a/firefox/popup/settings.html +++ b/firefox/popup/settings.html @@ -603,31 +603,31 @@

PageSpecificTitle;Disney+

SkippedTime

StatisticAd;Amazon

-

0s

+

0s

AmazonAdDescription


StatisticAd;Netflix

-

0s

+

0s

NetflixAdDescription


StatisticIntro

-

0s

+

0s

StatisticIntroDescription


StatisticRecap

-

0s

+

0s

StatisticRecapDescription


StatisticSegments

-

0

+

0

StatisticSegmentsDescription

diff --git a/firefox/popup/settings.js b/firefox/popup/settings.js index 2662e381..486978c2 100644 --- a/firefox/popup/settings.js +++ b/firefox/popup/settings.js @@ -203,17 +203,7 @@ function setCheckboxesToSettings() { if (button) button.textContent = sliderValue / 10 + "x"; // Statistics - button = document.querySelector("#AmazonAdTime"); - if (button) button.textContent = getTimeFormatted(settings?.Statistics.AmazonAdTimeSkipped); - button = document.querySelector("#NetflixAdTime"); - if (button) button.textContent = getTimeFormatted(settings?.Statistics.NetflixAdTimeSkipped); - button = document.querySelector("#IntroTimeSkipped"); - if (button) button.textContent = getTimeFormatted(settings?.Statistics.IntroTimeSkipped); - button = document.querySelector("#RecapTimeSkipped"); - if (button) button.textContent = getTimeFormatted(settings?.Statistics.RecapTimeSkipped); - button = document.querySelector("#SegmentsSkipped"); - if (button) button.textContent = settings?.Statistics.SegmentsSkipped; - + setCheckboxesOfService("Statistics"); // import/export buttons button = document.querySelector("#save"); if (button) {