diff options
Diffstat (limited to 'recipes/googleclassroom')
-rw-r--r-- | recipes/googleclassroom/LICENSE | 21 | ||||
-rw-r--r-- | recipes/googleclassroom/README.md | 23 | ||||
-rw-r--r-- | recipes/googleclassroom/darkmode.css | 154 | ||||
-rw-r--r-- | recipes/googleclassroom/icon.png | bin | 0 -> 49059 bytes | |||
-rw-r--r-- | recipes/googleclassroom/icon.svg | 13 | ||||
-rw-r--r-- | recipes/googleclassroom/index.js | 11 | ||||
-rw-r--r-- | recipes/googleclassroom/package.json | 15 | ||||
-rw-r--r-- | recipes/googleclassroom/service.css | 1 | ||||
-rw-r--r-- | recipes/googleclassroom/webview.js | 17 |
9 files changed, 255 insertions, 0 deletions
diff --git a/recipes/googleclassroom/LICENSE b/recipes/googleclassroom/LICENSE new file mode 100644 index 0000000..516df99 --- /dev/null +++ b/recipes/googleclassroom/LICENSE | |||
@@ -0,0 +1,21 @@ | |||
1 | MIT License | ||
2 | |||
3 | Copyright (c) 2020 Tania R. Zúñiga | ||
4 | |||
5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
6 | of this software and associated documentation files (the "Software"), to deal | ||
7 | in the Software without restriction, including without limitation the rights | ||
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
9 | copies of the Software, and to permit persons to whom the Software is | ||
10 | furnished to do so, subject to the following conditions: | ||
11 | |||
12 | The above copyright notice and this permission notice shall be included in all | ||
13 | copies or substantial portions of the Software. | ||
14 | |||
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
21 | SOFTWARE. | ||
diff --git a/recipes/googleclassroom/README.md b/recipes/googleclassroom/README.md new file mode 100644 index 0000000..a1a3455 --- /dev/null +++ b/recipes/googleclassroom/README.md | |||
@@ -0,0 +1,23 @@ | |||
1 | # Ferdi Google Classroom | ||
2 | A Google Classroom recipe for Ferdi | ||
3 | |||
4 | Fixes getferdi/recipes#135 | ||
5 | |||
6 | ### Release notes | ||
7 | 1.0.2: DarkMode support | ||
8 | |||
9 | 1.0.1: fix serviceURL | ||
10 | |||
11 | 1.0.0: First version | ||
12 | |||
13 | ### How to use? | ||
14 | 1. Click on Download ZIP or use `git clone https://github.com/TanZng/ferdi-googleclassroom` | ||
15 | 2. On Ferdi click on *Add new service* and go to *Custom Service* | ||
16 | 3. Click on *Open Folder* | ||
17 | 4. In the folder that Ferdi opened for you `...\Ferdi\recipes\dev`, drag the **unzip** ferdi-googleclassroom folder | ||
18 | 5. After that Google Classroom should appear on Custom Services. If not, restart Ferdi. | ||
19 | |||
20 | > :warning: **Don't use dark mode**: Google Classroom page will load with a black background! We are fixing it. | ||
21 | |||
22 | ### How to create your own Ferdi recipes: | ||
23 | * [Read the documentation](https://github.com/getferdi/recipes/blob/master/docs/integration.md) | ||
diff --git a/recipes/googleclassroom/darkmode.css b/recipes/googleclassroom/darkmode.css new file mode 100644 index 0000000..0e47715 --- /dev/null +++ b/recipes/googleclassroom/darkmode.css | |||
@@ -0,0 +1,154 @@ | |||
1 | html { | ||
2 | -webkit-filter:invert(90%) hue-rotate(180deg)!important; | ||
3 | filter:invert(90%) hue-rotate(180deg)!important; | ||
4 | background:#191919!important; | ||
5 | } | ||
6 | |||
7 | .CflnFb { | ||
8 | background-color:#7b96c1!important; | ||
9 | filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; | ||
10 | color:#FFF!important; | ||
11 | } | ||
12 | |||
13 | .h5t3Nc .GrK4Mb,.h5t3Nc .hVDHke,.h5t3Nc .l7VQxb,.h5t3Nc .zP0T0b,.h5t3Nc .qNixLe { | ||
14 | background-color:#c9c9c9; | ||
15 | border-color:#FFF; | ||
16 | } | ||
17 | |||
18 | .lq96Td { | ||
19 | background-color:#003e3a!important; | ||
20 | color:#FFF!important; | ||
21 | filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; | ||
22 | } | ||
23 | |||
24 | .GooADb { | ||
25 | color:#9dceff!important; | ||
26 | text-shadow:0 0 #404040!important; | ||
27 | } | ||
28 | |||
29 | .bJZIjf.qs41qe { | ||
30 | opacity:0.3; | ||
31 | } | ||
32 | |||
33 | #gb a.gb_ja,#gb a.gb_ja:visited,#gb a.gb_ja:active,#gb a.gb_ka,#gb a.gb_ka:visited { | ||
34 | color:rgba(255,255,255,0.87)!important; | ||
35 | text-decoration:none!important; | ||
36 | background-color:#000!important; | ||
37 | } | ||
38 | |||
39 | .M6tHv { | ||
40 | background-color:#444!important; | ||
41 | } | ||
42 | |||
43 | .gb_ea.gb_6f { | ||
44 | background-color:#e8e8e8!important; | ||
45 | } | ||
46 | |||
47 | .gb_yc svg,.gb_kc svg { | ||
48 | color:#000!important; | ||
49 | opacity:.54!important; | ||
50 | } | ||
51 | |||
52 | .HkPXyb { | ||
53 | background-color:#f9f9f9; | ||
54 | } | ||
55 | |||
56 | .EfQccc.F262Ye.EiZ8Dd::after { | ||
57 | border-color:#000; | ||
58 | } | ||
59 | |||
60 | .uHMk6b.fsHoPb { | ||
61 | border:7px solid #000!important; | ||
62 | } | ||
63 | |||
64 | .g3VIld.GFhhge.Up8vH.hFEqNb.J9Nfi.iWO5td { | ||
65 | filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; | ||
66 | background:#191919!important; | ||
67 | color:#FFF!important; | ||
68 | } | ||
69 | |||
70 | .g3dbUc .jKgTF,.QGRmIf,.lcPUt { | ||
71 | filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; | ||
72 | font-weight:700!important; | ||
73 | mix-blend-mode:darken; | ||
74 | } | ||
75 | |||
76 | .g3dbUc.UflSff { | ||
77 | filter:invert(100%) hue-rotate(180deg) saturate(140%) contrast(105%) opacity(40%)!important; | ||
78 | color:#404040!important; | ||
79 | } | ||
80 | |||
81 | .NlL62b.EfQccc.elYzab-cXXICe-Hjleke.EiZ8Dd.UflSff.jKgTF { | ||
82 | filter:invert(100%) hue-rotate(180deg) saturate(140%) contrast(50%) brightness(140%) opacity(90%)!important; | ||
83 | } | ||
84 | |||
85 | .NlL62b.EfQccc.elYzab-cXXICe-Hjleke.EiZ8Dd.UflSff { | ||
86 | filter:opacity(80%)!important; | ||
87 | } | ||
88 | |||
89 | .NlL62b.EfQccc.elYzab-cXXICe-Hjleke.EiZ8Dd.jKgTF { | ||
90 | filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; | ||
91 | font-weight:700!important; | ||
92 | } | ||
93 | |||
94 | .W0m3G { | ||
95 | font-weight:500!important; | ||
96 | } | ||
97 | |||
98 | .g3dbUc { | ||
99 | font-weight:900!important; | ||
100 | color:#000!important; | ||
101 | } | ||
102 | |||
103 | .g3dbUc.smECzc { | ||
104 | color:#666!important; | ||
105 | } | ||
106 | |||
107 | .FAxxKc { | ||
108 | font-weight:600!important; | ||
109 | color:#000!important; | ||
110 | } | ||
111 | |||
112 | .rq8Mwb { | ||
113 | filter:invert(100%)!important; | ||
114 | } | ||
115 | |||
116 | .WpDZC,.zHQkBf { | ||
117 | color:#c1c1c1!important; | ||
118 | } | ||
119 | |||
120 | .XHsn7e,.YqtBEc,.xuBVOe,.Mh0NNb,.ck4bY,.asor.asor_i0,.gsoi.gsoi_w,.gsoi.gsoi_c.asor_v,.gsoi.gsoi_9.asor_v,.gsoi.gsoi_7.asor_v,#vqd3vxfo4jpl,#pnsketfj08m,.st-wc,.NlL62b.EfQccc.elYzab-cXXICe-Hjleke.EiZ8Dd,.a63c9c.ztKZ3d,.a63c9c,.Oxm52e,.kImhzd,.hsrazb,.Tnsqdc,.kw5sif,.kXIDId,.sIyjR,.ghXZpb,.whsOnd.zHQkBf { | ||
121 | filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; | ||
122 | } | ||
123 | |||
124 | .gb_3,#rAECCd,.jPtXgd { | ||
125 | font-weight:600!important; | ||
126 | } | ||
127 | |||
128 | #I0_1513527137275,.gb_W,:not([data-date]):before,img,svg,.jPtXgd,.gb_Wa.gb_Fe,.fFW7wc-OEVmcd { | ||
129 | filter:invert(100%) hue-rotate(180deg) brightness(1.1) contrast(105%)!important; | ||
130 | } | ||
131 | |||
132 | .Wbs5sd,.rF3YF.wmyjXb,.A6wOnd,.VgueE,.Jmftzc.gVNoLb.EiZ8Dd,.Jmftzc.K9QN7e.EiZ8Dd.UflSff,.Jmftzc.K9QN7e.EiZ8Dd,.i5a7ie,.gb_Eb { | ||
133 | color:#000!important; | ||
134 | } | ||
135 | |||
136 | .EfQccc.Hrn1mc.EiZ8Dd::after,.EfQccc.MmaWIb.KKjvXb.EiZ8Dd::after { | ||
137 | border:1px solid #000; | ||
138 | } | ||
139 | |||
140 | .XBkKC.WSvIUd,.logo-plus-button-lockup-text { | ||
141 | color:#FFF; | ||
142 | } | ||
143 | |||
144 | .IP9Hyd .O0WRkf:first-child,.gb_je.gb_ee { | ||
145 | color:#fff; | ||
146 | } | ||
147 | |||
148 | .Jmftzc.gVNoLb.LKeQwe,.Jmftzc.EiZ8Dd { | ||
149 | color:#000; | ||
150 | } | ||
151 | |||
152 | .gb_fa.gb_ng,.gb_Z { | ||
153 | font-weight:bolder!important; | ||
154 | } | ||
diff --git a/recipes/googleclassroom/icon.png b/recipes/googleclassroom/icon.png new file mode 100644 index 0000000..5dbd55e --- /dev/null +++ b/recipes/googleclassroom/icon.png | |||
Binary files differ | |||
diff --git a/recipes/googleclassroom/icon.svg b/recipes/googleclassroom/icon.svg new file mode 100644 index 0000000..922bd4e --- /dev/null +++ b/recipes/googleclassroom/icon.svg | |||
@@ -0,0 +1,13 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024pt" height="1024pt" viewBox="0 0 1024 1024" version="1.1"> | ||
3 | <g id="surface1"> | ||
4 | <path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,75.686275%,2.745098%);fill-opacity:1;" d="M 874.667969 896 L 149.332031 896 C 102.273438 896 64 857.726562 64 810.667969 L 64 213.332031 C 64 166.273438 102.273438 128 149.332031 128 L 874.667969 128 C 921.726562 128 960 166.273438 960 213.332031 L 960 810.667969 C 960 857.726562 921.726562 896 874.667969 896 Z M 874.667969 896 "/> | ||
5 | <path style=" stroke:none;fill-rule:nonzero;fill:rgb(21.960784%,55.686275%,23.529412%);fill-opacity:1;" d="M 149.332031 213.332031 L 874.667969 213.332031 L 874.667969 810.667969 L 149.332031 810.667969 Z M 149.332031 213.332031 "/> | ||
6 | <path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 597.332031 768 L 768 768 L 768 810.667969 L 597.332031 810.667969 Z M 512 362.667969 C 476.652344 362.667969 448 391.320312 448 426.667969 C 448 462.011719 476.652344 490.667969 512 490.667969 C 547.347656 490.667969 576 462.011719 576 426.667969 C 576 391.320312 547.347656 362.667969 512 362.667969 Z M 512 362.667969 "/> | ||
7 | <path style=" stroke:none;fill-rule:nonzero;fill:rgb(64.705882%,83.921569%,65.490196%);fill-opacity:1;" d="M 341.332031 448 C 317.769531 448 298.667969 467.101562 298.667969 490.667969 C 298.667969 514.230469 317.769531 533.332031 341.332031 533.332031 C 364.898438 533.332031 384 514.230469 384 490.667969 C 384 467.101562 364.898438 448 341.332031 448 Z M 341.332031 448 "/> | ||
8 | <path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,49.019608%,19.607843%);fill-opacity:1;" d="M 149.332031 213.332031 L 874.667969 213.332031 L 874.667969 256 L 149.332031 256 Z M 149.332031 213.332031 "/> | ||
9 | <path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,67.058824%,0%);fill-opacity:1;" d="M 768 810.667969 L 597.332031 810.667969 L 682.667969 896 L 853.332031 896 Z M 768 810.667969 "/> | ||
10 | <path style=" stroke:none;fill-rule:nonzero;fill:rgb(64.705882%,83.921569%,65.490196%);fill-opacity:1;" d="M 682.667969 448 C 659.101562 448 640 467.101562 640 490.667969 C 640 514.230469 659.101562 533.332031 682.667969 533.332031 C 706.230469 533.332031 725.332031 514.230469 725.332031 490.667969 C 725.332031 467.101562 706.230469 448 682.667969 448 Z M 789.332031 612.011719 C 789.332031 602.515625 785.855469 593.367188 779.347656 586.433594 C 764.566406 570.667969 733.078125 554.667969 682.667969 554.667969 C 632.257812 554.667969 600.769531 570.667969 585.984375 586.433594 C 579.476562 593.367188 576 602.496094 576 612.011719 L 576 640 L 789.332031 640 Z M 448 612.011719 C 448 602.515625 444.523438 593.367188 438.015625 586.433594 C 423.230469 570.667969 391.742188 554.667969 341.332031 554.667969 C 290.921875 554.667969 259.433594 570.667969 244.652344 586.433594 C 238.144531 593.367188 234.667969 602.496094 234.667969 612.011719 L 234.667969 640 L 448 640 Z M 448 612.011719 "/> | ||
11 | <path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 640 591.828125 C 640 580.4375 635.820312 569.472656 628.011719 561.152344 C 610.28125 542.230469 572.480469 512 512 512 C 451.519531 512 413.71875 542.230469 395.988281 561.128906 C 388.179688 569.449219 384 580.414062 384 591.828125 L 384 640 L 640 640 Z M 640 591.828125 "/> | ||
12 | </g> | ||
13 | </svg> | ||
diff --git a/recipes/googleclassroom/index.js b/recipes/googleclassroom/index.js new file mode 100644 index 0000000..c9bd550 --- /dev/null +++ b/recipes/googleclassroom/index.js | |||
@@ -0,0 +1,11 @@ | |||
1 | var os = require('os') | ||
2 | |||
3 | module.exports = Franz => | ||
4 | class googleclassroom extends Franz { | ||
5 | overrideUserAgent() { | ||
6 | if (os.platform() == 'linux') | ||
7 | return "Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0" | ||
8 | else | ||
9 | return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0"; | ||
10 | } | ||
11 | }; \ No newline at end of file | ||
diff --git a/recipes/googleclassroom/package.json b/recipes/googleclassroom/package.json new file mode 100644 index 0000000..b33114c --- /dev/null +++ b/recipes/googleclassroom/package.json | |||
@@ -0,0 +1,15 @@ | |||
1 | { | ||
2 | "id": "googleclassroom", | ||
3 | "name": "Google Classroom", | ||
4 | "version": "1.0.2", | ||
5 | "description": "Google Classroom", | ||
6 | "main": "index.js", | ||
7 | "author": "Tania R. Zuniga <tania@tanx.dev>", | ||
8 | "license": "MIT", | ||
9 | "repository": "https://github.com/TanZng/ferdi-googleclassroom", | ||
10 | "config": { | ||
11 | "serviceURL": "https://accounts.google.com/ServiceLogin/signinchooser?service=classroom&passive=1209600&continue=https%3A%2F%2Fclassroom.google.com%2F%3Fsafe%3Dactive&followup=https%3A%2F%2Fclassroom.google.com%2F%3Fsafe%3Dactive&emr=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin", | ||
12 | "hasTeamId": false, | ||
13 | "hasNotificationSound": false | ||
14 | } | ||
15 | } | ||
diff --git a/recipes/googleclassroom/service.css b/recipes/googleclassroom/service.css new file mode 100644 index 0000000..38dcab0 --- /dev/null +++ b/recipes/googleclassroom/service.css | |||
@@ -0,0 +1 @@ | |||
/* Insert custom styles you want to insert here */ \ No newline at end of file | |||
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 | ||