-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
26 lines (26 loc) · 1.13 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
var courseObj;
var courseOne;
window.onload = function() {
document.getElementById('button').onclick = function() {
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
var manaTEAMS = new ManaTEAMS(username, password);
manaTEAMS.login(function(selectInfo) {
manaTEAMS.getAllCourses(function(html, courses) {
courseObj = courses;
manaTEAMS.getCycleClassGrades(courses[1].courseId, 1, 0, html, function(courseOneret) {
courseOne = courseOneret;
});
document.getElementById("response").innerHTML = JSON.stringify(courses);
});
},function(error) {
console.log(error);
});
}
document.getElementById('button2').onclick = function() {
var manaTEAMS = new ManaTEAMS(document.getElementById('username').value, document.getElementById('password').value);
manaTEAMS.getGradesPage(function(html, error) {
document.getElementById("response").innerHTML = error || "Logged In!";
})
}
}