-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ToasteR1032/master
Completed assignments are now marked with tick icons
- Loading branch information
Showing
3 changed files
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters