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
|
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
|
-
-
-
|
this.save();
});
document.addEventListener("dialogextra1", (event) => {
this.reset();
});
},
_setDialogOptions: function (bDefaultOptions=false) {
console.log("_setDialogOptions");
try {
sOptions = bDefaultOptions ? prefs.getCharPref("sGCDefaultOptions") : prefs.getCharPref("sGCOptions");
this.oOptions = JSON.parse(sOptions);
for (let sParam in this.oOptions) {
if (document.getElementById("option_"+sParam) !== null) {
document.getElementById("option_"+sParam).checked = this.oOptions[sParam];
}
}
}
catch (e) {
console.error(e);
}
},
save: function () {
console.log("save");
try {
for (let xNode of document.getElementsByClassName("option")) {
this.oOptions[xNode.id.slice(7)] = xNode.checked;
}
prefs.setCharPref("sGCOptions", JSON.stringify(this.oOptions));
}
catch (e) {
console.error(e);
}
},
reset: function () {
console.log("reset");
this._setDialogOptions(true);
}
}
oOptControl.load();
|