Skip to content

Commit

Permalink
reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Oct 30, 2023
1 parent 2f54311 commit d247f3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
15 changes: 5 additions & 10 deletions chrome/popup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,19 @@ function setCheckboxesToSettings() {
if (button) button.checked = settings?.Netflix.skipRecap && settings?.Netflix.skipBlocked && settings?.Netflix.profile;
button = document.querySelector("#DisneySkips");
if (button) button.checked = settings?.Disney.skipIntro;
// ------------- Amazon ---------------------------------------
// ------------- Individual Checkboxes ---------------------------------------
setCheckboxesOfService("Amazon");
// ------------- Netflix ---------------------------------------
setCheckboxesOfService("Netflix");

setCheckboxesOfService("Disney");
setCheckboxesOfService("Statistics");
// ------------- Netflix other ---------------------------------------
button = document.querySelector("#profileName");
if (button) button.textContent = settings?.General.profileName;
button = document.querySelector("#profilePicture");
if (button && settings.General.profilePicture) {
button.setAttribute("src", settings?.General.profilePicture);
button.style.display = "block";
}
// ------------- Disney ---------------------------------------
setCheckboxesOfService("Disney");
button = document.querySelector("#DisneySkipIntro");
if (button) button.checked = settings?.Disney.skipIntro;
// ------------- Slider Options ---------------------------------------
button = document.querySelector("#SliderSteps");
if (button) button.value = settings?.General.sliderSteps;
Expand All @@ -202,8 +199,6 @@ function setCheckboxesToSettings() {
button = document.querySelector("#SliderValue");
if (button) button.textContent = sliderValue / 10 + "x";

// Statistics
setCheckboxesOfService("Statistics");
// import/export buttons
button = document.querySelector("#save");
if (button) {
Expand Down Expand Up @@ -364,7 +359,7 @@ function listenForClicks() {
settings.Netflix.watchCredits = !settings.Netflix.watchCredits;
if (settings.Netflix.watchCredits) settings.Netflix.skipCredits = false;
} else if (e.target.id === "NetflixSkipBlocked") settings.Netflix.skipBlocked = !settings.Netflix.skipBlocked;
else if (e.target.id === "NetflixAds") settings.Netflix.NetflixAds = !settings.Netflix.NetflixAds;
else if (e.target.id === "NetflixNetflixAds") settings.Netflix.NetflixAds = !settings.Netflix.NetflixAds;
else if (e.target.id === "NetflixSpeedSlider") settings.Netflix.speedSlider = !settings.Netflix.speedSlider;
else if (e.target.id === "NetflixProfile") settings.Netflix.profile = !settings.Netflix.profile;
else if (e.target.id === "NetflixShowRating") settings.Netflix.showRating = !settings.Netflix.showRating;
Expand Down
15 changes: 5 additions & 10 deletions firefox/popup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,19 @@ function setCheckboxesToSettings() {
if (button) button.checked = settings?.Netflix.skipRecap && settings?.Netflix.skipBlocked && settings?.Netflix.profile;
button = document.querySelector("#DisneySkips");
if (button) button.checked = settings?.Disney.skipIntro;
// ------------- Amazon ---------------------------------------
// ------------- Individual Checkboxes ---------------------------------------
setCheckboxesOfService("Amazon");
// ------------- Netflix ---------------------------------------
setCheckboxesOfService("Netflix");

setCheckboxesOfService("Disney");
setCheckboxesOfService("Statistics");
// ------------- Netflix other ---------------------------------------
button = document.querySelector("#profileName");
if (button) button.textContent = settings?.General.profileName;
button = document.querySelector("#profilePicture");
if (button && settings.General.profilePicture) {
button.setAttribute("src", settings?.General.profilePicture);
button.style.display = "block";
}
// ------------- Disney ---------------------------------------
setCheckboxesOfService("Disney");
button = document.querySelector("#DisneySkipIntro");
if (button) button.checked = settings?.Disney.skipIntro;
// ------------- Slider Options ---------------------------------------
button = document.querySelector("#SliderSteps");
if (button) button.value = settings?.General.sliderSteps;
Expand All @@ -202,8 +199,6 @@ function setCheckboxesToSettings() {
button = document.querySelector("#SliderValue");
if (button) button.textContent = sliderValue / 10 + "x";

// Statistics
setCheckboxesOfService("Statistics");
// import/export buttons
button = document.querySelector("#save");
if (button) {
Expand Down Expand Up @@ -364,7 +359,7 @@ function listenForClicks() {
settings.Netflix.watchCredits = !settings.Netflix.watchCredits;
if (settings.Netflix.watchCredits) settings.Netflix.skipCredits = false;
} else if (e.target.id === "NetflixSkipBlocked") settings.Netflix.skipBlocked = !settings.Netflix.skipBlocked;
else if (e.target.id === "NetflixAds") settings.Netflix.NetflixAds = !settings.Netflix.NetflixAds;
else if (e.target.id === "NetflixNetflixAds") settings.Netflix.NetflixAds = !settings.Netflix.NetflixAds;
else if (e.target.id === "NetflixSpeedSlider") settings.Netflix.speedSlider = !settings.Netflix.speedSlider;
else if (e.target.id === "NetflixProfile") settings.Netflix.profile = !settings.Netflix.profile;
else if (e.target.id === "NetflixShowRating") settings.Netflix.showRating = !settings.Netflix.showRating;
Expand Down

0 comments on commit d247f3b

Please sign in to comment.