updated the search to now do the semester, class, and level search, and put link to RIS on popup
This commit is contained in:
@@ -283,7 +283,7 @@ input[type=number]::-webkit-outer-spin-button {
|
|||||||
|
|
||||||
.select-style {
|
.select-style {
|
||||||
border: 1px solid #979797;
|
border: 1px solid #979797;
|
||||||
margin: 10px 0px;
|
margin: 5px 0px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
display: none;
|
display: none;
|
||||||
background: transparent no-repeat 90% 50%;
|
background: transparent no-repeat 90% 50%;
|
||||||
@@ -324,7 +324,7 @@ input[type=number]::-webkit-outer-spin-button {
|
|||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#class_id_input {
|
.class_id_input {
|
||||||
display: none;
|
display: none;
|
||||||
border: 1px solid #979797;
|
border: 1px solid #979797;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
@@ -332,7 +332,7 @@ input[type=number]::-webkit-outer-spin-button {
|
|||||||
padding: 5px 8px;
|
padding: 5px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#class_id_input::placeholder {
|
.class_id_input::placeholder {
|
||||||
color: rgba(0, 0, 45, 0.48);
|
color: rgba(0, 0, 45, 0.48);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
var grades;
|
var grades;
|
||||||
var current_semesters = {};
|
var current_semesters = {};
|
||||||
|
var departments = [];
|
||||||
var should_open = false;
|
var should_open = false;
|
||||||
onStartup();
|
onStartup();
|
||||||
|
|
||||||
@@ -39,6 +40,9 @@ chrome.runtime.onMessage.addListener(function (request, sender, response) {
|
|||||||
response({ semesters: current_semesters});
|
response({ semesters: current_semesters});
|
||||||
getCurrentSemesters();
|
getCurrentSemesters();
|
||||||
break;
|
break;
|
||||||
|
case "currentDepartments":
|
||||||
|
response({departments: departments});
|
||||||
|
break;
|
||||||
case "setOpen":
|
case "setOpen":
|
||||||
should_open = true;
|
should_open = true;
|
||||||
chrome.tabs.create({ url: request.url});
|
chrome.tabs.create({ url: request.url});
|
||||||
@@ -117,9 +121,9 @@ function onStartup(){
|
|||||||
updateBadge(true);
|
updateBadge(true);
|
||||||
loadDataBase()
|
loadDataBase()
|
||||||
getCurrentSemesters();
|
getCurrentSemesters();
|
||||||
|
getCurrentDepartments();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getCurrentSemesters(){
|
function getCurrentSemesters(){
|
||||||
$.get('https://registrar.utexas.edu/schedules', function (response) {
|
$.get('https://registrar.utexas.edu/schedules', function (response) {
|
||||||
if (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) {
|
function updateBadge(first, new_changes) {
|
||||||
if (new_changes) {
|
if (new_changes) {
|
||||||
@@ -401,4 +418,3 @@ function loadBinaryFile(path, success) {
|
|||||||
};
|
};
|
||||||
xhr.send();
|
xhr.send();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
46
js/popup.js
46
js/popup.js
@@ -2,6 +2,7 @@ var courses;
|
|||||||
|
|
||||||
setCourseList();
|
setCourseList();
|
||||||
getSemesters();
|
getSemesters();
|
||||||
|
getDepartments();
|
||||||
|
|
||||||
var can_remove = true;
|
var can_remove = true;
|
||||||
|
|
||||||
@@ -105,9 +106,9 @@ $("#clear").click(function () {
|
|||||||
showEmpty();
|
showEmpty();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#schedule").click(function () {
|
$("#RIS").click(function () {
|
||||||
chrome.tabs.create({
|
chrome.tabs.create({
|
||||||
'url': 'https://registrar.utexas.edu/schedules'
|
'url': 'https://utdirect.utexas.edu/registrar/ris.WBX'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -201,22 +202,16 @@ $('#export-class').click(function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function openCoursePage(sem, unique) {
|
function openSearch(semester, department, level) {
|
||||||
var link = `https://utdirect.utexas.edu/apps/registrar/course_schedule/${sem}/${unique}/`;
|
var link = `https://utdirect.utexas.edu/apps/registrar/course_schedule/${semester}/results/?fos_fl=${department}&level=${level}&search_type_main=FIELD`
|
||||||
openMoreInfoWithOpenModal(link);
|
chrome.tabs.create({ url: link});
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#search-class").click(() => {
|
$("#search-class").click(() => {
|
||||||
var unique_id = $("#class_id_input").val();
|
let semester = $("#semesters").find(":selected").val();
|
||||||
if (!isNaN(unique_id)) {
|
let department = $("#department").find(":selected").val();
|
||||||
if (unique_id.length == 5) {
|
let level = $("#level").find(":selected").val();
|
||||||
let selected_semester = $("#semesters").find(":selected").val();
|
openSearch(semester, department, level);
|
||||||
openCoursePage(selected_semester, unique_id);
|
|
||||||
$("#class_id_input").val('');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
alert("Oops, check your input. Class IDs should have 5 digits!");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#options_button").click(function () {
|
$("#options_button").click(function () {
|
||||||
@@ -367,9 +362,10 @@ function showEmpty() {
|
|||||||
|
|
||||||
function hideSearchPopup() {
|
function hideSearchPopup() {
|
||||||
$("#search>i").text('search');
|
$("#search>i").text('search');
|
||||||
$("#class_id_input").hide();
|
|
||||||
$("#semcon").hide();
|
$("#semcon").hide();
|
||||||
|
$("#depcon").hide();
|
||||||
$("#semesters").hide();
|
$("#semesters").hide();
|
||||||
|
$("#levcon").hide();
|
||||||
$("#search-popup").addClass('hide');
|
$("#search-popup").addClass('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +374,8 @@ function showSearchPopup() {
|
|||||||
$("#class_id_input").show();
|
$("#class_id_input").show();
|
||||||
$("#semesters").show();
|
$("#semesters").show();
|
||||||
$("#semcon").show();
|
$("#semcon").show();
|
||||||
$('#class_id_input').focus();
|
$("#depcon").show();
|
||||||
|
$("#levcon").show();
|
||||||
$("#search-popup").removeClass('hide');
|
$("#search-popup").removeClass('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,7 +394,6 @@ function getSemesters() {
|
|||||||
command: "currentSemesters"
|
command: "currentSemesters"
|
||||||
}, function(response){
|
}, function(response){
|
||||||
let { semesters } = response;
|
let { semesters } = response;
|
||||||
console.log(semesters);
|
|
||||||
let semester_names = Object.keys(semesters);
|
let semester_names = Object.keys(semesters);
|
||||||
for(let i = 0; i<semester_names.length;i++){
|
for(let i = 0; i<semester_names.length;i++){
|
||||||
let name = semester_names[i];
|
let name = semester_names[i];
|
||||||
@@ -405,3 +401,17 @@ function getSemesters() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDepartments() {
|
||||||
|
chrome.runtime.sendMessage({
|
||||||
|
command: "currentDepartments"
|
||||||
|
}, function(response){
|
||||||
|
let { departments } = response;
|
||||||
|
console.log(departments);
|
||||||
|
for(let i = 0; i<departments.length; i++){
|
||||||
|
let abv = departments[i];
|
||||||
|
$("#department").append(`<option value='${abv}'>${abv}</option>`);
|
||||||
|
}
|
||||||
|
$("#department").val('C S');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
20
popup.html
20
popup.html
@@ -12,7 +12,7 @@
|
|||||||
<div class="card" id="card-header">
|
<div class="card" id="card-header">
|
||||||
<div id="buttons" style="padding: 5px 10px 5px 10px;display: flex;justify-content: space-between;">
|
<div id="buttons" style="padding: 5px 10px 5px 10px;display: flex;justify-content: space-between;">
|
||||||
<button id="clear" class="matbut" style="font-size:15px; background:#4CAF50;margin: 7px;">Clear All</button>
|
<button id="clear" class="matbut" style="font-size:15px; background:#4CAF50;margin: 7px;">Clear All</button>
|
||||||
<button id="schedule" class="matbut" style="font-size:15px;background:#FF9800;margin: 7px;">Course List</button>
|
<button id="RIS" class="matbut" style="font-size:15px;background:#FF9800;margin: 7px;">Registrar Info </button>
|
||||||
<button id="calendar" class="matbut" style="font-size:15px; background: #FF0000; margin:7px;">My Schedule</button>
|
<button id="calendar" class="matbut" style="font-size:15px; background: #FF0000; margin:7px;">My Schedule</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,8 +50,22 @@
|
|||||||
<select id="semesters"></select>
|
<select id="semesters"></select>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" id="class_id_input" class="item" name="class_id" maxlength="5"
|
<div id='depcon' class="select-style item">
|
||||||
placeholder="Course ID #"></input>
|
<label>
|
||||||
|
<select id="department"></select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div id='levcon' class="select-style item">
|
||||||
|
<label>
|
||||||
|
<select id="level">
|
||||||
|
<option value="L">Lower</option>
|
||||||
|
<option value="U">Upper</option>
|
||||||
|
<option value="G">Grad</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<!-- <input type="text" id="class_id_input" class="class_id_input item" name="class_id" maxlength="5"
|
||||||
|
placeholder="Course ID #"></input> -->
|
||||||
</div>
|
</div>
|
||||||
<button id="search-class" class="matbut">Search</button>
|
<button id="search-class" class="matbut">Search</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user