-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.js
executable file
·42 lines (40 loc) · 1.13 KB
/
install.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
30
31
32
33
34
35
36
37
38
39
40
41
42
function bulleStore(e){
var infobulles;
var infobulles_once;
var id = parseInt(this.id.replace("check-alert", ""));
var checked = this.checked;
chrome.storage.local.get('infobulles', function(results){
infobulles = results.infobulles;
if(checked) {
infobulles[id] = true;
}
else {
infobulles[id] = false;
}
chrome.storage.local.set({
'infobulles': infobulles,
}
);
});
}
function main(){
var colors = [
"#A2A9AE", "#129AF0", "#D50303", "#F5A725", "#468847"
];
chrome.storage.local.get('infobulles', function(results){
for(var i=0;i<5;i++){
if(results.infobulles[i] == true){
document.getElementById("check-alert" + i).checked = true;
}
else {
document.getElementById("check-alert" + i).checked = false;
}
}
});
}
document.addEventListener('DOMContentLoaded', function () {
for(var i=0;i<5;i++){
document.querySelector('#check-alert'+i).addEventListener('click', bulleStore);
}
main();
});