From b4e8c7589e53f1064d70703459cc6d66fae1b04c Mon Sep 17 00:00:00 2001 From: Kevin Dao Date: Tue, 28 Aug 2018 18:00:50 -0500 Subject: [PATCH 1/3] Revert "individual bug fix" This reverts commit af61433f9a868637951c03cfa44837ae98be7099. --- js/content.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/js/content.js b/js/content.js index 9947eb73..1f4cfa7d 100644 --- a/js/content.js +++ b/js/content.js @@ -217,12 +217,7 @@ function getCourseInfo(row) { /*Handle if on the individual course page, ie if the textbook button exists*/ if ($("#textbook_button").length) { coursename = $("#details h2").text(); - var gotname = $("table").find("td[data-th='Instructor']").text(); - if (gotname != "") { - profinit = $("table").find("td[data-th='Instructor']").text().split(", ")[1].substring(0, 1); - } else { - profinit = ""; - } + profinit = $("table").find("td[data-th='Instructor']").text().split(", ")[1].substring(0, 1); profurl = document.URL; console.log(profurl); } From 9a02248a81e85e5a282b83f670d52804cb568649 Mon Sep 17 00:00:00 2001 From: Kevin Dao Date: Tue, 28 Aug 2018 18:07:59 -0500 Subject: [PATCH 2/3] Added condition for resetting storage on update and updated schedule margins --- js/background.js | 26 ++++++++++++++------------ js/popup.js | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/js/background.js b/js/background.js index 26e1e067..a38ffcd9 100644 --- a/js/background.js +++ b/js/background.js @@ -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*/ diff --git a/js/popup.js b/js/popup.js index 8d1aa4e2..708a9b89 100644 --- a/js/popup.js +++ b/js/popup.js @@ -41,7 +41,7 @@ chrome.storage.sync.get('savedCourses', function (data) { if (profname == "") { profname = "Undecided Professor"; } - var listhtml = "
  • " + department + " " + course_nbr + "" + " with " + profname + " (" + courses[i].unique + ")" + "

  • "; + var listhtml = "
  • " + department + " " + course_nbr + "" + " with " + profname + " (" + courses[i].unique + ")" + "

  • "; $("#courseList").append(listhtml); } }); From fd9a41b352a9c509c45c718f1bb76b3d8ad77916 Mon Sep 17 00:00:00 2001 From: Kevin Dao Date: Wed, 29 Aug 2018 11:36:46 -0500 Subject: [PATCH 3/3] Updated to match upstream branch --- js/content.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/content.js b/js/content.js index 1f4cfa7d..9947eb73 100644 --- a/js/content.js +++ b/js/content.js @@ -217,7 +217,12 @@ function getCourseInfo(row) { /*Handle if on the individual course page, ie if the textbook button exists*/ if ($("#textbook_button").length) { coursename = $("#details h2").text(); - profinit = $("table").find("td[data-th='Instructor']").text().split(", ")[1].substring(0, 1); + var gotname = $("table").find("td[data-th='Instructor']").text(); + if (gotname != "") { + profinit = $("table").find("td[data-th='Instructor']").text().split(", ")[1].substring(0, 1); + } else { + profinit = ""; + } profurl = document.URL; console.log(profurl); }