Skip to content

Commit

Permalink
removed background page
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyguan committed Sep 28, 2020
1 parent df17377 commit ad2199e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Binary file modified whiteboard.zip
Binary file not shown.
7 changes: 4 additions & 3 deletions whiteboard/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,21 +536,22 @@ function fetchGrades() {
grade = converted["grade"];
}

var lastGradeRow = doc.querySelector(".graded_item_row");
var lastGradeElement = doc.querySelector(".graded_item_row > div.cell.grade");
var lastGrade = "N/A";
var lastHW = "N/A";
var lastGradeColor = "success";
var date = "No date information.";
if (lastGradeElement) {
lastGrade = doc.querySelector(".graded_item_row > div.cell.grade").textContent.trim();
lastGrade = lastGradeElement.textContent.trim();
var convertedLast = gradeToColor(lastGrade, "success");
lastGradeColor = convertedLast["color"];
lastGrade = convertedLast["grade"];
var dateElement = doc.querySelector("div.cell.activity.timestamp > span.lastActivityDate");
var dateElement = lastGradeRow.querySelector("div.cell.activity.timestamp > span.lastActivityDate");
if (dateElement) {
date = dateElement.textContent;
}
lastHW = doc.querySelector(".graded_item_row > div.cell.gradable > a").textContent.trim();
lastHW = lastGradeRow.querySelector("div.cell.gradable > a").textContent.trim();
if (lastHW.length > 35) lastHW = lastHW.substring(0, 35) + "...";
}

Expand Down
8 changes: 1 addition & 7 deletions whiteboard/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Whiteboard",
"version": "1.0.1",
"version": "1.0.2",
"manifest_version": 2,
"content_scripts": [
{
Expand All @@ -23,12 +23,6 @@
"storage",
"cookies"
],
"background": {
"scripts": [
"bg_page.js"
],
"persistent": false
},
"browser_action": {
"default_popup": "popup.html"
},
Expand Down

0 comments on commit ad2199e

Please sign in to comment.