updating status
This commit is contained in:
@@ -11,7 +11,11 @@ chrome.runtime.onMessage.addListener(function (request, sender, response) {
|
||||
isSingleConflict(request.dtarr, request.unique, response);
|
||||
} else if (request.command == "checkConflicts") {
|
||||
checkConflicts(response);
|
||||
} else if (request.command == "alreadyContains") {
|
||||
}
|
||||
else if(request.command == "updateStatus"){
|
||||
updateStatus();
|
||||
}
|
||||
else if (request.command == "alreadyContains") {
|
||||
alreadyContains(request.unique, response);
|
||||
} else {
|
||||
const xhr = new XMLHttpRequest();
|
||||
@@ -167,4 +171,22 @@ function alreadyContains(unique, sendResponse) {
|
||||
alreadyContains: contains
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function updateStatus(){
|
||||
chrome.storage.sync.get('savedCourses', function (data) {
|
||||
console.log(data.savedCourses);
|
||||
for(let i = 0; i<data.savedCourses.length; i++){
|
||||
let c = data.savedCourses[i];
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", c.link, false);
|
||||
xhr.send();
|
||||
var result = xhr.responseText;
|
||||
var dummy = document.createElement( 'html' );
|
||||
dummy.innerHTML = result;
|
||||
element = dummy.querySelector('[data-th="Status"]').textContent;
|
||||
console.log(element);
|
||||
// console.log(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -23,13 +23,19 @@ const days = new Map([
|
||||
["W", "Wednesday"],
|
||||
["TH", "Thursday"],
|
||||
["F", "Friday"]
|
||||
]);
|
||||
]);
|
||||
const fadetime = 150;
|
||||
const butdelay = 75;
|
||||
//This extension may be super lit, but you know what's even more lit?
|
||||
//Matthew Tran's twitter and insta: @MATTHEWTRANN and @matthew.trann
|
||||
$(function () {
|
||||
loadDataBase();
|
||||
|
||||
chrome.runtime.sendMessage({
|
||||
command: "updateStatus",
|
||||
}, function (response) {
|
||||
console.log(response);
|
||||
});
|
||||
//make heading and modal
|
||||
$("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 id="title">Computer Fluency (C S 302)</h2><h2 class=profname id="profname">with Bruce Porter</h2><div id="topbuttons" 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="textbook" style="background: #FFC107;"> Textbook </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 style=""><ul class=description id="description" style="list-style-type:disc"></ul></div></div><div class=card ><div id="chartcontainer" class=cardcontainer><div id=chart></div></div></div>';
|
||||
@@ -364,18 +370,18 @@ function openDialog(dep, cls, sem, professor, res) {
|
||||
text: 'Grades'
|
||||
},
|
||||
categories: [
|
||||
'A',
|
||||
'A-',
|
||||
'B+',
|
||||
'B',
|
||||
'B-',
|
||||
'C+',
|
||||
'C',
|
||||
'C-',
|
||||
'D+',
|
||||
'D',
|
||||
'D-',
|
||||
'F'
|
||||
'A',
|
||||
'A-',
|
||||
'B+',
|
||||
'B',
|
||||
'B-',
|
||||
'C+',
|
||||
'C',
|
||||
'C-',
|
||||
'D+',
|
||||
'D',
|
||||
'D-',
|
||||
'F'
|
||||
],
|
||||
crosshair: true
|
||||
},
|
||||
@@ -453,13 +459,13 @@ function openDialog(dep, cls, sem, professor, res) {
|
||||
if (data.length == 0) {
|
||||
//if no data, then show the message and hide the series
|
||||
chart.renderer.text('Could not find distribution for this Instructor teaching this Course.', 100, 120)
|
||||
.css({
|
||||
fontSize: '20px',
|
||||
align: 'center',
|
||||
width: '300px',
|
||||
left: '160px'
|
||||
})
|
||||
.add();
|
||||
.css({
|
||||
fontSize: '20px',
|
||||
align: 'center',
|
||||
width: '300px',
|
||||
left: '160px'
|
||||
})
|
||||
.add();
|
||||
$.each(chart.series, function (i, ser) {
|
||||
ser.hide();
|
||||
});
|
||||
@@ -564,7 +570,7 @@ function loadBinaryFile(path, success) {
|
||||
var data = new Uint8Array(xhr.response);
|
||||
var arr = new Array();
|
||||
for (var i = 0; i != data.length; ++i) arr[i] = String.fromCharCode(data[i]);
|
||||
success(arr.join(""));
|
||||
success(arr.join(""));
|
||||
};
|
||||
xhr.send();
|
||||
};
|
||||
@@ -158,8 +158,8 @@ function makeLine(index) {
|
||||
//converted times back
|
||||
var dtmap = new Map([]);
|
||||
for (var i = 0; i < datetimearr.length; i++) {
|
||||
datetimearr[i][1][0] = moment(datetimearr[i][1][0], ["HH:mm"]).format("h:mm A");
|
||||
datetimearr[i][1][1] = moment(datetimearr[i][1][1], ["HH:mm"]).format("h:mm A");
|
||||
datetimearr[i][1][0] = moment(datetimearr[i][1][0], ["HH:mm"]).format("h:mm a");
|
||||
datetimearr[i][1][1] = moment(datetimearr[i][1][1], ["HH:mm"]).format("h:mm a");
|
||||
}
|
||||
for (var i = 0; i < datetimearr.length; i++) {
|
||||
if (dtmap.has(String(datetimearr[i][1]))) {
|
||||
@@ -182,7 +182,7 @@ function makeLine(index) {
|
||||
if (building == "") {
|
||||
building = "Undecided Location";
|
||||
}
|
||||
output += `<span style='font-size:large;display:inline-block;width: 20%;'>${dayarr[i]}:</span><span style='margin-left:10px;display:inline-block;width: 45%;'>${timearr[i].split(",")[0]} to ${timearr[i].split(",")[1]}</span><span style='float:right;display:inline-block;text-align:right;width: 30%;margin-top:3px;'><a target='_blank' style='color:#3c87a3;text-decoration:none;'href='https://maps.utexas.edu/buildings/UTM/${building}'>${place}</a></span><br>`;
|
||||
output += `<span style='font-size:large;display:inline-block;width: 20%;'>${dayarr[i]}:</span><span style='margin-left:10px;display:inline-block;width: 45%;'>${timearr[i].split(",")[0]} to ${timearr[i].split(",")[1]}</span><span style='float:right;display:inline-block;text-align:right;width: 30%;margin-top:5px;'><a target='_blank' style='color:#3c87a3;text-decoration:none;'href='https://maps.utexas.edu/buildings/UTM/${building}'>${place}</a></span><br>`;
|
||||
}
|
||||
}
|
||||
return output;
|
||||
|
||||
Reference in New Issue
Block a user