eCIS and more
This commit is contained in:
54
content.js
54
content.js
@@ -1,6 +1,6 @@
|
|||||||
var grades;
|
var grades;
|
||||||
|
|
||||||
var rmpLink;
|
var rmpLink;
|
||||||
|
var eCISLink;
|
||||||
var coursename;
|
var coursename;
|
||||||
var profname;
|
var profname;
|
||||||
var profinit;
|
var profinit;
|
||||||
@@ -11,12 +11,13 @@ var description;
|
|||||||
const days = new Map([["M" ,"Monday"],
|
const days = new Map([["M" ,"Monday"],
|
||||||
["T", "Tuesday"], ["W", "Wednesday"],["TH" ,"Thursday"],
|
["T", "Tuesday"], ["W", "Wednesday"],["TH" ,"Thursday"],
|
||||||
["F", "Friday"]]);
|
["F", "Friday"]]);
|
||||||
|
const fadetime = 150;
|
||||||
|
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
loadDataBase();
|
loadDataBase();
|
||||||
//make heading
|
//make heading
|
||||||
$("table thead th:last-child").after('<th scope=col>Plus</th>');
|
$("table thead th:last-child").after('<th scope=col>Plus</th>');
|
||||||
var modhtml = '<div class=modal id=myModal><div class=modal-content><span class=close>×</span><div class=card><div class=cardcontainer><h2 class=title>Computer Fluency (C S 302)</h2><h2 class=profname>with Bruce Porter</h2><div class=topbuttons><button class=matbut id="rateMyProf" style="background: #CDDC39;"> RMP </button><button class=matbut id="eCIS"> Past Syllabi </button><button class=matbut id="saveCourse" style="background: #F44336;"> Save Course +</button></div></div></div><div class=card><div class=cardcontainer><ul class=description style="list-style-type:disc"></ul></div></div><div class=card><div class=cardcontainer><div id=chart></div></div></div></div>'
|
var modhtml = '<div class=modal id=myModal><div class=modal-content><span class=close>×</span><div class=card><div class=cardcontainer><h2 class=title>Computer Fluency (C S 302)</h2><h2 class=profname>with Bruce Porter</h2><div class=topbuttons><button class=matbut id="rateMyProf" style="background: #4CAF50;"> RMP </button><button class=matbut id="eCIS" style="background: #CDDC39;"> eCIS </button><button class=matbut id="Syllabi"> Past Syllabi </button><button class=matbut id="saveCourse" style="background: #F44336;"> Save Course +</button></div></div></div><div class=card><div class=cardcontainer><ul class=description style="list-style-type:disc"></ul></div></div><div class=card><div class=cardcontainer><div id=chart></div></div></div></div>'
|
||||||
$("#container").prepend(modhtml);
|
$("#container").prepend(modhtml);
|
||||||
//console.log(grades);
|
//console.log(grades);
|
||||||
$('table').find('tr').each(function(){
|
$('table').find('tr').each(function(){
|
||||||
@@ -33,7 +34,7 @@ $(document).ready( function() {
|
|||||||
let lastname = profname.split(',')[0];
|
let lastname = profname.split(',')[0];
|
||||||
rating = "Hello";
|
rating = "Hello";
|
||||||
}
|
}
|
||||||
$(this).append('<td data-th="Plus"><input type="image" class="distButton" style="vertical-align: bottom;" width="30" height="30" src='+chrome.extension.getURL('disticon.png')+' /></td>');
|
$(this).append('<td data-th="Plus"><input type="image" class="distButton" style="vertical-align: bottom;" width="25" height="25" src='+chrome.extension.getURL('disticon.png')+' /></td>');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(".distButton").click(function(){
|
$(".distButton").click(function(){
|
||||||
@@ -44,7 +45,7 @@ $(document).ready( function() {
|
|||||||
$("#saveCourse").click(function(){
|
$("#saveCourse").click(function(){
|
||||||
|
|
||||||
});
|
});
|
||||||
$("#eCIS").click(function(){
|
$("#Syllabi").click(function(){
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
window.open('https://utdirect.utexas.edu/apps/student/coursedocs/nlogon/?semester=&department='+department+'&course_number='+course_nbr+'&course_title=&unique=&instructor_first=&instructor_last='+profname+'&course_type=In+Residence&search=Search');
|
window.open('https://utdirect.utexas.edu/apps/student/coursedocs/nlogon/?semester=&department='+department+'&course_number='+course_nbr+'&course_title=&unique=&instructor_first=&instructor_last='+profname+'&course_type=In+Residence&search=Search');
|
||||||
}, 200);
|
}, 200);
|
||||||
@@ -54,6 +55,18 @@ $(document).ready( function() {
|
|||||||
window.open(rmpLink);
|
window.open(rmpLink);
|
||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
|
$("#eCIS").click(function(){
|
||||||
|
setTimeout(function(){
|
||||||
|
window.open(eCISLink);
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
|
$(document).keydown(function(e) {
|
||||||
|
if (e.keyCode == 27) {
|
||||||
|
$(".modal").fadeOut(fadetime);
|
||||||
|
//or
|
||||||
|
// window.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function getCourseInfo(row){
|
function getCourseInfo(row){
|
||||||
@@ -150,12 +163,12 @@ openDialog(department,coursename,"aggregate",profname,res);
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openDialog(dep,cls,sem,professor,res){
|
function openDialog(dep,cls,sem,professor,res){
|
||||||
|
$(".modal").fadeIn(fadetime);
|
||||||
var data;
|
var data;
|
||||||
if(typeof res == 'undefined'){
|
if(typeof res == 'undefined'){
|
||||||
data = [];
|
data = [];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
//TODO: Have placeholder chart for when database doesn't have
|
|
||||||
data = res.values[0];
|
data = res.values[0];
|
||||||
}
|
}
|
||||||
var modal = document.getElementById('myModal');
|
var modal = document.getElementById('myModal');
|
||||||
@@ -166,7 +179,9 @@ $(".title").text(prettifyTitle());
|
|||||||
var name;
|
var name;
|
||||||
if(profname == ""){
|
if(profname == ""){
|
||||||
name = "Undecided Professor ";
|
name = "Undecided Professor ";
|
||||||
//console.log(res.values);
|
if(typeof res == 'undefined'){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
name = profinit+". "+profname.substring(0,1)+profname.substring(1).toLowerCase();
|
name = profinit+". "+profname.substring(0,1)+profname.substring(1).toLowerCase();
|
||||||
@@ -175,7 +190,7 @@ else{
|
|||||||
$(".profname").text("with "+ name);
|
$(".profname").text("with "+ name);
|
||||||
//console.log(coursename);
|
//console.log(coursename);
|
||||||
span.onclick = function() {
|
span.onclick = function() {
|
||||||
modal.style.display = "none";
|
$(".modal").fadeOut(200);
|
||||||
}
|
}
|
||||||
chart = Highcharts.chart('chart', {
|
chart = Highcharts.chart('chart', {
|
||||||
chart: {
|
chart: {
|
||||||
@@ -225,8 +240,7 @@ chart = Highcharts.chart('chart', {
|
|||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
headerFormat: '<span style="font-size:small; font-weight:bold">{point.key}</span><table>',
|
headerFormat: '<span style="font-size:small; font-weight:bold">{point.key}</span><table>',
|
||||||
pointFormat: '<tr><td style="color:{series.color};padding:0"></td>' +
|
pointFormat: '<td style="color:{black};padding:0;font-size:small; font-weight:bold;"><b>{point.y:.0f} Students</b></td>',
|
||||||
'<td style="padding:0;font-size:small; font-weight:bold;"><b>{point.y:.1f} Students</b></td></tr>',
|
|
||||||
footerFormat: '</table>',
|
footerFormat: '</table>',
|
||||||
shared: true,
|
shared: true,
|
||||||
useHTML: true
|
useHTML: true
|
||||||
@@ -265,9 +279,8 @@ chart = Highcharts.chart('chart', {
|
|||||||
}); // When the user clicks anywhere outside of the modal, close it
|
}); // When the user clicks anywhere outside of the modal, close it
|
||||||
window.onclick = function(event) {
|
window.onclick = function(event) {
|
||||||
if (event.target == modal) {
|
if (event.target == modal) {
|
||||||
modal.style.display = "none";
|
$(".modal").fadeOut(fadetime);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,31 +305,36 @@ chrome.runtime.sendMessage({
|
|||||||
object.find('#details > p').each(function(){
|
object.find('#details > p').each(function(){
|
||||||
var sentence = $(this).text();
|
var sentence = $(this).text();
|
||||||
if(sentence.indexOf("Prerequisite") == 0){
|
if(sentence.indexOf("Prerequisite") == 0){
|
||||||
sentence = "<li style='font-weight: bold; padding-left: 5px;'>"+sentence+"</li>";
|
sentence = "<li style='font-weight: bold; padding: 0px 5px 5px 5px;'>"+sentence+"</li>";
|
||||||
}
|
}
|
||||||
else if(sentence.indexOf("May be") >=0 ){
|
else if(sentence.indexOf("May be") >=0 ){
|
||||||
console.log(sentence.indexOf("May be"));
|
console.log(sentence.indexOf("May be"));
|
||||||
sentence = "<li style='font-style: italic; padding-left: 5px;'>"+sentence+"</li>";
|
sentence = "<li style='font-style: italic; padding: 0px 5px 5px 5px;'>"+sentence+"</li>";
|
||||||
}
|
}
|
||||||
else if(sentence.indexOf("Restricted to") == 0){
|
else if(sentence.indexOf("Restricted to") == 0){
|
||||||
//console.log(sentence);
|
//console.log(sentence);
|
||||||
sentence = "<li style='color:red; padding-left: 5px;'>"+sentence+"</li>";
|
sentence = "<li style='color:red; padding: 0px 5px 5px 5px;'>"+sentence+"</li>";
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
sentence= "<li style='padding: 5px;'>"+sentence+"</li>";
|
sentence= "<li style='padding: 0px 5px 5px 5px;'>"+sentence+"</li>";
|
||||||
}
|
}
|
||||||
output+=sentence;
|
output+=sentence;
|
||||||
|
|
||||||
});
|
});
|
||||||
description = output;
|
description = output;
|
||||||
$(".description").animate({'opacity': 0}, 400, function(){
|
$(".description").animate({'opacity': 0}, 200, function(){
|
||||||
$(this).html(description).animate({'opacity': 1}, 300);
|
$(this).html(description).animate({'opacity': 1}, 200);
|
||||||
});
|
});
|
||||||
var first = object.find('td[data-th="Instructor"]').text();
|
var first = object.find('td[data-th="Instructor"]').text();
|
||||||
first = first.substring(first.indexOf(", "),first.indexOf(" ",first.indexOf(", ")+2));
|
first = first.substring(first.indexOf(", "),first.indexOf(" ",first.indexOf(", ")+2));
|
||||||
first = first.substring(2);
|
first = first.substring(2);
|
||||||
rmpLink = "http://www.ratemyprofessors.com/search.jsp?queryBy=teacherName&schoolName=university+of+texas+at+austin&queryoption=HEADER&query="+first+" "+profname+";&facetSearch=true";
|
rmpLink = "http://www.ratemyprofessors.com/search.jsp?queryBy=teacherName&schoolName=university+of+texas+at+austin&queryoption=HEADER&query="+first+" "+profname+";&facetSearch=true";
|
||||||
|
if(profname == ""){
|
||||||
|
eCISLink = "http://utdirect.utexas.edu/ctl/ecis/results/index.WBX?s_in_action_sw=S&s_in_search_type_sw=C&s_in_max_nbr_return=10&s_in_search_course_dept="+department+"&s_in_search_course_num="+course_nbr;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
eCISLink = "http://utdirect.utexas.edu/ctl/ecis/results/index.WBX?&s_in_action_sw=S&s_in_search_type_sw=N&s_in_search_name="+profname.substring(0,1)+profname.substring(1).toLowerCase()+"%2C%20"+first.substring(0,1)+first.substring(1).toLowerCase();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
font-size: x-large;
|
font-size: x-large;
|
||||||
font-weight: bold ;
|
font-weight: bold ;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
|
padding-left: 5px;
|
||||||
margin:0px 0px 5px 0px;
|
margin:0px 0px 5px 0px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
7
todo
7
todo
@@ -4,14 +4,11 @@ TODO:
|
|||||||
- Saving courses
|
- Saving courses
|
||||||
- popup.html
|
- popup.html
|
||||||
- Online classes/no location
|
- Online classes/no location
|
||||||
- eCIS? link or scrape
|
|
||||||
- Schedule Conflicts
|
- Schedule Conflicts
|
||||||
- waitlist/closed/open colors
|
- waitlist/closed/open colors
|
||||||
- maybe modal animations?
|
|
||||||
- fix close button
|
- fix close button
|
||||||
- Degree plan?
|
- Degree plan?
|
||||||
- underline Courses maybe? click to go to using the planner link thing
|
- underline Courses maybe? click to go to using the planner link thing
|
||||||
- Rate my prof link scraping?
|
|
||||||
- when almost everything is blank: M 379H as example
|
- when almost everything is blank: M 379H as example
|
||||||
CLEAN UP:
|
CLEAN UP:
|
||||||
Everything lmao
|
Everything lmao
|
||||||
@@ -35,6 +32,6 @@ FIXED/DONE since 7/7/18:
|
|||||||
- show time's
|
- show time's
|
||||||
- MANAYATHU SASI BROKEN BECAUSE OF REMOVING SPACES
|
- MANAYATHU SASI BROKEN BECAUSE OF REMOVING SPACES
|
||||||
- location w/ map
|
- location w/ map
|
||||||
|
- eCIS? link or scrape (nah just scrape)
|
||||||
|
- maybe modal animations?
|
||||||
|
|
||||||
|
|
||||||
<h2 class="profname" style="font-size: smaller;padding-left: 5px;margin: 0px 0px;">Monday and Wednesday, 3:00 PM - 4:00 PM, at GDC</h2>
|
|
||||||
Reference in New Issue
Block a user