2023-06-02 21:15:10 +02:00
|
|
|
// Get the download option from local storage, or set it to 'sameWindow' if it doesn't exist
|
2024-02-16 22:49:06 +01:00
|
|
|
var downloadOption = localStorage.getItem("downloadOption") || "sameWindow";
|
2023-06-02 21:15:10 +02:00
|
|
|
|
|
|
|
// Set the selected option in the dropdown
|
2024-02-16 22:49:06 +01:00
|
|
|
document.getElementById("downloadOption").value = downloadOption;
|
2023-06-02 21:15:10 +02:00
|
|
|
|
|
|
|
// Save the selected option to local storage when the dropdown value changes
|
2024-02-16 22:49:06 +01:00
|
|
|
document.getElementById("downloadOption").addEventListener("change", function () {
|
|
|
|
downloadOption = this.value;
|
|
|
|
localStorage.setItem("downloadOption", downloadOption);
|
|
|
|
});
|
2023-06-02 21:15:10 +02:00
|
|
|
|
|
|
|
// Get the zipThreshold value from local storage, or set it to 0 if it doesn't exist
|
2024-02-16 22:49:06 +01:00
|
|
|
var zipThreshold = parseInt(localStorage.getItem("zipThreshold"), 10) || 4;
|
2023-06-02 21:15:10 +02:00
|
|
|
|
|
|
|
// Set the value of the slider and the display span
|
2024-02-16 22:49:06 +01:00
|
|
|
document.getElementById("zipThreshold").value = zipThreshold;
|
|
|
|
document.getElementById("zipThresholdValue").textContent = zipThreshold;
|
2023-06-02 21:15:10 +02:00
|
|
|
|
|
|
|
// Save the selected value to local storage when the slider value changes
|
2024-02-16 22:49:06 +01:00
|
|
|
document.getElementById("zipThreshold").addEventListener("input", function () {
|
|
|
|
zipThreshold = this.value;
|
|
|
|
document.getElementById("zipThresholdValue").textContent = zipThreshold;
|
|
|
|
localStorage.setItem("zipThreshold", zipThreshold);
|
2023-06-02 21:15:10 +02:00
|
|
|
});
|
|
|
|
|
2024-02-16 22:49:06 +01:00
|
|
|
var boredWaiting = localStorage.getItem("boredWaiting") || "disabled";
|
|
|
|
document.getElementById("boredWaiting").checked = boredWaiting === "enabled";
|
2023-06-02 21:15:10 +02:00
|
|
|
|
2024-02-16 22:49:06 +01:00
|
|
|
document.getElementById("boredWaiting").addEventListener("change", function () {
|
|
|
|
boredWaiting = this.checked ? "enabled" : "disabled";
|
|
|
|
localStorage.setItem("boredWaiting", boredWaiting);
|
|
|
|
});
|