-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.js
More file actions
28 lines (25 loc) · 1.06 KB
/
options.js
File metadata and controls
28 lines (25 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const saveOptions = () => {
const manageCases = document.getElementById("manageCases").value;
const manageOrg = document.getElementById("manageOrg").value;
const ccdAdminWeb = document.getElementById("ccdAdminWeb").value;
chrome.storage.local.set(
{ manageCases: manageCases, manageOrg: manageOrg, ccdAdminWeb: ccdAdminWeb }).then(() => {
const status = document.getElementById("status");
status.textContent = "Options saved";
setTimeout(() => {
status.textContent = "";
}, 750);
}
);
};
const restoreOptions = () => {
chrome.storage.local.get(
["manageCases", "manageOrg", "ccdAdminWeb"]).then((options) => {
document.getElementById("manageCases").value = options.manageCases;
document.getElementById("manageOrg").value = options.manageOrg;
document.getElementById("ccdAdminWeb").value = options.ccdAdminWeb;
}
);
};
document.addEventListener("DOMContentLoaded", restoreOptions);
document.getElementById("save").addEventListener("click", saveOptions);