saving courses UI/popup

This commit is contained in:
Sriram Hariharan
2018-07-10 02:06:11 -05:00
parent df4b1f12a8
commit 0014f7aed7
6 changed files with 88 additions and 29 deletions

View File

@@ -7,12 +7,15 @@ chrome.runtime.onMessage.addListener(function(request, sender, response) {
remove(request,sender,response);
}
}
if(request.command == "checkConflicts"){
else if(request.command == "checkConflicts"){
//Check conflicts
}
else if(request.command == "alreadyContains"){
alreadyContains(request.unique,response);
}
else if(request.command == "getCourses"){
getCourses(response);
}
else{
const xhr = new XMLHttpRequest();
const method = request.method ? request.method.toUpperCase() : "GET";
@@ -34,6 +37,13 @@ chrome.runtime.onMessage.addListener(function(request, sender, response) {
});
});
function getCourses(sendResponse){
chrome.storage.sync.get('savedCourses', function(data) {
sendResponse({done:data.savedCourses});
});
}
function add(request, sender, sendResponse) {
var courses;
var response;