mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-18 05:25:04 +00:00

# Description Please provide a summary of the changes, including relevant motivation and context. Closes #(issue_number) ## Checklist - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have performed a self-review of my own code - [ ] I have attached images of the change if it is UI based - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] If my code has heavily changed functionality I have updated relevant docs on [Stirling-PDFs doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) - [x] My changes generate no new warnings - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only)
42 lines
1.8 KiB
JavaScript
42 lines
1.8 KiB
JavaScript
// Get the download option from local storage, or set it to 'sameWindow' if it doesn't exist
|
|
var downloadOption = localStorage.getItem("downloadOption") || "sameWindow";
|
|
|
|
// Set the selected option in the dropdown
|
|
document.getElementById("downloadOption").value = downloadOption;
|
|
|
|
// Save the selected option to local storage when the dropdown value changes
|
|
document.getElementById("downloadOption").addEventListener("change", function () {
|
|
downloadOption = this.value;
|
|
localStorage.setItem("downloadOption", downloadOption);
|
|
});
|
|
|
|
// Get the zipThreshold value from local storage, or set it to 0 if it doesn't exist
|
|
var zipThreshold = parseInt(localStorage.getItem("zipThreshold"), 10) || 4;
|
|
|
|
// Set the value of the slider and the display span
|
|
document.getElementById("zipThreshold").value = zipThreshold;
|
|
document.getElementById("zipThresholdValue").textContent = zipThreshold;
|
|
|
|
// Save the selected value to local storage when the slider value changes
|
|
document.getElementById("zipThreshold").addEventListener("input", function () {
|
|
zipThreshold = this.value;
|
|
document.getElementById("zipThresholdValue").textContent = zipThreshold;
|
|
localStorage.setItem("zipThreshold", zipThreshold);
|
|
});
|
|
|
|
var boredWaiting = localStorage.getItem("boredWaiting") || "disabled";
|
|
document.getElementById("boredWaiting").checked = boredWaiting === "enabled";
|
|
|
|
document.getElementById("boredWaiting").addEventListener("change", function () {
|
|
boredWaiting = this.checked ? "enabled" : "disabled";
|
|
localStorage.setItem("boredWaiting", boredWaiting);
|
|
});
|
|
|
|
var cacheInputs = localStorage.getItem("cacheInputs") || "disabled";
|
|
document.getElementById("cacheInputs").checked = cacheInputs === "enabled";
|
|
|
|
document.getElementById("cacheInputs").addEventListener("change", function () {
|
|
cacheInputs = this.checked ? "enabled" : "disabled";
|
|
localStorage.setItem("cacheInputs", cacheInputs);
|
|
});
|