-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgear.js
21 lines (19 loc) · 973 Bytes
/
gear.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var selectButton = document.getElementById("select");
var intervalInput = document.getElementById("intervalTime");
var breakInput = document.getElementById("breakTime");
selectButton.onclick = function(){
intervalTimeStored = Math.floor(intervalInput.value * 1);
breakTimeStored = Math.floor(breakInput.value * 1);
const checkboxes = document.querySelectorAll('input[name="exercise"]:checked');
var eList = [];
for(var elem of checkboxes.values()) {
eList.push(elem.value);
}
window.localStorage.setItem("elist",JSON.stringify(eList));
window.localStorage.setItem("intervalTimeStored",JSON.stringify(intervalTimeStored));
window.localStorage.setItem("breakTimeStored",JSON.stringify(breakTimeStored));
var goBack = window.open('', 'parent');
goBack.focus();
window.close;
return;
}