diff --git a/content.js b/content.js index 3f9bee3..e0ddfdc 100755 --- a/content.js +++ b/content.js @@ -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)); -}); \ No newline at end of file +}); diff --git a/manifest.json b/manifest.json index 23d84a6..3374347 100755 --- a/manifest.json +++ b/manifest.json @@ -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"], @@ -13,4 +13,4 @@ "*://elearning.tgm.ac.at/*", "tabs", "webNavigation" ], "web_accessible_resources": ["tick.png"] -} \ No newline at end of file +}