forked from vearne/ireminder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
27 lines (22 loc) · 848 Bytes
/
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
'use strict';
let setRemindButton = document.getElementById('setRemindButton');
let removeRemindButton = document.getElementById('removeRemindButton');
chrome.storage.sync.get(['interval', 'tip'], result => {
let intervalInput = document.getElementById('interval');
let tipInput = document.getElementById('tip');
if(result.interval){
intervalInput.value = result.interval;
tipInput.value = result.tip;
console.info("change the popup");
}
});
setRemindButton.onclick = function(element) {
let interval = document.getElementById('interval');
let tip = document.getElementById('tip');
var bg = chrome.extension.getBackgroundPage();
bg.setReminder(parseInt(interval.value), tip.value);
};
removeRemindButton.onclick = function(element) {
var bg = chrome.extension.getBackgroundPage();
bg.removeReminder();
}