forked from jonroig/MailtOWA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
70 lines (65 loc) · 2.58 KB
/
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
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
'use strict';
const interceptOn = document.getElementById('interceptOn');
const interceptOnLive = document.getElementById('interceptOnLive');
const interceptOff = document.getElementById('interceptOff');
const interceptOnText = document.getElementById('interceptOnText');
const interceptOnLiveText = document.getElementById('interceptOnLiveText');
const interceptOffText = document.getElementById('interceptOffText');
chrome.storage.sync.get('owaIntercept', (data) => {
console.log('data', data);
if (data.owaIntercept === "on") {
interceptOn.checked = true;
interceptOnLive.checked = false;
interceptOff.checked = false;
interceptOnText.style.fontWeight = 'bold';
interceptOnLive.style.fontWeight = 'normal';
interceptOffText.style.fontWeight = 'normal';
} else if (data.owaIntercept === "on_live") {
interceptOn.checked = false;
interceptOnLive.checked = true;
interceptOff.checked = false;
interceptOnText.style.fontWeight = 'normal';
interceptOnLiveText.style.fontWeight = 'bold';
interceptOffText.style.fontWeight = 'normal';
} else {
interceptOn.checked = false;
interceptOnLive.checked = false;
interceptOff.checked = true;
interceptOnText.style.fontWeight = 'normal';
interceptOnLiveText.style.fontWeight = 'normal';
interceptOffText.style.fontWeight = 'bold';
}
});
interceptOn.onclick = () => {
chrome.storage.sync.set({owaIntercept: "on"}, () => {
console.log('intercept on');
interceptOn.checked = true;
interceptOnLive.checked = false;
interceptOff.checked = false;
interceptOnText.style.fontWeight = 'bold';
interceptOnLive.style.fontWeight = 'normal';
interceptOffText.style.fontWeight = 'normal';
});
}
interceptOnLive.onclick = () => {
chrome.storage.sync.set({owaIntercept: "on_live"}, () => {
console.log('intercept on_live');
interceptOn.checked = false;
interceptOnLive.checked = true;
interceptOff.checked = false;
interceptOnText.style.fontWeight = 'normal';
interceptOnLiveText.style.fontWeight = 'bold';
interceptOffText.style.fontWeight = 'normal';
});
}
interceptOff.onclick = () => {
chrome.storage.sync.set({owaIntercept: "off"}, () => {
console.log('intercept off');
interceptOn.checked = false;
interceptOnLive.checked = false;
interceptOff.checked = true;
interceptOnText.style.fontWeight = 'normal';
interceptOnLiveText.style.fontWeight = 'normal';
interceptOffText.style.fontWeight = 'bold';
});
}