more fixes
This commit is contained in:
43
content.js
43
content.js
@@ -12,6 +12,7 @@ var datetimearr = [];
|
|||||||
var chart;
|
var chart;
|
||||||
var description;
|
var description;
|
||||||
var status;
|
var status;
|
||||||
|
|
||||||
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"]]);
|
||||||
@@ -29,7 +30,7 @@ $(document).ready( function() {
|
|||||||
if(!($(this).find('td').hasClass("course_header")) && $(this).has('th').length == 0){
|
if(!($(this).find('td').hasClass("course_header")) && $(this).has('th').length == 0){
|
||||||
//if a course row, then add the extension button and do something if that course has been "saved"
|
//if a course row, then add the extension button and do something if that course has been "saved"
|
||||||
var thisForm = this;
|
var thisForm = this;
|
||||||
$(this).append('<td data-th="Plus"><input type="image" class="distButton" id="distButton" style="vertical-align: bottom; display:block;" width="25" height="25" src='+chrome.extension.getURL('disticon.png')+' /></td>');
|
$(this).append('<td data-th="Plus"><input type="image" class="distButton" id="distButton" style="vertical-align: bottom; display:block;" width="20" height="20" src='+chrome.extension.getURL('disticon.png')+' /></td>');
|
||||||
chrome.runtime.sendMessage({command: "isSingleConflict",dtarr: getDtarr(this)}, function(response) {
|
chrome.runtime.sendMessage({command: "isSingleConflict",dtarr: getDtarr(this)}, function(response) {
|
||||||
if(response.isConflict){
|
if(response.isConflict){
|
||||||
//DO SOMETHING IF ALREADY CONTAINS
|
//DO SOMETHING IF ALREADY CONTAINS
|
||||||
@@ -82,6 +83,12 @@ $(document).ready( function() {
|
|||||||
}
|
}
|
||||||
$("#snackbar").attr("class","");
|
$("#snackbar").attr("class","");
|
||||||
});
|
});
|
||||||
|
chrome.runtime.onMessage.addListener(
|
||||||
|
function(request, sender, sendResponse) {
|
||||||
|
if (request.command == "update"){
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function update(){
|
function update(){
|
||||||
@@ -111,7 +118,6 @@ function update(){
|
|||||||
|
|
||||||
function getDtarr(row){
|
function getDtarr(row){
|
||||||
var numlines = $(row).find('td[data-th="Days"]>span').length;
|
var numlines = $(row).find('td[data-th="Days"]>span').length;
|
||||||
console.log("Numlines: "+numlines);
|
|
||||||
var dtarr = [];
|
var dtarr = [];
|
||||||
for(var i=0; i<numlines;i++){
|
for(var i=0; i<numlines;i++){
|
||||||
var date = $(row).find('td[data-th="Days"]>span:eq('+i+')').text();
|
var date = $(row).find('td[data-th="Days"]>span:eq('+i+')').text();
|
||||||
@@ -131,7 +137,6 @@ function getDtarr(row){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(dtarr);
|
|
||||||
return dtarr;
|
return dtarr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +159,6 @@ function getCourseInfo(row){
|
|||||||
profurl = $(this).find('td[data-th="Unique"] a').prop('href');
|
profurl = $(this).find('td[data-th="Unique"] a').prop('href');
|
||||||
uniquenum = $(this).find('td[data-th="Unique"]').text();
|
uniquenum = $(this).find('td[data-th="Unique"]').text();
|
||||||
status = $(this).find('td[data-th="Status"]').text();
|
status = $(this).find('td[data-th="Status"]').text();
|
||||||
console.log(status);
|
|
||||||
profname = $(this).find('td[data-th="Instructor"]').text().split(', ')[0];
|
profname = $(this).find('td[data-th="Instructor"]').text().split(', ')[0];
|
||||||
profinit = $(this).find('td[data-th="Instructor"]').text().split(', ')[1];
|
profinit = $(this).find('td[data-th="Instructor"]').text().split(', ')[1];
|
||||||
if(profname.indexOf(" ") == 0){
|
if(profname.indexOf(" ") == 0){
|
||||||
@@ -169,20 +173,16 @@ function getCourseInfo(row){
|
|||||||
$("#topbuttons").before('<h2 class="dateTimePlace">'+makeLine(date,time,place)+'</th>');
|
$("#topbuttons").before('<h2 class="dateTimePlace">'+makeLine(date,time,place)+'</th>');
|
||||||
// makeLine(date,time,place);
|
// makeLine(date,time,place);
|
||||||
}
|
}
|
||||||
console.log(datetimearr);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(typeof coursename == 'undefined'){
|
if(typeof coursename == 'undefined'){
|
||||||
coursename = $("#details h2").text();
|
coursename = $("#details h2").text();
|
||||||
console.log(profname+" "+profinit);
|
|
||||||
profinit = profinit.substring(0,1);
|
profinit = profinit.substring(0,1);
|
||||||
profurl = document.URL;
|
profurl = document.URL;
|
||||||
}
|
}
|
||||||
//console.log(coursename);
|
|
||||||
getDescription();
|
getDescription();
|
||||||
department = coursename.substring(0,coursename.search(/\d/)-2);
|
department = coursename.substring(0,coursename.search(/\d/)-2);
|
||||||
//console.log(department);
|
|
||||||
course_nbr = coursename.substring(coursename.search(/\d/),coursename.indexOf(" ",coursename.search(/\d/)));
|
course_nbr = coursename.substring(coursename.search(/\d/),coursename.indexOf(" ",coursename.search(/\d/)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,12 +240,10 @@ function convertTime(time){
|
|||||||
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.replace(/'/g, "")+"%'";
|
||||||
query += " and course_nbr like '%"+course_nbr+"%'";
|
query += " and course_nbr like '%"+course_nbr+"%'";
|
||||||
query += "order by a1+a2+a3+b1+b2+b3+c1+c2+c3+d1+d2+d3+f desc";
|
query += "order by a1+a2+a3+b1+b2+b3+c1+c2+c3+d1+d2+d3+f desc";
|
||||||
// console.log(query);
|
|
||||||
var res = grades.exec(query)[0];
|
var res = grades.exec(query)[0];
|
||||||
// console.log(res);
|
|
||||||
var output = "";
|
var output = "";
|
||||||
openDialog(department,coursename,"aggregate",profname,res);
|
openDialog(department,coursename,"aggregate",profname,res);
|
||||||
}
|
}
|
||||||
@@ -271,12 +269,7 @@ function openDialog(dep,cls,sem,professor,res){
|
|||||||
console.log(res);
|
console.log(res);
|
||||||
var title = null
|
var title = null
|
||||||
if(profname == "" && typeof res != 'undefined'){
|
if(profname == "" && typeof res != 'undefined'){
|
||||||
// for(var i = 0; i<5;i++){
|
|
||||||
// $("#profdropdown-menu").append('<li class = "active menu-item"><a href = "#" class = "menu-item-link">'+res.values[i][1]+'</a></li>');
|
|
||||||
// }
|
|
||||||
// $("#profdropdown").css("visibility","visible");
|
|
||||||
title = res.values[0][1];
|
title = res.values[0][1];
|
||||||
|
|
||||||
}
|
}
|
||||||
var modal = document.getElementById('myModal');
|
var modal = document.getElementById('myModal');
|
||||||
var span = document.getElementsByClassName("close")[0];
|
var span = document.getElementsByClassName("close")[0];
|
||||||
@@ -294,25 +287,21 @@ function openDialog(dep,cls,sem,professor,res){
|
|||||||
color = "#F44336";
|
color = "#F44336";
|
||||||
}
|
}
|
||||||
$("#title").append("<span style='color:"+color+";font-size:medium;'>"+" #"+uniquenum+"</>");
|
$("#title").append("<span style='color:"+color+";font-size:medium;'>"+" #"+uniquenum+"</>");
|
||||||
|
|
||||||
var name;
|
var name;
|
||||||
if(profname == ""){
|
if(profname == ""){
|
||||||
name = "Undecided Professor ";
|
name = "Undecided Professor ";
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#profname").text("with "+ name);
|
$("#profname").text("with "+ name);
|
||||||
//console.log(coursename);
|
|
||||||
span.onclick = function() {
|
span.onclick = function() {
|
||||||
$("#myModal").fadeOut(200);
|
$("#myModal").fadeOut(200);
|
||||||
$("#snackbar").attr("class","");
|
$("#snackbar").attr("class","");
|
||||||
|
}
|
||||||
}
|
chart = Highcharts.chart('chart', {
|
||||||
chart = Highcharts.chart('chart', {
|
|
||||||
chart: {
|
chart: {
|
||||||
type: 'column',
|
type: 'column',
|
||||||
backgroundColor: ' #fefefe',
|
backgroundColor: ' #fefefe',
|
||||||
@@ -398,13 +387,13 @@ 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) {
|
||||||
$("#myModal").fadeOut(fadetime);
|
$("#myModal").fadeOut(fadetime);
|
||||||
$("#snackbar").attr("class","");
|
$("#snackbar").attr("class","");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function prettifyTitle(){
|
function prettifyTitle(){
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"name": "UT Course Extension",
|
"name": "UT Course Extension",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Chrome Extension to show more information on the UT Course catalog",
|
"description": "Chrome Extension to show more information on the UT Course catalog",
|
||||||
"permissions": [
|
"permissions": [ "tabs",
|
||||||
"declarativeContent",
|
"declarativeContent",
|
||||||
"storage",
|
"storage",
|
||||||
"*://*.utdirect.utexas.edu/apps/registrar/course_schedule/*",
|
"*://*.utdirect.utexas.edu/apps/registrar/course_schedule/*",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="card" id="header">
|
<div class="card" id="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:medium; background:#4CAF50;margin: 10px;">Clear All</button>
|
<button id="clear" class="matbut" style="font-size:medium; background:#4CAF50;margin: 10px;">Clear All</button>
|
||||||
<button id="schedule" class="matbut" style="font-size:medium;background:#FF9800;margin: 10px">Schedule</button>
|
<button id="schedule" class="matbut" style="font-size:medium;background:#FF9800;margin: 10px">UT Planner</button>
|
||||||
<button id="open" class="matbut" style="font-size:medium;background:#FFC107;margin: 10px;">Options</button>
|
<button id="open" class="matbut" style="font-size:medium;background:#FFC107;margin: 10px;">Options</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
22
popup.js
22
popup.js
@@ -67,9 +67,6 @@ function updateConflicts(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#clear").click(function(){
|
|
||||||
clear();
|
|
||||||
});
|
|
||||||
$("#courseList li").click(function(){
|
$("#courseList li").click(function(){
|
||||||
//GACKY FIX
|
//GACKY FIX
|
||||||
$(this).find("#listMoreInfo").click(function(){
|
$(this).find("#listMoreInfo").click(function(){
|
||||||
@@ -87,6 +84,11 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
updateConflicts();
|
updateConflicts();
|
||||||
|
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
|
||||||
|
for(var i = 0; i<tabs.length;i++){
|
||||||
|
chrome.tabs.sendMessage(tabs[i].id, {command: "update"});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if($(this).find("#moreInfo").is(":hidden")){
|
if($(this).find("#moreInfo").is(":hidden")){
|
||||||
@@ -97,6 +99,15 @@ $(document).ready(function() {
|
|||||||
$(this).find("#moreInfo").fadeOut(200);
|
$(this).find("#moreInfo").fadeOut(200);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$("#clear").click(function(){
|
||||||
|
clear();
|
||||||
|
});
|
||||||
|
$("#schedule").click(function(){
|
||||||
|
chrome.tabs.create({ 'url': 'https://utexas.collegescheduler.com/entry'});
|
||||||
|
});
|
||||||
|
$("#open").click(function(){
|
||||||
|
chrome.tabs.create({ 'url': 'chrome://extensions/?options=' + chrome.runtime.id });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function makeLine(index){
|
function makeLine(index){
|
||||||
@@ -133,6 +144,11 @@ function makeLine(index){
|
|||||||
|
|
||||||
function clear(){
|
function clear(){
|
||||||
chrome.storage.sync.set({savedCourses: []});
|
chrome.storage.sync.set({savedCourses: []});
|
||||||
|
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
|
||||||
|
for(var i = 0; i<tabs.length;i++){
|
||||||
|
chrome.tabs.sendMessage(tabs[i].id, {command: "update"});
|
||||||
|
}
|
||||||
|
});
|
||||||
console.log("cleared");
|
console.log("cleared");
|
||||||
$("#courseList").fadeOut(300,function(){
|
$("#courseList").fadeOut(300,function(){
|
||||||
$("#empty").fadeIn(200);
|
$("#empty").fadeIn(200);
|
||||||
|
|||||||
56
styles.css
56
styles.css
@@ -158,10 +158,9 @@
|
|||||||
#snackbar {
|
#snackbar {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
min-width: 250px;
|
min-width: 250px;
|
||||||
margin-left: -125px;
|
margin-left: -200px;
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-align: center;
|
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -196,56 +195,3 @@
|
|||||||
from {bottom: 30px; opacity: 1;}
|
from {bottom: 30px; opacity: 1;}
|
||||||
to {bottom: 0; opacity: 0;}
|
to {bottom: 0; opacity: 0;}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-menu {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
width: 130px;
|
|
||||||
display: inline-table;
|
|
||||||
border: solid 1px #CCCCCC;
|
|
||||||
max-height: 50px;
|
|
||||||
position: absolute;
|
|
||||||
font-size: x-small;
|
|
||||||
z-index: 100;
|
|
||||||
overflow: auto;
|
|
||||||
border-bottom-style: none;
|
|
||||||
background-color: #fefefe;;
|
|
||||||
}
|
|
||||||
.dropdown-menu .menu-item {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.dropdown-menu .menu-item-link {
|
|
||||||
display: table-cell;
|
|
||||||
border-bottom: solid 1px #CCCCCC;
|
|
||||||
text-decoration: none;
|
|
||||||
color: rgba(89,87,87,0.9);
|
|
||||||
height: 30px;
|
|
||||||
padding: 5px;
|
|
||||||
vertical-align: middle;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.dropdown-menu:hover .menu-item {
|
|
||||||
border-bottom-style: solid;
|
|
||||||
}
|
|
||||||
.dropdown-menu .menu-item-link:hover {
|
|
||||||
background-color: #DDDDDD;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-menu:hover .menu-item {
|
|
||||||
display: table-row;
|
|
||||||
}
|
|
||||||
.dropdown-menu .menu-item.active {
|
|
||||||
display: table-header-group;
|
|
||||||
}
|
|
||||||
.dropdown-menu .menu-item.active .menu-item-link:after {
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top: 12px;
|
|
||||||
right: 8px;
|
|
||||||
border-top: 4px solid rgba(0, 0, 0, 1);
|
|
||||||
border-left: 4px solid transparent;
|
|
||||||
border-right: 4px solid transparent;
|
|
||||||
|
|
||||||
}
|
|
||||||
31
todo
31
todo
@@ -1,29 +1,12 @@
|
|||||||
TODO as of 7/10/18:
|
TODO as of 7/10/18:
|
||||||
- undefined prof, show all possible profs from past? (DIFFERENT IF NO PROF)
|
|
||||||
- Online classes/no location
|
|
||||||
- save image of modal?
|
|
||||||
- no place
|
|
||||||
- Degree plan?
|
|
||||||
- default message save courses
|
|
||||||
- eureka integration
|
- eureka integration
|
||||||
- underline Courses maybe? click to go to using the planner link thing
|
|
||||||
- schedule generator
|
|
||||||
- show schedule conflicts on the course page, and on the registration courselist
|
|
||||||
- highlight in red on save course screen
|
|
||||||
- sync saved
|
|
||||||
- "more at a glance" info on course list screen
|
|
||||||
- use maps for schedule conflict
|
- use maps for schedule conflict
|
||||||
- refresh the page get description
|
|
||||||
- update page with schedule conflict information
|
- update page with schedule conflict information
|
||||||
|
|
||||||
CLEAN UP:
|
CLEAN UP:
|
||||||
Everything lmao
|
Everything lmao
|
||||||
|
|
||||||
KNOWN BUGS:
|
KNOWN BUGS:
|
||||||
- FIX POP UP CARD NOT FILLING FULL LENGTH
|
|
||||||
- FIX toast bug
|
|
||||||
- FIX save course when no times blank
|
|
||||||
- FIX Open popup flickering
|
|
||||||
- FIX DIST ICON NOT SCALING IN TD PROBLEM
|
- FIX DIST ICON NOT SCALING IN TD PROBLEM
|
||||||
|
|
||||||
IN-PROGRESS:
|
IN-PROGRESS:
|
||||||
@@ -47,6 +30,20 @@ FIXED/DONE as of 7/10/18:
|
|||||||
- Saving courses
|
- Saving courses
|
||||||
- waitlist/closed/open colors
|
- waitlist/closed/open colors
|
||||||
- popup.html
|
- popup.html
|
||||||
|
- no place
|
||||||
- Schedule Conflicts
|
- Schedule Conflicts
|
||||||
|
- Online classes/no location
|
||||||
|
- default message save courses
|
||||||
- when almost everything is blank: M 379H as example
|
- when almost everything is blank: M 379H as example
|
||||||
- added/removing/action toasts
|
- added/removing/action toasts
|
||||||
|
- sync saved
|
||||||
|
- undefined prof, show all possible profs from past? (DIFFERENT IF NO PROF)
|
||||||
|
- refresh the page get description
|
||||||
|
- "more at a glance" info on course list screen
|
||||||
|
- show schedule conflicts on the course page, and on the registration courselist
|
||||||
|
- FIX POP UP CARD NOT FILLING FULL LENGTH
|
||||||
|
- FIX toast bug
|
||||||
|
- FIX save course when no times blank
|
||||||
|
- FIX Open popup flickering
|
||||||
|
|
||||||
|
chrome.tabs.create({ 'url': 'chrome://extensions/?options=' + chrome.runtime.id });
|
||||||
|
|||||||
Reference in New Issue
Block a user