Added condition for resetting storage on update and updated schedule margins

This commit is contained in:
Kevin Dao
2018-08-28 18:07:59 -05:00
parent b4e8c7589e
commit 9a02248a81
2 changed files with 15 additions and 13 deletions

View File

@@ -28,18 +28,20 @@ chrome.runtime.onMessage.addListener(function (request, sender, response) {
});
/* Initially set the course data in storage */
chrome.runtime.onInstalled.addListener(function () {
var arr = new Array();
chrome.storage.sync.set({
savedCourses: arr
}, function () {
console.log('initial course list');
});
chrome.storage.sync.set({
courseConflictHighlight: true
}, function () {
console.log('initial highlighting: true');
});
chrome.runtime.onInstalled.addListener(function (details) {
if (details.reason == "install" || details.reason == "update") {
var arr = new Array();
chrome.storage.sync.set({
savedCourses: arr
}, function () {
console.log('initial course list');
});
chrome.storage.sync.set({
courseConflictHighlight: true
}, function () {
console.log('initial highlighting: true');
});
}
});
/* Find all the conflicts in the courses and send them out/ if there is even a conflict*/

View File

@@ -41,7 +41,7 @@ chrome.storage.sync.get('savedCourses', function (data) {
if (profname == "") {
profname = "Undecided Professor";
}
var listhtml = "<li id='" + i + "'style='padding: 0px 5px 5px 5px; overflow-y: auto;max-height:400px;'><div class='card'><div class='container' style='background:" + color + "''><h4 class='truncate' style='color:white;margin:5px; display:inline-block;font-size:large;'><b>" + department + " " + course_nbr + "<span style='font-size:medium'>" + " with </span><span style='font-size:medium'>" + profname + " (" + courses[i].unique + ")" + "</span></b></h4><p style='float:right;font-size:small;display:inline-block;margin-top:10px;color:white;'>&#9660;</p></div></div><div id='moreInfo' style='display: none;'><p style='font-weight:bold;padding:10px;margin:0px;font-size:small;background-color:#FFCDD2;'>" + makeLine(i) + "</p><div id='infoButtons' style='border-radius:0px;'><button class='matbut' id='listRemove'style='float:right;background:#F44336; margin:5px;'>Remove</button><button class='matbut' id='listMoreInfo' style='float:right;background:#2196F3; margin:5px;'>More Info</button></div></div></li>";
var listhtml = "<li id='" + i + "'style='padding: 0px 5px 5px 5px; overflow-y: auto;max-height:400px;'><div class='card'><div class='container' style='background:" + color + "''><h4 class='truncate' style='color:white;margin:5px; display:inline-block;font-size:large;'><b>" + department + " " + course_nbr + "<span style='font-size:medium'>" + " with </span><span style='font-size:medium'>" + profname + " (" + courses[i].unique + ")" + "</span></b></h4><p style='float:right;font-size:small;display:inline-block;margin-top:10px;color:white;'>&#9660;</p></div></div><div id='moreInfo' style='display: none;'><p style='font-weight:bold;padding:10px;margin:0px 5px 0px 15px;font-size:small;background-color:#FFCDD2;'>" + makeLine(i) + "</p><div id='infoButtons' style='border-radius:0px;'><button class='matbut' id='listRemove'style='float:right;background:#F44336; margin:5px;'>Remove</button><button class='matbut' id='listMoreInfo' style='float:right;background:#2196F3; margin:5px;'>More Info</button></div></div></li>";
$("#courseList").append(listhtml);
}
});