This commit is contained in:
2024-04-22 02:56:06 -07:00
parent b8ab66cd78
commit 3f61d82ec5
5 changed files with 63 additions and 26 deletions

7
popup/bootstrap.bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -11,7 +11,7 @@
<div class="container">
<div class="row">
<div class="col-12">
<h3 style="white-space: nowrap;">not-a-rescheduler<br><span id="version"></span></h3>
<h3 style="white-space: nowrap;">not-a-rescheduler <span id="version"></span></h3>
</div>
</div>
<div class="row">
@@ -23,28 +23,45 @@
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group mb-2">
<label for="username">Username</label>
<input type="text" class="form-control" id="username" placeholder="Username">
</div>
<div class="form-group mb-2">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" placeholder="Password">
<button type="button" id="showPassword" class="btn btn-link btn-sm">Show password</button>
</div>
<div class="mb-2">
<button type="button mb-2" class="btn btn-primary" id="saveButton">Save credentials</button>
<span id="saveStatus">Saved!</span>
</div>
<div class="col form-group">
<label for="username">Username</label>
<input type="text" class="form-control" id="username" placeholder="Username">
</div>
</div>
<div class="row">
<div class="col form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" placeholder="Password"><button type="button" id="showPassword" class="btn btn-link btn-sm">Show</button>
</div>
</div>
<div class="row">
<div class="col">
<div class="mb-2">
<input type="range" id="frequency" name="frequency" min="1" max="10" step="1">
<label for="frequency">Frequency of checks<br>(every <span id="frequency_info">1</span> minutes)</label>
</div>
<button type="button" class="btn btn-primary" id="saveButton">Save credentials</button>
<span id="saveStatus">Saved!</span>
</div>
</div>
<div class="row">
<div class="col">
<label for="frequency" class="form-label">Frequency (minutes)</label>
</div>
<div class="col">
<input type="number" class="form-control" id="frequency" placeholder="minutes">
</div>
</div>
<div class="row">
<div class="col">
<label for="deltaAppt">Appointment delta (days)</label>
</div>
<div class="col">
<input type="number" class="form-control" id="deltaAppt" placeholder="days">
</div>
</div>
<div class="row">
<div class="col">
<label for="deltaNow">Preparation time (days)</label>
</div>
<div class="col">
<input type="number" class="form-control" id="deltaNow" placeholder="days">
</div>
</div>
<div class="row">
@@ -53,6 +70,7 @@
</div>
</div>
</div>
<script src="bootstrap.bundle.min.js"></script>
<script src="popup.js"></script>
</body>
</html>

View File

@@ -8,13 +8,14 @@
document.getElementById("username").value = items["__username"] || "";
document.getElementById("password").value = items["__password"] || "";
document.getElementById("frequency").value = items["__frequency"] || 1;
document.getElementById("frequency_info").innerText = items["__frequency"] || 1;
document.getElementById("status").innerText = items["__status"] || "unknown";
document.getElementById("deltaAppt").value = items["__deltaAppt"] || 1;
document.getElementById("deltaNow").value = items["__deltaNow"] || 1;
});
chrome.storage.onChanged.addListener((changes, area) => {
if (changes.__frequency)
document.getElementById("frequency_info").innerText = changes.__frequency.newValue;
document.getElementById("frequency_info").innerText = changes.__frequency.newValue;
});
// activate checkbox
@@ -62,9 +63,15 @@
passwordField.type = "password";
});
// frequency range slider
document.getElementById("frequency").addEventListener("change", function() {
// range sliders
document.getElementById("frequency").addEventListener("input", function() {
chrome.storage.local.set({ __frequency: this.value });
});
document.getElementById("deltaAppt").addEventListener("input", function() {
chrome.storage.local.set({ __deltaAppt: this.value });
});
document.getElementById("deltaNow").addEventListener("change", function() {
chrome.storage.local.set({ __deltaNow: this.value });
});
})();