Skip to content

Commit

Permalink
Merge pull request #1 from ToasteR1032/master
Browse files Browse the repository at this point in the history
Completed assignments are now marked with tick icons
  • Loading branch information
Rene Hollander committed Nov 30, 2015
2 parents c2b4c48 + b9cb973 commit 55a5e41
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
21 changes: 13 additions & 8 deletions content.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
events = $(".block_calendar_upcoming .content .event > a");
var tickpath = chrome.extension.getURL('tick.png');
events = $(".block_calendar_upcoming .content .event");

events.each(function() {
checkAssignment($(this));
});

function checkAssignment(event) {
var name = event.text()
var eventlink = event.find("> a");
var name = eventlink.text();
var handler = function(data) {
var submissionstatussubmitted = $(data).find('.submissionstatussubmitted')
var submissionstatussubmitted = $(data).find('.submissionstatussubmitted');
if (submissionstatussubmitted.length >= 1) {
console.log(name + ": submitted");
event.parent().css("background-color", "#7AFF7A")
} else {
console.log(name + ": not submitted");
var img = event.find(".icon > img");
img.attr("src" , tickpath);
}
};
$.get(event.attr('href'), handler);
$.get(eventlink.attr('href'), handler);
}
events = $(".block_calendar_upcoming .content .event > a");

events.each(function() {
checkAssignment($(this));
});
5 changes: 3 additions & 2 deletions manifest.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
}],
"permissions": [
"*://elearning.tgm.ac.at/*", "tabs", "webNavigation"
]
}
],
"web_accessible_resources": ["tick.png"]
}
Binary file added tick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 55a5e41

Please sign in to comment.