-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
44 lines (40 loc) · 1.06 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
var state = document.getElementById('state');
var subject = document.getElementById('subject');
var message = document.getElementById('message');
var save = document.getElementById('save');
function set_local_storage()
{
chrome.storage.sync.set(
{
'chz_bbs_subject': subject.value,
'chz_bbs_message' : message.value
},
function()
{
save.innerHTML = "sauvegardé ^.^"
setTimeout(
function()
{
save.innerHTML = "sauvegarder"
},
1000
);
}
);
}
function get_local_storage()
{
chrome.storage.sync.get(
[
'chz_bbs_subject',
'chz_bbs_message'
],
function(result)
{
if(result.chz_bbs_subject != undefined) subject.value = result.chz_bbs_subject;
if(result.chz_bbs_message != undefined) message.value = result.chz_bbs_message;
}
);
}
get_local_storage();
save.addEventListener('click', set_local_storage);