updated the search to now do the semester, class, and level search, and put link to RIS on popup
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
var grades;
|
||||
var current_semesters = {};
|
||||
var departments = [];
|
||||
var should_open = false;
|
||||
onStartup();
|
||||
|
||||
@@ -39,6 +40,9 @@ chrome.runtime.onMessage.addListener(function (request, sender, response) {
|
||||
response({ semesters: current_semesters});
|
||||
getCurrentSemesters();
|
||||
break;
|
||||
case "currentDepartments":
|
||||
response({departments: departments});
|
||||
break;
|
||||
case "setOpen":
|
||||
should_open = true;
|
||||
chrome.tabs.create({ url: request.url});
|
||||
@@ -117,9 +121,9 @@ function onStartup(){
|
||||
updateBadge(true);
|
||||
loadDataBase()
|
||||
getCurrentSemesters();
|
||||
getCurrentDepartments();
|
||||
}
|
||||
|
||||
|
||||
function getCurrentSemesters(){
|
||||
$.get('https://registrar.utexas.edu/schedules', function (response) {
|
||||
if (response) {
|
||||
@@ -150,6 +154,19 @@ function getCurrentSemesters(){
|
||||
}
|
||||
|
||||
|
||||
function getCurrentDepartments(){
|
||||
$.get('https://catalog.utexas.edu/undergraduate/appendix-b/', function(response){
|
||||
if(response){;
|
||||
departments = [];
|
||||
htmlToNode(response).find('.column1').each(function(i){
|
||||
if(i > 0){
|
||||
let abv = $(this).text();
|
||||
departments.push(abv);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateBadge(first, new_changes) {
|
||||
if (new_changes) {
|
||||
@@ -401,4 +418,3 @@ function loadBinaryFile(path, success) {
|
||||
};
|
||||
xhr.send();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user