-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.js
127 lines (121 loc) · 5.59 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* POSSEDEX
VERSION 1 / MARS 2017
VERSION 2 / JANVIER 2018
REMERCIEMENT A L'EQUIPE LES DECODEURS DU MONDE
REMERCIEMENT AUX INSOUMIS QUI SE RECONNAITRONT
.y.
-dMm.
.mMMMd.
.dMMMMMd. .:+oyyso-
`hMMMMMMMd` -odNMMMMMMMNy` `..
sMMMm:dMMMddNMMMMmyoomMMMh `.-/+oydmmN:
:NMMN/ .mMMMMMNd+-` -NMMMyydmNNNMMMMMMMd.
hMMMy -mMMMN: sMMMMMMMMNNmhhNMMMo
-mMMM- -mMMMy` -NMMMy+/-.`` /NMMN.
/NMMM` -mMMMy` `hMMM+ sMMMh
-mMMMo` :mMMMs` sMMMd .NMMN/
+NMMNy` :NMMNs /MMMm` +MMMd.
:dMMMd: :NMMMo` `NMMN- `dMMMo
.yMMMN+ :NMMNo NMMN/ /NMMM.
`oNMMNy. /NMMN+ dMMMo yMMMh
:mMMMd- /NMMN+ yMMMs `NMMN/
`-://ohhhhy+////ymNMN/.-shhds:--+mmmd.
`/osoo+++++++++++oosshdsssoooooooooosss+/-`
`+so/:::::::::::::::/osss+:::::::::::://+os+-`
-ss/:----------------/ss+:--------------::+ss+-.```
.ss+:::::::--::::::::+sso::---------------::+osoooo-
`+sso+++///::::///+++oosso+//:::::::--------:::/+ss-
`/ss+/::::::::::::::::::+ssssoooooo+:------------/ss-
.os+:-------------------:oso-....os+-------------/ss-
`+so::----------:::::://+ss+` +so:------------/ss-
.+so+////////:::::////+++os+. -ss/------------/ss-
`-oso//:::::------------:os+ `/so/:----------/ss-
`oso:-----------------::oso `+so/:---------/ss-
:ss+:::::::::::::::://+oss/. ``/so+:--------/ss-
-+osoooooo++///::::::::/+so- -.`:oso/::-----/ss-
.-:::oso:-------------:os+` o+ `:oso+/::::/ss-
/so/:------------:os+` /Ms. `-+ysssoooss-
`+so+/:::::::::/+oso. +MMd- .hNmmh----`
`:+oooossssooooo+:` yMMMy` -MMMN/
`..:dmmm/...` :NMMM: sMMMm`
:MMMm. yMMMh .dMMMs
yMMMy ``.:+yMMMN: :NMMN:
`mMMM/ ``-+shmMMMMMMNNy sMMMm`
/NMMN-:ohmMMMMNNmdyo+/-- .mMMMo
sMMMMmMMMMNmyo/.` `.:/+ossodMMMN:
.mMMMMMNmy+.` `-+ymNMMMMMMMMMMMMd`
:MMMMNs:` ``./oymNMMMMNdhyssyhmMMMMo
yMMMNyoooyhdNNMMMMNMMMMo` `dMMMd`
-dNMMMMMMMMMNNNdy+:oMMMN: `:hMMMN:
`:+syyyyso/:.` yMMMm` `/dMMMMd:
.dMMMhomMMMNh/
-NMMMMMMNy-
+NMMMms.
sMmo`
`/`
*/
var browser = browser || chrome;
// @FIXME use same function and element id as popup.js
function optionStore(e){
var infobulles;
var infobulles_once;
var classement = this.id.replace("check-alert-", "");
var checked = this.checked;
browser.storage.local.get('infobulles', function(results){
infobulles = results.infobulles;
if(checked) {
infobulles[classement] = true;
}
else {
infobulles[classement] = false;
}
browser.storage.local.set({
'infobulles': infobulles
}
);
});
}
function main(){
var colors = [
"#A2A9AE", // gris
"#F5A725", // rouge
"#D50303", // jaune
"#129AF0", // bleu
"#468847", // vert
"#468847" // INSOUMIS AUSSI :D
];
browser.storage.local.get('infobulles', function(results){
try {
classements = [ 'inconnu', 'capital', 'etat', 'independant' ];
classements.forEach(function(classement){
var selector = document.getElementById('check-alert-' + classement);
if (selector) {
if(results.infobulles[classement] == true){
selector.checked = true;
}
else {
selector.checked = false;
}
}
});
} catch(e) {
console && console.log("error in install.js for infobulles, check-alert"+classement);
console && console.error(e);
}
});
}
document.addEventListener('DOMContentLoaded', function () {
try {
classements = [ 'inconnu', 'capital', 'etat', 'independant' ];
classements.forEach(function(classement){
var selector = document.getElementById('check-alert-' + classement);
if (selector) {
selector.addEventListener('click', optionStore);
}
});
} catch(e) {
console && console.info("error in install.js for check-alert-"+classement);
console && console.error(e);
}
main();
});