diff --git a/content.js b/content.js old mode 100644 new mode 100755 index b035113..3f9bee3 --- a/content.js +++ b/content.js @@ -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)); +}); \ No newline at end of file diff --git a/manifest.json b/manifest.json old mode 100644 new mode 100755 index 6bfd119..23d84a6 --- a/manifest.json +++ b/manifest.json @@ -11,5 +11,6 @@ }], "permissions": [ "*://elearning.tgm.ac.at/*", "tabs", "webNavigation" - ] -} + ], + "web_accessible_resources": ["tick.png"] +} \ No newline at end of file diff --git a/tick.png b/tick.png new file mode 100644 index 0000000..f77255f Binary files /dev/null and b/tick.png differ