Merge branch 'sghsri:master' into master
This commit is contained in:
@@ -205,15 +205,9 @@ function getCurrentSemesters() {
|
||||
|
||||
// use the utexas review api for getting the list of departments
|
||||
function getCurrentDepartments() {
|
||||
$.get("https://www.utexasreview.com/api/get_major", function (response) {
|
||||
$.get("https://raw.githubusercontent.com/sghsri/UT-Registration-Plus/master/docs/departments.json", function (response) {
|
||||
if (response) {
|
||||
let { majors } = response;
|
||||
let indices = Object.keys(majors);
|
||||
let new_departments = [];
|
||||
for (let i = 0; i < indices.length; i++) {
|
||||
new_departments.push(majors[i].abr);
|
||||
}
|
||||
departments = new_departments;
|
||||
departments = JSON.parse(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -263,7 +257,7 @@ function checkConflicts(sendResponse) {
|
||||
}
|
||||
}
|
||||
sendResponse({
|
||||
isConflict: conflicts.length === 0,
|
||||
isConflict: conflicts.length !== 0,
|
||||
between: conflicts.length ? conflicts : undefined,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -35,8 +35,8 @@ $.get("https://api.github.com/repos/sghsri/UT-Registration-Plus/stats/contributo
|
||||
for (var contributorData of data) {
|
||||
$.get(`https://api.github.com/users/${contributorData.author.login}`, userData => {
|
||||
let fullData = { ...contributorData, ...userData };
|
||||
let { login, avatar_url, html_url, name } = fullData;
|
||||
$("#contributor-list").append(Template.Options.contributor_card(login, name, avatar_url, html_url));
|
||||
let { login, avatar_url, html_url } = fullData;
|
||||
$("#contributor-list").append(Template.Options.contributor_card(login, "name", avatar_url, html_url));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
19
js/popup.js
19
js/popup.js
@@ -23,10 +23,10 @@ function setCourseList() {
|
||||
let { department, number } = separateCourseNameParts(coursename);
|
||||
let class_length = parseInt(number.charAt(0));
|
||||
let multi_semester_code = number.slice(-1);
|
||||
if (["A","B"].includes(multi_semester_code)) {
|
||||
hours += Math.floor(class_length/2);
|
||||
} else if (["X","Y","Z"].includes(multi_semester_code)) {
|
||||
hours += Math.floor(class_length/3);
|
||||
if (["A", "B"].includes(multi_semester_code)) {
|
||||
hours += Math.floor(class_length / 2);
|
||||
} else if (["X", "Y", "Z"].includes(multi_semester_code)) {
|
||||
hours += Math.floor(class_length / 3);
|
||||
} else {
|
||||
hours += class_length;
|
||||
}
|
||||
@@ -59,6 +59,7 @@ function updateConflicts() {
|
||||
command: "checkConflicts",
|
||||
},
|
||||
function (response) {
|
||||
console.log("updateConflicts -> response", response);
|
||||
if (response.isConflict) {
|
||||
var between = response.between;
|
||||
let conflict_message = "";
|
||||
@@ -310,15 +311,13 @@ function subtractHours(curr_course) {
|
||||
let curr_course_number = separateCourseNameParts(curr_course.coursename).number;
|
||||
let class_length = parseInt(curr_course_number.charAt(0));
|
||||
let multi_semester_code = curr_course_number.slice(-1);
|
||||
if (["A","B"].includes(multi_semester_code)) {
|
||||
$("#meta-metric").text(curr_total_hours - Math.floor(class_length/2));
|
||||
} else if (["X","Y","Z"].includes(multi_semester_code)) {
|
||||
$("#meta-metric").text(curr_total_hours - Math.floor(class_length/3));
|
||||
if (["A", "B"].includes(multi_semester_code)) {
|
||||
$("#meta-metric").text(curr_total_hours - Math.floor(class_length / 2));
|
||||
} else if (["X", "Y", "Z"].includes(multi_semester_code)) {
|
||||
$("#meta-metric").text(curr_total_hours - Math.floor(class_length / 3));
|
||||
} else {
|
||||
$("#meta-metric").text(curr_total_hours - class_length);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function handleMoreInfo(clicked_item, curr_course) {
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "UT Registration Plus",
|
||||
"version": "1.2.2.6",
|
||||
"version": "1.2.2.7",
|
||||
"options_page": "options.html",
|
||||
"description": "Improves the course registration process at the University of Texas at Austin!",
|
||||
"permissions": [
|
||||
"tabs",
|
||||
"declarativeContent",
|
||||
"storage",
|
||||
"*://*.utdirect.utexas.edu/apps/registrar/course_schedule/*",
|
||||
"*://*.utexas.collegescheduler.com/*",
|
||||
@@ -14,11 +12,6 @@
|
||||
"*://*.registrar.utexas.edu/schedules/*",
|
||||
"*://*.login.utexas.edu/login/*"
|
||||
],
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "sghsri@gmail.com"
|
||||
}
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"css": ["css/styles.css"],
|
||||
|
||||
Reference in New Issue
Block a user