Minor bugfixes
This commit is contained in:
@@ -164,7 +164,7 @@ $(function () {
|
||||
function makeMap(datetimearr) {
|
||||
var dtmap = new Map([]);
|
||||
for (var i = 0; i < datetimearr.length; i++) {
|
||||
console.log(datetimearr[i][1][0]);
|
||||
//console.log(datetimearr[i][1][0]);
|
||||
datetimearr[i][1][0] = moment(datetimearr[i][1][0], ["HH:mm A"]).format("h:mm A");
|
||||
datetimearr[i][1][1] = moment(datetimearr[i][1][1], ["HH:mm A"]).format("h:mm A");
|
||||
}
|
||||
@@ -232,8 +232,8 @@ $(function () {
|
||||
|
||||
//create the event object for every section
|
||||
function setEventForSection(session, colorCounter, i) {
|
||||
console.log(moment().startOf('month').format("YYYY-MM-D"));
|
||||
console.log(moment().day(fullday));
|
||||
// console.log(moment().startOf('month').format("YYYY-MM-D"));
|
||||
// console.log(moment().day(fullday));
|
||||
var fullday = days.get(session[0]);
|
||||
var classInfo = savedCourses[i];
|
||||
var department = classInfo.coursename.substring(0, classInfo.coursename.search(/\d/) - 2);
|
||||
@@ -277,7 +277,7 @@ $(function () {
|
||||
chrome.storage.sync.get("savedCourses", function (data) {
|
||||
savedCourses = data.savedCourses
|
||||
setAllEvents(data.savedCourses);
|
||||
console.log(classSchedules);
|
||||
// console.log(classSchedules);
|
||||
$('#calendar').fullCalendar('removeEventSources');
|
||||
$("#calendar").fullCalendar('addEventSource', classSchedules, true);
|
||||
});
|
||||
|
||||
@@ -89,7 +89,7 @@ $(function () {
|
||||
chrome.runtime.onMessage.addListener(
|
||||
function (request, sender, sendResponse) {
|
||||
if (request.command == "updateCourseList") {
|
||||
console.log("hello");
|
||||
// console.log("hello");
|
||||
update();
|
||||
}
|
||||
});
|
||||
@@ -193,7 +193,7 @@ function getCourseInfo(row) {
|
||||
if ($(this).is(row)) {
|
||||
profurl = $(this).find('td[data-th="Unique"] a').prop('href');
|
||||
registerlink = $(this).find('td[data-th="Add"] a').prop('href');
|
||||
console.log(registerlink);
|
||||
// console.log(registerlink);
|
||||
uniquenum = $(this).find('td[data-th="Unique"]').text();
|
||||
status = $(this).find('td[data-th="Status"]').text();
|
||||
profname = $(this).find('td[data-th="Instructor"]').text().split(', ')[0];
|
||||
@@ -222,7 +222,7 @@ function getCourseInfo(row) {
|
||||
profinit = "";
|
||||
}
|
||||
profurl = document.URL;
|
||||
console.log(profurl);
|
||||
// console.log(profurl);
|
||||
}
|
||||
getDescription();
|
||||
department = coursename.substring(0, coursename.search(/\d/) - 2);
|
||||
@@ -491,8 +491,8 @@ function prettifyName() {
|
||||
|
||||
/*Get the course description from the profurl and highlight the important elements, as well as set the eCIS, and rmp links.*/
|
||||
function getDescription() {
|
||||
console.log(window.location.href);
|
||||
console.log(profurl);
|
||||
// console.log(window.location.href);
|
||||
// console.log(profurl);
|
||||
chrome.runtime.sendMessage({
|
||||
method: "GET",
|
||||
action: "xhttp",
|
||||
|
||||
27
js/popup.js
27
js/popup.js
@@ -89,21 +89,23 @@ $(document).ready(function () {
|
||||
window.open(courses[$(this).closest("li").attr("id")].link);
|
||||
});
|
||||
let status = courses[$(this).closest("li").attr("id")].status;
|
||||
|
||||
if (status.includes("closed") || status.includes("cancelled")|| !status) {
|
||||
let registerlink = courses[$(this).closest("li").attr("id")].registerlink;
|
||||
if (status.includes("closed") || status.includes("cancelled") || !status || !registerlink) {
|
||||
$(this).find("#register").text("Can't Register").css("background-color", "#FF5722");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (status.includes("waitlisted")) {
|
||||
$(this).find("#register").text("Join Waitlist").css("background-color", "#FF9800");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$(this).find("#register").text("Register").css("background-color", "#4CAF50");
|
||||
}
|
||||
$(this).find("#register").click(function () {
|
||||
let registerlink = courses[$(this).closest("li").attr("id")].registerlink;
|
||||
chrome.tabs.query({currentWindow: true, active: true}, function (tab) {
|
||||
chrome.tabs.update(tab.id, {url: registerlink});
|
||||
chrome.tabs.query({
|
||||
currentWindow: true,
|
||||
active: true
|
||||
}, function (tab) {
|
||||
chrome.tabs.update(tab.id, {
|
||||
url: registerlink
|
||||
});
|
||||
});
|
||||
})
|
||||
}
|
||||
@@ -185,8 +187,7 @@ function makeLine(index) {
|
||||
|
||||
if (timearr.length == 0) {
|
||||
output = "<span style='font-size:medium;'>This class has no meeting times.</span>"
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
for (var i = 0; i < dayarr.length; i++) {
|
||||
var place = findLoc(dayarr[i], timearr[i], datetimearr);
|
||||
var building = place.substring(0, place.search(/\d/) - 1);
|
||||
@@ -204,8 +205,8 @@ function makeLine(index) {
|
||||
function findLoc(day, timearr, datetimearr) {
|
||||
for (let i = 0; i < datetimearr.length; i++) {
|
||||
var dtl = datetimearr[i];
|
||||
console.log(dtl[1]);
|
||||
console.log(timearr);
|
||||
// console.log(dtl[1]);
|
||||
// console.log(timearr);
|
||||
if (day.includes(dtl[0])) {
|
||||
if (JSON.stringify(timearr) == JSON.stringify(fixDtl1(dtl[1]))) {
|
||||
return dtl[2];
|
||||
|
||||
Reference in New Issue
Block a user