list
This commit is contained in:
491
content.js
491
content.js
@@ -9,17 +9,16 @@ var department;
|
|||||||
var course_nbr;
|
var course_nbr;
|
||||||
var description;
|
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"]]);
|
||||||
|
|
||||||
$(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><h2 class=description></h2></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: #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>'
|
||||||
$("#container").prepend(modhtml);
|
$("#container").prepend(modhtml);
|
||||||
//console.log(grades);
|
//console.log(grades);
|
||||||
|
|
||||||
$('table').find('tr').each(function(){
|
$('table').find('tr').each(function(){
|
||||||
if($(this).find('td').hasClass("course_header")){
|
if($(this).find('td').hasClass("course_header")){
|
||||||
|
|
||||||
@@ -46,100 +45,103 @@ $(document).ready( function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
$("#eCIS").click(function(){
|
$("#eCIS").click(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');
|
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');
|
||||||
|
}, 200);
|
||||||
});
|
});
|
||||||
$("#rateMyProf").click(function(){
|
$("#rateMyProf").click(function(){
|
||||||
window.open(rmpLink);
|
setTimeout(function(){
|
||||||
|
window.open(rmpLink);
|
||||||
|
}, 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function getCourseInfo(row){
|
function getCourseInfo(row){
|
||||||
$(".dateTimePlace").remove();
|
$(".dateTimePlace").remove();
|
||||||
$('table').find('tr').each(function(){
|
$('table').find('tr').each(function(){
|
||||||
if($(this).find('td').hasClass("course_header")){
|
if($(this).find('td').hasClass("course_header")){
|
||||||
coursename = $(this).find('td').text() + "";
|
coursename = $(this).find('td').text() + "";
|
||||||
}
|
|
||||||
if($(this).is(row)){
|
|
||||||
profurl = $(this).find('td[data-th="Unique"] a').prop('href');
|
|
||||||
profname = $(this).find('td[data-th="Instructor"]').text().split(', ')[0];
|
|
||||||
profinit = $(this).find('td[data-th="Instructor"]').text().split(', ')[1];
|
|
||||||
if(profname.indexOf(" ") == 0){
|
|
||||||
profname = profname.substring(1);
|
|
||||||
}
|
|
||||||
var numlines = $(this).find('td[data-th="Days"]>span').length;
|
|
||||||
for(var i=0; i<numlines;i++){
|
|
||||||
var date = $(this).find('td[data-th="Days"]>span:eq('+i+')').text();
|
|
||||||
var time = $(this).find('td[data-th="Hour"]>span:eq('+i+')').text();
|
|
||||||
var place = $(this).find('td[data-th="Room"]>span:eq('+i+')').text();
|
|
||||||
$(".topbuttons").before('<h2 class="dateTimePlace">'+makeLine(date,time,place)+'</th>');
|
|
||||||
// makeLine(date,time,place);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(typeof coursename == 'undefined'){
|
|
||||||
coursename = $("#details h2").text();
|
|
||||||
console.log(profname+" "+profinit);
|
|
||||||
profinit = profinit.substring(0,1);
|
|
||||||
profurl = document.URL;
|
|
||||||
}
|
}
|
||||||
//console.log(coursename);
|
if($(this).is(row)){
|
||||||
getDescription();
|
profurl = $(this).find('td[data-th="Unique"] a').prop('href');
|
||||||
department = coursename.substring(0,coursename.search(/\d/)-2);
|
profname = $(this).find('td[data-th="Instructor"]').text().split(', ')[0];
|
||||||
//console.log(department);
|
profinit = $(this).find('td[data-th="Instructor"]').text().split(', ')[1];
|
||||||
course_nbr = coursename.substring(coursename.search(/\d/),coursename.indexOf(" ",coursename.search(/\d/)));
|
if(profname.indexOf(" ") == 0){
|
||||||
|
profname = profname.substring(1);
|
||||||
|
}
|
||||||
|
var numlines = $(this).find('td[data-th="Days"]>span').length;
|
||||||
|
for(var i=0; i<numlines;i++){
|
||||||
|
var date = $(this).find('td[data-th="Days"]>span:eq('+i+')').text();
|
||||||
|
var time = $(this).find('td[data-th="Hour"]>span:eq('+i+')').text();
|
||||||
|
var place = $(this).find('td[data-th="Room"]>span:eq('+i+')').text();
|
||||||
|
$(".topbuttons").before('<h2 class="dateTimePlace">'+makeLine(date,time,place)+'</th>');
|
||||||
|
// makeLine(date,time,place);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(typeof coursename == 'undefined'){
|
||||||
|
coursename = $("#details h2").text();
|
||||||
|
console.log(profname+" "+profinit);
|
||||||
|
profinit = profinit.substring(0,1);
|
||||||
|
profurl = document.URL;
|
||||||
|
}
|
||||||
|
//console.log(coursename);
|
||||||
|
getDescription();
|
||||||
|
department = coursename.substring(0,coursename.search(/\d/)-2);
|
||||||
|
//console.log(department);
|
||||||
|
course_nbr = coursename.substring(coursename.search(/\d/),coursename.indexOf(" ",coursename.search(/\d/)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//MWF
|
//MWF
|
||||||
//TTH
|
//TTH
|
||||||
//MTHF
|
//MTHF
|
||||||
function makeLine(date, time, place){
|
function makeLine(date, time, place){
|
||||||
var arr = new Array();
|
var arr = new Array();
|
||||||
var output = "";
|
var output = "";
|
||||||
for(var i = 0; i<date.length;i++){
|
for(var i = 0; i<date.length;i++){
|
||||||
var letter = date.charAt(i);
|
var letter = date.charAt(i);
|
||||||
var day = "";
|
var day = "";
|
||||||
if(letter == "T" && i <date.length-1 && date.charAt(i+1) == "H"){
|
if(letter == "T" && i <date.length-1 && date.charAt(i+1) == "H"){
|
||||||
arr.push(days.get("TH"));
|
arr.push(days.get("TH"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(letter != "H"){
|
if(letter != "H"){
|
||||||
arr.push(days.get(letter));
|
arr.push(days.get(letter));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(arr.length > 2){
|
}
|
||||||
for(var i = 0; i<arr.length;i++){
|
if(arr.length > 2){
|
||||||
if(i < arr.length-1){
|
for(var i = 0; i<arr.length;i++){
|
||||||
output+=arr[i]+", "
|
if(i < arr.length-1){
|
||||||
}
|
output+=arr[i]+", "
|
||||||
if(i == arr.length-2){
|
}
|
||||||
output+= "and ";
|
if(i == arr.length-2){
|
||||||
}
|
output+= "and ";
|
||||||
if(i == arr.length-1){
|
}
|
||||||
output+=arr[i];
|
if(i == arr.length-1){
|
||||||
}
|
output+=arr[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(arr.length == 2){
|
}
|
||||||
output = arr[0]+" and "+arr[1];
|
else if(arr.length == 2){
|
||||||
}
|
output = arr[0]+" and "+arr[1];
|
||||||
else{
|
}
|
||||||
output+=arr[0];
|
else{
|
||||||
}
|
output+=arr[0];
|
||||||
var building = place.substring(0,place.search(/\d/)-1);
|
}
|
||||||
return output + " at "+time.replace(/\./g,'').replace(/\-/g,' to ')+" in "+"<a style='font-size:medium' href='"+"https://maps.utexas.edu/buildings/UTM/"+building+"''>"+place.substring(0,place.search(/\d/)-1)+"</>";
|
var building = place.substring(0,place.search(/\d/)-1);
|
||||||
|
return output + " at "+time.replace(/\./g,'').replace(/\-/g,' to ')+" in "+"<a style='font-size:medium' href='"+"https://maps.utexas.edu/buildings/UTM/"+building+"''>"+place.substring(0,place.search(/\d/)-1)+"</>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function order(){
|
function order(){
|
||||||
|
|
||||||
}
|
}
|
||||||
function getDistribution(){
|
function getDistribution(){
|
||||||
var query = "select * from agg";
|
var query = "select * from agg";
|
||||||
query += " where dept like '%"+department+"%'";
|
query += " where dept like '%"+department+"%'";
|
||||||
query += " and prof like '%"+profname+"%'";
|
query += " and prof like '%"+profname+"%'";
|
||||||
query += " and course_nbr like '%"+course_nbr+"%'";
|
query += " and course_nbr like '%"+course_nbr+"%'";
|
||||||
// console.log(query);
|
// console.log(query);
|
||||||
var res = grades.exec(query)[0];
|
var res = grades.exec(query)[0];
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
@@ -148,195 +150,198 @@ openDialog(department,coursename,"aggregate",profname,res);
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openDialog(dep,cls,sem,professor,res){
|
function openDialog(dep,cls,sem,professor,res){
|
||||||
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
|
//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');
|
||||||
var span = document.getElementsByClassName("close")[0];
|
var span = document.getElementsByClassName("close")[0];
|
||||||
modal.style.display = "block";
|
modal.style.display = "block";
|
||||||
|
|
||||||
$(".title").text(prettifyTitle());
|
$(".title").text(prettifyTitle());
|
||||||
var name;
|
var name;
|
||||||
if(profname == ""){
|
if(profname == ""){
|
||||||
name = "Undecided Professor ";
|
name = "Undecided Professor ";
|
||||||
//console.log(res.values);
|
//console.log(res.values);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
name = profinit+". "+profname.substring(0,1)+profname.substring(1).toLowerCase();
|
name = profinit+". "+profname.substring(0,1)+profname.substring(1).toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".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.style.display = "none";
|
||||||
}
|
}
|
||||||
chart = Highcharts.chart('chart', {
|
chart = Highcharts.chart('chart', {
|
||||||
chart: {
|
chart: {
|
||||||
type: 'column',
|
type: 'column',
|
||||||
spacingLeft: 10
|
spacingLeft: 10
|
||||||
},
|
},
|
||||||
|
title: {
|
||||||
|
text: null
|
||||||
|
},
|
||||||
|
subtitle: {
|
||||||
|
text: null
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
title: {
|
title: {
|
||||||
text: null
|
text: 'Grades'
|
||||||
},
|
},
|
||||||
subtitle: {
|
categories: [
|
||||||
text: null
|
'A',
|
||||||
},
|
'A-',
|
||||||
legend: {
|
'B+',
|
||||||
enabled: false
|
'B',
|
||||||
},
|
'B-',
|
||||||
xAxis: {
|
'C+',
|
||||||
title: {
|
'C',
|
||||||
text: 'Grades'
|
'C-',
|
||||||
},
|
'D+',
|
||||||
categories: [
|
'D',
|
||||||
'A',
|
'D-',
|
||||||
'A-',
|
'F'
|
||||||
'B+',
|
],
|
||||||
'B',
|
crosshair: true
|
||||||
'B-',
|
},
|
||||||
'C+',
|
yAxis: {
|
||||||
'C',
|
min: 0,
|
||||||
'C-',
|
title: {
|
||||||
'D+',
|
text: 'Students'
|
||||||
'D',
|
|
||||||
'D-',
|
|
||||||
'F'
|
|
||||||
],
|
|
||||||
crosshair: true
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
min: 0,
|
|
||||||
title: {
|
|
||||||
text: 'Students'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
credits: {
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
lang: {
|
|
||||||
noData: "The professor hasn't taught this class :("
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
headerFormat: '<span style="font-size:small; font-weight:bold">{point.key}</span><table>',
|
|
||||||
pointFormat: '<tr><td style="color:{series.color};padding:0"></td>' +
|
|
||||||
'<td style="padding:0;font-size:small; font-weight:bold;"><b>{point.y:.1f} Students</b></td></tr>',
|
|
||||||
footerFormat: '</table>',
|
|
||||||
shared: true,
|
|
||||||
useHTML: true
|
|
||||||
},
|
|
||||||
plotOptions: {
|
|
||||||
bar: {
|
|
||||||
pointPadding: 0.2,
|
|
||||||
borderWidth: 0
|
|
||||||
},
|
|
||||||
series: {
|
|
||||||
animation: {
|
|
||||||
duration: 700
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
series: [{
|
|
||||||
name: 'Grades',
|
|
||||||
data: [{y: data[6], color: '#4CAF50'}, {y: data[7], color: '#8BC34A'}, {y: data[8], color: '#CDDC39'}, {y: data[9], color: '#FFEB3B'}, {y: data[10], color: '#FFC107'}, {y: data[11], color: '#FFA000'}, {y: data[12], color: '#F57C00'}, {y: data[13], color: '#FF5722'}, {y: data[14], color: '#FF5252'}, {y: data[15], color: '#E64A19'}, {y: data[16], color: '#F44336'}, {y: data[17], color: '#D32F2F'}]
|
|
||||||
|
|
||||||
}]
|
|
||||||
}, function(chart) { // on complete
|
|
||||||
if(data.length == 0){
|
|
||||||
chart.renderer.text('Could not find distribution for this Professor in this Course', 100, 120)
|
|
||||||
.css({
|
|
||||||
fontSize: '20px',
|
|
||||||
align:'center',
|
|
||||||
width: '300px',
|
|
||||||
left:'160px'
|
|
||||||
})
|
|
||||||
.add();
|
|
||||||
$.each(chart.series, function(i, ser) {
|
|
||||||
ser.hide();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
credits: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
lang: {
|
||||||
|
noData: "The professor hasn't taught this class :("
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
headerFormat: '<span style="font-size:small; font-weight:bold">{point.key}</span><table>',
|
||||||
|
pointFormat: '<tr><td style="color:{series.color};padding:0"></td>' +
|
||||||
|
'<td style="padding:0;font-size:small; font-weight:bold;"><b>{point.y:.1f} Students</b></td></tr>',
|
||||||
|
footerFormat: '</table>',
|
||||||
|
shared: true,
|
||||||
|
useHTML: true
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
bar: {
|
||||||
|
pointPadding: 0.2,
|
||||||
|
borderWidth: 0
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
animation: {
|
||||||
|
duration: 700
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [{
|
||||||
|
name: 'Grades',
|
||||||
|
data: [{y: data[6], color: '#4CAF50'}, {y: data[7], color: '#8BC34A'}, {y: data[8], color: '#CDDC39'}, {y: data[9], color: '#FFEB3B'}, {y: data[10], color: '#FFC107'}, {y: data[11], color: '#FFA000'}, {y: data[12], color: '#F57C00'}, {y: data[13], color: '#FF5722'}, {y: data[14], color: '#FF5252'}, {y: data[15], color: '#E64A19'}, {y: data[16], color: '#F44336'}, {y: data[17], color: '#D32F2F'}]
|
||||||
|
|
||||||
|
}]
|
||||||
|
}, function(chart) { // on complete
|
||||||
|
if(data.length == 0){
|
||||||
|
chart.renderer.text('Could not find distribution for this Professor in this Course', 100, 120)
|
||||||
|
.css({
|
||||||
|
fontSize: '20px',
|
||||||
|
align:'center',
|
||||||
|
width: '300px',
|
||||||
|
left:'160px'
|
||||||
|
})
|
||||||
|
.add();
|
||||||
|
$.each(chart.series, function(i, ser) {
|
||||||
|
ser.hide();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}); // 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.style.display = "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function prettifyTitle(){
|
function prettifyTitle(){
|
||||||
val = department.length+course_nbr.length+3;
|
val = department.length+course_nbr.length+3;
|
||||||
output = coursename.substring(val).replace(/\b\w*/g, function(txt){
|
output = coursename.substring(val).replace(/\b\w*/g, function(txt){
|
||||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||||
});
|
});
|
||||||
return output + " ("+department+" "+course_nbr+")";
|
return output + " ("+department+" "+course_nbr+")";
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDescription(){
|
function getDescription(){
|
||||||
chrome.runtime.sendMessage({
|
chrome.runtime.sendMessage({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
action: "xhttp",
|
action: "xhttp",
|
||||||
url: profurl,
|
url: profurl,
|
||||||
data: ""
|
data: ""
|
||||||
}, function(response) {
|
}, function(response) {
|
||||||
if(response){
|
if(response){
|
||||||
var output="";
|
var output="";
|
||||||
var object = $('<div/>').html(response).contents();
|
var object = $('<div/>').html(response).contents();
|
||||||
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 = "<span style='font-weight: bold;'>"+sentence+"</span>";
|
sentence = "<li style='font-weight: bold; padding-left: 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 = "<span style='font-style: italic;'>"+sentence+"</span>";
|
sentence = "<li style='font-style: italic; padding-left: 5px;'>"+sentence+"</li>";
|
||||||
}
|
}
|
||||||
else if(sentence.indexOf("Restricted to") == 0){
|
else if(sentence.indexOf("Restricted to") == 0){
|
||||||
//console.log(sentence);
|
//console.log(sentence);
|
||||||
sentence = "<span style='color:red;'>"+sentence+"</span>";
|
sentence = "<li style='color:red; padding-left: 5px;'>"+sentence+"</li>";
|
||||||
}
|
}
|
||||||
output+=sentence+"<br></>";
|
else{
|
||||||
|
sentence= "<li style='padding: 5px;'>"+sentence+"</li>";
|
||||||
});
|
}
|
||||||
description = output;
|
output+=sentence;
|
||||||
$(".description").animate({'opacity': 0}, 400, function(){
|
|
||||||
$(this).html(description).animate({'opacity': 1}, 300);
|
});
|
||||||
});
|
description = output;
|
||||||
var first = object.find('td[data-th="Instructor"]').text();
|
$(".description").animate({'opacity': 0}, 400, function(){
|
||||||
first = first.substring(first.indexOf(", "),first.indexOf(" ",first.indexOf(", ")+2));
|
$(this).html(description).animate({'opacity': 1}, 300);
|
||||||
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";
|
var first = object.find('td[data-th="Instructor"]').text();
|
||||||
|
first = first.substring(first.indexOf(", "),first.indexOf(" ",first.indexOf(", ")+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";
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadDataBase(){
|
function loadDataBase(){
|
||||||
sql = window.SQL;
|
sql = window.SQL;
|
||||||
loadBinaryFile('grades.db', function(data){
|
loadBinaryFile('grades.db', function(data){
|
||||||
var sqldb = new SQL.Database(data);
|
var sqldb = new SQL.Database(data);
|
||||||
// Database is ready
|
// Database is ready
|
||||||
grades = sqldb;
|
grades = sqldb;
|
||||||
//console.log(grades.exec(query)[0]);
|
//console.log(grades.exec(query)[0]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function loadBinaryFile(path,success) {
|
function loadBinaryFile(path,success) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("GET", chrome.extension.getURL(path), true);
|
xhr.open("GET", chrome.extension.getURL(path), true);
|
||||||
xhr.responseType = "arraybuffer";
|
xhr.responseType = "arraybuffer";
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
var data = new Uint8Array(xhr.response);
|
var data = new Uint8Array(xhr.response);
|
||||||
var arr = new Array();
|
var arr = new Array();
|
||||||
for(var i = 0; i != data.length; ++i) arr[i] = String.fromCharCode(data[i]);
|
for(var i = 0; i != data.length; ++i) arr[i] = String.fromCharCode(data[i]);
|
||||||
success(arr.join(""));
|
success(arr.join(""));
|
||||||
};
|
};
|
||||||
xhr.send();
|
xhr.send();
|
||||||
};
|
};
|
||||||
|
|
||||||
// function getProfessorLink(profname) {
|
// function getProfessorLink(profname) {
|
||||||
|
|||||||
@@ -11,5 +11,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<button id="changeColor"></button>
|
<button id="changeColor"></button>
|
||||||
|
<script src="popup.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
background-color: #fefefe;
|
background-color: #fefefe;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
max-height: 85%;
|
max-height: 85%;
|
||||||
min-width: 55%;
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border: 1px solid #888;
|
border: 1px solid #888;
|
||||||
@@ -86,6 +85,9 @@
|
|||||||
transition:width 300ms ease-in-out, height 300ms ease-in-out;
|
transition:width 300ms ease-in-out, height 300ms ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.close:hover,
|
.close:hover,
|
||||||
.close:focus {
|
.close:focus {
|
||||||
@@ -101,6 +103,7 @@
|
|||||||
/* Material style */
|
/* Material style */
|
||||||
.matbut {
|
.matbut {
|
||||||
border: none;
|
border: none;
|
||||||
|
outline: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: white;
|
color: white;
|
||||||
margin: 10px 10px 10px 0px;
|
margin: 10px 10px 10px 0px;
|
||||||
|
|||||||
1
todo
1
todo
@@ -9,6 +9,7 @@ TODO:
|
|||||||
- waitlist/closed/open colors
|
- waitlist/closed/open colors
|
||||||
- maybe modal animations?
|
- maybe modal animations?
|
||||||
- fix close button
|
- fix close button
|
||||||
|
- 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?
|
- Rate my prof link scraping?
|
||||||
- when almost everything is blank: M 379H as example
|
- when almost everything is blank: M 379H as example
|
||||||
|
|||||||
Reference in New Issue
Block a user