-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpopup.js
29 lines (26 loc) · 976 Bytes
/
popup.js
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
29
window.addEventListener("load", function() {
var disabledBox = document.getElementById("extensionDisabled");
var showMarkerBox = document.getElementById("showMarker");
chrome.storage.local.get(null, function(data) {
console.log(data);
if(data["compassionomaticDisabled"] == true) {
disabledBox.checked = true;
chrome.browserAction.setIcon({ path: "icon24grey.png" });
}
if(data["compassionomaticShowMarker"] == true) {
showMarkerBox.checked = true;
}
});
disabledBox.addEventListener("change", function() {
if(disabledBox.checked) {
chrome.browserAction.setIcon({ path: "icon24grey.png" });
}
else {
chrome.browserAction.setIcon({ path: "icon24.png" });
}
chrome.storage.local.set({ "compassionomaticDisabled": disabledBox.checked });
});
showMarkerBox.addEventListener("change", function() {
chrome.storage.local.set({ "compassionomaticShowMarker": showMarkerBox.checked });
});
});