Skip to content

Commit

Permalink
fixed some bugs that were introduced with 55a5e41
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneHollander committed Nov 30, 2015
1 parent 55a5e41 commit 6815d2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
15 changes: 4 additions & 11 deletions content.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
var tickpath = chrome.extension.getURL('tick.png');
events = $(".block_calendar_upcoming .content .event");

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

function checkAssignment(event) {
var eventlink = event.find("> a");
var name = eventlink.text();
var handler = function(data) {
$.get(eventlink.attr('href'), function(data) {
var submissionstatussubmitted = $(data).find('.submissionstatussubmitted');
if (submissionstatussubmitted.length >= 1) {
var img = event.find(".icon > img");
img.attr("src" , tickpath);
}
};
$.get(eventlink.attr('href'), handler);
});
}
events = $(".block_calendar_upcoming .content .event > a");

events.each(function() {
$(".block_calendar_upcoming .content .event").each(function() {
checkAssignment($(this));
});
});
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"manifest_version": 2,

"name": "moodle-tick-deadlines",
"name": "moodle-tick-assignments",
"description": "Checks the deadlines on the Moodle frontpage and ticks or hides them if they are done.",
"version": "0.0.1",
"version": "1.0.0",
"content_scripts": [{
"matches": ["*://elearning.tgm.ac.at/my/"],
"js": ["jquery.js", "content.js"],
Expand All @@ -13,4 +13,4 @@
"*://elearning.tgm.ac.at/*", "tabs", "webNavigation"
],
"web_accessible_resources": ["tick.png"]
}
}

0 comments on commit 6815d2f

Please sign in to comment.