Skip to content

Commit

Permalink
chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Oct 30, 2023
1 parent 738cee1 commit 4893c8e
Show file tree
Hide file tree
Showing 2 changed files with 243 additions and 517 deletions.
11 changes: 9 additions & 2 deletions chrome/popup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ function setCheckboxesOfService(service) {
const buttons = document.querySelectorAll("#" + service + capitalizeFirstLetter(key));
// console.log(service + capitalizeFirstLetter(key), buttons);
buttons.forEach((button) => {
button.checked = settings[service][key];
if (service === "Statistics") {
if (key != "SegmentsSkipped") button.textContent = getTimeFormatted(settings[service][key]);
else button.textContent = settings[service][key];
} else button.checked = settings[service][key];
});
});
}
Expand Down Expand Up @@ -279,6 +282,7 @@ function listenForClicks() {
// all buttons changing settings
else {
// ------------- Video ---------------------------------------
const currentSettings = { ...settings };
if (e.target.id === "VideoSkips") {
const VideoSkips = !(
getBooleanOfCategory("skipIntro") &&
Expand Down Expand Up @@ -378,7 +382,10 @@ function listenForClicks() {
if (settings.Disney.watchCredits) settings.Disney.skipCredits = false;
} else if (e.target.id === "DisneySpeedSlider") settings.Disney.speedSlider = !settings.Disney.speedSlider;
else if (e.target.id === "DisneyShowRating") settings.Disney.showRating = !settings.Disney.showRating;
setSettings(e.target.id);
// check if settings changed
if (JSON.stringify(settings) !== JSON.stringify(currentSettings)) {
setSettings(e.target.id);
}
}
});
}
Expand Down
Loading

0 comments on commit 4893c8e

Please sign in to comment.