diff options
Diffstat (limited to 'recipes/googleclassroom/webview.js')
-rw-r--r-- | recipes/googleclassroom/webview.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/recipes/googleclassroom/webview.js b/recipes/googleclassroom/webview.js new file mode 100644 index 0000000..c53fe10 --- /dev/null +++ b/recipes/googleclassroom/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | const getMessages = function getMessages() { | ||
5 | var homework = 0 | ||
6 | const upcomingAssignment = document.getElementsByClassName('hrUpcomingAssignmentGroup') | ||
7 | if (upcomingAssignment.length != 0) { | ||
8 | var i; | ||
9 | for (i = 0; i < upcomingAssignment.length; i++) { | ||
10 | homework += upcomingAssignment[i].childElementCount; | ||
11 | } | ||
12 | } | ||
13 | Franz.setBadge(parseInt(homework, 10)); | ||
14 | }; | ||
15 | |||
16 | Franz.loop(getMessages); | ||
17 | }; \ No newline at end of file | ||