");
//go through all the rows in the list
@@ -49,7 +78,7 @@ $(function () {
//update the conflicts
update();
/*Handle the button clicks*/
- $("tbody").on('click','.distButton',function () {
+ $("tbody").on('click', '.distButton', function () {
var row = $(this).closest('tr');
getCourseInfo(row);
getDistribution();
@@ -99,18 +128,23 @@ $(function () {
});
});
-function loadNextPages(inHTML){
+function loadNextPages(inHTML) {
var html = $('').html(inHTML).contents();
let next = html.find("#next_nav_link");
- if(next.length){
+ if (next.length) {
let link = next.prop('href');
console.log(link);
- chrome.runtime.sendMessage({method: "GET", action: "xhttp", url:link, data:""}, function(response){
- if(response){
+ chrome.runtime.sendMessage({
+ method: "GET",
+ action: "xhttp",
+ url: link,
+ data: ""
+ }, function (response) {
+ if (response) {
var nextpage = $('').html(response).contents();
var current = $('tbody');
- nextpage.find('tbody>tr').each(function(){
- if(!($(this).find('td').hasClass("course_header") && $(this).has('th').length == 0 )){
+ nextpage.find('tbody>tr').each(function () {
+ if (!($(this).find('td').hasClass("course_header") && $(this).has('th').length == 0)) {
$(this).append(`
`);
}
current.append($(this));
@@ -322,6 +356,8 @@ function getDistribution() {
function openDialog(dep, cls, sem, professor, res) {
$("#myModal").fadeIn(fadetime);
//initial text on the "save course button"
+
+
chrome.runtime.sendMessage({
command: "alreadyContains",
unique: uniquenum
@@ -334,9 +370,16 @@ function openDialog(dep, cls, sem, professor, res) {
});
//set if no grade distribution
var data;
+ $("#semesters").empty();
if (typeof res == 'undefined' || profname == "") {
data = [];
+ $("#semesters").append("")
} else {
+ var semesters = res.values[0][18].split(",");
+ semesters.unshift('Aggregate');
+ for (var i = 0; i < semesters.length; i++) {
+ $("#semesters").append(``)
+ }
data = res.values[0];
}
var modal = document.getElementById('myModal');
@@ -593,4 +636,4 @@ function loadBinaryFile(path, success) {
success(arr.join(""));
};
xhr.send();
-};
+};
\ No newline at end of file
diff --git a/todo b/todo
index c7955401..98cb0e9c 100644
--- a/todo
+++ b/todo
@@ -27,3 +27,12 @@ DONE/FIXED:
- Showing the icon on the flags pages
- Easter egg, no course messages
- search by unique number
+
+
+
+for FIXING DB:
+
+ALTER TABLE agg ADD semesters
+
+update agg
+set semesters = (select group_concat(sem) from grades where agg.prof = grades.prof and agg.course_nbr = grades.course_nbr and agg.dept = grades.dept);
\ No newline at end of file