diff --git a/css/styles.css b/css/styles.css
index 56387e1b..e26d0cd4 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -89,6 +89,7 @@
.dateTimePlace {
margin-left: 5px;
margin-bottom: 0px;
+ margin-top: 0px;
font-size: smaller;
font-weight: bold;
}
diff --git a/js/Template.js b/js/Template.js
index 4f9c110a..f2d73639 100644
--- a/js/Template.js
+++ b/js/Template.js
@@ -13,7 +13,7 @@ class Template {
-
+
@@ -57,6 +57,39 @@ class Template {
}
+ static UTPlanner = class UTPlanner{
+ static modal(){
+ return `
+
+
×
+
+
+
Computer Fluency (C S 302)
+
with Bruce Porter
+
+
+
+
+
+
+
+
+
+
+
`
+ }
+ }
+
+
static Calendar = class Calendar {
static line(line) {
let {
diff --git a/js/background.js b/js/background.js
index e5ebdeca..064c5fba 100644
--- a/js/background.js
+++ b/js/background.js
@@ -1,11 +1,7 @@
var grades;
var current_semesters = {};
-updateBadge(true);
-loadDataBase()
-getCurrentSemesters();
-
-
+onStartup();
/* Handle messages and their commands from content and popup scripts*/
chrome.runtime.onMessage.addListener(function (request, sender, response) {
@@ -40,6 +36,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, response) {
executeQuery(request.query, response);
case "currentSemesters":
response({ semesters: current_semesters});
+ getCurrentSemesters();
default:
const xhr = new XMLHttpRequest();
const method = request.method ? request.method.toUpperCase() : "GET";
@@ -106,13 +103,10 @@ chrome.storage.onChanged.addListener(function (changes) {
}
});
-
-function executeQuery(query, sendResponse) {
- console.log(grades)
- var res = grades.exec(query)[0];
- sendResponse({
- data: res,
- });
+function onStartup(){
+ updateBadge(true);
+ loadDataBase()
+ getCurrentSemesters();
}
@@ -259,7 +253,8 @@ function add(request, sender, sendResponse) {
}
sendResponse({
done: "Added: (" + request.course.unique + ") " + request.course.coursename,
- label: "Remove Course -"
+ label: "Remove Course -",
+ value: "remove"
});
});
}
@@ -278,7 +273,8 @@ function remove(request, sender, sendResponse) {
});
sendResponse({
done: "Removed: (" + request.course.unique + ") " + request.course.coursename,
- label: "Add Course +"
+ label: "Add Course +",
+ value: "add"
});
});
}
@@ -365,6 +361,15 @@ function updateStatus(sendResponse) {
});
}
+
+function executeQuery(query, sendResponse) {
+ console.log(grades)
+ var res = grades.exec(query)[0];
+ sendResponse({
+ data: res,
+ });
+}
+
/* Load the database*/
function loadDataBase() {
sql = window.SQL;
@@ -385,4 +390,5 @@ function loadBinaryFile(path, success) {
success(arr.join(""));
};
xhr.send();
-};
\ No newline at end of file
+};
+
diff --git a/js/courseCatalog.js b/js/courseCatalog.js
index 4ee29102..66821e87 100644
--- a/js/courseCatalog.js
+++ b/js/courseCatalog.js
@@ -168,9 +168,10 @@ function saveCourse() {
chrome.runtime.sendMessage({
command: "courseStorage",
course: c,
- action: $("#saveCourse").text().substring(0, $("#saveCourse").text().indexOf(" ")).toLowerCase()
+ action: $("#saveCourse").val()
}, function (response) {
$("#saveCourse").text(response.label);
+ $("#saveCourse").val(response.value);
$("#snackbar").text(response.done);
toggleSnackbar();
chrome.runtime.sendMessage({
@@ -320,12 +321,17 @@ function buildSemestersDropdown(course_data, res) {
}
-/*Open the modal and show all the data*/
-function openDialog(course_info, res) {
+function displayBasicCourseInfo(course_info){
$("#title").text(buildTitle(course_info))
$("#topbuttons").before(buildTimeTitle(course_info));
$("#profname").text(buildProfTitle(course_info));
$("#myModal").fadeIn(Timing.fade_time);
+ console.log(course_info);
+}
+
+/*Open the modal and show all the data*/
+function openDialog(course_info, res) {
+ displayBasicCourseInfo(course_info);
//initial text on the "save course button"
chrome.runtime.sendMessage({
command: "alreadyContains",
@@ -345,6 +351,9 @@ function openDialog(course_info, res) {
setChart(data);
}
+
+
+
function setChart(data) {
// set up the chart
toggleChartLoading(false);
@@ -497,16 +506,6 @@ $("#retry").click(function () {
loadNextPages();
});
-/*Listen for update mssage coming from popup*/
-chrome.runtime.onMessage.addListener(
- function (request, sender, sendResponse) {
- if (request.command == "updateCourseList") {
- updateListConflictHighlighting(0);
- }
- }
-);
-
-
function toggleLoadingPage(loading) {
if (loading) {
done_loading = false;
@@ -546,15 +545,6 @@ function toggleSnackbar() {
}, 3000);
}
-$(document).keydown(function (e) {
- /*Close Modal when hit escape*/
- if (e.keyCode == 27) {
- close();
- } else if (e.keyCode == 13 && $('#myModal').is(':visible')) {
- saveCourse();
- }
-});
-
function allowClosing() {
$('.close').click(function () {
@@ -570,4 +560,24 @@ function allowClosing() {
function close() {
$("#myModal").fadeOut(Timing.fade_time);
$("#snackbar").attr("class", "");
-}
\ No newline at end of file
+}
+
+
+$(document).keydown(function (e) {
+ /*Close Modal when hit escape*/
+ if (e.keyCode == 27) {
+ close();
+ } else if (e.keyCode == 13 && $('#myModal').is(':visible')) {
+ saveCourse();
+ }
+});
+
+
+/*Listen for update mssage coming from popup or calendar or other course catalog pages*/
+chrome.runtime.onMessage.addListener(
+ function (request, sender, sendResponse) {
+ if (request.command == "updateCourseList") {
+ updateListConflictHighlighting(0);
+ }
+ }
+);
diff --git a/js/util.js b/js/util.js
index 672d0663..7e57a0d4 100644
--- a/js/util.js
+++ b/js/util.js
@@ -18,8 +18,6 @@ function getStatusColor(status, sub = false) {
return color;
}
-
-
function buildQuery(course_data, sem) {
let query = !sem ? "select * from agg" : "select * from grades";
query += " where dept like '%" + course_data["department"] + "%'";
@@ -54,15 +52,16 @@ function capitalizeString(string) {
return output.trim();
}
-function seperateDays(date) {
+function seperateDays(date, simple=false) {
let arr = [];
for (var i = 0; i < date.length; i++) {
let letter = date.charAt(i);
+ let seperated_letter = letter;
if (letter == "T" && i < date.length - 1 && date.charAt(i + 1) == "H") {
- arr.push(days.get("TH"));
+ arr.push(simple ? "TH" : days.get("TH"));
} else {
if (letter != "H") {
- arr.push(days.get(letter));
+ arr.push(simple ? letter : days.get(letter));
}
}
}
diff --git a/js/utplanner.js b/js/utplanner.js
index e0772b13..c24d87ca 100644
--- a/js/utplanner.js
+++ b/js/utplanner.js
@@ -1,3 +1,15 @@
+let semester_code = "";
+curr_course = {}
+
+chrome.runtime.sendMessage({
+ command: "currentSemesters"
+}, function(response){
+ let semester_text = $('.row:contains(Semester)').find('span').text();
+ let key = semester_text.split(' ').reverse().join(' ');
+ semester_code = response.semesters[key];
+});
+
+
if ($('html').hasClass('gr__utexas_collegescheduler_com')) {
$.initialize("table.section-detail-grid", function () {
$(this).find('thead>tr').append(' Plus |