Compare commits
802 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd4fcaf2f9 | ||
|
|
297e174a84 | ||
|
|
71c704588d | ||
|
|
26b2ac1830 | ||
|
|
266988327f | ||
|
|
58b55bf2ba | ||
|
|
df0f9e01bc | ||
|
|
d6cc83a8ff | ||
|
|
44f23d804d | ||
|
|
cc06e52488 | ||
|
|
a6fe077d88 | ||
|
|
df39ea19e7 | ||
|
|
2f455d03f5 | ||
|
|
98c1de387d | ||
|
|
53d185bf9c | ||
|
|
0ef3987956 | ||
|
|
a7ce1d1468 | ||
|
|
9cc2942a49 | ||
|
|
4ffe34c538 | ||
|
|
22b12073f9 | ||
|
|
83489fff84 | ||
|
|
2511dd5b4e | ||
|
|
767bd08f0c | ||
|
|
d2ba2ff544 | ||
|
|
f6ad1226f5 | ||
|
|
785b0d7395 | ||
|
|
ea91a55bd6 | ||
|
|
c73f13baa8 | ||
|
|
a44c68ef46 | ||
|
|
218627e62d | ||
|
|
5d6e775b02 | ||
|
|
2b86cff3f3 | ||
|
|
0bc70dbc9e | ||
|
|
d1f7baad2b | ||
|
|
6d57bc2c5a | ||
|
|
8e3cf93011 | ||
|
|
51f6d17fbb | ||
|
|
b2e5229c78 | ||
|
|
87ec87e09d | ||
|
|
25bf7ac915 | ||
|
|
bcadad5564 | ||
|
|
bacda4624f | ||
|
|
9c5434e32c | ||
|
|
058421b9aa | ||
|
|
f947f50213 | ||
|
|
54688e6a71 | ||
|
|
d789bd7710 | ||
|
|
b3fa69f7c7 | ||
|
|
3ec47b2310 | ||
|
|
9bc37d8ecd | ||
|
|
dd21c46331 | ||
|
|
3c69cf7d5a | ||
|
|
97f8a0faf6 | ||
|
|
ce8b6dc995 | ||
|
|
d78eebdb0e | ||
|
|
01f78e0595 | ||
|
|
fc8e710a07 | ||
|
|
929131f5e6 | ||
|
|
4fbb0e454e | ||
|
|
3832a8811d | ||
|
|
8f6461e80f | ||
|
|
e21e12820b | ||
|
|
1edff1048f | ||
|
|
8e71e6b0ea | ||
|
|
1efd3dbea9 | ||
|
|
d02ad5a5b6 | ||
|
|
8758047ff0 | ||
|
|
c17df3c2b6 | ||
|
|
fe54d6537f | ||
|
|
dcc3516587 | ||
|
|
7039296c64 | ||
|
|
cdba36628f | ||
|
|
b2465f9bdc | ||
|
|
4b4a398c99 | ||
|
|
d292bd033f | ||
|
|
faa5683b26 | ||
|
|
ce0ae1bf04 | ||
|
|
b8f49b9312 | ||
|
|
7b9bcdfd10 | ||
|
|
72d65a18ef | ||
|
|
160a008a0b | ||
|
|
030f5ed315 | ||
|
|
018051572c | ||
|
|
fc2d1ffaca | ||
|
|
418eb81e1c | ||
|
|
5c2c576cb4 | ||
|
|
9cf11bf2d9 | ||
|
|
a050d220d0 | ||
|
|
5e64d55ac0 | ||
|
|
d32a657d62 | ||
|
|
78e5e298b3 | ||
|
|
44ad0f3a51 | ||
|
|
e783cc64f5 | ||
|
|
c1f10a1c46 | ||
|
|
a0231ed598 | ||
|
|
900ba2f3a2 | ||
|
|
519e224914 | ||
|
|
2e067f98ff | ||
|
|
63ca296037 | ||
|
|
2221053c66 | ||
|
|
5ce6354bd3 | ||
|
|
44ae334492 | ||
|
|
4020de976f | ||
|
|
9929a5f578 | ||
|
|
3dd1e916c1 | ||
|
|
5b810e8cf5 | ||
|
|
a9356fbd4a | ||
|
|
6aad9e6130 | ||
|
|
258b4113db | ||
|
|
66d5b7a6f4 | ||
|
|
4c4df5011e | ||
|
|
2b99b888bc | ||
|
|
618e1f64df | ||
|
|
fca00e7084 | ||
|
|
7d92df6626 | ||
|
|
f00b552305 | ||
|
|
d7b5f5f25b | ||
|
|
a4c3088e02 | ||
|
|
0e44df8cfa | ||
|
|
eddc2214ed | ||
|
|
db3f87d219 | ||
|
|
d962124da2 | ||
|
|
e1c8afd5ba | ||
|
|
01614667a4 | ||
|
|
43bd4ff468 | ||
|
|
d5bdb78de6 | ||
|
|
acd5e547fd | ||
|
|
201eb38a35 | ||
|
|
9b13c2554a | ||
|
|
21918cadd9 | ||
|
|
55191a6e9b | ||
|
|
e93a30d2e1 | ||
|
|
443fce9fd1 | ||
|
|
02f4a730c7 | ||
|
|
f02626a118 | ||
|
|
7632219a83 | ||
|
|
4e563b3c05 | ||
|
|
92a60bd03e | ||
|
|
1238ef62fa | ||
|
|
0a101e3b69 | ||
|
|
ecd2f0e0f2 | ||
|
|
9be3cc1f13 | ||
|
|
c64c503ba9 | ||
|
|
d704b2ecac | ||
|
|
66539aa422 | ||
|
|
f8c20e55a4 | ||
|
|
3b5448a334 | ||
|
|
4b1614e247 | ||
|
|
bb4f843a33 | ||
|
|
9008039a2a | ||
|
|
fb1ee381fe | ||
|
|
8ad0ce8911 | ||
|
|
59c4b6db86 | ||
|
|
f4e15215ec | ||
|
|
b57cc559d9 | ||
|
|
4a1d6047ac | ||
|
|
3d411826f2 | ||
|
|
898c0a2f7c | ||
|
|
2a9bc2278d | ||
|
|
989209758a | ||
|
|
1d4386e9e9 | ||
|
|
d8e45814bb | ||
|
|
ce01f8bce0 | ||
|
|
76384e38c8 | ||
|
|
ac64512ff7 | ||
|
|
7d9261dace | ||
|
|
6187b849a7 | ||
|
|
724d0b2567 | ||
|
|
2d24e2e0eb | ||
|
|
d4d65044b3 | ||
|
|
717f1e7eec | ||
|
|
30b58d213e | ||
|
|
0404b5f1e4 | ||
|
|
f2a946790d | ||
|
|
37ea2260b8 | ||
|
|
938ad5f8b9 | ||
|
|
4e881415d2 | ||
|
|
96af470708 | ||
|
|
3275abafb0 | ||
|
|
2538a41fcb | ||
|
|
d93b76a664 | ||
|
|
ea5703d99d | ||
|
|
22c3c797ff | ||
|
|
0cc0ec6c55 | ||
|
|
d1e5fdc1e0 | ||
|
|
ed9c5a0dc7 | ||
|
|
e1fae2e219 | ||
|
|
e5cf24e1cc | ||
|
|
3d1f970262 | ||
|
|
a002655b3d | ||
|
|
9fe2384b47 | ||
|
|
a6781414a5 | ||
|
|
cbdbac4e01 | ||
|
|
c867e62502 | ||
|
|
341fe5d46e | ||
|
|
e70eefdbbf | ||
|
|
67c2daf4ef | ||
|
|
178cfd4a6b | ||
|
|
6d868e21da | ||
|
|
691a6d0956 | ||
|
|
6eda60d314 | ||
|
|
41b0896c2e | ||
|
|
e8bdeed556 | ||
|
|
c29dd321e3 | ||
|
|
6062534d91 | ||
|
|
d6bb61c428 | ||
|
|
65a56684ec | ||
|
|
e1dfe30661 | ||
|
|
87cb1cc4f7 | ||
|
|
0be75ca38e | ||
|
|
54b2561da1 | ||
|
|
fbba7a30d0 | ||
|
|
42d361b7ad | ||
|
|
6d41e6b962 | ||
|
|
ed32aad64a | ||
|
|
e4896fe935 | ||
|
|
2f81690783 | ||
|
|
dc3ec24cd7 | ||
|
|
797171fc3a | ||
|
|
16e12a8a7b | ||
|
|
0e07124cbc | ||
|
|
5db66e3fcb | ||
|
|
01770d25f8 | ||
|
|
e4366c8dfa | ||
|
|
f19446eda9 | ||
|
|
0d7f1657de | ||
|
|
e905f01305 | ||
|
|
e5e7fa3f8a | ||
|
|
69575622a2 | ||
|
|
ee229e9ed8 | ||
|
|
21a9481459 | ||
|
|
f28732904d | ||
|
|
06828e2cfd | ||
|
|
e89c58e2e9 | ||
|
|
cb1203a2b8 | ||
|
|
be64aba265 | ||
|
|
316281d42b | ||
|
|
91520753b0 | ||
|
|
94bb94e8f4 | ||
|
|
fcf020658a | ||
|
|
4d8cd8a926 | ||
|
|
ec871c1a41 | ||
|
|
acf7fe3117 | ||
|
|
55f99980cc | ||
|
|
7079cc0d20 | ||
|
|
dfb68c512b | ||
|
|
85ff73c055 | ||
|
|
96bb31de5f | ||
|
|
b06f13e32a | ||
|
|
512282c446 | ||
|
|
0986583365 | ||
|
|
7e5c07c6e5 | ||
|
|
99d14139d2 | ||
|
|
b5419ee747 | ||
|
|
22e9f3308b | ||
|
|
d1161207da | ||
|
|
f8aad34bb1 | ||
|
|
8b9686edba | ||
|
|
e0e8a66d48 | ||
|
|
6d029505ed | ||
|
|
e5c7c4b02f | ||
|
|
a17bbc4d15 | ||
|
|
bc5c9df40d | ||
|
|
59c5dfe703 | ||
|
|
953e2e6a73 | ||
|
|
f16b3cb2dd | ||
|
|
b8d5978668 | ||
|
|
6dc2d5092d | ||
|
|
45227c6628 | ||
|
|
76f88ffd66 | ||
|
|
5a6864f26e | ||
|
|
8eca4c8054 | ||
|
|
1a12ce8992 | ||
|
|
db8d6ce4ab | ||
|
|
9874c5f417 | ||
|
|
9f2e4277bb | ||
|
|
2d933416f8 | ||
|
|
6886f3081f | ||
|
|
3edbbda7fa | ||
|
|
7e7160e0bf | ||
|
|
a9f92dc9f3 | ||
|
|
57d6da52bb | ||
|
|
72dc85d90d | ||
|
|
ff5ff54e88 | ||
|
|
6ab0fa3fbd | ||
|
|
4d4c02ebb3 | ||
|
|
a34542171c | ||
|
|
fce6138031 | ||
|
|
38c8197989 | ||
|
|
b7f4578c34 | ||
|
|
e5ea72e334 | ||
|
|
73a0f610c3 | ||
|
|
ee2d884434 | ||
|
|
a9ac568dc0 | ||
|
|
365dac5c2b | ||
|
|
511069b641 | ||
|
|
342d3bbd49 | ||
|
|
28da67c0c5 | ||
|
|
47c9de2e22 | ||
|
|
9e6f8c16a5 | ||
|
|
1f8d3aa7f4 | ||
|
|
209c16eff8 | ||
|
|
49b0135798 | ||
|
|
1d55dad4b1 | ||
|
|
f4e9434294 | ||
|
|
97cf766466 | ||
|
|
debcd3dc0d | ||
|
|
495d7ba9aa | ||
|
|
aac405a99d | ||
|
|
22fed1dfba | ||
|
|
ce79a638f5 | ||
|
|
ae420910e9 | ||
|
|
8068d4e591 | ||
|
|
cd3a7375e6 | ||
|
|
be9f60abf3 | ||
|
|
6431afec31 | ||
|
|
43c744df59 | ||
|
|
116d7b4365 | ||
|
|
a4fd51445d | ||
|
|
66393224ba | ||
|
|
8faceb1376 | ||
|
|
3ce0379c99 | ||
|
|
24a8dfdfdb | ||
|
|
3952044a82 | ||
|
|
a11128ae9f | ||
|
|
ca802a7254 | ||
|
|
ae7d4770fa | ||
|
|
430c00c689 | ||
|
|
302f7018d4 | ||
|
|
804445637d | ||
|
|
e9d1718793 | ||
|
|
d9953ff0ac | ||
|
|
5433bf013d | ||
|
|
244cbb39ca | ||
|
|
a0eac8e0dc | ||
|
|
f8c473d039 | ||
|
|
fc259f5c20 | ||
|
|
a3a6ec4838 | ||
|
|
c32a8c1614 | ||
|
|
50f4e623f7 | ||
|
|
b7de63c5f5 | ||
|
|
4ed41cf06a | ||
|
|
d613ceb3eb | ||
|
|
91ee57997b | ||
|
|
50a7a94dac | ||
|
|
61c5d7e637 | ||
|
|
816ba32bb0 | ||
|
|
3c6937ea94 | ||
|
|
bf897eb02a | ||
|
|
254bb9e0a9 | ||
|
|
2cdd9a7fc0 | ||
|
|
774abcc612 | ||
|
|
bbea1fba25 | ||
|
|
1c68b02343 | ||
|
|
1f2054beb7 | ||
|
|
2385942f7c | ||
|
|
36bef805ea | ||
|
|
ed1f88db9d | ||
|
|
c4390a0bb0 | ||
|
|
301e761897 | ||
|
|
72173298e3 | ||
|
|
c4265edaf4 | ||
|
|
93f9bde307 | ||
|
|
0bf8f978f9 | ||
|
|
a6522bbcf2 | ||
|
|
44aeddcdbd | ||
|
|
c6a630875f | ||
|
|
b18fa8fa76 | ||
|
|
689808a9db | ||
|
|
8bb45d6f43 | ||
|
|
cd1ff1699b | ||
|
|
4ca13ca884 | ||
|
|
b05138630a | ||
|
|
9394ac47f4 | ||
|
|
c43716b0d9 | ||
|
|
e8b54ddc1f | ||
|
|
37d756b1b0 | ||
|
|
e3140aaab8 | ||
|
|
238aa2e509 | ||
|
|
54c6d4fb96 | ||
|
|
969b921fae | ||
|
|
40add5ca44 | ||
|
|
06db4610ca | ||
|
|
e4334f256a | ||
|
|
4286baec0f | ||
|
|
cd1df94235 | ||
|
|
649b73f0e1 | ||
|
|
e967d4b344 | ||
|
|
e5a71b8044 | ||
|
|
9886957034 | ||
|
|
3e7d155002 | ||
|
|
b96add529c | ||
|
|
e91db6aeec | ||
|
|
1b25283284 | ||
|
|
2bc61baac3 | ||
|
|
f862f1a2c4 | ||
|
|
3074169446 | ||
|
|
afee575f10 | ||
|
|
94a53a278c | ||
|
|
4a3ac7176f | ||
|
|
305c5bad68 | ||
|
|
4570da2e26 | ||
|
|
7ec0487e37 | ||
|
|
3aa3dccda7 | ||
|
|
21efa7f639 | ||
|
|
614fd1a85d | ||
|
|
05bd6a5d48 | ||
|
|
208fa85e8f | ||
|
|
2b703cac3a | ||
|
|
ce59872a66 | ||
|
|
c402c416e5 | ||
|
|
466b4314c5 | ||
|
|
40f8aac655 | ||
|
|
2afd1ab938 | ||
|
|
722fcaa2e1 | ||
|
|
5d3830d3de | ||
|
|
da244fe836 | ||
|
|
c00ff163f1 | ||
|
|
6bb18f18fd | ||
|
|
b8ea8f8a97 | ||
|
|
f9c01d03d3 | ||
|
|
f05dcf99ff | ||
|
|
a8edec2184 | ||
|
|
de3db81222 | ||
|
|
e0a49bc71e | ||
|
|
031e65efa7 | ||
|
|
3a1978e2fe | ||
|
|
edffa28d89 | ||
|
|
2c60fadb99 | ||
|
|
adfd9f63fa | ||
|
|
22f3f245b5 | ||
|
|
53e832fbf0 | ||
|
|
884c180e43 | ||
|
|
a1d5c0252d | ||
|
|
94a40f4b79 | ||
|
|
523467f47e | ||
|
|
eea48c257f | ||
|
|
d9e6718217 | ||
|
|
84afda69c0 | ||
|
|
820a1c1604 | ||
|
|
941d79410b | ||
|
|
78d2b8a68b | ||
|
|
0d147c7585 | ||
|
|
2f23d6a67d | ||
|
|
df6c5fee9c | ||
|
|
41f6bc588c | ||
|
|
660eedb917 | ||
|
|
37cc205dfa | ||
|
|
78beaf0b45 | ||
|
|
8c5cb09e70 | ||
|
|
3163e53502 | ||
|
|
1a58cdb08f | ||
|
|
183ebfad96 | ||
|
|
49e7e14422 | ||
|
|
6576099748 | ||
|
|
5d6bc5bc55 | ||
|
|
edf0c62ce3 | ||
|
|
0a9f3efecc | ||
|
|
a7bc98d1e3 | ||
|
|
ac03bc50b7 | ||
|
|
61a8d07912 | ||
|
|
2d744f1080 | ||
|
|
2582fe20db | ||
|
|
6a322ef9d5 | ||
|
|
bbcbd55e5a | ||
|
|
99f6e1b346 | ||
|
|
a7c564ee20 | ||
|
|
bf9b6f634c | ||
|
|
1698c9311b | ||
|
|
6b7c2c6f01 | ||
|
|
54e52758e5 | ||
|
|
4f9a85b3a7 | ||
|
|
7fe63a2cfe | ||
|
|
a7c418ac79 | ||
|
|
3a51ce523c | ||
|
|
ff0f8bd86e | ||
|
|
12d4b1448d | ||
|
|
3e552f19b5 | ||
|
|
13e2ce88d5 | ||
|
|
276814f2d8 | ||
|
|
4263c59117 | ||
|
|
786e1441d7 | ||
|
|
4100673705 | ||
|
|
759d4475fc | ||
|
|
2e986a4bdd | ||
|
|
005afae9aa | ||
|
|
739cdea934 | ||
|
|
894e774523 | ||
|
|
397a3f5d80 | ||
|
|
c30c6a4cfb | ||
|
|
01134c94b8 | ||
|
|
0cd963a9cf | ||
|
|
1db452829d | ||
|
|
9e7d0d7429 | ||
|
|
de891f783f | ||
|
|
dd4922ea77 | ||
|
|
e0ac7022fc | ||
|
|
0809c80965 | ||
|
|
1e5e8ef5fc | ||
|
|
bc44ee346a | ||
|
|
2ed9a55c9b | ||
|
|
88196afc14 | ||
|
|
60605eb347 | ||
|
|
d361621dc3 | ||
|
|
1e99b7ffa2 | ||
|
|
143e02d16c | ||
|
|
92cb18389e | ||
|
|
ce4383505c | ||
|
|
6e0ab7f24d | ||
|
|
64461d649b | ||
|
|
19acd42336 | ||
|
|
5d050348ea | ||
|
|
6d34e8e9bb | ||
|
|
5a80658ec5 | ||
|
|
be3ba2219a | ||
|
|
00026ee452 | ||
|
|
706e381f02 | ||
|
|
d06655316b | ||
|
|
17308694d8 | ||
|
|
ef7dfa7709 | ||
|
|
871ece2514 | ||
|
|
106ea10d93 | ||
|
|
5398b98195 | ||
|
|
4caef40690 | ||
|
|
a7ab6f11fb | ||
|
|
41b1d68de6 | ||
|
|
c322c8818b | ||
|
|
6a2de3a9a7 | ||
|
|
f40c52d317 | ||
|
|
c2774fc562 | ||
|
|
bad7fd1234 | ||
|
|
3bc2227f70 | ||
|
|
8c2c25ad52 | ||
|
|
0dc4511f0f | ||
|
|
3cdf057be5 | ||
|
|
727e11996c | ||
|
|
7259154e0c | ||
|
|
8e5212b37a | ||
|
|
b09b4929ea | ||
|
|
5629bb63c0 | ||
|
|
2c100466c4 | ||
|
|
a963567d95 | ||
|
|
6f9b1586bf | ||
|
|
3076ed37dd | ||
|
|
38fe1c60f6 | ||
|
|
fc551a7acd | ||
|
|
1e974807e5 | ||
|
|
0dc258ebde | ||
|
|
b26e92ecb7 | ||
|
|
6488a62c45 | ||
|
|
cf3825be83 | ||
|
|
a4bb14d1a0 | ||
|
|
a5e431e31c | ||
|
|
4005f2c6de | ||
|
|
b0b9be552b | ||
|
|
acacdc870a | ||
|
|
66a89572ca | ||
|
|
a12c817821 | ||
|
|
d19912ff5b | ||
|
|
111ede487d | ||
|
|
6f7ca3cb5e | ||
|
|
e6b63095ad | ||
|
|
a40e8e3c57 | ||
|
|
0d129be808 | ||
|
|
d70ab1beab | ||
|
|
5666cbd9c0 | ||
|
|
b0d4eb7c3f | ||
|
|
ed5773883b | ||
|
|
fc668cb395 | ||
|
|
d7746c48f2 | ||
|
|
b5cb340a43 | ||
|
|
44089e28f7 | ||
|
|
1c6fb7f1ac | ||
|
|
4198b31cd7 | ||
|
|
638364d3d2 | ||
|
|
e7195e40b0 | ||
|
|
1e084234fd | ||
|
|
833813098d | ||
|
|
df0e27e56a | ||
|
|
5b8fbf8ea6 | ||
|
|
3286d38fc8 | ||
|
|
8838185cbf | ||
|
|
0be5bfd050 | ||
|
|
154b265e1f | ||
|
|
7a9e965cc2 | ||
|
|
e05a770f51 | ||
|
|
fd5e5ff7d4 | ||
|
|
53e73cc42a | ||
|
|
c419eef405 | ||
|
|
0c24ac38be | ||
|
|
67535d8691 | ||
|
|
1205d5d113 | ||
|
|
7be63d8e99 | ||
|
|
695cf18449 | ||
|
|
a117d42f67 | ||
|
|
a98dd3382c | ||
|
|
34e0755b78 | ||
|
|
975f8d81ce | ||
|
|
769b6465d1 | ||
|
|
12d3a781ff | ||
|
|
0bab251f3d | ||
|
|
8eb0d43287 | ||
|
|
44e69429ad | ||
|
|
d787de821a | ||
|
|
7c616718fd | ||
|
|
2edfab25d7 | ||
|
|
584fc6088e | ||
|
|
99254b3315 | ||
|
|
e5f3d86b9f | ||
|
|
0322aeada2 | ||
|
|
6d9ca8a820 | ||
|
|
c57f647ddd | ||
|
|
1f5669532f | ||
|
|
055d6a6790 | ||
|
|
9eb03f2c16 | ||
|
|
f6569f5091 | ||
|
|
cb0a632944 | ||
|
|
576c3cc7d2 | ||
|
|
8490e93b99 | ||
|
|
31d318b7d2 | ||
|
|
cd50872acb | ||
|
|
ff7ff8ee58 | ||
|
|
14d29dc167 | ||
|
|
99aa8579cd | ||
|
|
5df7be8fef | ||
|
|
4fbd56cf08 | ||
|
|
01f9ccdb4d | ||
|
|
c6749105e0 | ||
|
|
7a582a6576 | ||
|
|
dfab4af72c | ||
|
|
a200246843 | ||
|
|
89a6c467d4 | ||
|
|
a4bc108cdc | ||
|
|
d0f5b803fa | ||
|
|
10f1acc0ac | ||
|
|
10da4bc4e6 | ||
|
|
cb6d5865a4 | ||
|
|
fe19187dad | ||
|
|
024e9b247e | ||
|
|
d058940728 | ||
|
|
5ca16e8f1c | ||
|
|
d52ddfed36 | ||
|
|
b1ba8e4d6e | ||
|
|
2e9c5d3bac | ||
|
|
ac79d8482f | ||
|
|
597594b5bc | ||
|
|
7736259f70 | ||
|
|
f3558f4aa7 | ||
|
|
e6fa3dd823 | ||
|
|
c4b1502385 | ||
|
|
ccb75f4166 | ||
|
|
bc3932d008 | ||
|
|
9e29398b11 | ||
|
|
a0646862fc | ||
|
|
2085b0340f | ||
|
|
1550997d55 | ||
|
|
18f6c24809 | ||
|
|
7c387140d4 | ||
|
|
91765df50d | ||
|
|
ac4cd8f5c6 | ||
|
|
27ef9efb38 | ||
|
|
874dd9ff62 | ||
|
|
a3cce7edcd | ||
|
|
1ac98acefd | ||
|
|
9370a9331b | ||
|
|
cfe2522699 | ||
|
|
ee9bd8dd1a | ||
|
|
532ac4f8a7 | ||
|
|
1859fce603 | ||
|
|
452c1da6b8 | ||
|
|
75569abbe2 | ||
|
|
0ce772a6d6 | ||
|
|
92c28368f6 | ||
|
|
216228d9e4 | ||
|
|
c13145971a | ||
|
|
c78e90588a | ||
|
|
8e3b7b0418 | ||
|
|
f3eac47dc7 | ||
|
|
bf7304df3b | ||
|
|
c5ddf1a1c7 | ||
|
|
de951e3ea0 | ||
|
|
44b7e34d7f | ||
|
|
e025496bbc | ||
|
|
db747ea246 | ||
|
|
84c1110f18 | ||
|
|
73253cda17 | ||
|
|
34f6ac59f6 | ||
|
|
da814b0a5a | ||
|
|
99421e7617 | ||
|
|
c30eb02d91 | ||
|
|
59185b6112 | ||
|
|
79c070ec0d | ||
|
|
ce4b1c8014 | ||
|
|
3d3d44440a | ||
|
|
a91f7126e1 | ||
|
|
d9358b6134 | ||
|
|
fd4cdcaba6 | ||
|
|
13fd612b50 | ||
|
|
905872232d | ||
|
|
409fa79f59 | ||
|
|
82304058b2 | ||
|
|
ec457a0e44 | ||
|
|
f176938831 | ||
|
|
33c5a40e9f | ||
|
|
57874362c3 | ||
|
|
c1581f3845 | ||
|
|
72d510a6c1 | ||
|
|
723233be84 | ||
|
|
ad9a0b2f50 | ||
|
|
b881ea1e03 | ||
|
|
e2fb3802d7 | ||
|
|
eb7674cf04 | ||
|
|
3ee169ba14 | ||
|
|
4a903053de | ||
|
|
961ad02e8a | ||
|
|
472a063979 | ||
|
|
4fd61c97df | ||
|
|
5b81c31ba2 | ||
|
|
ef9507a282 | ||
|
|
4efe137e82 | ||
|
|
cea5a282c2 | ||
|
|
2ad69bf1e9 | ||
|
|
397cfaf23a | ||
|
|
8223c073ef | ||
|
|
b564b5d0f6 | ||
|
|
c744f1ff93 | ||
|
|
39656bec03 | ||
|
|
5b1f7db2c5 | ||
|
|
f914026c14 | ||
|
|
156150bd36 | ||
|
|
99b7e83324 | ||
|
|
4222d98e49 | ||
|
|
cd00881afb | ||
|
|
d1cf1e4243 | ||
|
|
cf5227a81f | ||
|
|
2110fbee8d | ||
|
|
680116082b | ||
|
|
94092eb6af | ||
|
|
1286fb165c | ||
|
|
36a22bd5eb | ||
|
|
15fa4b80b2 | ||
|
|
2c5281a41c | ||
|
|
2e433d73db | ||
|
|
1f915c6c5e | ||
|
|
bec69b3abf | ||
|
|
530e82cc6d | ||
|
|
29765230b1 | ||
|
|
29a556c7d1 | ||
|
|
7f3d4ba8aa | ||
|
|
9c714c9c4e | ||
|
|
91ef9955b4 | ||
|
|
97f0f3784d | ||
|
|
42d903ac16 | ||
|
|
b9111348d3 | ||
|
|
69b7fa79de | ||
|
|
4c67233e83 | ||
|
|
c9d14992b9 | ||
|
|
f06411e018 | ||
|
|
73b9c419ff | ||
|
|
e763d98134 | ||
|
|
0533256b87 | ||
|
|
4d0c874a95 | ||
|
|
ae1608e0bb | ||
|
|
88ae7c8994 | ||
|
|
d697ce8c81 | ||
|
|
a684cf1294 | ||
|
|
b9d4028074 | ||
|
|
916cb7e76f | ||
|
|
6dd61af5dd | ||
|
|
5bee7c0791 | ||
|
|
a4a731f04a | ||
|
|
b15d3c5375 | ||
|
|
99ba73f194 | ||
|
|
1456c15f91 | ||
|
|
8a26580453 | ||
|
|
af393ad0ca | ||
|
|
8a46f3a7d2 | ||
|
|
0aff71496c | ||
|
|
f3a5642bcd | ||
|
|
b97e6e0870 | ||
|
|
3e704c3d22 | ||
|
|
ae02fa80ce | ||
|
|
ec5c1038b3 | ||
|
|
e5e6295a83 | ||
|
|
19560fe60f | ||
|
|
1f1b469a4b | ||
|
|
eb095a7497 | ||
|
|
6415b095ab | ||
|
|
d93c959da8 | ||
|
|
09893e1409 | ||
|
|
93ec6384d0 | ||
|
|
a221bf33b2 | ||
|
|
c7ec3d2197 | ||
|
|
18d04099fd | ||
|
|
fec52ee19f | ||
|
|
d87a22da23 | ||
|
|
4bda273947 | ||
|
|
7c8a2e32b4 | ||
|
|
45e8d0c2b6 | ||
|
|
3fe0b93567 | ||
|
|
06147dd5cc | ||
|
|
44dae3832e |
30
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
# Contributing
|
||||
|
||||
## Requiered knowledge
|
||||
|
||||
- JavaScript
|
||||
- html5
|
||||
- NodeJS
|
||||
|
||||
Additional:
|
||||
|
||||
- CSS
|
||||
- [VueJS](https://vuejs.org/)
|
||||
- [ElectronJS](https://electronjs.org/)
|
||||
- [NPMjs](https://www.npmjs.com/)
|
||||
|
||||
A source code editor is also requiered. We recommend [Visual Studio Code](https://code.visualstudio.com/).
|
||||
|
||||
### Installing the components
|
||||
|
||||
1. Install [Git](https://git-scm.com/)
|
||||
2. Install [Node](https://nodejs.org/en/)
|
||||
|
||||
### Cloning the project
|
||||
|
||||
1. Fork the [repository](https://github.com/PreMiD/PreMiD)
|
||||
2. Open a terminal and type `git clone https://github.com/PreMiD/PreMiD`
|
||||
|
||||
### Coding your vision
|
||||
|
||||
Please keep the structure. We don't want to disorganize our project. Chaotic files may not be accepted.
|
||||
BIN
.github/Electron/Chrome_bsp.png
vendored
Normal file
|
After Width: | Height: | Size: 332 KiB |
BIN
.github/Electron/PMD_Banner.png
vendored
Normal file
|
After Width: | Height: | Size: 682 KiB |
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: Timeraa
|
||||
open_collective: premid
|
||||
ko_fi: timeraa
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZU8Q766ACS2WS&lc=US
|
||||
3
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,7 +1,6 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for YT Presence
|
||||
|
||||
about: Suggest an idea for PreMiD
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
|
||||
16
.github/ISSUE_TEMPLATE/service_request.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: Service request
|
||||
about: Suggest Rich Presence support for a website
|
||||
---
|
||||
|
||||
**What's the name of the service?**
|
||||
Ex. www.youtube.com | YouTube
|
||||
|
||||
**What should the Presence display?**
|
||||
Informations about the current video
|
||||
|
||||
**Why do you want support for this service?**
|
||||
Tell us why you want to have support for this website. Please don't just tell us "I use it all the time"
|
||||
|
||||
**Are you able to provide an image for the service? (512x512 minimum)**
|
||||
If you can provide the logo pls paste a link in here or the image
|
||||
BIN
.github/Logo.png
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
.github/Patreon.png
vendored
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
1
.github/PayPal.svg
vendored
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
13
.github/SUPPORT.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# How to get support
|
||||
|
||||
## Take a look at the [wiki](https://wiki.premid.app)
|
||||
Our GitHub wiki is full of information around PreMiD.<br>
|
||||
Take a look and feel free to contribute if you want to add something new.
|
||||
|
||||
## [Open a issue](https://github.com/PreMiD/PreMiD/issues/new/choose) on [GitHub](https://github.com/PreMiD/PreMiD)
|
||||
Simply open a issue if you don't feel allright.<br>
|
||||
*Aand there he goes...*
|
||||
|
||||
## Ask a staff member in [#support](https://discord.gg/WvfVZ8T)
|
||||
The team is ready to tell you the secrets of the underworld.<br>
|
||||
Join our [Discord server](https://discord.gg/WvfVZ8T) and find out what we're hiding.
|
||||
BIN
.github/TwitterButton.png
vendored
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
42
.github/deploy.ts
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import * as Client from "ssh2-sftp-client";
|
||||
import * as archiver from "archiver";
|
||||
import * as rimraf from "rimraf";
|
||||
import { platform } from "os";
|
||||
import { createWriteStream } from "fs";
|
||||
|
||||
let sftp = new Client();
|
||||
|
||||
sftp
|
||||
.connect({
|
||||
host: process.env.SSH_HOST,
|
||||
username: process.env.SSH_USERNAME,
|
||||
password: process.env.SSH_PASSWORD
|
||||
})
|
||||
.then(async () => {
|
||||
rimraf.sync("../dist/app/");
|
||||
|
||||
console.log("Zipping...");
|
||||
let output = createWriteStream("app.zip"),
|
||||
archive = archiver("zip");
|
||||
|
||||
archive.directory(`../dist/`, platform());
|
||||
|
||||
output.on("close", function() {
|
||||
console.log("Uploading...");
|
||||
sftp
|
||||
.fastPut("app.zip", `/home/PreMiD/builds/${platform()}.zip`)
|
||||
.then(() => {
|
||||
console.log("Done!");
|
||||
sftp.end();
|
||||
});
|
||||
});
|
||||
|
||||
archive.on("error", function(err) {
|
||||
sftp.end();
|
||||
throw err;
|
||||
});
|
||||
|
||||
archive.pipe(output);
|
||||
|
||||
archive.finalize();
|
||||
});
|
||||
BIN
.github/example.png
vendored
Normal file
|
After Width: | Height: | Size: 332 KiB |
88
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
name: DePloY
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "src/**/*"
|
||||
- "**.ts"
|
||||
env:
|
||||
NODE_ENV: DePloY
|
||||
jobs:
|
||||
package:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, macOS-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/setup-node@master
|
||||
- name: Install Dependencies
|
||||
run: npm i -g yarn
|
||||
- name: Prepare to package
|
||||
run: |
|
||||
yarn
|
||||
yarn run init
|
||||
- name: Package
|
||||
run: yarn pkg
|
||||
- name: Upload to server
|
||||
env:
|
||||
SSH_HOST: ${{ secrets.SSHHOST }}
|
||||
SSH_USERNAME: ${{ secrets.SSHUSERNAME }}
|
||||
SSH_PASSWORD: ${{ secrets.SSHPASSWORD }}
|
||||
run: yarn deploy
|
||||
installer:
|
||||
needs: package
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Prepare for installer
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSHHOST }}
|
||||
username: ${{ secrets.SSHUSERNAME }}
|
||||
password: ${{ secrets.SSHPASSWORD }}
|
||||
script: |
|
||||
cd /home/PreMiD/builds
|
||||
unzip darwin.zip
|
||||
unzip win32.zip
|
||||
mv darwin/PreMiD-darwin-x64 PreMiD-darwin-x64
|
||||
mv win32/PreMiD-win32-ia32 PreMiD-win32-ia32
|
||||
mv win32/PreMiD-win32-x64 PreMiD-win32-x64
|
||||
rm -r win32.zip darwin.zip darwin win32
|
||||
- name: Create installer (Windows 32bit)
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSHHOST }}
|
||||
username: ${{ secrets.SSHUSERNAME }}
|
||||
password: ${{ secrets.SSHPASSWORD }}
|
||||
script: |
|
||||
cd /home/PreMiD/builds
|
||||
node prepare.js PreMiD-win32-ia32
|
||||
/opt/installbuilder-19.9.0/bin/builder build installer.xml windows
|
||||
- name: Create installer (Windows 64bit)
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSHHOST }}
|
||||
username: ${{ secrets.SSHUSERNAME }}
|
||||
password: ${{ secrets.SSHPASSWORD }}
|
||||
script: |
|
||||
cd /home/PreMiD/builds
|
||||
node prepare.js PreMiD-win32-x64
|
||||
/opt/installbuilder-19.9.0/bin/builder build installer.xml windows
|
||||
- name: Create installer (MacOS)
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSHHOST }}
|
||||
username: ${{ secrets.SSHUSERNAME }}
|
||||
password: ${{ secrets.SSHPASSWORD }}
|
||||
script: |
|
||||
cd /home/PreMiD/builds
|
||||
node prepare.js PreMiD-darwin-x64
|
||||
/opt/installbuilder-19.9.0/bin/builder build installer.xml osx
|
||||
- name: Cleanup
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSHHOST }}
|
||||
username: ${{ secrets.SSHUSERNAME }}
|
||||
password: ${{ secrets.SSHPASSWORD }}
|
||||
script: |
|
||||
cd /home/PreMiD/builds
|
||||
rm -r PreMiD-darwin-x64 PreMiD-win32-ia32 PreMiD-win32-x64
|
||||
14
.gitignore
vendored
@@ -1,4 +1,16 @@
|
||||
node_modules
|
||||
out
|
||||
dist
|
||||
tmp
|
||||
|
||||
.vscode
|
||||
dist
|
||||
.env
|
||||
|
||||
src/package-lock.json
|
||||
src/package.json
|
||||
src/update.ini
|
||||
|
||||
*.exe
|
||||
*.app
|
||||
*.xml.backup
|
||||
*.js
|
||||
22
@types/PreMiD/ExtensionSettings.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
export default interface ExtensionSettings {
|
||||
/**
|
||||
* If extension is enabled
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* Autolaunch enabled
|
||||
*/
|
||||
autoLaunch: boolean;
|
||||
/**
|
||||
* Media keys enabled
|
||||
*/
|
||||
mediaKeys: boolean;
|
||||
/**
|
||||
* title menubar (TrayTitle)
|
||||
*/
|
||||
titleMenubar: boolean;
|
||||
/**
|
||||
* language of extension
|
||||
*/
|
||||
language: string;
|
||||
}
|
||||
16
@types/PreMiD/Presence.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as Discord from "discord-rpc";
|
||||
|
||||
export default interface Presence {
|
||||
/**
|
||||
* Client ID of presence
|
||||
*/
|
||||
clientId: string;
|
||||
/**
|
||||
* Rich Procedual call connection
|
||||
*/
|
||||
rpc: Discord.Client;
|
||||
/**
|
||||
* Connection ready?
|
||||
*/
|
||||
ready: Boolean;
|
||||
}
|
||||
33
@types/PreMiD/PresenceData.d.ts
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as Discord from "discord-rpc";
|
||||
|
||||
export default interface PresenceData {
|
||||
/**
|
||||
* Client ID of presence
|
||||
*/
|
||||
clientId: string;
|
||||
/**
|
||||
* Tray title to be shown in Mac OS tray
|
||||
*/
|
||||
trayTitle: string;
|
||||
/**
|
||||
* service name of presence
|
||||
* @deprecated
|
||||
*/
|
||||
service: string;
|
||||
/**
|
||||
* Determines if the service is currently playing something back or not, if false it will automatically hide after 1 minute
|
||||
*/
|
||||
playback: boolean;
|
||||
/**
|
||||
* Discord Presence which gets sent directly to Discord app
|
||||
*/
|
||||
presenceData: Discord.Presence;
|
||||
/**
|
||||
* Determines if the service should be hidden (clearActivity)
|
||||
*/
|
||||
hidden: boolean;
|
||||
/**
|
||||
* Determines if the service is mediaKey able / uses them
|
||||
*/
|
||||
mediaKeys: boolean;
|
||||
}
|
||||
66
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,66 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at contact@premid.app or by contacting a staff member on our [Discord server](https://discord.gg/WvfVZ8T). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
@@ -1,54 +0,0 @@
|
||||
#ytp-connectinfo {
|
||||
position: fixed;
|
||||
top: -50px;
|
||||
right: 0;
|
||||
z-index: 10000;
|
||||
width: 175px;
|
||||
border-bottom-left-radius: 5px;
|
||||
height: 50px;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
user-select: none;
|
||||
animation-name: slideIn;
|
||||
animation-duration: 5s;
|
||||
animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
|
||||
color: black;
|
||||
}
|
||||
|
||||
#ytp-connectinfo * {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#ytp-connectinfo img {
|
||||
float: left;
|
||||
margin: 5px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
#ytp-connectinfo h1 {
|
||||
font-size: 20px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
#ytp-connectinfo h2 {
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
@keyframes slideIn {
|
||||
0% {
|
||||
top: -50px;
|
||||
}
|
||||
|
||||
10% {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
90% {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
top: -50px;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 120 KiB |
@@ -1,49 +0,0 @@
|
||||
{
|
||||
"name": "YT Presence",
|
||||
"author": "Timeraa",
|
||||
"version": "1.1",
|
||||
"description": "YT Presence adds Discord Rich Presence integration, Media controls and much more to YouTube/YouTube Music, Twitch etc...",
|
||||
"manifest_version": 2,
|
||||
"icons": {
|
||||
"2024": "icon.png"
|
||||
},
|
||||
"browser_action": {
|
||||
"default_icon": {
|
||||
"2024": "icon.png"
|
||||
}
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"js": ["util/jquery-3.3.1.min.js", "util/socket.io-2.1.1.min.js"],
|
||||
"css": ["connect.css"],
|
||||
"matches": [
|
||||
"https://www.youtube.com/*",
|
||||
"https://music.youtube.com/*",
|
||||
"https://www.netflix.com/*",
|
||||
"https://soundcloud.com/*",
|
||||
"https://www.twitch.tv/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"js": ["presences/YouTubeMusic.js"],
|
||||
"matches": ["https://music.youtube.com/*"]
|
||||
},
|
||||
{
|
||||
"js": ["presences/YouTube.js"],
|
||||
"matches": ["https://www.youtube.com/*"]
|
||||
},
|
||||
{
|
||||
"js": ["presences/Netflix.js"],
|
||||
"matches": ["https://*.netflix.com/*"]
|
||||
},
|
||||
{
|
||||
"js": ["presences/SoundCloud.js"],
|
||||
"matches": ["https://*.soundcloud.com/*"]
|
||||
},
|
||||
{
|
||||
"js": ["presences/Twitch.js"],
|
||||
"matches": ["https://*.twitch.tv/*"]
|
||||
}
|
||||
],
|
||||
"permissions": ["http://localhost:3000/", "tabs", "storage"]
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
let playback = true,
|
||||
eventType,
|
||||
playbackNew
|
||||
|
||||
var lastPlaybackState = true
|
||||
setInterval(() => {
|
||||
if($('.VideoContainer div video')[0] != null && $('.VideoContainer div video')[0].paused && lastPlaybackState == true) {
|
||||
handlePlayPause()
|
||||
lastPlaybackState = false;
|
||||
}
|
||||
if($('.VideoContainer div video')[0] != null && !$('.VideoContainer div video')[0].paused && lastPlaybackState == false) {
|
||||
handlePlayPause()
|
||||
lastPlaybackState = true;
|
||||
}
|
||||
}, 500)
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if (musicRunning) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.VideoContainer div video')[0].paused ? $('.VideoContainer div video')[0].play() : $('.VideoContainer div video')[0].pause()
|
||||
updateData("playPauseVideo")
|
||||
break
|
||||
case "nextTrack":
|
||||
$('.button-nfplayerNextEpisode').click()
|
||||
//* Prevent playback from being paused again
|
||||
playback = true
|
||||
//* Send response back to application
|
||||
updateData("nextVideo")
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function handlePlayPause() {
|
||||
//* Toggle playback variable
|
||||
if (playback == true) playback = false; else playback = true;
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
function checkPlayChange() {
|
||||
//* Correct playback if out of sync
|
||||
if (playback == false) {
|
||||
//* Check if playbutton on page matches variable
|
||||
if ($('.ytp-play-button svg').prop("outerHTML") == playButton) {
|
||||
//* Update playback variable
|
||||
playback = true
|
||||
//* Pause song
|
||||
$('.ytp-play-button').click()
|
||||
}
|
||||
}
|
||||
|
||||
//* Set musicRunning variable to true if url has /watch or music title not empty
|
||||
if (document.location.pathname.includes("/watch")) musicRunning = true; else musicRunning = false;
|
||||
}
|
||||
|
||||
//* Start interval
|
||||
window.onload = function () {
|
||||
setInterval(updateData, 1000)
|
||||
}
|
||||
|
||||
//* Create needed variables
|
||||
let urlForVideo,
|
||||
songTime,
|
||||
calcDifference = []
|
||||
|
||||
function updateData(playbackChange = false) {
|
||||
if (document.location.pathname.includes("/watch")) musicRunning = true; else musicRunning = false;
|
||||
urlForVideo = document.location.href
|
||||
if ($(".time-remaining__time").html() != "") {
|
||||
let data
|
||||
|
||||
if (playbackChange != false) {
|
||||
var eventType = 'playBackChange'
|
||||
} else {
|
||||
var eventType = 'updateData'
|
||||
}
|
||||
|
||||
var endTime
|
||||
if(musicRunning && $('.VideoContainer div video')[0] != undefined) {
|
||||
var startTime = Date.now();
|
||||
endTime = Math.floor(startTime / 1000) -
|
||||
Math.floor($('.VideoContainer div video')[0].currentTime) +
|
||||
Math.floor($('.VideoContainer div video')[0].duration);
|
||||
|
||||
data = {
|
||||
nflix: {
|
||||
url: urlForVideo,
|
||||
seriesTitle: $('.ellipsize-text').children().html(),
|
||||
season: $($('.ellipsize-text').children().get(1)).html(),
|
||||
episodeTitle: $($('.ellipsize-text').children().get(2)).html(),
|
||||
episodeCurrentTimeSeconds: Math.floor($('.VideoContainer div video')[0].currentTime),
|
||||
episodeEndTimeSeconds: Math.floor($('.VideoContainer div video')[0].duration),
|
||||
episodeCurrentTime: startTime,
|
||||
episodeEndTime: endTime,
|
||||
playback: $('.VideoContainer div video')[0].paused ? "paused" : "playing"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
nflix: {
|
||||
playback: false
|
||||
}
|
||||
}
|
||||
}
|
||||
if (socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
let playback = true,
|
||||
eventType,
|
||||
playbackNew
|
||||
|
||||
var lastPlaybackState = true
|
||||
setInterval(() => {
|
||||
if($('.playControl').hasClass('playing') && lastPlaybackState == true) {
|
||||
handlePlayPause()
|
||||
lastPlaybackState = false;
|
||||
}
|
||||
if(!$('.playControl').hasClass('playing') && lastPlaybackState == false) {
|
||||
handlePlayPause()
|
||||
lastPlaybackState = true;
|
||||
}
|
||||
}, 500)
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if ($('.playControl') != undefined) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.playControl').click()
|
||||
updateData("playPauseVideo")
|
||||
break
|
||||
case "nextTrack":
|
||||
$('.skipControl__next').click()
|
||||
//* Prevent playback from being paused again
|
||||
playback = true
|
||||
//* Send response back to application
|
||||
updateData("nextVideo")
|
||||
break
|
||||
case "previousTrack":
|
||||
$('.skipControl__previous').click()
|
||||
//* Prevent playback from being paused again
|
||||
playback = true
|
||||
//* Send response back to application
|
||||
updateData("nextVideo")
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function handlePlayPause() {
|
||||
//* Toggle playback variable
|
||||
if (playback == true) playback = false; else playback = true;
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
function checkPlayChange() {
|
||||
//* Correct playback if out of sync
|
||||
if (playback == false) {
|
||||
//* Check if playbutton on page matches variable
|
||||
if ($('.ytp-play-button svg').prop("outerHTML") == playButton) {
|
||||
//* Update playback variable
|
||||
playback = true
|
||||
//* Pause song
|
||||
$('.ytp-play-button').click()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//* Start interval
|
||||
window.onload = function () {
|
||||
setInterval(updateData, 1000)
|
||||
}
|
||||
|
||||
//* Create needed variables
|
||||
let urlForVideo,
|
||||
songTime,
|
||||
calcDifference = []
|
||||
|
||||
function updateData(playbackChange = false) {
|
||||
urlForVideo = document.location.href
|
||||
if ($(".time-remaining__time").html() != "") {
|
||||
let data
|
||||
|
||||
if (playbackChange != false) {
|
||||
var eventType = 'playBackChange'
|
||||
} else {
|
||||
var eventType = 'updateData'
|
||||
}
|
||||
|
||||
var endTime
|
||||
if($('.playbackSoundBadge__titleContextContainer') != undefined) {
|
||||
var startTime = Date.now();
|
||||
endTime = Math.floor(startTime/1000) -
|
||||
getSeconds($('.playbackTimeline__timePassed').children().get(1).innerHTML) + getSeconds($('.playbackTimeline__duration').children().get(1).innerHTML);
|
||||
data = {
|
||||
scloud: {
|
||||
url: urlForVideo,
|
||||
songTitle: $('.playbackSoundBadge__titleLink').children().get(1).innerHTML,
|
||||
songAuthor: $('.playbackSoundBadge__titleContextContainer').children().get(0).innerHTML,
|
||||
songCurrentTimeSeconds: getSeconds($('.playbackTimeline__timePassed').children().get(1).innerHTML),
|
||||
songEndTimeSeconds: getSeconds($('.playbackTimeline__duration').children().get(1).innerHTML),
|
||||
songCurrentTime: startTime,
|
||||
songEndTime: endTime,
|
||||
playback: $('.playControl').hasClass('playing') ? "playing" : "paused"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
scloud: {
|
||||
playback: false
|
||||
}
|
||||
}
|
||||
}
|
||||
if (socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
}
|
||||
|
||||
function getSeconds(string) {
|
||||
const a = string.split(":")
|
||||
|
||||
const seconds = +a[0] * 60 + +a[1]
|
||||
return seconds
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
let playback = true,
|
||||
eventType,
|
||||
playbackNew,
|
||||
lastURL = null,
|
||||
startTimeStamp
|
||||
|
||||
var lastPlaybackState = true
|
||||
setInterval(() => {
|
||||
if($('.player-video video')[0] != null && $('.player-video video')[0].paused && lastPlaybackState == true) {
|
||||
handlePlayPause()
|
||||
lastPlaybackState = false;
|
||||
}
|
||||
if($('.player-video video')[0] != null && !$('.player-video video')[0].paused && lastPlaybackState == false) {
|
||||
handlePlayPause()
|
||||
lastPlaybackState = true;
|
||||
}
|
||||
}, 500)
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if ($('.player-video video')[0] != null) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.player-video video')[0].paused ? $('.qa-pause-play-button').click() : $('.qa-pause-play-button').click()
|
||||
updateData("playPauseVideo")
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function handlePlayPause() {
|
||||
//* Toggle playback variable
|
||||
if (playback == true) playback = false; else playback = true;
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
function checkPlayChange() {
|
||||
//* Correct playback if out of sync
|
||||
if (playback == false) {
|
||||
//* Check if playbutton on page matches variable
|
||||
if ($('.ytp-play-button svg').prop("outerHTML") == playButton) {
|
||||
//* Update playback variable
|
||||
playback = true
|
||||
//* Pause song
|
||||
$('.ytp-play-button').click()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//* Start interval
|
||||
window.onload = function () {
|
||||
setInterval(updateData, 1000)
|
||||
}
|
||||
|
||||
//* Create needed variables
|
||||
let urlForVideo,
|
||||
songTime,
|
||||
calcDifference = []
|
||||
|
||||
function updateData(playbackChange = false) {
|
||||
urlForVideo = document.location.href
|
||||
let data
|
||||
|
||||
if (playbackChange != false) {
|
||||
var eventType = 'playBackChange'
|
||||
} else {
|
||||
var eventType = 'updateData'
|
||||
}
|
||||
|
||||
if($('.player-video video')[0] != undefined && $('.tw-ellipsis.tw-mg-b-05').children().length > 0) {
|
||||
if(urlForVideo != lastURL) {
|
||||
lastURL = urlForVideo
|
||||
startTimeStamp = Date.now()
|
||||
}
|
||||
|
||||
data = {
|
||||
twitch: {
|
||||
url: urlForVideo,
|
||||
streamTitle: $('.tw-ellipsis.tw-mg-b-05').children().get(0).innerHTML,
|
||||
streamHost: $('.channel-header__user h5').html(),
|
||||
watchingSince: startTimeStamp,
|
||||
playback: $('.player-video video')[0].paused ? "paused" : "playing"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
twitch: {
|
||||
playback: false
|
||||
}
|
||||
}
|
||||
}
|
||||
if (socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
var pauseButton = '<svg height="100%" version="1.1" viewBox="0 0 36 36" width="100%"><use class="ytp-svg-shadow" xlink:href="#ytp-id-91"></use><path class="ytp-svg-fill" d="M 12,26 18.5,22 18.5,14 12,10 z M 18.5,22 25,18 25,18 18.5,14 z" id="ytp-id-91"></path></svg>'
|
||||
var pauseButton = '<svg height="100%" version="1.1" viewBox="0 0 36 36" width="100%"><use class="ytp-svg-shadow" xlink:href="#ytp-id-93"></use><path class="ytp-svg-fill" d="M 12,26 16,26 16,10 12,10 z M 21,26 25,26 25,10 21,10 z" id="ytp-id-93"></path></svg>'
|
||||
|
||||
let playback = true,
|
||||
eventType,
|
||||
playbackNew
|
||||
|
||||
//* Register listeners
|
||||
$('.video-stream').click(handlePlayPause)
|
||||
$('.ytp-play-button').click(handlePlayPause)
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
//$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if (musicRunning) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.video-stream').click()
|
||||
updateData("playPauseVideo")
|
||||
break
|
||||
case "nextTrack":
|
||||
$('.ytp-next-button')[0].click()
|
||||
//* Prevent playback from being paused again
|
||||
playback = true
|
||||
//* Send response back to application
|
||||
updateData("nextVideo")
|
||||
break
|
||||
case "previousTrack":
|
||||
$('.ytp-prev-button')[0].click()
|
||||
//* Send response back to application
|
||||
updateData("previousVideo")
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function handlePlayPause() {
|
||||
//* Toggle playback variable
|
||||
if (playback == true) playback = false; else playback = true;
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
function checkPlayChange() {
|
||||
//* Correct playback if out of sync
|
||||
if (playback == false) {
|
||||
//* Check if playbutton on page matches variable
|
||||
if ($('.ytp-play-button svg').prop("outerHTML") == playButton) {
|
||||
//* Update playback variable
|
||||
playback = true
|
||||
//* Pause song
|
||||
$('.ytp-play-button').click()
|
||||
}
|
||||
}
|
||||
|
||||
//* Set musicRunning variable to true if url has /watch or music title not empty
|
||||
if (document.location.pathname.includes("/watch") || $(".title.style-scope.ytmusic-player-bar").html() != "") musicRunning = true; else musicRunning = false;
|
||||
}
|
||||
|
||||
//* Start interval
|
||||
window.onload = function () {
|
||||
setInterval(updateData, 1000)
|
||||
}
|
||||
|
||||
//* Create needed variables
|
||||
let urlForVideo,
|
||||
songTime,
|
||||
calcDifference = []
|
||||
|
||||
function updateData(playbackChange = false) {
|
||||
if (document.location.pathname.includes("/watch")) musicRunning = true; else musicRunning = false;
|
||||
urlForVideo = document.location.href
|
||||
if ($(".ytp-time-current").html() != " " && $('.video-stream')[0] != null) {
|
||||
let data
|
||||
|
||||
if (playbackChange != false) {
|
||||
var playbackNew = playbackChange
|
||||
var eventType = 'playBackChange'
|
||||
} else {
|
||||
var playbackNew = playback ? "playing" : "paused"
|
||||
var eventType = 'updateData'
|
||||
}
|
||||
|
||||
var endTime
|
||||
if(musicRunning) {
|
||||
var startTime = Date.now();
|
||||
endTime = Math.floor(startTime / 1000) -
|
||||
Math.floor($('.video-stream')[0].currentTime) +
|
||||
Math.floor($('.video-stream')[0].duration);
|
||||
|
||||
data = {
|
||||
yt: {
|
||||
url: urlForVideo,
|
||||
videoTitle: $(".title.style-scope.ytd-video-primary-info-renderer")
|
||||
.children().html(),
|
||||
videoAuthor: $("#upload-info .style-scope .ytd-video-owner-renderer")
|
||||
.contents()
|
||||
.first()
|
||||
.html(),
|
||||
videoCurrentTimeSeconds: Math.floor($('.video-stream')[0].currentTime),
|
||||
videoEndTimeSeconds: Math.floor($('.video-stream')[0].duration),
|
||||
videoCurrentTime: startTime,
|
||||
videoEndTime: endTime,
|
||||
playback: playbackNew
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(document.location.pathname.startsWith('www.youtube.com')) console.log("NICE")
|
||||
data = {
|
||||
yt: {
|
||||
playback: false
|
||||
}
|
||||
}
|
||||
}
|
||||
if (socket.connected && !isNaN($('.video-stream')[0].duration)) socket.emit(eventType, data)
|
||||
}
|
||||
}
|
||||
|
||||
function getSeconds(string) {
|
||||
const a = string.split(":")
|
||||
|
||||
const seconds = +a[0] * 60 + +a[1]
|
||||
return seconds
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
//* Play Pause buttons
|
||||
var playButton = '<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope iron-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope iron-icon"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" class="style-scope iron-icon"></path></g></svg>'
|
||||
var pauseButton = '<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope iron-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope iron-icon"><path d="M8 5v14l11-7z" class="style-scope iron-icon"></path></g></svg>'
|
||||
|
||||
//* Create needed variables
|
||||
let splitTime,
|
||||
songCurrentTime,
|
||||
songEndTime,
|
||||
songAuthors = [],
|
||||
playback = true,
|
||||
eventType
|
||||
|
||||
//* Register listeners
|
||||
$('.play-pause-button').click(handlePlayPause)
|
||||
$('.ytmusic-player').click(handlePlayPause)
|
||||
//* Start interval
|
||||
$(document).ready(() => {
|
||||
//* Check Play change
|
||||
setInterval(checkPlayChange, 250)
|
||||
//* Update data and send to application
|
||||
setInterval(updateData, 1000)
|
||||
})
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
socket.on('error', (err) => console.log(`Error while connecting... ${err}`))
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if (musicRunning) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.play-pause-button').click()
|
||||
updateData("playPauseTrack")
|
||||
break
|
||||
case "nextTrack":
|
||||
$('.next-button').click()
|
||||
//* Prevent playback from being paused again
|
||||
playback = true
|
||||
//* Send response back to application
|
||||
updateData("nextTrack")
|
||||
break
|
||||
case "previousTrack":
|
||||
$('.previous-button').click()
|
||||
//* Send response back to application
|
||||
updateData("previousTrack")
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function handlePlayPause() {
|
||||
//* Toggle playback variable
|
||||
if (playback == true) playback = false; else playback = true;
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
function checkPlayChange() {
|
||||
//* Correct playback if out of sync
|
||||
if (playback == false) {
|
||||
//* Check if playbutton on page matches variable
|
||||
if ($(".play-pause-button svg").prop("outerHTML") == playButton) {
|
||||
//* Update playback variable
|
||||
playback = true
|
||||
//* Pause song
|
||||
$('.play-pause-button').click()
|
||||
}
|
||||
}
|
||||
|
||||
//* Set musicRunning variable to true if url has /watch or music title not empty
|
||||
if (document.location.pathname.includes("/watch") || $(".title.style-scope.ytmusic-player-bar").html() != "") musicRunning = true; else musicRunning = false;
|
||||
}
|
||||
|
||||
function updateData(playbackChange = false) {
|
||||
//* Clear author array
|
||||
songAuthors = []
|
||||
|
||||
if ($(".title.style-scope.ytmusic-player-bar").html() != "") {
|
||||
//* Get song Time String (2:10 / 3:21)
|
||||
//* Split to array ["2:10", "3:21"]
|
||||
splitTime = $(".time-info.style-scope.ytmusic-player-bar").html().split(" / ", 2)
|
||||
//* Convert to seconds
|
||||
songCurrentTime = getSeconds(splitTime[0])
|
||||
songEndTime = getSeconds(splitTime[1])
|
||||
|
||||
//* Get all authors
|
||||
$(".byline.ytmusic-player-bar").contents().each(function (index, item) {
|
||||
if (item.classList != undefined) {
|
||||
if (item.classList.contains("yt-simple-endpoint") == true) {
|
||||
songAuthors.push(item.innerHTML)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
//* If no authors found in previous method use this
|
||||
if (songAuthors.length == 0 || songAuthors.length == 1) {
|
||||
//* Clear old list
|
||||
songAuthors = []
|
||||
songAuthors.push($(".byline.ytmusic-player-bar").contents().first().text())
|
||||
}
|
||||
|
||||
var startTime = Date.now();
|
||||
var endTime =
|
||||
Math.floor(startTime / 1000) -
|
||||
songCurrentTime +
|
||||
songEndTime;
|
||||
|
||||
if (playbackChange != false) {
|
||||
playbackNew = playbackChange
|
||||
eventType = 'playBackChange'
|
||||
} else {
|
||||
playbackNew = playback ? "playing" : "paused"
|
||||
eventType = 'updateData'
|
||||
}
|
||||
|
||||
var data = {
|
||||
ytm: {
|
||||
songTitle: $(".title.style-scope.ytmusic-player-bar").html(),
|
||||
songAuthors: songAuthors,
|
||||
songCurrentTimeSeconds: songCurrentTime,
|
||||
songCurrentTime: startTime,
|
||||
songEndTimeSeconds: songEndTime,
|
||||
songEndTime: endTime,
|
||||
songCover: $(".image.style-scope.ytmusic-player-bar").attr("src"),
|
||||
playback: playbackNew
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var data = {
|
||||
status: "keepAlive"
|
||||
}
|
||||
eventType = 'updateData'
|
||||
}
|
||||
|
||||
if(socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
|
||||
//* Used to extract seconds from Syntax
|
||||
//* 1:39 => 99
|
||||
function getSeconds(string) {
|
||||
const s = string.split(":")
|
||||
|
||||
const seconds = +s[0] * 60 + +s[1]
|
||||
return seconds
|
||||
}
|
||||
2
Extension/util/jquery-3.3.1.min.js
vendored
7
Extension/util/socket.io-2.1.1.min.js
vendored
386
LICENSE
@@ -1,21 +1,373 @@
|
||||
MIT License
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
Copyright (c) 2018 Florian Metz
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
||||
|
||||
134
README.md
@@ -1,115 +1,43 @@
|
||||
##  [](https://discord.gg/Kw7WaYn)
|
||||
<div align="center">
|
||||
|
||||
# <img src="icon.png" width="20" draggable="false"><b> </b>YouTube Presence · Watcha watching there? 👀
|
||||
<img src=".github/Logo.png" width="150px" draggable="false"><br>
|
||||
|
||||
_YT Presence Features like **Discord Rich Presence** integration, **Media controls** to **YouTube**/**YouTube Music**, **Twitch**, **SoundCloud**, **Netflix**._
|
||||
# PreMiD
|
||||
|
||||
<a href="https://discord.gg/Kw7WaYn" title="Join our Discord!">
|
||||
<img src="discord-logo.svg" width="200px" draggable="false">
|
||||
</a>
|
||||
## Your Rich Presence for web services!
|
||||
|
||||
# Table of contents
|
||||

|
||||

|
||||

|
||||
[](https://chrome.google.com/webstore/detail/premid/agjnjboanicjcpenljmaaigopkgdnihi)
|
||||

|
||||

|
||||

|
||||
|
||||
- [Features](#features)
|
||||
- [Support](#support)
|
||||
- [Installation](#installation)
|
||||
- [Installing the Extension](#installing-the-extension)
|
||||
- Chrome
|
||||
- Opera
|
||||
- [Installing the Application](#installing-the-application)
|
||||
- Mac OS
|
||||
- Windows
|
||||
- [FAQ](#faq-·-frequently-asked-questions)
|
||||
- Is this project up to date?
|
||||
- Will this project stay free?
|
||||
<img src=".github/example.png" draggable="false"><br>
|
||||
|
||||
# About
|
||||
|
||||
**PreMiD** is a simple, configurable utility that allows you to show what you're doing on the web in your Discord **now playing status**. It supports many different websites, and will support multiple users watching the same content simultaneously in an upcoming update.
|
||||
|
||||
# Features
|
||||
|
||||
- Discord Rich Presence Integration
|
||||
- Media control keys
|
||||
- Automatically clears Presence after 1 minute of inactivity
|
||||
- _More soon_
|
||||
· Displays your current web service in Discord as your status.<br>
|
||||
· Grants full control over Presences.<br>
|
||||
· Supports over 100 web services, still rising!<br>
|
||||
· _Watch parties and more are coming soon!_
|
||||
|
||||
# Support
|
||||
# Installation/Troubleshooting
|
||||
|
||||
### **Operating Systems**
|
||||
### Installation instructions, Troubleshooting guides etc. can be found in our [**Wiki**](https://wiki.premid.app).
|
||||
|
||||
- Windows
|
||||
- Mac OS
|
||||
# Support us
|
||||
|
||||
### **Browsers**
|
||||
|
||||
- Chrome
|
||||
- Opera
|
||||
|
||||
# Installation
|
||||
|
||||
## Extension
|
||||
|
||||
<details>
|
||||
<summary><b><u>Installing the Chrome extension</u></b> (Click to expand)</summary>
|
||||
<h1>Chrome extension installation</h1>
|
||||
<ol>
|
||||
<li>Click <a href="https://chrome.google.com/webstore/detail/yt-presence/agjnjboanicjcpenljmaaigopkgdnihi">this</a> link</li>
|
||||
</li>
|
||||
<li>Click "add to Chrome"</li>
|
||||
<li>Install the <a href="#installing-the-application">application</a></li>
|
||||
</ol>
|
||||
</details>
|
||||
<details>
|
||||
<summary><b><u>Installing the Opera extension</u></b> (Click to expand)</summary>
|
||||
<h1>Opera extension installation</h1>
|
||||
<ol>
|
||||
<li>Download the latest version of the <a href="https://github.com/Timeraa/YT-Presence/releases/latest">extension</a>
|
||||
</li>
|
||||
<li>Extract the downloaded <b>.zip</b> file</li>
|
||||
<li>Open Opera</li>
|
||||
<li>Go to <a href="chrome://extensions/">chrome://extensions/</a></li>
|
||||
<li>Drag and drop the extension's folder on the page<br>
|
||||
<li>Load the extracted <b>Extension</b> folder</li>
|
||||
<li>Install the <a href="#installing-the-application">application</a></li>
|
||||
</ol>
|
||||
</details>
|
||||
|
||||
## Application
|
||||
|
||||
<details>
|
||||
<summary><b><u>Mac OS</u></b> (Click to expand)</summary>
|
||||
<h1>Installation on Mac OS</h1>
|
||||
<ol>
|
||||
<li>Download the latest version of the <a href="https://github.com/Timeraa/YT-Presence/releases/latest">application</a>
|
||||
</li>
|
||||
<li>Open the downloaded <b>.dmg</b> file</li>
|
||||
<li>Drag <b>YT Presence</b> Into your <b>Applications</b> Folder</li>
|
||||
<li>Open your Launchpad</li>
|
||||
<li>Open <b>YT Presence</b></li>
|
||||
<li>Install Extension if not already</li>
|
||||
</ol>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b><u>Windows</u></b> (Click to expand)</summary>
|
||||
<h1>Installation on Windows</h1>
|
||||
<ol>
|
||||
<li>Download the latest installer from <a href="https://github.com/Timeraa/YT-Presence/releases/">here</a></li>
|
||||
<li>Open the downloaded <b>.exe</b> installer</li>
|
||||
<li>If SmartScreen comes up press more informations then press run anyways. (Its not a virus, i promise)</li>
|
||||
<li>YouTube Presence should install itself and start automatically (You can tell by looking at the taskbar)</li>
|
||||
<li>Install Extension if not already</li>
|
||||
</ol>
|
||||
</details>
|
||||
<br>
|
||||
|
||||
# FAQ · Frequently Asked Questions
|
||||
|
||||
> ## Is this project still up to date?<br>
|
||||
|
||||
- Yes! I use and work on this program and extension almost everyday!<br>There are currently no plans on discontinuing this Project.
|
||||
|
||||
> ## Will this project stay free?<br>
|
||||
|
||||
- Of course! Its open source! But i would highly appreciate a little bit of Money it helps me for my Future, like a **Driving license**. <br><br><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZU8Q766ACS2WS&lc=US">Donate here</a>
|
||||
|
||||
---
|
||||
|
||||
### YT Presence V1.1 · By Timeraa
|
||||
<div>
|
||||
<a target="_blank" href="https://www.patreon.com/bePatron?u=4610890" data-patreon-widget-type="become-patron-button" title="Support me on Patreon!">
|
||||
<img height="75px" draggable="false" src=".github/Patreon.png">
|
||||
</a>
|
||||
<a target="_blank" href="https://discord.gg/WvfVZ8T" title="Join our Discord!">
|
||||
<img height="75px" draggable="false" src="https://discordapp.com/api/guilds/493130730549805057/widget.png?style=banner2" alt="Join my Discord!">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
BIN
appIcon.icns
BIN
appIcon.ico
|
Before Width: | Height: | Size: 36 KiB |
@@ -1,11 +0,0 @@
|
||||
var electronInstaller = require('electron-winstaller');
|
||||
|
||||
resultPromise = electronInstaller.createWindowsInstaller({
|
||||
appDirectory: './out/YT Presence-win32-x64',
|
||||
outputDirectory: './dist/windows/',
|
||||
exe: './YT Presence.exe',
|
||||
iconUrl: 'https://raw.githubusercontent.com/Timeraa/YT-Presence/master/appIcon.ico',
|
||||
noMsi: true
|
||||
});
|
||||
|
||||
resultPromise.then(() => console.log("It worked!"), (e) => console.log(`No dice: ${e.message}`));
|
||||
112
devMode.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import * as ts from "typescript";
|
||||
import chalk from "chalk";
|
||||
import { ChildProcess, spawn } from "child_process";
|
||||
import { removeSync, writeFileSync, copySync } from "fs-extra";
|
||||
import { extname } from "path";
|
||||
import * as glob from "fast-glob";
|
||||
|
||||
//* Current child process = null
|
||||
var currChild: ChildProcess = null;
|
||||
|
||||
//* Format Host
|
||||
const formatHost: ts.FormatDiagnosticsHost = {
|
||||
getCanonicalFileName: path => path,
|
||||
getCurrentDirectory: ts.sys.getCurrentDirectory,
|
||||
getNewLine: () => ts.sys.newLine
|
||||
};
|
||||
|
||||
//* Create ts program
|
||||
const createProgram = ts.createSemanticDiagnosticsBuilderProgram;
|
||||
|
||||
//* Create Watch compoile host
|
||||
const host = ts.createWatchCompilerHost(
|
||||
"./tsconfig.json",
|
||||
{},
|
||||
ts.sys,
|
||||
createProgram,
|
||||
null,
|
||||
fileChange
|
||||
);
|
||||
|
||||
if (process.argv.length == 3 && process.argv[2] == "compile")
|
||||
prepareDist().then(() => process.exit());
|
||||
//* Create watch program
|
||||
else ts.createWatchProgram(host);
|
||||
|
||||
async function fileChange(diagnostic: ts.Diagnostic) {
|
||||
//* TS compilation != done
|
||||
if (diagnostic.code !== 6194) {
|
||||
//* If error
|
||||
if ([6031, 6032].includes(diagnostic.code))
|
||||
console.log(
|
||||
chalk.blueBright(ts.formatDiagnostic(diagnostic, formatHost))
|
||||
);
|
||||
else
|
||||
console.log(chalk.redBright(ts.formatDiagnostic(diagnostic, formatHost)));
|
||||
return;
|
||||
} else
|
||||
console.log(chalk.greenBright(ts.formatDiagnostic(diagnostic, formatHost)));
|
||||
|
||||
console.log(currChild && currChild.killed);
|
||||
//* Kill old child if exists && alive
|
||||
if (currChild && !currChild.killed) currChild.kill();
|
||||
|
||||
//* Run devMode script
|
||||
prepareDist();
|
||||
|
||||
//* Clear console
|
||||
console.clear();
|
||||
|
||||
//* Run child
|
||||
currChild = spawn("yarn start", {
|
||||
shell: true,
|
||||
stdio: "inherit"
|
||||
});
|
||||
}
|
||||
|
||||
//* Prepare dist folder
|
||||
async function prepareDist() {
|
||||
//* Select files
|
||||
var dist = await glob("dist/app/**/*", { onlyFiles: true }),
|
||||
src = await glob("src/**/*", { onlyFiles: true });
|
||||
|
||||
//* Filter file differences
|
||||
var nDist = dist.map(f => [f.replace("dist/app/", ""), f]);
|
||||
src = src
|
||||
.map(f => f.replace("src/", "").split(".")[0])
|
||||
.filter(sf => nDist.find(d => d[0].split(".")[0] == sf));
|
||||
|
||||
//* Old files, delete
|
||||
Promise.all(
|
||||
dist
|
||||
.filter(f => !src.includes(f.replace("dist/app/", "").split(".")[0]))
|
||||
.map(f => removeSync(f))
|
||||
);
|
||||
|
||||
//* Copy package.json (minified)
|
||||
var packageJSON = require("./package.json"),
|
||||
srcPackageJSON = packageJSON;
|
||||
|
||||
//* Delete scripts, not needed
|
||||
delete srcPackageJSON.scripts;
|
||||
|
||||
//* only electron as devDependency
|
||||
srcPackageJSON.devDependencies = {
|
||||
electron: packageJSON.devDependencies.electron
|
||||
};
|
||||
|
||||
//* Write file
|
||||
await writeFileSync(
|
||||
"./src/package.json",
|
||||
JSON.stringify(srcPackageJSON, null, 2)
|
||||
);
|
||||
|
||||
//* Copy files from src to dist
|
||||
copySync("src", "dist/app", {
|
||||
filter: function(path) {
|
||||
if (path.includes("node_modules")) return false;
|
||||
return extname(path) !== ".ts";
|
||||
console.log(path);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Before Width: | Height: | Size: 5.8 KiB |
@@ -1 +0,0 @@
|
||||
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 272.1"><style>.st0{fill:#7289DA;}</style><path class="st0" d="M142.8 120.1c-5.7 0-10.2 4.9-10.2 11s4.6 11 10.2 11c5.7 0 10.2-4.9 10.2-11s-4.6-11-10.2-11zM106.3 120.1c-5.7 0-10.2 4.9-10.2 11s4.6 11 10.2 11c5.7 0 10.2-4.9 10.2-11 .1-6.1-4.5-11-10.2-11z"/><path class="st0" d="M191.4 36.9h-134c-11.3 0-20.5 9.2-20.5 20.5v134c0 11.3 9.2 20.5 20.5 20.5h113.4l-5.3-18.3 12.8 11.8 12.1 11.1 21.6 18.7V57.4c-.1-11.3-9.3-20.5-20.6-20.5zm-38.6 129.5s-3.6-4.3-6.6-8c13.1-3.7 18.1-11.8 18.1-11.8-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.4-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.6-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.2-1.8-1-2.8-1.7-2.8-1.7s4.8 7.9 17.5 11.7c-3 3.8-6.7 8.2-6.7 8.2-22.1-.7-30.5-15.1-30.5-15.1 0-31.9 14.4-57.8 14.4-57.8 14.4-10.7 28-10.4 28-10.4l1 1.2c-18 5.1-26.2 13-26.2 13s2.2-1.2 5.9-2.8c10.7-4.7 19.2-5.9 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.5 0 0-7.9-7.5-24.9-12.6l1.4-1.6s13.7-.3 28 10.4c0 0 14.4 25.9 14.4 57.8 0-.1-8.4 14.3-30.5 15zM303.8 79.7h-33.2V117l22.1 19.9v-36.2h11.8c7.5 0 11.2 3.6 11.2 9.4v27.7c0 5.8-3.5 9.7-11.2 9.7h-34v21.1h33.2c17.8.1 34.5-8.8 34.5-29.2v-29.8c.1-20.8-16.6-29.9-34.4-29.9zm174 59.7v-30.6c0-11 19.8-13.5 25.8-2.5l18.3-7.4c-7.2-15.8-20.3-20.4-31.2-20.4-17.8 0-35.4 10.3-35.4 30.3v30.6c0 20.2 17.6 30.3 35 30.3 11.2 0 24.6-5.5 32-19.9l-19.6-9c-4.8 12.3-24.9 9.3-24.9-1.4zM417.3 113c-6.9-1.5-11.5-4-11.8-8.3.4-10.3 16.3-10.7 25.6-.8l14.7-11.3c-9.2-11.2-19.6-14.2-30.3-14.2-16.3 0-32.1 9.2-32.1 26.6 0 16.9 13 26 27.3 28.2 7.3 1 15.4 3.9 15.2 8.9-.6 9.5-20.2 9-29.1-1.8l-14.2 13.3c8.3 10.7 19.6 16.1 30.2 16.1 16.3 0 34.4-9.4 35.1-26.6 1-21.7-14.8-27.2-30.6-30.1zm-67 55.5h22.4V79.7h-22.4v88.8zM728 79.7h-33.2V117l22.1 19.9v-36.2h11.8c7.5 0 11.2 3.6 11.2 9.4v27.7c0 5.8-3.5 9.7-11.2 9.7h-34v21.1H728c17.8.1 34.5-8.8 34.5-29.2v-29.8c0-20.8-16.7-29.9-34.5-29.9zm-162.9-1.2c-18.4 0-36.7 10-36.7 30.5v30.3c0 20.3 18.4 30.5 36.9 30.5 18.4 0 36.7-10.2 36.7-30.5V109c0-20.4-18.5-30.5-36.9-30.5zm14.4 60.8c0 6.4-7.2 9.7-14.3 9.7-7.2 0-14.4-3.1-14.4-9.7V109c0-6.5 7-10 14-10 7.3 0 14.7 3.1 14.7 10v30.3zM682.4 109c-.5-20.8-14.7-29.2-33-29.2h-35.5v88.8h22.7v-28.2h4l20.6 28.2h28L665 138.1c10.7-3.4 17.4-12.7 17.4-29.1zm-32.6 12h-13.2v-20.3h13.2c14.1 0 14.1 20.3 0 20.3z"/></svg>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
BIN
installer_assets/appIcon.icns
Normal file
BIN
installer_assets/appIcon.ico
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
installer_assets/appIcon.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
257
installer_assets/installer.xml
Normal file
@@ -0,0 +1,257 @@
|
||||
<project>
|
||||
<shortName>PreMiD</shortName>
|
||||
<fullName>PreMiD</fullName>
|
||||
<version>{{VERSION}}</version>
|
||||
<installerFilename>${product_fullname}-${product_version}-installer_64bit.${platform_exec_suffix}</installerFilename>
|
||||
<wrapLicenseFileText>0</wrapLicenseFileText>
|
||||
<logoImage>../installer_assets/appIcon.png</logoImage>
|
||||
<osxApplicationBundleIcon>../installer_assets/appIcon.icns</osxApplicationBundleIcon>
|
||||
<componentList>
|
||||
<component>
|
||||
<name>default</name>
|
||||
<description>Default Component</description>
|
||||
<canBeEdited>1</canBeEdited>
|
||||
<selected>1</selected>
|
||||
<show>1</show>
|
||||
<folderList>
|
||||
<folder>
|
||||
<description>Program Files</description>
|
||||
<destination>${installdir}</destination>
|
||||
<name>programfiles</name>
|
||||
<platforms>all</platforms>
|
||||
<distributionFileList>
|
||||
<distributionFile>
|
||||
<origin>update.ini</origin>
|
||||
</distributionFile>
|
||||
</distributionFileList>
|
||||
</folder>
|
||||
<folder>
|
||||
<description>Program Files</description>
|
||||
<destination>${installdir}</destination>
|
||||
<name>programfileslinux</name>
|
||||
<platforms>linux</platforms>
|
||||
</folder>
|
||||
<folder>
|
||||
<description>Program Files</description>
|
||||
<destination>${installdir}</destination>
|
||||
<name>programfileswindows</name>
|
||||
<platforms>windows</platforms>
|
||||
<distributionFileList>
|
||||
<distributionDirectory allowWildcards="1">
|
||||
<origin>../dist/PACKAGEDNAME/*</origin>
|
||||
</distributionDirectory>
|
||||
<distributionFile>
|
||||
<origin>../installer_assets/appIcon.ico</origin>
|
||||
</distributionFile>
|
||||
<distributionFile>
|
||||
<origin>../installer_assets/updater.exe</origin>
|
||||
</distributionFile>
|
||||
</distributionFileList>
|
||||
</folder>
|
||||
<folder>
|
||||
<description>Program Files</description>
|
||||
<destination>${installdir}</destination>
|
||||
<name>programfilesosx</name>
|
||||
<platforms>osx</platforms>
|
||||
<distributionFileList>
|
||||
<distributionFile>
|
||||
<origin>../installer_assets/updater.app</origin>
|
||||
</distributionFile>
|
||||
<distributionFile>
|
||||
<origin>../dist/PACKAGEDNAME/PreMiD.app</origin>
|
||||
</distributionFile>
|
||||
</distributionFileList>
|
||||
</folder>
|
||||
</folderList>
|
||||
<startMenuShortcutList>
|
||||
<startMenuShortcut>
|
||||
<comment></comment>
|
||||
<name>${product_fullname}</name>
|
||||
<runAsAdmin>0</runAsAdmin>
|
||||
<runInTerminal>0</runInTerminal>
|
||||
<windowsExec>${installdir}/PreMiD.exe</windowsExec>
|
||||
<windowsExecArgs></windowsExecArgs>
|
||||
<windowsIcon></windowsIcon>
|
||||
<windowsPath>${installdir}/</windowsPath>
|
||||
</startMenuShortcut>
|
||||
</startMenuShortcutList>
|
||||
</component>
|
||||
</componentList>
|
||||
<preInstallationActionList>
|
||||
<kill>
|
||||
<abortOnError>0</abortOnError>
|
||||
<name>${product_fullname}.exe</name>
|
||||
<progressText>Killing ${product_fullname}</progressText>
|
||||
<showMessageOnError>0</showMessageOnError>
|
||||
<ruleList>
|
||||
<platformTest>
|
||||
<type>windows</type>
|
||||
</platformTest>
|
||||
</ruleList>
|
||||
</kill>
|
||||
<runProgram>
|
||||
<program>pkill</program>
|
||||
<programArguments>PreMiD</programArguments>
|
||||
<runAs>${env(USER)}</runAs>
|
||||
<useMSDOSPath>0</useMSDOSPath>
|
||||
<workingDirectory>${installdir}/</workingDirectory>
|
||||
<ruleList>
|
||||
<platformTest>
|
||||
<type>osx</type>
|
||||
</platformTest>
|
||||
<processTest>
|
||||
<logic>is_running</logic>
|
||||
<name>PreMiD</name>
|
||||
</processTest>
|
||||
</ruleList>
|
||||
</runProgram>
|
||||
<runProgram>
|
||||
<program>${windows_folder_local_appdata}\premid\Update.exe</program>
|
||||
<programArguments>--uninstall</programArguments>
|
||||
<onErrorActionList>
|
||||
<deleteFile>
|
||||
<matchHiddenFiles>1</matchHiddenFiles>
|
||||
<path>${windows_folder_local_appdata}\premid</path>
|
||||
</deleteFile>
|
||||
</onErrorActionList>
|
||||
<ruleList>
|
||||
<platformTest>
|
||||
<type>windows</type>
|
||||
</platformTest>
|
||||
<fileExists>
|
||||
<path>${windows_folder_local_appdata}\premid\PreMiD.exe</path>
|
||||
</fileExists>
|
||||
</ruleList>
|
||||
</runProgram>
|
||||
<runProgram>
|
||||
<program>${windows_folder_common_appdata}\${system_username}\premid\Update.exe</program>
|
||||
<programArguments>--uninstall</programArguments>
|
||||
<onErrorActionList>
|
||||
<deleteFile>
|
||||
<matchHiddenFiles>1</matchHiddenFiles>
|
||||
<path>${windows_folder_common_appdata}\${system_username}\premid</path>
|
||||
</deleteFile>
|
||||
</onErrorActionList>
|
||||
<ruleList>
|
||||
<platformTest>
|
||||
<type>windows</type>
|
||||
</platformTest>
|
||||
<fileExists>
|
||||
<path>${windows_folder_common_appdata}\${system_username}\premid\PreMiD.exe</path>
|
||||
</fileExists>
|
||||
</ruleList>
|
||||
</runProgram>
|
||||
</preInstallationActionList>
|
||||
<postInstallationActionList>
|
||||
<runProgram>
|
||||
<abortOnError>0</abortOnError>
|
||||
<program>PreMiD.exe</program>
|
||||
<programArguments>&</programArguments>
|
||||
<progressText>Launching PreMiD</progressText>
|
||||
<show>0</show>
|
||||
<showMessageOnError>0</showMessageOnError>
|
||||
<workingDirectory>${installdir}</workingDirectory>
|
||||
<ruleList>
|
||||
<platformTest>
|
||||
<type>windows</type>
|
||||
</platformTest>
|
||||
</ruleList>
|
||||
</runProgram>
|
||||
<setInstallerVariableFromRegEx show="0">
|
||||
<name>escaped_installdir</name>
|
||||
<pattern> </pattern>
|
||||
<substitution>\\ </substitution>
|
||||
<text>${installdir}</text>
|
||||
</setInstallerVariableFromRegEx>
|
||||
<runProgram>
|
||||
<program>open</program>
|
||||
<programArguments> ${escaped_installdir}/PreMiD.app</programArguments>
|
||||
<progressText>Launching PreMiD</progressText>
|
||||
<runAs>${env(USER)}</runAs>
|
||||
<useMSDOSPath>0</useMSDOSPath>
|
||||
<workingDirectory>${installdir}/</workingDirectory>
|
||||
<ruleList>
|
||||
<platformTest>
|
||||
<type>osx</type>
|
||||
</platformTest>
|
||||
</ruleList>
|
||||
</runProgram>
|
||||
<deleteFile>
|
||||
<path>${installdir}/update</path>
|
||||
</deleteFile>
|
||||
<addDirectoriesToUninstaller>
|
||||
<addContents>1</addContents>
|
||||
<files>${installdir}</files>
|
||||
</addDirectoriesToUninstaller>
|
||||
<deleteFile>
|
||||
<path>${windows_folder_local_appdata}\premid</path>
|
||||
<ruleList>
|
||||
<platformTest>
|
||||
<type>windows</type>
|
||||
</platformTest>
|
||||
</ruleList>
|
||||
</deleteFile>
|
||||
</postInstallationActionList>
|
||||
<preUninstallationActionList>
|
||||
<kill>
|
||||
<abortOnError>0</abortOnError>
|
||||
<name>${product_fullname}.exe</name>
|
||||
<progressText>Killing ${product_fullname}</progressText>
|
||||
<showMessageOnError>0</showMessageOnError>
|
||||
<ruleList>
|
||||
<platformTest>
|
||||
<type>windows</type>
|
||||
</platformTest>
|
||||
</ruleList>
|
||||
</kill>
|
||||
<runProgram>
|
||||
<program>pkill</program>
|
||||
<programArguments>PreMiD</programArguments>
|
||||
<runAs>${env(USER)}</runAs>
|
||||
<useMSDOSPath>0</useMSDOSPath>
|
||||
<workingDirectory>${installdir}/</workingDirectory>
|
||||
<ruleList>
|
||||
<platformTest>
|
||||
<type>osx</type>
|
||||
</platformTest>
|
||||
<processTest>
|
||||
<logic>is_running</logic>
|
||||
<name>PreMiD</name>
|
||||
</processTest>
|
||||
</ruleList>
|
||||
</runProgram>
|
||||
<deleteFile>
|
||||
<path>${installdir}/update/</path>
|
||||
</deleteFile>
|
||||
<deleteFile>
|
||||
<matchHiddenFiles>1</matchHiddenFiles>
|
||||
<path>${windows_folder_appdata}/${product_fullname}</path>
|
||||
</deleteFile>
|
||||
</preUninstallationActionList>
|
||||
<defaultInstallationMode>unattended</defaultInstallationMode>
|
||||
<enableRollback>0</enableRollback>
|
||||
<enableTimestamp>1</enableTimestamp>
|
||||
<installationScope>user</installationScope>
|
||||
<overwritePolicy>onlyIfNewer</overwritePolicy>
|
||||
<osxApplicationBundleIdentifier>eu.Timeraa.PreMiD</osxApplicationBundleIdentifier>
|
||||
<outputDirectory>../dist/installer</outputDirectory>
|
||||
<productDisplayIcon>${installdir}/appIcon.ico</productDisplayIcon>
|
||||
<saveRelativePaths>1</saveRelativePaths>
|
||||
<unattendedModeUI>minimal</unattendedModeUI>
|
||||
<vendor>Timeraa</vendor>
|
||||
<windowsExecutableIcon>../installer_assets/appIcon.ico</windowsExecutableIcon>
|
||||
<parameterList>
|
||||
<directoryParameter>
|
||||
<name>installdir</name>
|
||||
<description>Installer.Parameter.installdir.description</description>
|
||||
<explanation>Installer.Parameter.installdir.explanation</explanation>
|
||||
<value></value>
|
||||
<default>${platform_install_prefix}/${product_shortname}</default>
|
||||
<allowEmptyValue>0</allowEmptyValue>
|
||||
<cliOptionName>prefix</cliOptionName>
|
||||
<mustBeWritable>1</mustBeWritable>
|
||||
<mustExist>0</mustExist>
|
||||
<width>40</width>
|
||||
</directoryParameter>
|
||||
</parameterList>
|
||||
</project>
|
||||
6
installer_assets/update.ini
Normal file
@@ -0,0 +1,6 @@
|
||||
[Update]
|
||||
|
||||
url=https://api.premid.app/app/update/64bit/
|
||||
version_id= ?
|
||||
check_for_updates=1
|
||||
update_download_location=${installer_directory}/update
|
||||
11
installer_assets/updater.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<autoUpdateProject>
|
||||
<fullName>PreMiD</fullName>
|
||||
<shortName>PreMiD</shortName>
|
||||
<vendor>Timeraa</vendor>
|
||||
<version>2.0</version>
|
||||
<singleInstanceCheck>1</singleInstanceCheck>
|
||||
<requestedExecutionLevel>asInvoker</requestedExecutionLevel>
|
||||
<enableSslSupport>1</enableSslSupport>
|
||||
<outputDirectory>./</outputDirectory>
|
||||
<installerFilename>updater.${platform_exec_suffix}</installerFilename>
|
||||
</autoUpdateProject>
|
||||
|
Before Width: | Height: | Size: 16 KiB |
2941
package-lock.json
generated
61
package.json
@@ -1,24 +1,51 @@
|
||||
{
|
||||
"name": "yt_presence",
|
||||
"productName": "YT Presence",
|
||||
"version": "1.0.0",
|
||||
"description": "YT Presence adds cool Features to YouTube/YouTube Music. Like for example Discord Rich Presence integration, Media controls and much more.",
|
||||
"main": "index.js",
|
||||
"repository": "Timeraa/YT-Presence",
|
||||
"name": "premid",
|
||||
"productName": "PreMiD",
|
||||
"description": "Discord Rich Presence for websites.",
|
||||
"version": "2.0.3",
|
||||
"repository": "https://github.com/PreMiD/PreMiD",
|
||||
"scripts": {
|
||||
"start": "electron src/.",
|
||||
"pkgmac": "electron-packager ./src/ --out=./out/ --asar --overwrite --icon=./appIcon.ico --osx-sign.identity='Florian Metz'",
|
||||
"pkgwin": "electron-packager ./src/ --out=./out/ --overwrite --icon=./appIcon.ico",
|
||||
"installer-mac": "npm run pkgmac && electron-installer-dmg ./out/YT\\ Presence-darwin-x64/YT\\ Presence.app YT\\ Presence\\ Installer --overwrite --icon=./appIcon.icns --out=./dist",
|
||||
"installer-win": "npm run pkgwin && node createInstaller"
|
||||
"init": "tsc && tsc pkg devMode && node devMode.js compile",
|
||||
"start": "electron dist/app/.",
|
||||
"dev": "node devMode.js",
|
||||
"pkg": "rimraf dist && tsc && node devMode compile && cd dist/app/ && yarn && cd ../../ && node pkg",
|
||||
"deploy": "tsc .github/deploy && cd .github && node deploy.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Timeraa",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"electron-installer-dmg": "^1.0.0",
|
||||
"electron-installer-windows": "^1.1.0",
|
||||
"electron-packager": "^12.2.0",
|
||||
"electron-winstaller": "^2.7.0"
|
||||
"@types/archiver": "3.0.0",
|
||||
"@types/auto-launch": "5.0.1",
|
||||
"@types/discord-rpc": "3.0.2",
|
||||
"@types/electron-packager": "14.0.0",
|
||||
"@types/fs-extra": "8.0.1",
|
||||
"@types/ini": "1.3.30",
|
||||
"@types/node": "^12.11.7",
|
||||
"@types/prompts": "2.0.2",
|
||||
"@types/request-promise-native": "1.0.17",
|
||||
"@types/rimraf": "2.0.3",
|
||||
"@types/socket.io": "2.1.4",
|
||||
"@types/ssh2-sftp-client": "4.1.0",
|
||||
"archiver": "3.1.1",
|
||||
"chalk": "2.4.2",
|
||||
"electron": "7.0.0",
|
||||
"electron-packager": "14.0.6",
|
||||
"fast-glob": "3.1.0",
|
||||
"fs-extra": "8.1.0",
|
||||
"ini": "1.3.5",
|
||||
"nodemon": "1.19.4",
|
||||
"ora": "4.0.2",
|
||||
"prompts": "2.2.1",
|
||||
"rimraf": "3.0.0",
|
||||
"source-map-support": "0.5.13",
|
||||
"ssh2-sftp-client": "4.2.2",
|
||||
"typescript": "3.6.4",
|
||||
"yarn": "^1.19.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"auto-launch": "5.0.5",
|
||||
"discord-rpc": "github:discordjs/RPC",
|
||||
"electron-store": "5.0.0",
|
||||
"socket.io": "2.3.0",
|
||||
"sudo-prompt": "9.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
233
pkg.ts
Normal file
@@ -0,0 +1,233 @@
|
||||
import * as electronPackager from "electron-packager";
|
||||
import { platform, arch } from "os";
|
||||
import { existsSync, readFileSync, writeFileSync } from "fs";
|
||||
import { resolve } from "path";
|
||||
import { exec } from "child_process";
|
||||
import { removeSync, ensureDirSync } from "fs-extra";
|
||||
import { parse, stringify } from "ini";
|
||||
import * as prompts from "prompts";
|
||||
import * as ora from "ora";
|
||||
|
||||
(async () => {
|
||||
let response = {
|
||||
os: "current",
|
||||
arch: "all",
|
||||
installer: false
|
||||
};
|
||||
|
||||
if (process.env.NODE_ENV !== "DePloY")
|
||||
response = await prompts([
|
||||
{
|
||||
type: "select",
|
||||
name: "arch",
|
||||
message: "What architecture?",
|
||||
choices: [
|
||||
{
|
||||
title: "current",
|
||||
value: "current"
|
||||
},
|
||||
{
|
||||
title: "all",
|
||||
value: "all"
|
||||
},
|
||||
{
|
||||
title: "arm64",
|
||||
value: "arm64"
|
||||
},
|
||||
{
|
||||
title: "armv7l",
|
||||
value: "armv7l"
|
||||
},
|
||||
{
|
||||
title: "ia32",
|
||||
value: "ia32"
|
||||
},
|
||||
{
|
||||
title: "mips64el",
|
||||
value: "mips64el"
|
||||
},
|
||||
{
|
||||
title: "x64",
|
||||
value: "x64"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: "select",
|
||||
name: "os",
|
||||
message: "What operating system?",
|
||||
choices: [
|
||||
{
|
||||
title: "current",
|
||||
value: "current"
|
||||
},
|
||||
{
|
||||
title: "all",
|
||||
value: "all"
|
||||
},
|
||||
{
|
||||
title: "darwin",
|
||||
value: "darwin"
|
||||
},
|
||||
{
|
||||
title: "linux",
|
||||
value: "linux"
|
||||
},
|
||||
{
|
||||
title: "mas",
|
||||
value: "mas"
|
||||
},
|
||||
{
|
||||
title: "win32",
|
||||
value: "win32"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: "confirm",
|
||||
name: "installer",
|
||||
message: "With installer?"
|
||||
}
|
||||
]);
|
||||
|
||||
//#region WIP
|
||||
let installerXml = readFileSync(`installer_assets/installer.xml`, "utf-8");
|
||||
|
||||
installerXml = installerXml.replace(
|
||||
"{{VERSION}}",
|
||||
require("./package.json").version
|
||||
);
|
||||
installerXml = installerXml.replace(
|
||||
/(PACKAGEDNAME)/g,
|
||||
`PreMiD-${platform()}-${arch()}`
|
||||
);
|
||||
|
||||
ensureDirSync("tmp");
|
||||
writeFileSync("tmp/installer.xml", installerXml);
|
||||
//#endregion
|
||||
|
||||
if (!response.os) {
|
||||
process.exit();
|
||||
return;
|
||||
}
|
||||
|
||||
let icon: string;
|
||||
|
||||
if (
|
||||
response.os == "darwin" ||
|
||||
(response.os === "current" && platform() === "darwin")
|
||||
)
|
||||
icon = "./installer_assets/appIcon.icns";
|
||||
if (["ia32", "x64"].includes(response.arch) || platform() === "win32")
|
||||
icon = "./installer_assets/appIcon.ico";
|
||||
|
||||
if (existsSync("./dist/app/update.ini")) removeSync("./dist/app/update.ini");
|
||||
if (existsSync("./dist/app/updater.app"))
|
||||
removeSync("./dist/app/updater.app");
|
||||
if (existsSync("./dist/app/updater.exe"))
|
||||
removeSync("./dist/app/updater.exe");
|
||||
|
||||
let spinner = ora("Packaging app").start(),
|
||||
packagingOptions: electronPackager.Options = {
|
||||
dir: "./dist/app",
|
||||
out: "./dist",
|
||||
darwinDarkModeSupport: true,
|
||||
icon: icon,
|
||||
overwrite: true,
|
||||
quiet: true,
|
||||
appBundleId: "eu.Timeraa.PreMiD",
|
||||
appCategoryType: "Utilities",
|
||||
appCopyright: `Timeraa 2018-${new Date().getFullYear()}`,
|
||||
prune: true,
|
||||
// @ts-ignore
|
||||
arch: response.arch,
|
||||
// @ts-ignore
|
||||
platform: response.os
|
||||
};
|
||||
|
||||
if (response.arch === "current") delete packagingOptions.arch;
|
||||
if (response.os === "current") delete packagingOptions.platform;
|
||||
|
||||
// @ts-ignore
|
||||
electronPackager(packagingOptions).then(() => {
|
||||
if (!response.installer) {
|
||||
spinner.text = "Done!";
|
||||
spinner.succeed();
|
||||
process.exit();
|
||||
return;
|
||||
}
|
||||
|
||||
let versionId = "0" + require("./package.json").version.replace(/[.]/g, ""),
|
||||
updateIni = parse(readFileSync("./installer_assets/update.ini", "utf-8"));
|
||||
|
||||
updateIni.Update.version_id = versionId;
|
||||
|
||||
ensureDirSync("./tmp");
|
||||
writeFileSync("./tmp/update.ini", stringify(updateIni));
|
||||
|
||||
let bitRockBuilder = "",
|
||||
bitRockUpdater = "";
|
||||
|
||||
if (platform() === "win32") {
|
||||
bitRockBuilder = resolve(
|
||||
"C:/Program Files (x86)/BitRock InstallBuilder Enterprise 19.8.0/bin/builder-cli.exe"
|
||||
);
|
||||
bitRockUpdater = resolve(
|
||||
"C:/Program Files (x86)/BitRock InstallBuilder Enterprise 19.8.0/autoupdate/bin/customize.exe"
|
||||
);
|
||||
}
|
||||
|
||||
if (platform() === "darwin") {
|
||||
bitRockBuilder = resolve(
|
||||
"/Applications/Installbuilder/bin/Builder.app/Contents/MacOS/installbuilder.sh"
|
||||
);
|
||||
bitRockUpdater = resolve(
|
||||
"/Applications/Installbuilder/autoupdate/bin/customize.sh"
|
||||
);
|
||||
}
|
||||
|
||||
if (!existsSync(bitRockBuilder) || !existsSync(bitRockUpdater)) {
|
||||
spinner.fail("Bitrock installation not found.");
|
||||
process.exit();
|
||||
return;
|
||||
}
|
||||
|
||||
spinner.text = "Building updater";
|
||||
|
||||
let updater = exec(
|
||||
`"${bitRockUpdater}" build installer_assets/updater.xml ${
|
||||
platform() === "win32" ? "windows" : "osx"
|
||||
}`
|
||||
);
|
||||
|
||||
updater.once("exit", (code, signal) => {
|
||||
if (![0, 1].includes(code)) {
|
||||
spinner.fail(`Updater failed with code ${code}: ${signal}`);
|
||||
process.exit();
|
||||
return;
|
||||
}
|
||||
|
||||
spinner.text = "Building installer";
|
||||
let builder = exec(
|
||||
`"${bitRockBuilder}" build tmp/installer.xml ${
|
||||
platform() === "win32" ? "windows" : "osx"
|
||||
}`
|
||||
);
|
||||
|
||||
builder.once("exit", code => {
|
||||
removeSync("./tmp");
|
||||
|
||||
if (code !== 0) {
|
||||
spinner.fail(`Error code: ${code}`);
|
||||
process.exit();
|
||||
return;
|
||||
}
|
||||
|
||||
spinner.text = "Done!";
|
||||
spinner.succeed();
|
||||
process.exit();
|
||||
return;
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
Before Width: | Height: | Size: 379 B |
|
Before Width: | Height: | Size: 660 B |
|
Before Width: | Height: | Size: 120 KiB |
BIN
src/assets/tray/Icon@2x.png
Normal file
|
After Width: | Height: | Size: 986 B |
BIN
src/assets/tray/Icon@2xTemplate.png
Normal file
|
After Width: | Height: | Size: 986 B |
BIN
src/assets/tray/IconTemplate.png
Normal file
|
After Width: | Height: | Size: 880 B |
BIN
src/assets/tray/icon.png
Normal file
|
After Width: | Height: | Size: 880 B |
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"yt_client_id": "463097721130188830",
|
||||
"ytm_client_id": "463151177836658699",
|
||||
"nflix_client_id": "499981204045430784",
|
||||
"twitch_client_id": "501021996336021504",
|
||||
"scloud_client_id": "501021185887436810",
|
||||
"version": "1.1",
|
||||
"devBuild": false
|
||||
}
|
||||
138
src/index.js
@@ -1,138 +0,0 @@
|
||||
//* Handle Winstall
|
||||
require('./util/handleWinstall')
|
||||
|
||||
//#region Define constants
|
||||
//* Declare needed constants
|
||||
const {app} = require('electron')
|
||||
|
||||
const AutoLaunch = require('auto-launch')
|
||||
//* Require config
|
||||
const config = require('./config.json');
|
||||
const constants = require('./util/constants')
|
||||
//* Require electron-config
|
||||
const os = require('os')
|
||||
//* Update constant in file
|
||||
constants.platform = os.platform()
|
||||
//* Require Update checker
|
||||
const updater = require('./util/updateChecker')
|
||||
//* Require Needed packages
|
||||
const chalk = require("chalk")
|
||||
//* Setup electron-config
|
||||
const Config = require('electron-config');
|
||||
//#endregion
|
||||
|
||||
//* Required for Windows Push notifications
|
||||
app.setAppUserModelId("eu.Timeraa.yt_presence")
|
||||
|
||||
global.UPDATEAVAIABLE = ""
|
||||
global.VERSION = config.version
|
||||
if(config.devBuild) {
|
||||
global.VERSIONSTRING = VERSION + "-DEV"
|
||||
} else {
|
||||
global.VERSIONSTRING = VERSION
|
||||
}
|
||||
|
||||
global.BROWSERCONNECTIONSTATE = "NOT_CONNECTED"
|
||||
global.EXTENSIONSOCKET = null
|
||||
|
||||
//* YTM global vars
|
||||
global.CURRENTSONGTITLE = ""
|
||||
global.CURRENTSONGAUTHORS = []
|
||||
global.CURRENTSONGAUTHORSSTRING = ""
|
||||
global.CURRENTSONGSTARTTIME = ""
|
||||
global.CURRENTSONGSTARTTIMESECONDS = ""
|
||||
global.CURRENTSONGENDTIME = ""
|
||||
global.CONSOLEPREFIX = chalk.bold(chalk.bgHex('#db0918')(chalk.hex('#000000')(" Y") + chalk.hex('#ffffff')("T "))) + chalk.cyan(" Presence") + chalk.hex('#ffffff')(": ")
|
||||
global.YTRPCREADY = false
|
||||
global.YTMRPCREADY = false
|
||||
global.NFLIXRPCREADY = false
|
||||
global.TWITCHRPCREADY = false
|
||||
global.SCLOUDRPCREADY = false
|
||||
|
||||
global.YTRPC = null
|
||||
global.YTMRPC = null
|
||||
global.NFLIXRPC = null
|
||||
global.TWITCHRPC = null
|
||||
global.SCLOUDRPC = null
|
||||
global.TRAY = null
|
||||
|
||||
|
||||
//* Clear console
|
||||
process.stdout.write("\u001b[2J\u001b[0;0H");
|
||||
|
||||
//* Single Instance Check
|
||||
var iShouldQuit = app.makeSingleInstance(() => {return true});
|
||||
|
||||
if(iShouldQuit){
|
||||
console.log(CONSOLEPREFIX + chalk.red("App already running, closing current instance..."))
|
||||
app.quit();
|
||||
return;
|
||||
}
|
||||
|
||||
const userSettings = new Config({
|
||||
name: "userSettings"
|
||||
});
|
||||
|
||||
//* Set default values for electon-config userSettings
|
||||
if(userSettings.get('enabled') == undefined) userSettings.set('enabled', true)
|
||||
if(userSettings.get('youTube') == undefined) userSettings.set('youTube', true)
|
||||
if(userSettings.get('youTubeMusic') == undefined) userSettings.set('youTubeMusic', true)
|
||||
if(userSettings.get('netflix') == undefined) userSettings.set('netflix', true)
|
||||
if(userSettings.get('twitch') == undefined) userSettings.set('twitch', true)
|
||||
if(userSettings.get('soundcloud') == undefined) userSettings.set('soundcloud', true)
|
||||
if(userSettings.get('titleMenubar') == undefined) userSettings.set('titleMenubar', true)
|
||||
if(userSettings.get('autoUpdateCheck') == undefined) userSettings.set('autoUpdateCheck', true)
|
||||
|
||||
|
||||
//* Set dock Badge to version
|
||||
if(constants.platform == "darwin") {
|
||||
app.dock.setBadge("V" + VERSION)
|
||||
}
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.yellow("Loading..."))
|
||||
|
||||
//* App ready
|
||||
const appReady = () => {
|
||||
//* Setup MenuBar
|
||||
require('./tray/createTray').run()
|
||||
//* Require shortcuts
|
||||
require('./util/shortcutHandler')
|
||||
//* Include PresenceHandler
|
||||
require('./presenceHandler.js')
|
||||
|
||||
//* Automatically check for update
|
||||
if(userSettings.get('autoUpdateCheck') == true)
|
||||
updater.checkForUpdate(true)
|
||||
|
||||
//* hide Dock icon when everything running
|
||||
if(constants.platform == "darwin") {
|
||||
app.dock.hide()
|
||||
}
|
||||
|
||||
if(userSettings.get('autoLaunch') == undefined || userSettings.get('autoLaunch') == true) {
|
||||
userSettings.set('autoLaunch', true)
|
||||
//* Add App to AutoLaunch
|
||||
console.log(CONSOLEPREFIX + chalk.yellow("Adding App to autostart..."))
|
||||
let autoLaunch = new AutoLaunch({
|
||||
name: 'YT Presence',
|
||||
path: app.getPath('exe'),
|
||||
isHidden: true
|
||||
});
|
||||
|
||||
//* Enable AutoLaunch if disabled
|
||||
autoLaunch.isEnabled().then(async (isEnabled) => {
|
||||
if (!isEnabled) autoLaunch.enable();
|
||||
console.log(CONSOLEPREFIX + chalk.green("Added App to autostart."))
|
||||
})
|
||||
//* Catch error
|
||||
.catch(function(err) {
|
||||
console.log(CONSOLEPREFIX + chalk.red("Error while adding App to autostart."))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//* Register Handler
|
||||
app.on('ready', appReady);
|
||||
|
||||
//* Prevent default behaviour
|
||||
app.on('window-all-closed', () => {});
|
||||
45
src/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { app, dialog } from "electron";
|
||||
//* Source .map support if devEnv
|
||||
if (!app.isPackaged) require("source-map-support").install();
|
||||
|
||||
import { init as initSocket, socket } from "./managers/socketManager";
|
||||
import { init as initTray } from "./managers/trayManager";
|
||||
import { update as initAutoLaunch } from "./managers/launchManager";
|
||||
import { platform } from "os";
|
||||
import { checkForUpdate } from "./util/updateChecker";
|
||||
|
||||
//* Define and set it to null
|
||||
//* Set AppUserModelId for task manager etc
|
||||
//* When app is ready
|
||||
export let updateCheckerInterval = null;
|
||||
app.setAppUserModelId("Timeraa.PreMiD");
|
||||
app.whenReady().then(async () => {
|
||||
//* Init auto launch
|
||||
//* Check for updates > Update and relaunch
|
||||
//* Init socket
|
||||
//* init application tray icon
|
||||
//* If app is packaged, run an update check every 15 mins
|
||||
initAutoLaunch();
|
||||
await checkForUpdate(true);
|
||||
await initSocket();
|
||||
await initTray();
|
||||
app.isPackaged
|
||||
? (updateCheckerInterval = setInterval(checkForUpdate, 15 * 1000 * 60))
|
||||
: undefined;
|
||||
if (platform() === "darwin") app.dock.hide();
|
||||
});
|
||||
|
||||
//* If second instance started, close old one
|
||||
app.on("second-instance", app.quit);
|
||||
|
||||
//* Send errors from app to extension
|
||||
process.on("unhandledRejection", rejection => {
|
||||
console.log(rejection);
|
||||
socket.emit("unhandledRejection", rejection);
|
||||
});
|
||||
|
||||
// TODO Find better way to log
|
||||
process.on("uncaughtException", err => {
|
||||
dialog.showErrorBox(err.name, err.stack);
|
||||
app.exit(0);
|
||||
});
|
||||
118
src/managers/discordManager.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
import { Client } from "discord-rpc";
|
||||
import { app } from "electron";
|
||||
import { platform } from "os";
|
||||
import { tray } from "./trayManager";
|
||||
import { info } from "../util/debug";
|
||||
|
||||
//* Import custom types
|
||||
import Presence from "../../@types/PreMiD/Presence";
|
||||
import PresenceData from "../../@types/PreMiD/PresenceData";
|
||||
|
||||
//* Define Presence array
|
||||
let loggedInPresences: Array<Presence> = [];
|
||||
|
||||
/**
|
||||
* Sets the user's activity
|
||||
* @param presence PresenceData to set activity
|
||||
*/
|
||||
export function setActivity(presence: PresenceData) {
|
||||
//* If platform is darwin (Mac OS) set trayTitle if theres one
|
||||
//* Check if theres an active RPC connection that we can use
|
||||
//* If we have one, use it
|
||||
//* Else create one and use it
|
||||
//* Show debug
|
||||
if (platform() === "darwin" && presence.trayTitle)
|
||||
tray.setTitle(presence.trayTitle);
|
||||
let rpc = loggedInPresences.find(p => p.clientId === presence.clientId);
|
||||
if (rpc) rpc.rpc.setActivity(presence.presenceData).catch(destroy);
|
||||
else
|
||||
loginPresence(presence.clientId).then(p =>
|
||||
p.rpc.setActivity(presence.presenceData).catch(destroy)
|
||||
);
|
||||
info("setActivity");
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear a user's activity
|
||||
* @param clientId clientId of presence to clear
|
||||
*/
|
||||
export function clearActivity(clientId: string = undefined) {
|
||||
//* Clear tray title
|
||||
//* If clientId set
|
||||
//* Else map through presences and clear them
|
||||
//* Show Debug
|
||||
if (platform() === "darwin") tray.setTitle("");
|
||||
if (clientId) {
|
||||
//* Check if this presence is logged in
|
||||
//* If it is clear its activity
|
||||
//* Return to prevent further actions
|
||||
let pTC = loggedInPresences.find(p => p.clientId === clientId);
|
||||
if (pTC) pTC.rpc.clearActivity().catch(destroy);
|
||||
return;
|
||||
}
|
||||
loggedInPresences.map(p => p.rpc.clearActivity().catch(destroy));
|
||||
info("clearActivity");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create RPC connection to discord
|
||||
* @param clientId client ID of presence
|
||||
*/
|
||||
function loginPresence(clientId: string) {
|
||||
//* Return promise that will resolve to either Presence or null
|
||||
return new Promise<Presence>((resolve, reject) => {
|
||||
//* Create presence object
|
||||
//* Add presence to object
|
||||
//* Try login with client id
|
||||
//* Once RPC connection is ready
|
||||
//* Destroy all clients when Discord closed (My issue #42)
|
||||
let presence: Presence = {
|
||||
clientId: clientId,
|
||||
rpc: new Client({ transport: "ipc" }),
|
||||
ready: false
|
||||
};
|
||||
loggedInPresences.push(presence);
|
||||
presence.rpc.login({ clientId: clientId }).catch(() => {
|
||||
//* If couldn't log in remove it from loggedInPresences
|
||||
//* Reject promise
|
||||
loggedInPresences = loggedInPresences.filter(
|
||||
p => p.clientId !== presence.clientId
|
||||
);
|
||||
reject();
|
||||
});
|
||||
presence.rpc.once("ready", () => {
|
||||
//* Update status
|
||||
//* Resolve with presence
|
||||
presence.ready = true;
|
||||
resolve(presence);
|
||||
});
|
||||
// @ts-ignore
|
||||
presence.rpc.once("disconnected", destroy);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys all rpc connections
|
||||
*/
|
||||
export function destroy() {
|
||||
//* Clear tray title
|
||||
//* Map through loggedInPresences and destroy their rpcs
|
||||
//* Set loggedInPresences to new Array
|
||||
//* Return the promise
|
||||
if (platform() === "darwin" && typeof tray !== "undefined") tray.setTitle("");
|
||||
let res = Promise.all(
|
||||
loggedInPresences.map((presence: Presence) =>
|
||||
presence.rpc.destroy().catch(() => {})
|
||||
)
|
||||
);
|
||||
loggedInPresences = [];
|
||||
return res;
|
||||
}
|
||||
|
||||
//* if app will quit
|
||||
app.once("will-quit", () => {
|
||||
//* Show debug
|
||||
//* Destroy all connections
|
||||
info("Closing rpc connections");
|
||||
destroy();
|
||||
});
|
||||
29
src/managers/launchManager.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import AutoLaunch from "auto-launch";
|
||||
import { app } from "electron";
|
||||
import { settings } from "./settingsManager";
|
||||
import { info } from "../util/debug";
|
||||
|
||||
//* Create autoLaunch object
|
||||
let autoLaunch = new AutoLaunch({
|
||||
name: app.name,
|
||||
isHidden: true
|
||||
});
|
||||
|
||||
/**
|
||||
* Updates autoLaunch
|
||||
*/
|
||||
export async function update() {
|
||||
//* If app not packaged return
|
||||
//* Either enable/disable autolaunch
|
||||
if (!app.isPackaged) {
|
||||
//* Show debug
|
||||
//* Return
|
||||
info("Skipping autoLaunch.");
|
||||
return;
|
||||
}
|
||||
if (settings.get("autoLaunch", true))
|
||||
//* Enable if not enabled
|
||||
autoLaunch.enable();
|
||||
//* Disable if enabled
|
||||
else autoLaunch.disable();
|
||||
}
|
||||
77
src/managers/presenceDevManager.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import { readdirSync, readFileSync, unwatchFile, watchFile } from "fs";
|
||||
import { dialog } from "electron";
|
||||
import { socket } from "./socketManager";
|
||||
import { extname } from "path";
|
||||
import { info } from "../util/debug";
|
||||
|
||||
let presenceDevWatchedFiles = [],
|
||||
currWatchPath = "";
|
||||
|
||||
export async function watchDir(path: string) {
|
||||
//* Read dir
|
||||
//* Set currWatchDir
|
||||
//* Set watched files to files
|
||||
//* Add file watcher to each file
|
||||
let files = await readdirSync(path);
|
||||
currWatchPath = path + "/";
|
||||
presenceDevWatchedFiles = files;
|
||||
presenceDevWatchedFiles.map(f => {
|
||||
//* Watch file
|
||||
//* ReadFiles
|
||||
watchFile(currWatchPath + f, { interval: 250 }, async () => {
|
||||
//* Read dir
|
||||
//* ReadFiles
|
||||
files = await readdirSync(path);
|
||||
readFiles(files, path);
|
||||
});
|
||||
});
|
||||
readFiles(files, path);
|
||||
}
|
||||
|
||||
async function readFiles(files, path) {
|
||||
//* Send files to extension
|
||||
socket.emit("localPresence", {
|
||||
files: await Promise.all(
|
||||
files.map(f => {
|
||||
if (extname(f) === ".json")
|
||||
return {
|
||||
file: f,
|
||||
contents: JSON.parse(readFileSync(`${path}/${f}`).toString())
|
||||
};
|
||||
else if (extname(f) === ".js")
|
||||
return {
|
||||
file: f,
|
||||
contents: readFileSync(`${path}/${f}`).toString()
|
||||
};
|
||||
else return;
|
||||
})
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
export async function openFileDialog() {
|
||||
//* Open file dialog
|
||||
//* If user cancels
|
||||
//* Unwatch all still watched files
|
||||
//* Watch directory
|
||||
let filePaths = await dialog.showOpenDialogSync(null, {
|
||||
title: "Select Presence Folder",
|
||||
message:
|
||||
"Please select the folder that contains the presence you want to load.\n(metadata.json, presence.js, iframe.js)",
|
||||
buttonLabel: "Load Presence",
|
||||
properties: ["openDirectory"]
|
||||
});
|
||||
if (typeof filePaths === "undefined") {
|
||||
//* Show debug
|
||||
//* return
|
||||
info("Presence load canceled.");
|
||||
return;
|
||||
}
|
||||
info(`Watching ${filePaths[0]}`);
|
||||
if (presenceDevWatchedFiles.length > 0)
|
||||
await Promise.all(
|
||||
presenceDevWatchedFiles.map(f => unwatchFile(currWatchPath + f))
|
||||
);
|
||||
|
||||
watchDir(filePaths[0]);
|
||||
}
|
||||
33
src/managers/settingsManager.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import ElectronStore from "electron-store";
|
||||
import { tray } from "./trayManager";
|
||||
import { update as updateAutoLaunch } from "./launchManager";
|
||||
import { platform } from "os";
|
||||
import { info } from "../util/debug";
|
||||
|
||||
//* Import custom types
|
||||
import ExtensionSettings from "../../@types/PreMiD/ExtensionSettings";
|
||||
|
||||
//* Export and set default settings
|
||||
export let settings = new ElectronStore({
|
||||
defaults: {
|
||||
autoLaunch: true
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Update settings of app
|
||||
* @param extensionSettings Settings from extension
|
||||
*/
|
||||
export function update(extensionSettings: ExtensionSettings) {
|
||||
//* Show debug
|
||||
//* remove title if disabled
|
||||
//* Update autolaunch if updated
|
||||
//* Save Settings
|
||||
info("Updated settings");
|
||||
if (!extensionSettings.titleMenubar && platform() === "darwin")
|
||||
tray.setTitle("");
|
||||
if (settings.get("autoLaunch") != extensionSettings.autoLaunch) {
|
||||
settings.set("autoLaunch", extensionSettings.autoLaunch);
|
||||
updateAutoLaunch();
|
||||
}
|
||||
}
|
||||
77
src/managers/socketManager.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import socketIo from "socket.io";
|
||||
import { createServer, Server } from "http";
|
||||
import { app, dialog } from "electron";
|
||||
import { success, error } from "../util/debug";
|
||||
import { update as updateSettings } from "./settingsManager";
|
||||
import { openFileDialog } from "./presenceDevManager";
|
||||
import { setActivity, clearActivity, destroy } from "./discordManager";
|
||||
|
||||
export let io: socketIo.Server;
|
||||
export let socket: socketIo.Socket;
|
||||
export let server: Server;
|
||||
|
||||
export function init() {
|
||||
return new Promise(resolve => {
|
||||
//* Create server
|
||||
//* create SocketIo server, don't server client
|
||||
//* Try to listen to port 3020
|
||||
//* If that fails/some other error happens run socketError
|
||||
//* If someone connects to socket socketConnection
|
||||
server = createServer();
|
||||
io = socketIo(server, { serveClient: false });
|
||||
server.listen(3020, () => {
|
||||
//* Resolve promise
|
||||
//* Debug info
|
||||
resolve();
|
||||
success("Opened socket");
|
||||
});
|
||||
server.on("error", socketError);
|
||||
io.on("connection", socketConnection);
|
||||
});
|
||||
}
|
||||
|
||||
function socketConnection(cSocket: socketIo.Socket) {
|
||||
//* Show debug
|
||||
//* Set exported socket letiable to current socket
|
||||
//* Handle setActivity event
|
||||
//* Handle clearActivity event
|
||||
//* Handle settingsUpdate
|
||||
//* Handle presenceDev
|
||||
//* Handle version request
|
||||
//* Once socket user disconnects run cleanup
|
||||
success("Socket connection");
|
||||
socket = cSocket;
|
||||
socket.on("setActivity", setActivity);
|
||||
socket.on("clearActivity", clearActivity);
|
||||
socket.on("settingUpdate", updateSettings);
|
||||
socket.on("selectLocalPresence", openFileDialog);
|
||||
socket.on("getVersion", () =>
|
||||
socket.emit("receiveVersion", app.getVersion().replace(/[\D]/g, ""))
|
||||
);
|
||||
socket.once("disconnect", () => {
|
||||
//* Show debug
|
||||
//* Destroy all open RPC connections
|
||||
error("Socket disconnection.");
|
||||
destroy();
|
||||
});
|
||||
}
|
||||
|
||||
//* Runs on socket errors
|
||||
function socketError(e: any) {
|
||||
//* Show debug
|
||||
//* If port in use
|
||||
error(e.message);
|
||||
if (e.code === "EADDRINUSE") {
|
||||
//* Focus app
|
||||
//* Show error dialog
|
||||
//* Exit app afterwards
|
||||
app.focus();
|
||||
dialog.showErrorBox(
|
||||
"Oh noes! Port error...",
|
||||
`${app.name} could not bind to port ${
|
||||
e.port
|
||||
}.\nIs ${app.name} running already?`
|
||||
);
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
26
src/managers/trayManager.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Menu, Tray } from "electron";
|
||||
import { join } from "path";
|
||||
|
||||
//* Export tray
|
||||
//* Export trayContextMenu
|
||||
export let tray: Tray;
|
||||
export let trayContextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
role: "quit"
|
||||
}
|
||||
]);
|
||||
|
||||
/**
|
||||
* Create tray
|
||||
*/
|
||||
export function init() {
|
||||
//* Return promise resolves to Tray
|
||||
return new Promise<Tray>(function(resolve) {
|
||||
//* Create Tray
|
||||
//* Set its context menu
|
||||
//* Resolve promise
|
||||
tray = new Tray(join(__dirname, "../assets/tray/IconTemplate.png"));
|
||||
tray.setContextMenu(trayContextMenu);
|
||||
resolve(tray);
|
||||
});
|
||||
}
|
||||
5961
src/package-lock.json
generated
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "yt_presence",
|
||||
"productName": "YT Presence",
|
||||
"version": "1.0.0",
|
||||
"description": "YT Presence adds cool Features to YouTube/YouTube Music. Like for example Discord Rich Presence integration, Media controls and much more.",
|
||||
"main": "index.js",
|
||||
"repository": "Timeraa/YT-Presence",
|
||||
"keywords": [],
|
||||
"author": "Timeraa",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"auto-launch": "^5.0.5",
|
||||
"chalk": "^2.4.1",
|
||||
"discord-rpc": "^3.0.1",
|
||||
"electron-config": "^1.0.0",
|
||||
"electron-squirrel-startup": "^1.0.0",
|
||||
"express": "^4.16.3",
|
||||
"html-entities": "^1.2.1",
|
||||
"request": "^2.88.0",
|
||||
"socket.io": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron-prebuilt-compile": "3.0.2"
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
//* Require needed packages
|
||||
const chalk = require("chalk")
|
||||
const express = require("express")
|
||||
var constants = require('./util/constants.js')
|
||||
var extension = express();
|
||||
var http = require('http')
|
||||
var socketServer = http.createServer(extension);
|
||||
var io = require('socket.io')(socketServer);
|
||||
|
||||
//* Load Config
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: "userSettings"
|
||||
});
|
||||
|
||||
//* Define needed variables
|
||||
var keepAliveSwitch = 0,
|
||||
lastKeepAliveSwitch = 0,
|
||||
ytrpcused = false,
|
||||
ytmrpcused = false,
|
||||
nflixrpcused = false,
|
||||
twitchrpcused = false,
|
||||
scloudrpcused = false
|
||||
|
||||
//* Keep alive check to automatically remove presence if browser not running/not using YT
|
||||
setInterval(keepAliveCheck, 1000)
|
||||
|
||||
function keepAliveCheck() {
|
||||
if (lastKeepAliveSwitch > keepAliveSwitch + 10) {
|
||||
TRAY.setTitle("")
|
||||
if (YTMRPCREADY) YTMRPC.clearActivity()
|
||||
if (YTRPCREADY) YTRPC.clearActivity()
|
||||
if (NFLIXRPCREADY) NFLIXRPC.clearActivity()
|
||||
if (TWITCHRPCREADY) TWITCHRPC.clearActivity()
|
||||
if (SCLOUDRPCREADY) SCLOUDRPC.clearActivity()
|
||||
}
|
||||
lastKeepAliveSwitch += 1
|
||||
}
|
||||
|
||||
//* Listen on port 3020
|
||||
socketServer.listen(3020, () => {
|
||||
console.log(CONSOLEPREFIX + chalk.green("Listening on Port 3020"))
|
||||
});
|
||||
|
||||
//* Socket connection event
|
||||
io.on('connection', function (socket) {
|
||||
global.EXTENSIONSOCKET = socket
|
||||
BROWSERCONNECTIONSTATE = "CONNECTED"
|
||||
|
||||
socket.on('playBackChange', (data) => {
|
||||
updatePresence(data, true)
|
||||
})
|
||||
|
||||
socket.on('updateData', (data) => {
|
||||
updatePresence(data)
|
||||
})
|
||||
})
|
||||
|
||||
//* Updates the presence with the incomming data
|
||||
function updatePresence(data, force = false) {
|
||||
lastKeepAliveSwitch = 0
|
||||
if (!userSettings.get('titleMenubar')) constants.tray.setTitle("")
|
||||
|
||||
if (data.yt != undefined) {
|
||||
ytrpcused = true
|
||||
if (userSettings.get('youTube')) require('./presences/YouTube.js')(data, force); else if (YTRPCREADY) YTRPC.clearActivity()
|
||||
} else if (data.ytm != undefined) {
|
||||
ytmrpcused = true
|
||||
if (userSettings.get('youTubeMusic')) require('./presences/YouTube_Music.js')(data, force); else if (YTMRPCREADY) YTMRPC.clearActivity()
|
||||
} else if(data.nflix != undefined) {
|
||||
nflixrpcused = true
|
||||
if (userSettings.get('netflix')) require('./presences/Netflix.js')(data, force); else if (NFLIXRPCREADY) NFLIXRPC.clearActivity()
|
||||
} else if(data.twitch != undefined) {
|
||||
twitchrpcused = true
|
||||
if (userSettings.get('twitch')) require('./presences/Twitch.js')(data, force); else if (TWITCHRPCREADY) TWITCHRPC.clearActivity()
|
||||
} else if(data.scloud != undefined) {
|
||||
scloudrpcused = true
|
||||
if (userSettings.get('soundcloud')) require('./presences/SoundCloud.js')(data, force); else if(SCLOUDRPCREADY) SCLOUDRPC.clearActivity()
|
||||
}
|
||||
|
||||
if (data.yt == undefined && YTRPCREADY) {
|
||||
if (ytrpcused == true) {
|
||||
ytrpcused = false
|
||||
YTRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
}
|
||||
|
||||
if (data.ytm == undefined && YTMRPCREADY) {
|
||||
if (ytmrpcused == true) {
|
||||
ytmrpcused = false
|
||||
YTMRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
}
|
||||
|
||||
if (data.nflix == undefined && NFLIXRPCREADY) {
|
||||
if (nflixrpcused == true) {
|
||||
nflixrpcused = false
|
||||
NFLIXRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
}
|
||||
|
||||
if (data.twitch == undefined && TWITCHRPCREADY) {
|
||||
if (twitchrpcused == true) {
|
||||
twitchrpcused = false
|
||||
TWITCHRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
}
|
||||
|
||||
if (data.scloud == undefined && SCLOUDRPCREADY) {
|
||||
if (scloudrpcused == true) {
|
||||
scloudrpcused = false
|
||||
SCLOUDRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
const DiscordRPC = require('discord-rpc')
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { nflix_client_id } = require("../config.json");
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: 'userSettings'
|
||||
})
|
||||
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
lastVideoTitle = "",
|
||||
videoTitle,
|
||||
videoAuthor,
|
||||
videoStartTime,
|
||||
videoEndTime,
|
||||
seriesTitle
|
||||
|
||||
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
if (force) {
|
||||
if (data.nflix.playback == "paused")
|
||||
updatePresence(seriesTitle, videoAuthor, "pause", "Paused")
|
||||
else if (data.nflix.playback == "playing")
|
||||
updatePresence(seriesTitle, videoAuthor, "play", "Watching", videoStartTime, videoEndTime)
|
||||
} else {
|
||||
updateData(data)
|
||||
|
||||
if ((data.nflix.playback == "playing" && NFLIXRPCREADY) && (videoEndTime != lastEndTime || videoTitle != lastVideoTitle)) {
|
||||
lastVideoTitle = videoTitle
|
||||
lastEndTime = videoEndTime
|
||||
updatePresence(seriesTitle, videoAuthor, "play", "Watching", videoStartTime, videoEndTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) NFLIXRPC.clearActivity()
|
||||
if(data.nflix.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
NFLIXRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
NFLIXRPC.login({ clientId: nflix_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}NFLIXRPC: ${err.message}`))
|
||||
NFLIXRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
NFLIXRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null, endTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(details)); else TRAY.setTitle("");
|
||||
NFLIXRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "nflix_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
endTimestamp: endTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
videoTitle = data.nflix.episodeTitle
|
||||
videoAuthor = data.nflix.season + " - " + data.nflix.episodeTitle
|
||||
videoStartTime = Math.floor(data.nflix.episodeCurrentTime / 1000);
|
||||
videoEndTime = data.nflix.episodeEndTime;
|
||||
seriesTitle = data.nflix.seriesTitle
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
const DiscordRPC = require('discord-rpc')
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { scloud_client_id } = require("../config.json");
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: 'userSettings'
|
||||
})
|
||||
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
lastSongTitle = "",
|
||||
songAuthor,
|
||||
songStartTime,
|
||||
songEndTime,
|
||||
songTitle
|
||||
|
||||
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
if (force) {
|
||||
if (data.scloud.playback == "paused")
|
||||
updatePresence(songTitle, songAuthor, "pause", "Paused")
|
||||
else if (data.scloud.playback == "playing")
|
||||
updatePresence(songTitle, songAuthor, "play", "Playing back.", songStartTime, songEndTime)
|
||||
} else {
|
||||
updateData(data)
|
||||
|
||||
if ((data.scloud.playback == "playing" && SCLOUDRPCREADY) && (songEndTime != lastEndTime || songTitle != lastSongTitle)) {
|
||||
lastSongTitle = songTitle
|
||||
lastEndTime = songEndTime
|
||||
updatePresence(songTitle, songAuthor, "play", "Playing back", songStartTime, songEndTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) SCLOUDRPC.clearActivity()
|
||||
if(data.scloud.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
SCLOUDRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
SCLOUDRPC.login({ clientId: scloud_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}SCLOUDRPC: ${err.message}`))
|
||||
SCLOUDRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
SCLOUDRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null, endTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(details)); else TRAY.setTitle("");
|
||||
SCLOUDRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "scloud_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
endTimestamp: endTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
songAuthor = data.scloud.songAuthor
|
||||
songStartTime = Math.floor(data.scloud.songCurrentTime / 1000);
|
||||
songEndTime = data.scloud.songEndTime;
|
||||
songTitle = data.scloud.songTitle
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
const DiscordRPC = require('discord-rpc')
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { twitch_client_id } = require("../config.json");
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: 'userSettings'
|
||||
})
|
||||
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
laststreamTitle = "",
|
||||
streamTitle,
|
||||
streamHost,
|
||||
videoStartTime
|
||||
|
||||
|
||||
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
if (force) {
|
||||
if (data.twitch.playback == "paused")
|
||||
updatePresence(streamTitle, streamHost, "pause", "Paused")
|
||||
else if (data.twitch.playback == "playing")
|
||||
updatePresence(streamTitle, streamHost, "play", "Watching", videoStartTime)
|
||||
} else {
|
||||
updateData(data)
|
||||
|
||||
if ((data.twitch.playback == "playing" && TWITCHRPCREADY) && streamTitle != laststreamTitle) {
|
||||
laststreamTitle = streamTitle
|
||||
updatePresence(streamTitle, streamHost, "play", "Watching", videoStartTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) TWITCHRPC.clearActivity()
|
||||
if(data.twitch.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
TWITCHRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
TWITCHRPC.login({ clientId: twitch_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}TWITCHRPC: ${err.message}`))
|
||||
TWITCHRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
TWITCHRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(details)); else TRAY.setTitle("");
|
||||
TWITCHRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "twitch_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
streamTitle = data.twitch.streamTitle
|
||||
streamHost = data.twitch.streamHost
|
||||
videoStartTime = Math.floor(data.twitch.watchingSince / 1000);
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
const DiscordRPC = require('discord-rpc')
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { yt_client_id } = require("../config.json");
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: 'userSettings'
|
||||
})
|
||||
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
lastVideoTitle = "",
|
||||
videoTitle,
|
||||
videoAuthor,
|
||||
videoStartTime,
|
||||
videoEndTime
|
||||
|
||||
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
if (force) {
|
||||
if (data.yt.playback == "paused")
|
||||
updatePresence(videoTitle, videoAuthor, "pause", "Playback paused.")
|
||||
else if (data.yt.playback == "playing")
|
||||
updatePresence(videoTitle, videoAuthor, "play", "Playing back.", videoStartTime, videoEndTime)
|
||||
} else {
|
||||
updateData(data)
|
||||
|
||||
if ((data.yt.playback == "playing" && YTRPCREADY) && (videoEndTime != lastEndTime || videoTitle != lastVideoTitle)) {
|
||||
lastVideoTitle = videoTitle
|
||||
lastEndTime = videoEndTime
|
||||
updatePresence(videoTitle, videoAuthor, "play", "Playing back.", videoStartTime, videoEndTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) YTRPC.clearActivity()
|
||||
if(data.yt.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
YTRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
YTRPC.login({ clientId: yt_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}YTRPC: ${err.message}`))
|
||||
YTRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
YTRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null, endTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(details)); else TRAY.setTitle("");
|
||||
YTRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "yt_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
endTimestamp: endTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
videoTitle = data.yt.videoTitle
|
||||
videoAuthor = data.yt.videoAuthor
|
||||
videoStartTime = Math.floor(data.yt.videoCurrentTime / 1000);
|
||||
videoEndTime = data.yt.videoEndTime;
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
const DiscordRPC = require("discord-rpc")
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
|
||||
const { ytm_client_id } = require("../config.json");
|
||||
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({name: 'userSettings'})
|
||||
|
||||
//* Define needed variables
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
songTitle,
|
||||
songAuthorString,
|
||||
songEndTime,
|
||||
songStartTime
|
||||
|
||||
//* Try to connect RPC
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
//* If YTM RPC Ready
|
||||
if(YTMRPCREADY) {
|
||||
//* Is update forced?
|
||||
if (force) {
|
||||
//* Check what playback state and set its Presence
|
||||
if (data.ytm.playback == "paused")
|
||||
updatePresence(songTitle, songAuthorString, "pause", "Playback paused.");
|
||||
else if (data.ytm.playback == "playing")
|
||||
updatePresence(songTitle, songAuthorString, "play", "Playing back.", songStartTime, songEndTime);
|
||||
} else {
|
||||
//* Update Presence data
|
||||
updateData(data)
|
||||
|
||||
//* Only update Presence if time changed
|
||||
if (data.ytm.playback == "playing" && songEndTime != lastEndTime) {
|
||||
lastEndTime = songEndTime
|
||||
updatePresence(songTitle, songAuthorString, "play", "Playing back.", songStartTime, songEndTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) {
|
||||
YTMRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
|
||||
//* Increase pauseChange if paused
|
||||
if(data.ytm.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
YTMRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
YTMRPC.login({ clientId: ytm_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}YTMRPC: ${err.message}`))
|
||||
YTMRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
YTMRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null, endTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(songTitle)); else TRAY.setTitle("");
|
||||
YTMRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "ytm_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
endTimestamp: endTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
songTitle = data.ytm.songTitle
|
||||
var songAuthors = data.ytm.songAuthors
|
||||
songStartTime = Math.floor(data.ytm.songCurrentTime / 1000);
|
||||
songEndTime = data.ytm.songEndTime;
|
||||
|
||||
//* Create author string from author array
|
||||
songAuthors.forEach((author, index, authors) => {
|
||||
if (index == 0)
|
||||
songAuthorString = author;
|
||||
else if (index < authors.length - 2)
|
||||
songAuthorString = songAuthorString + ", " + author;
|
||||
else if (index < authors.length - 1) songAuthorString = songAuthorString + " and " + author;
|
||||
else songAuthorString = songAuthorString + " • " + author;
|
||||
});
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
const path = require('path')
|
||||
const constants = require("../util/constants")
|
||||
const {Tray, Menu, MenuItem} = require('electron')
|
||||
|
||||
exports.run = () => {
|
||||
TRAY = new Tray(path.join(__dirname, "../assets/images/icon.png"))
|
||||
TRAY.setToolTip(`YT Presence V${VERSIONSTRING}`)
|
||||
constants.menuBarMenu = new Menu()
|
||||
constants.menuBarMenu.append(new MenuItem({
|
||||
label: `YT Presence | V${VERSIONSTRING}`,
|
||||
enabled: false,
|
||||
icon: path.join(__dirname, "../assets/images/icon.png")
|
||||
}))
|
||||
constants.menuBarMenu.append(new MenuItem({type: "separator"}))
|
||||
constants.menuBarMenu.append(new MenuItem({
|
||||
click: require('./showAbout').run,
|
||||
label: "About"
|
||||
}))
|
||||
constants.menuBarMenu.append(new MenuItem({
|
||||
click: cfu,
|
||||
label: "Check for update"
|
||||
}))
|
||||
constants.menuBarMenu.append(new MenuItem({
|
||||
click: require('./showPreferences').run,
|
||||
label: "Preferences"
|
||||
}))
|
||||
constants.menuBarMenu.append(new MenuItem({type: "separator"}))
|
||||
constants.menuBarMenu.append(new MenuItem({role: "quit"}))
|
||||
TRAY.setContextMenu(constants.menuBarMenu)
|
||||
}
|
||||
|
||||
cfu = () => require('../util/updateChecker').checkForUpdate(true, true)
|
||||
@@ -1,22 +0,0 @@
|
||||
const path = require('path')
|
||||
const {BrowserWindow} = require('electron')
|
||||
|
||||
exports.run = () => {
|
||||
var aboutWindow = new BrowserWindow({
|
||||
center: true,
|
||||
maximizable: false,
|
||||
minimizable: false,
|
||||
resizable: false,
|
||||
width: 400,
|
||||
height: 600,
|
||||
alwaysOnTop: true
|
||||
})
|
||||
|
||||
aboutWindow.setMenu(null)
|
||||
|
||||
aboutWindow.loadURL("file://" + path.join(__dirname, "../windows/about.html"))
|
||||
|
||||
aboutWindow.on('close', () => {
|
||||
aboutWindow = null;
|
||||
})
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
const path = require('path')
|
||||
const {BrowserWindow} = require('electron')
|
||||
const os = require('os');
|
||||
let menuBarHeight
|
||||
|
||||
exports.run = () => {
|
||||
switch(os.platform()) {
|
||||
case "darwin":
|
||||
menuBarHeight = 440;
|
||||
break;
|
||||
default:
|
||||
menuBarHeight = 410;
|
||||
break;
|
||||
}
|
||||
|
||||
var settingsWindow = new BrowserWindow({
|
||||
center: true,
|
||||
maximizable: false,
|
||||
resizable: false,
|
||||
height: menuBarHeight,
|
||||
width: 400
|
||||
})
|
||||
|
||||
settingsWindow.setMenu(null)
|
||||
|
||||
settingsWindow.loadURL("file://" + path.join(__dirname, "../windows/preferences.html"))
|
||||
|
||||
settingsWindow.on('blur', () => {
|
||||
settingsWindow.close()
|
||||
})
|
||||
|
||||
settingsWindow.on('close', () => {
|
||||
settingsWindow = null;
|
||||
})
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
module.exports = {
|
||||
app: "",
|
||||
win: "",
|
||||
menuBar: "",
|
||||
menuBarMenu: "",
|
||||
chromeConnected: false,
|
||||
presenceReady: false,
|
||||
setup: false,
|
||||
newVersion: false,
|
||||
introRan: false,
|
||||
lastResponse: false,
|
||||
platform: "",
|
||||
data: ""
|
||||
};
|
||||
32
src/util/debug.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { app } from "electron";
|
||||
if (!app.isPackaged) var chalk = require("chalk");
|
||||
|
||||
/**
|
||||
* Show info message in console
|
||||
* */
|
||||
export function info(message: string) {
|
||||
//* Return if app packaged
|
||||
//* Show debug
|
||||
if (app.isPackaged) return;
|
||||
console.log(`${chalk.bgBlue(chalk.white(" INFO "))} ${message}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show success message in console
|
||||
* */
|
||||
export function success(message: string) {
|
||||
//* Return if app packaged
|
||||
//* Show debug
|
||||
if (app.isPackaged) return;
|
||||
console.log(`${chalk.bgGreen(" SUCCESS ")} ${message}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show error message in console
|
||||
* */
|
||||
export function error(message: string) {
|
||||
//* Return if app packaged
|
||||
//* Show debug
|
||||
if (app.isPackaged) return;
|
||||
console.log(`${chalk.bgRed(" ERROR ")} ${message}`);
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
if (require('electron-squirrel-startup')) return;
|
||||
|
||||
const {app} = require('electron');
|
||||
|
||||
// this should be placed at top of main.js to handle setup events quickly
|
||||
if (handleSquirrelEvent()) {
|
||||
// squirrel event handled and app will exit in 1000ms, so don't do anything else
|
||||
return;
|
||||
}
|
||||
|
||||
function handleSquirrelEvent() {
|
||||
if (process.argv.length === 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const ChildProcess = require('child_process');
|
||||
const path = require('path');
|
||||
|
||||
const appFolder = path.resolve(process.execPath, '..');
|
||||
const rootAtomFolder = path.resolve(appFolder, '..');
|
||||
const updateDotExe = path.resolve(path.join(rootAtomFolder, 'Update.exe'));
|
||||
const exeName = path.basename(process.execPath);
|
||||
|
||||
const spawn = function(command, args) {
|
||||
let spawnedProcess, error;
|
||||
|
||||
try {
|
||||
spawnedProcess = ChildProcess.spawn(command, args, {detached: true});
|
||||
} catch (error) {}
|
||||
|
||||
return spawnedProcess;
|
||||
};
|
||||
|
||||
const spawnUpdate = function(args) {
|
||||
return spawn(updateDotExe, args);
|
||||
};
|
||||
|
||||
const squirrelEvent = process.argv[1];
|
||||
switch (squirrelEvent) {
|
||||
case '--squirrel-install':
|
||||
case '--squirrel-updated':
|
||||
|
||||
// Install desktop and start menu shortcuts
|
||||
spawnUpdate(['--createShortcut', exeName]);
|
||||
|
||||
setTimeout(app.quit, 1000);
|
||||
return true;
|
||||
|
||||
case '--squirrel-uninstall':
|
||||
// Remove desktop and start menu shortcuts
|
||||
spawnUpdate(['--removeShortcut', exeName]);
|
||||
|
||||
setTimeout(app.quit, 1000);
|
||||
return true;
|
||||
|
||||
case '--squirrel-obsolete':
|
||||
app.quit();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const chalk = require('chalk')
|
||||
var { globalShortcut } = require('electron')
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.yellow("Registering keyboard shortcuts..."))
|
||||
|
||||
globalShortcut.register('medianexttrack', () => {
|
||||
if (EXTENSIONSOCKET != null) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "nextTrack" })
|
||||
})
|
||||
|
||||
globalShortcut.register('mediaplaypause', () => {
|
||||
if (EXTENSIONSOCKET != null) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "pause" })
|
||||
})
|
||||
|
||||
globalShortcut.register('mediaprevioustrack', () => {
|
||||
if (EXTENSIONSOCKET != null) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "previousTrack" })
|
||||
})
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.green("Successfully registered keyboard shortcuts."))
|
||||
@@ -1,69 +0,0 @@
|
||||
const { Notification, BrowserWindow } = require('electron');
|
||||
|
||||
const path = require('path')
|
||||
|
||||
const request = require("request")
|
||||
const chalk = require("chalk")
|
||||
let constants = require('./constants')
|
||||
|
||||
function checkForUpdate(sendNotification = false, sendNoUpdateInfo = false) {
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.cyan("Checking for update..."))
|
||||
|
||||
request({
|
||||
url: "https://api.github.com/repos/Timeraa/YT-Presence/releases/latest",
|
||||
json: true,
|
||||
headers: {'user-agent': 'node.js'}
|
||||
}, function (error, response, body) {
|
||||
if(error) {
|
||||
console.log(CONSOLEPREFIX + chalk.red("Error while checking for update. " + error))
|
||||
return
|
||||
}
|
||||
//* Remove v from version
|
||||
var gitVersion = body.tag_name.replace('v', '')
|
||||
//* Compare version
|
||||
if(gitVersion > VERSION) {
|
||||
global.UPDATEAVAIABLE = gitVersion
|
||||
constants.newVersion = gitVersion
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.cyan("New version avaiable: ") + chalk.red(`V${VERSION}`) + chalk.blue(' > ') + chalk.yellow(`V${gitVersion}`))
|
||||
|
||||
var updateWindow = new BrowserWindow({
|
||||
center: true,
|
||||
maximizable: false,
|
||||
minimizable: false,
|
||||
height: 500,
|
||||
width: 400,
|
||||
alwaysOnTop: true
|
||||
})
|
||||
|
||||
updateWindow.setMenu(null)
|
||||
|
||||
updateWindow.loadURL("file://" + path.join(__dirname, "../windows/update.html"))
|
||||
updateWindow.webContents.on('did-finish-load', () => {
|
||||
updateWindow.webContents.send('updateData', body);
|
||||
});
|
||||
|
||||
updateWindow.on('close', () => {
|
||||
updateWindow = null;
|
||||
})
|
||||
|
||||
} else {
|
||||
global.UPDATEAVAIABLE = false
|
||||
console.log(CONSOLEPREFIX + chalk.cyan("Up to date! ") + chalk.yellow(`V${VERSION}`))
|
||||
if(sendNoUpdateInfo) {
|
||||
const noUpdateAvaiableNotification = new Notification({
|
||||
title: 'YT Presence',
|
||||
body: `You are up to date! (V${VERSION})`,
|
||||
silent: true
|
||||
})
|
||||
|
||||
noUpdateAvaiableNotification.show()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return UPDATEAVAIABLE
|
||||
}
|
||||
|
||||
module.exports.checkForUpdate = checkForUpdate
|
||||
112
src/util/updateChecker.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import { spawn, exec } from "child_process";
|
||||
import { resolve } from "path";
|
||||
import { error, info } from "./debug";
|
||||
import { trayContextMenu } from "../managers/trayManager";
|
||||
import { MenuItem, app, dialog } from "electron";
|
||||
import { tray } from "../managers/trayManager";
|
||||
import { platform } from "os";
|
||||
import { updateCheckerInterval } from "../index";
|
||||
import { existsSync } from "fs";
|
||||
import sudoPrompt from "sudo-prompt";
|
||||
|
||||
let updaterPath: string;
|
||||
|
||||
export async function checkForUpdate(autoUpdate = false) {
|
||||
//* Skip Update checker if unsupported OS / not packaged
|
||||
if (!app.isPackaged || !["darwin", "win32"].includes(platform())) {
|
||||
//* Show debug
|
||||
//* return
|
||||
info("Skipping UpdateChecker");
|
||||
return;
|
||||
}
|
||||
|
||||
//* Resolve paths for each OS
|
||||
switch (platform()) {
|
||||
case "darwin":
|
||||
updaterPath = resolve(
|
||||
`${app.getAppPath()}../../../../../updater.app/Contents/MacOS/installbuilder.sh`
|
||||
);
|
||||
break;
|
||||
case "win32":
|
||||
updaterPath = resolve(`${app.getAppPath()}../../../updater.exe`);
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO remove?
|
||||
//* return if update doesn't exist
|
||||
if (!existsSync(updaterPath)) {
|
||||
error("Updater not found.");
|
||||
clearInterval(updateCheckerInterval);
|
||||
return;
|
||||
}
|
||||
|
||||
//* Spawn update checker
|
||||
let child = spawn(updaterPath, ["--mode", "unattended"]);
|
||||
|
||||
child.on("exit", code => {
|
||||
//* If no update or error return
|
||||
if (code === 1) {
|
||||
info("Up to date!");
|
||||
return;
|
||||
}
|
||||
if (code === 2) {
|
||||
error("Error while checking for updates");
|
||||
return;
|
||||
}
|
||||
|
||||
//* If autoUpdate == true
|
||||
if (autoUpdate) {
|
||||
update();
|
||||
return;
|
||||
}
|
||||
|
||||
if (trayContextMenu.items.length < 3) {
|
||||
trayContextMenu.insert(
|
||||
0,
|
||||
new MenuItem({
|
||||
label: "Update available!",
|
||||
click() {
|
||||
update();
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
trayContextMenu.insert(
|
||||
1,
|
||||
new MenuItem({
|
||||
type: "separator"
|
||||
})
|
||||
);
|
||||
tray.setContextMenu(trayContextMenu);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function update() {
|
||||
if (platform() === "darwin") {
|
||||
exec(
|
||||
`\"${updaterPath}\" --mode unattended --unattendedmodebehavior download`,
|
||||
() => {
|
||||
dialog.showErrorBox(
|
||||
"Error while updating",
|
||||
`${app.name} was unable to update itself. Please try again later.`
|
||||
);
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
sudoPrompt.exec(
|
||||
`\"${updaterPath}\" --mode unattended --unattendedmodebehavior download`,
|
||||
(error: Error) => {
|
||||
dialog.showErrorBox(
|
||||
"Error while updating",
|
||||
`${app.name} was unable to update itself. Please try again later.`
|
||||
);
|
||||
if (error) {
|
||||
checkForUpdate();
|
||||
return;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>About YouTube Presence</title>
|
||||
<link rel="stylesheet" href="css/reset.css">
|
||||
<link rel="stylesheet" href="css/about.css">
|
||||
<link href="css/ripple.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 id="hello">Hi there!</h1>
|
||||
<img src="https://avatars2.githubusercontent.com/u/29104008?s=150">
|
||||
<div id="background"></div>
|
||||
<h1 id="name">Florian Metz</h1>
|
||||
<div id="nickname">
|
||||
<p>T</p>
|
||||
<p>i</p>
|
||||
<p>m</p>
|
||||
<p>e</p>
|
||||
<p>r</p>
|
||||
<p>a</p>
|
||||
<p>a</p>
|
||||
</div>
|
||||
<div id="aboutMe">
|
||||
<p>
|
||||
My name is <a href="https://github.com/Timeraa">Timeraa (Florian Metz)</a>. I am a Web developer, master a lot of
|
||||
known languages and i love the TV series
|
||||
called<br>
|
||||
<a href="https://en.wikipedia.org/wiki/My_Little_Pony:_Friendship_Is_Magic">My little Pony: Friendship is Magic</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div id="aboutYTP">
|
||||
<p>
|
||||
I started this project because i recently switched to <a href="https://music.youtube.com/">YouTube Music</a>, now
|
||||
i wanted to have <b>Rich Presence
|
||||
Integration</b> for <a href="https://discordapp.com/">Discord</a>, so i just started to create this. And now
|
||||
you can use it. :P
|
||||
</p>
|
||||
</div>
|
||||
<button id="supportMe">
|
||||
Support me!
|
||||
<div class="rippleJS"></div>
|
||||
</button>
|
||||
<script>if (typeof module === 'object') { window.module = module; module = undefined; }</script>
|
||||
|
||||
<script src="js/jquery-3.3.1.min.js"></script>
|
||||
<script src="js/anime.min.js"></script>
|
||||
<script src="js/preferences.js"></script>
|
||||
<script src="js/ripple.min.js"></script>
|
||||
|
||||
<script>if (window.module) module = window.module;</script>
|
||||
<script>
|
||||
var shell = require('electron').shell;
|
||||
//open links externally by default
|
||||
$(document).on('click', 'a[href^="http"]', function (event) {
|
||||
event.preventDefault();
|
||||
shell.openExternal(this.href);
|
||||
});
|
||||
|
||||
$('#supportMe').click(() => {
|
||||
shell.openExternal("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZU8Q766ACS2WS&lc=US");
|
||||
})
|
||||
|
||||
$(window).on("load", () => {
|
||||
$('html').addClass("ready")
|
||||
|
||||
anime.timeline({
|
||||
targets: 'img',
|
||||
scale: [
|
||||
{ value: 0, duration: 0 },
|
||||
{ value: 1.25, duration: 1000 },
|
||||
{ value: 1, duration: 500 }
|
||||
],
|
||||
easing: 'easeInOutExpo',
|
||||
}).add({
|
||||
targets: '#background',
|
||||
scale: [0, 20],
|
||||
duration: 750,
|
||||
offset: 900
|
||||
}).add({
|
||||
targets: '#hello',
|
||||
translateY: [75, -25, 0],
|
||||
opacity: [0, 1],
|
||||
scale: [0, 1],
|
||||
duration: 2000,
|
||||
offset: 750
|
||||
}).add({
|
||||
targets: '#name',
|
||||
translateY: [0, 25],
|
||||
opacity: [0, 1],
|
||||
scale: [0, 1],
|
||||
duration: 2000,
|
||||
offset: 900
|
||||
}).add({
|
||||
targets: '#nickname p',
|
||||
opacity: [0, 1],
|
||||
duration: 500,
|
||||
color: ['rgba(0,0,0,0)', 'rgb(0, 150, 200)', '#fff'],
|
||||
delay: function (el, i) {
|
||||
return 2500 + 75 * i
|
||||
},
|
||||
offset: 0
|
||||
}).add({
|
||||
targets: '#aboutMe',
|
||||
translateY: [-25, 0],
|
||||
opacity: [0, 1],
|
||||
scale: [0.75, 1],
|
||||
easing: 'easeInOutSine',
|
||||
duration: 1500,
|
||||
offset: 3250
|
||||
}).add({
|
||||
targets: '#aboutYTP',
|
||||
translateY: [-25, 0],
|
||||
opacity: [0, 1],
|
||||
scale: [0.75, 1],
|
||||
easing: 'easeInOutSine',
|
||||
duration: 1500,
|
||||
offset: 4500
|
||||
}).add({
|
||||
targets: '#supportMe',
|
||||
opacity: [0, 1],
|
||||
scale: [0, 1],
|
||||
duration: 1500,
|
||||
offset: 5000
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,99 +0,0 @@
|
||||
* {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
html:not(.ready) * {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#background {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -75px;
|
||||
background-color: #1d1d1d;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-top: 35px;
|
||||
}
|
||||
|
||||
#name {
|
||||
margin-top: 150px;
|
||||
}
|
||||
|
||||
#nickname p {
|
||||
position: relative;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
img {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -75px;
|
||||
width: 150px;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
#aboutMe,
|
||||
#aboutYTP {
|
||||
width: 380px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
a {
|
||||
position: relative;
|
||||
color: rgb(0, 150, 255);
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
height: 2px;
|
||||
width: 0;
|
||||
transition: width 0.25s ease-out;
|
||||
background-color: rgb(0, 125, 255);
|
||||
}
|
||||
|
||||
a:hover:after {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
p {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
button {
|
||||
transition: 0.25s all ease-out;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
background-color: rgb(0, 160, 255);
|
||||
color: white;
|
||||
width: 150px;
|
||||
height: 35px;
|
||||
border: none;
|
||||
border-radius: 15px;
|
||||
outline: none;
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: rgb(0, 175, 255);
|
||||
box-shadow: 0 0 5px 3px rgba(0, 174, 255, 0.5);
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
/* The switch - the box around the slider */
|
||||
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 35px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
/* Hide default HTML checkbox */
|
||||
|
||||
.switch input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The slider */
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
-webkit-transition: 0.25s;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 17px;
|
||||
width: 17px;
|
||||
left: -2.5px;
|
||||
top: -2.5px;
|
||||
background-color: white;
|
||||
-webkit-transition: 0.25s;
|
||||
transition: 0.25s cubic-bezier(0.215, 0.61, 0.355, 1);
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: #2196f3;
|
||||
}
|
||||
|
||||
input:disabled + .slider {
|
||||
background-color: rgb(160, 160, 160);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
input:disabled + .slider:before {
|
||||
background-color: lightgray;
|
||||
border: 1px solid rgb(160, 160, 160);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px #2196f3;
|
||||
}
|
||||
|
||||
input:hover + .slider {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
transform: translateX(20px);
|
||||
}
|
||||
|
||||
/* Rounded sliders */
|
||||
|
||||
.slider.round {
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider.round:before {
|
||||
border-radius: 50%;
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
html {
|
||||
transition: 0.5s background-color ease-out;
|
||||
}
|
||||
|
||||
#header {
|
||||
background-color: #ce1d2a;
|
||||
color: white;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
#header img {
|
||||
margin: 5px;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
#header h1 {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
top: 10px;
|
||||
position: absolute;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
#options {
|
||||
border-collapse: collapse;
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
margin-right: 5%;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
#options th:nth-child(1) {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
#options th:nth-child(2) {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
#options tbody tr {
|
||||
transition: 1s color ease-in-out, 0.75s border ease-out;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
#options tbody tr:not(:last-child) {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
background-color: #ce1d2a;
|
||||
color: white;
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#footer #close-btn {
|
||||
position: relative;
|
||||
transition: background-color 0.2s ease-out;
|
||||
margin: 5px;
|
||||
appearance: none;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
background-color: rgba(255, 255, 255, 0.15);
|
||||
color: white;
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#footer #close-btn:hover {
|
||||
background-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
@font-face {
|
||||
font-family: "Montserrat";
|
||||
src: url("../fonts/Montserrat/Montserrat-Regular.ttf") format("truetype");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Montserrat";
|
||||
src: url("../fonts/Montserrat/Montserrat-Medium.ttf") format("truetype");
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Montserrat";
|
||||
src: url("../fonts/Montserrat/Montserrat-Bold.ttf") format("truetype");
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Montserrat";
|
||||
src: url("../fonts/Montserrat/Montserrat-Black.ttf") format("truetype");
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Montserrat";
|
||||
src: url("../fonts/Montserrat/Montserrat-BlackItalic.ttf") format("truetype");
|
||||
font-weight: 900;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
* {
|
||||
font-family: "Montserrat", sans-serif;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/** NOTE: When this is updated, refresh ripple.js' minified version. */
|
||||
|
||||
/**
|
||||
* contains a ripple. Will normally grow to fixed size (200px/200px), not
|
||||
* related to the holder itself.
|
||||
*/
|
||||
.rippleJS {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
border-radius: inherit;
|
||||
|
||||
/** Forces webkit to properly contain content within border-radius. */
|
||||
-webkit-mask-image: -webkit-radial-gradient(circle, white, black);
|
||||
}
|
||||
|
||||
/** adds default border-radius */
|
||||
.rippleJS.fill::after { /** allows webkit/blink to tap on corners */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
content: "";
|
||||
}
|
||||
.rippleJS.fill {
|
||||
border-radius: 1000000px; /** "large" number, but not 100% */
|
||||
}
|
||||
|
||||
.rippleJS .ripple {
|
||||
position: absolute;
|
||||
border-radius: 100%;
|
||||
background: currentColor;
|
||||
opacity: 0.2;
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
||||
/** only animate transform and opacity */
|
||||
-webkit-transition: -webkit-transform 0.4s ease-out, opacity 0.4s ease-out;
|
||||
transition: transform 0.4s ease-out, opacity 0.4s ease-out;
|
||||
|
||||
/** initially hidden */
|
||||
-webkit-transform: scale(0);
|
||||
transform: scale(0);
|
||||
|
||||
pointer-events: none;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.rippleJS .ripple.held {
|
||||
opacity: 0.4;
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.rippleJS .ripple.done {
|
||||
opacity: 0.0;
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
#header {
|
||||
background-color: #ce1d2a;
|
||||
color: white;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
#header img {
|
||||
margin: 5px;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
#header h1 {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
top: 10px;
|
||||
position: absolute;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin: 5px;
|
||||
margin-bottom: 65px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
background-color: #ce1d2a;
|
||||
color: white;
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#footer #update {
|
||||
position: relative;
|
||||
transition: background-color 0.2s ease-out;
|
||||
margin: 15px;
|
||||
appearance: none;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
background-color: rgb(0, 160, 255);
|
||||
color: white;
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#footer #update:hover {
|
||||
background-color: rgb(0, 175, 255);
|
||||
}
|
||||
|
||||
#footer #later {
|
||||
position: relative;
|
||||
transition: background-color 0.2s ease-out;
|
||||
float: right;
|
||||
margin: 15px;
|
||||
appearance: none;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
background-color: rgba(255, 255, 255, 0.15);
|
||||
color: white;
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#footer #later:hover {
|
||||
background-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
33
src/windows/js/anime.min.js
vendored
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
2017 Julian Garnier
|
||||
Released under the MIT license
|
||||
*/
|
||||
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,r,p){if(p.get||p.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[r]=p.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
|
||||
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++};
|
||||
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var r=0;return $jscomp.iteratorPrototype(function(){return r<e.length?{done:!1,value:e[r++]}:{done:!0}})};
|
||||
$jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(e,r){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var p=0,m={next:function(){if(p<e.length){var u=p++;return{value:r(u,e[u]),done:!1}}m.next=function(){return{done:!0,value:void 0}};return m.next()}};m[Symbol.iterator]=function(){return m};return m};
|
||||
$jscomp.polyfill=function(e,r,p,m){if(r){p=$jscomp.global;e=e.split(".");for(m=0;m<e.length-1;m++){var u=e[m];u in p||(p[u]={});p=p[u]}e=e[e.length-1];m=p[e];r=r(m);r!=m&&null!=r&&$jscomp.defineProperty(p,e,{configurable:!0,writable:!0,value:r})}};$jscomp.polyfill("Array.prototype.keys",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e){return e})}},"es6-impl","es3");var $jscomp$this=this;
|
||||
(function(e,r){"function"===typeof define&&define.amd?define([],r):"object"===typeof module&&module.exports?module.exports=r():e.anime=r()})(this,function(){function e(a){if(!h.col(a))try{return document.querySelectorAll(a)}catch(c){}}function r(a,c){for(var d=a.length,b=2<=arguments.length?arguments[1]:void 0,f=[],n=0;n<d;n++)if(n in a){var k=a[n];c.call(b,k,n,a)&&f.push(k)}return f}function p(a){return a.reduce(function(a,d){return a.concat(h.arr(d)?p(d):d)},[])}function m(a){if(h.arr(a))return a;
|
||||
h.str(a)&&(a=e(a)||a);return a instanceof NodeList||a instanceof HTMLCollection?[].slice.call(a):[a]}function u(a,c){return a.some(function(a){return a===c})}function C(a){var c={},d;for(d in a)c[d]=a[d];return c}function D(a,c){var d=C(a),b;for(b in a)d[b]=c.hasOwnProperty(b)?c[b]:a[b];return d}function z(a,c){var d=C(a),b;for(b in c)d[b]=h.und(a[b])?c[b]:a[b];return d}function T(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,c,d,k){return c+c+d+d+k+k});var c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);
|
||||
a=parseInt(c[1],16);var d=parseInt(c[2],16),c=parseInt(c[3],16);return"rgba("+a+","+d+","+c+",1)"}function U(a){function c(a,c,b){0>b&&(b+=1);1<b&&--b;return b<1/6?a+6*(c-a)*b:.5>b?c:b<2/3?a+(c-a)*(2/3-b)*6:a}var d=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a=parseInt(d[1])/360;var b=parseInt(d[2])/100,f=parseInt(d[3])/100,d=d[4]||1;if(0==b)f=b=a=f;else{var n=.5>f?f*(1+b):f+b-f*b,k=2*f-n,f=c(k,n,a+1/3),b=c(k,n,a);a=c(k,n,a-1/3)}return"rgba("+
|
||||
255*f+","+255*b+","+255*a+","+d+")"}function y(a){if(a=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a))return a[2]}function V(a){if(-1<a.indexOf("translate")||"perspective"===a)return"px";if(-1<a.indexOf("rotate")||-1<a.indexOf("skew"))return"deg"}function I(a,c){return h.fnc(a)?a(c.target,c.id,c.total):a}function E(a,c){if(c in a.style)return getComputedStyle(a).getPropertyValue(c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())||"0"}function J(a,c){if(h.dom(a)&&
|
||||
u(W,c))return"transform";if(h.dom(a)&&(a.getAttribute(c)||h.svg(a)&&a[c]))return"attribute";if(h.dom(a)&&"transform"!==c&&E(a,c))return"css";if(null!=a[c])return"object"}function X(a,c){var d=V(c),d=-1<c.indexOf("scale")?1:0+d;a=a.style.transform;if(!a)return d;for(var b=[],f=[],n=[],k=/(\w+)\((.+?)\)/g;b=k.exec(a);)f.push(b[1]),n.push(b[2]);a=r(n,function(a,b){return f[b]===c});return a.length?a[0]:d}function K(a,c){switch(J(a,c)){case "transform":return X(a,c);case "css":return E(a,c);case "attribute":return a.getAttribute(c)}return a[c]||
|
||||
0}function L(a,c){var d=/^(\*=|\+=|-=)/.exec(a);if(!d)return a;var b=y(a)||0;c=parseFloat(c);a=parseFloat(a.replace(d[0],""));switch(d[0][0]){case "+":return c+a+b;case "-":return c-a+b;case "*":return c*a+b}}function F(a,c){return Math.sqrt(Math.pow(c.x-a.x,2)+Math.pow(c.y-a.y,2))}function M(a){a=a.points;for(var c=0,d,b=0;b<a.numberOfItems;b++){var f=a.getItem(b);0<b&&(c+=F(d,f));d=f}return c}function N(a){if(a.getTotalLength)return a.getTotalLength();switch(a.tagName.toLowerCase()){case "circle":return 2*
|
||||
Math.PI*a.getAttribute("r");case "rect":return 2*a.getAttribute("width")+2*a.getAttribute("height");case "line":return F({x:a.getAttribute("x1"),y:a.getAttribute("y1")},{x:a.getAttribute("x2"),y:a.getAttribute("y2")});case "polyline":return M(a);case "polygon":var c=a.points;return M(a)+F(c.getItem(c.numberOfItems-1),c.getItem(0))}}function Y(a,c){function d(b){b=void 0===b?0:b;return a.el.getPointAtLength(1<=c+b?c+b:0)}var b=d(),f=d(-1),n=d(1);switch(a.property){case "x":return b.x;case "y":return b.y;
|
||||
case "angle":return 180*Math.atan2(n.y-f.y,n.x-f.x)/Math.PI}}function O(a,c){var d=/-?\d*\.?\d+/g,b;b=h.pth(a)?a.totalLength:a;if(h.col(b))if(h.rgb(b)){var f=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(b);b=f?"rgba("+f[1]+",1)":b}else b=h.hex(b)?T(b):h.hsl(b)?U(b):void 0;else f=(f=y(b))?b.substr(0,b.length-f.length):b,b=c&&!/\s/g.test(b)?f+c:f;b+="";return{original:b,numbers:b.match(d)?b.match(d).map(Number):[0],strings:h.str(a)||c?b.split(d):[]}}function P(a){a=a?p(h.arr(a)?a.map(m):m(a)):[];return r(a,
|
||||
function(a,d,b){return b.indexOf(a)===d})}function Z(a){var c=P(a);return c.map(function(a,b){return{target:a,id:b,total:c.length}})}function aa(a,c){var d=C(c);if(h.arr(a)){var b=a.length;2!==b||h.obj(a[0])?h.fnc(c.duration)||(d.duration=c.duration/b):a={value:a}}return m(a).map(function(a,b){b=b?0:c.delay;a=h.obj(a)&&!h.pth(a)?a:{value:a};h.und(a.delay)&&(a.delay=b);return a}).map(function(a){return z(a,d)})}function ba(a,c){var d={},b;for(b in a){var f=I(a[b],c);h.arr(f)&&(f=f.map(function(a){return I(a,
|
||||
c)}),1===f.length&&(f=f[0]));d[b]=f}d.duration=parseFloat(d.duration);d.delay=parseFloat(d.delay);return d}function ca(a){return h.arr(a)?A.apply(this,a):Q[a]}function da(a,c){var d;return a.tweens.map(function(b){b=ba(b,c);var f=b.value,e=K(c.target,a.name),k=d?d.to.original:e,k=h.arr(f)?f[0]:k,w=L(h.arr(f)?f[1]:f,k),e=y(w)||y(k)||y(e);b.from=O(k,e);b.to=O(w,e);b.start=d?d.end:a.offset;b.end=b.start+b.delay+b.duration;b.easing=ca(b.easing);b.elasticity=(1E3-Math.min(Math.max(b.elasticity,1),999))/
|
||||
1E3;b.isPath=h.pth(f);b.isColor=h.col(b.from.original);b.isColor&&(b.round=1);return d=b})}function ea(a,c){return r(p(a.map(function(a){return c.map(function(b){var c=J(a.target,b.name);if(c){var d=da(b,a);b={type:c,property:b.name,animatable:a,tweens:d,duration:d[d.length-1].end,delay:d[0].delay}}else b=void 0;return b})})),function(a){return!h.und(a)})}function R(a,c,d,b){var f="delay"===a;return c.length?(f?Math.min:Math.max).apply(Math,c.map(function(b){return b[a]})):f?b.delay:d.offset+b.delay+
|
||||
b.duration}function fa(a){var c=D(ga,a),d=D(S,a),b=Z(a.targets),f=[],e=z(c,d),k;for(k in a)e.hasOwnProperty(k)||"targets"===k||f.push({name:k,offset:e.offset,tweens:aa(a[k],d)});a=ea(b,f);return z(c,{children:[],animatables:b,animations:a,duration:R("duration",a,c,d),delay:R("delay",a,c,d)})}function q(a){function c(){return window.Promise&&new Promise(function(a){return p=a})}function d(a){return g.reversed?g.duration-a:a}function b(a){for(var b=0,c={},d=g.animations,f=d.length;b<f;){var e=d[b],
|
||||
k=e.animatable,h=e.tweens,n=h.length-1,l=h[n];n&&(l=r(h,function(b){return a<b.end})[0]||l);for(var h=Math.min(Math.max(a-l.start-l.delay,0),l.duration)/l.duration,w=isNaN(h)?1:l.easing(h,l.elasticity),h=l.to.strings,p=l.round,n=[],m=void 0,m=l.to.numbers.length,t=0;t<m;t++){var x=void 0,x=l.to.numbers[t],q=l.from.numbers[t],x=l.isPath?Y(l.value,w*x):q+w*(x-q);p&&(l.isColor&&2<t||(x=Math.round(x*p)/p));n.push(x)}if(l=h.length)for(m=h[0],w=0;w<l;w++)p=h[w+1],t=n[w],isNaN(t)||(m=p?m+(t+p):m+(t+" "));
|
||||
else m=n[0];ha[e.type](k.target,e.property,m,c,k.id);e.currentValue=m;b++}if(b=Object.keys(c).length)for(d=0;d<b;d++)H||(H=E(document.body,"transform")?"transform":"-webkit-transform"),g.animatables[d].target.style[H]=c[d].join(" ");g.currentTime=a;g.progress=a/g.duration*100}function f(a){if(g[a])g[a](g)}function e(){g.remaining&&!0!==g.remaining&&g.remaining--}function k(a){var k=g.duration,n=g.offset,w=n+g.delay,r=g.currentTime,x=g.reversed,q=d(a);if(g.children.length){var u=g.children,v=u.length;
|
||||
if(q>=g.currentTime)for(var G=0;G<v;G++)u[G].seek(q);else for(;v--;)u[v].seek(q)}if(q>=w||!k)g.began||(g.began=!0,f("begin")),f("run");if(q>n&&q<k)b(q);else if(q<=n&&0!==r&&(b(0),x&&e()),q>=k&&r!==k||!k)b(k),x||e();f("update");a>=k&&(g.remaining?(t=h,"alternate"===g.direction&&(g.reversed=!g.reversed)):(g.pause(),g.completed||(g.completed=!0,f("complete"),"Promise"in window&&(p(),m=c()))),l=0)}a=void 0===a?{}:a;var h,t,l=0,p=null,m=c(),g=fa(a);g.reset=function(){var a=g.direction,c=g.loop;g.currentTime=
|
||||
0;g.progress=0;g.paused=!0;g.began=!1;g.completed=!1;g.reversed="reverse"===a;g.remaining="alternate"===a&&1===c?2:c;b(0);for(a=g.children.length;a--;)g.children[a].reset()};g.tick=function(a){h=a;t||(t=h);k((l+h-t)*q.speed)};g.seek=function(a){k(d(a))};g.pause=function(){var a=v.indexOf(g);-1<a&&v.splice(a,1);g.paused=!0};g.play=function(){g.paused&&(g.paused=!1,t=0,l=d(g.currentTime),v.push(g),B||ia())};g.reverse=function(){g.reversed=!g.reversed;t=0;l=d(g.currentTime)};g.restart=function(){g.pause();
|
||||
g.reset();g.play()};g.finished=m;g.reset();g.autoplay&&g.play();return g}var ga={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},S={duration:1E3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},W="translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "),H,h={arr:function(a){return Array.isArray(a)},obj:function(a){return-1<Object.prototype.toString.call(a).indexOf("Object")},
|
||||
pth:function(a){return h.obj(a)&&a.hasOwnProperty("totalLength")},svg:function(a){return a instanceof SVGElement},dom:function(a){return a.nodeType||h.svg(a)},str:function(a){return"string"===typeof a},fnc:function(a){return"function"===typeof a},und:function(a){return"undefined"===typeof a},hex:function(a){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a)},rgb:function(a){return/^rgb/.test(a)},hsl:function(a){return/^hsl/.test(a)},col:function(a){return h.hex(a)||h.rgb(a)||h.hsl(a)}},A=function(){function a(a,
|
||||
d,b){return(((1-3*b+3*d)*a+(3*b-6*d))*a+3*d)*a}return function(c,d,b,f){if(0<=c&&1>=c&&0<=b&&1>=b){var e=new Float32Array(11);if(c!==d||b!==f)for(var k=0;11>k;++k)e[k]=a(.1*k,c,b);return function(k){if(c===d&&b===f)return k;if(0===k)return 0;if(1===k)return 1;for(var h=0,l=1;10!==l&&e[l]<=k;++l)h+=.1;--l;var l=h+(k-e[l])/(e[l+1]-e[l])*.1,n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(.001<=n){for(h=0;4>h;++h){n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(0===n)break;var m=a(l,c,b)-k,l=l-m/n}k=l}else if(0===
|
||||
n)k=l;else{var l=h,h=h+.1,g=0;do m=l+(h-l)/2,n=a(m,c,b)-k,0<n?h=m:l=m;while(1e-7<Math.abs(n)&&10>++g);k=m}return a(k,d,f)}}}}(),Q=function(){function a(a,b){return 0===a||1===a?a:-Math.pow(2,10*(a-1))*Math.sin(2*(a-1-b/(2*Math.PI)*Math.asin(1))*Math.PI/b)}var c="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),d={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],a],Out:[[.25,
|
||||
.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(b,c){return 1-a(1-b,c)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(b,c){return.5>b?a(2*b,c)/2:1-a(-2*b+2,c)/2}]},b={linear:A(.25,.25,.75,.75)},f={},e;for(e in d)f.type=e,d[f.type].forEach(function(a){return function(d,f){b["ease"+a.type+c[f]]=h.fnc(d)?
|
||||
d:A.apply($jscomp$this,d)}}(f)),f={type:f.type};return b}(),ha={css:function(a,c,d){return a.style[c]=d},attribute:function(a,c,d){return a.setAttribute(c,d)},object:function(a,c,d){return a[c]=d},transform:function(a,c,d,b,f){b[f]||(b[f]=[]);b[f].push(c+"("+d+")")}},v=[],B=0,ia=function(){function a(){B=requestAnimationFrame(c)}function c(c){var b=v.length;if(b){for(var d=0;d<b;)v[d]&&v[d].tick(c),d++;a()}else cancelAnimationFrame(B),B=0}return a}();q.version="2.2.0";q.speed=1;q.running=v;q.remove=
|
||||
function(a){a=P(a);for(var c=v.length;c--;)for(var d=v[c],b=d.animations,f=b.length;f--;)u(a,b[f].animatable.target)&&(b.splice(f,1),b.length||d.pause())};q.getValue=K;q.path=function(a,c){var d=h.str(a)?e(a)[0]:a,b=c||100;return function(a){return{el:d,property:a,totalLength:N(d)*(b/100)}}};q.setDashoffset=function(a){var c=N(a);a.setAttribute("stroke-dasharray",c);return c};q.bezier=A;q.easings=Q;q.timeline=function(a){var c=q(a);c.pause();c.duration=0;c.add=function(d){c.children.forEach(function(a){a.began=
|
||||
!0;a.completed=!0});m(d).forEach(function(b){var d=z(b,D(S,a||{}));d.targets=d.targets||a.targets;b=c.duration;var e=d.offset;d.autoplay=!1;d.direction=c.direction;d.offset=h.und(e)?b:L(e,b);c.began=!0;c.completed=!0;c.seek(d.offset);d=q(d);d.began=!0;d.completed=!0;d.duration>b&&(c.duration=d.duration);c.children.push(d)});c.seek(0);c.reset();c.autoplay&&c.restart();return c};return c};q.random=function(a,c){return Math.floor(Math.random()*(c-a+1))+a};return q});
|
||||
2
src/windows/js/jquery-3.3.1.min.js
vendored
@@ -1,231 +0,0 @@
|
||||
//* Declare needed constants
|
||||
const remote = require('electron').remote
|
||||
const app = remote.app
|
||||
const AutoLaunch = require('auto-launch');
|
||||
const Config = require('electron-config')
|
||||
const userSettings = new Config({
|
||||
name: "userSettings"
|
||||
})
|
||||
|
||||
var togglePresence,
|
||||
toggleYouTube,
|
||||
toggleYouTubeMusic,
|
||||
toggleTitleMenubar;
|
||||
|
||||
$(() => {
|
||||
|
||||
var os = require('os')
|
||||
if (os.platform() == "darwin") {
|
||||
$('<tr><td class="noselect">Title menubar</td><td class="right"><label class="switch"><input class="toggleTitleMenubar" type="checkbox"><span class="slider round"></span></label></td></tr>').insertAfter('.soundcloudToggle')
|
||||
}
|
||||
|
||||
togglePresence = $(".togglePresence"),
|
||||
toggleYouTube = $(".toggleYouTube"),
|
||||
toggleYouTubeMusic = $(".toggleYouTubeMusic");
|
||||
toggleNetflix = $(".toggleNetflix");
|
||||
toggleTwitch = $(".toggleTwitch");
|
||||
toggleSoundCloud = $(".toggleSoundCloud");
|
||||
toggleTitleMenubar = $(".toggleTitleMenubar");
|
||||
toggleAutoLaunch = $(".toggleAutoLaunch");
|
||||
toggleAutoUpdate = $(".toggleAutoUpdate");
|
||||
|
||||
togglePresence.change(switchPresence);
|
||||
toggleYouTube.change(switchYouTube);
|
||||
toggleYouTubeMusic.change(switchYouTubeMusic);
|
||||
toggleTitleMenubar.change(switchTitleMenubar);
|
||||
toggleAutoLaunch.change(switchAutomaticStartup);
|
||||
toggleAutoUpdate.change(switchAutoUpdate);
|
||||
toggleNetflix.change(switchNetflix);
|
||||
toggleTwitch.change(switchTwitch);
|
||||
toggleSoundCloud.change(switchSoundCloud);
|
||||
|
||||
if (userSettings.get('enabled') == true) togglePresence.prop("checked", true)
|
||||
else {
|
||||
togglePresence.prop("checked", false)
|
||||
toggleYouTube.prop("checked", false)
|
||||
toggleYouTubeMusic.prop("checked", false)
|
||||
toggleNetflix.prop("checked", false)
|
||||
toggleTwitch.prop("checked", false)
|
||||
toggleSoundCloud.prop("checked", false)
|
||||
|
||||
toggleYouTube.attr("disabled", "disabled")
|
||||
toggleYouTubeMusic.attr("disabled", "disabled")
|
||||
toggleNetflix.attr("disabled", "disabled")
|
||||
toggleTwitch.attr("disabled", "disabled")
|
||||
toggleSoundCloud.attr("disabled", "disabled")
|
||||
toggleTitleMenubar.attr("disabled", "disabled")
|
||||
}
|
||||
|
||||
if (userSettings.get('youTube') == true) {
|
||||
toggleYouTube.prop("checked", true)
|
||||
toggleYouTube.removeAttr("disabled")
|
||||
} else toggleYouTube.prop("checked", false)
|
||||
|
||||
if (userSettings.get('youTubeMusic') == true) {
|
||||
toggleYouTubeMusic.prop("checked", true)
|
||||
toggleYouTubeMusic.removeAttr("disabled")
|
||||
} else toggleYouTubeMusic.prop("checked", false)
|
||||
|
||||
if (userSettings.get('netflix') == true) {
|
||||
toggleNetflix.prop("checked", true)
|
||||
toggleNetflix.removeAttr("disabled")
|
||||
} else toggleNetflix.prop("checked", false)
|
||||
|
||||
if (userSettings.get('twitch') == true) {
|
||||
toggleTwitch.prop("checked", true)
|
||||
toggleTwitch.removeAttr("disabled")
|
||||
} else toggleTwitch.prop("checked", false)
|
||||
|
||||
if (userSettings.get('soundcloud') == true) {
|
||||
toggleSoundCloud.prop("checked", true)
|
||||
toggleSoundCloud.removeAttr("disabled")
|
||||
} else toggleSoundCloud.prop("checked", false)
|
||||
|
||||
if (userSettings.get('titleMenubar') == true) {
|
||||
toggleTitleMenubar.prop("checked", true)
|
||||
toggleTitleMenubar.removeAttr("disabled")
|
||||
} else {
|
||||
toggleTitleMenubar.prop("checked", false)
|
||||
}
|
||||
|
||||
if (userSettings.get('autoLaunch') == true) {
|
||||
toggleAutoLaunch.prop("checked", true)
|
||||
toggleAutoLaunch.removeAttr("disabled")
|
||||
} else toggleAutoLaunch.prop("checked", false)
|
||||
|
||||
if (userSettings.get('autoUpdateCheck') == true) {
|
||||
toggleAutoUpdate.prop("checked", true)
|
||||
toggleAutoUpdate.removeAttr("disabled")
|
||||
} else toggleAutoUpdate.prop("checked", false)
|
||||
})
|
||||
|
||||
function switchPresence() {
|
||||
if (userSettings.get('enabled') == true) {
|
||||
userSettings.set('enabled', false);
|
||||
userSettings.set('youTube', false);
|
||||
userSettings.set('youTubeMusic', false);
|
||||
userSettings.set('netflix', false);
|
||||
userSettings.set('soundcloud', false);
|
||||
|
||||
toggleYouTube.prop("checked", false)
|
||||
toggleYouTube.attr("disabled", "disabled")
|
||||
|
||||
toggleYouTubeMusic.prop("checked", false)
|
||||
toggleYouTubeMusic.attr("disabled", "disabled")
|
||||
|
||||
toggleNetflix.prop("checked", false)
|
||||
toggleNetflix.attr("disabled", "disabled")
|
||||
|
||||
toggleTwitch.prop("checked", false)
|
||||
toggleTwitch.attr("disabled", "disabled")
|
||||
|
||||
toggleSoundCloud.prop("checked", false)
|
||||
toggleSoundCloud.attr("disabled", "disabled")
|
||||
} else {
|
||||
userSettings.set('enabled', true);
|
||||
toggleYouTube.removeAttr("disabled")
|
||||
toggleYouTubeMusic.removeAttr("disabled")
|
||||
toggleNetflix.removeAttr("disabled")
|
||||
toggleTwitch.removeAttr("disabled")
|
||||
toggleSoundCloud.removeAttr("disabled")
|
||||
}
|
||||
}
|
||||
|
||||
function switchYouTube() {
|
||||
if (userSettings.get('youTube') == true) {
|
||||
userSettings.set('youTube', false)
|
||||
toggleYouTube.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('youTube', true)
|
||||
toggleYouTube.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchYouTubeMusic() {
|
||||
if (userSettings.get('youTubeMusic') == true) {
|
||||
userSettings.set('youTubeMusic', false);
|
||||
toggleYouTubeMusic.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('youTubeMusic', true);
|
||||
toggleYouTubeMusic.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchNetflix() {
|
||||
if (userSettings.get('netflix') == true) {
|
||||
userSettings.set('netflix', false);
|
||||
toggleNetflix.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('netflix', true);
|
||||
toggleNetflix.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchTwitch() {
|
||||
if (userSettings.get('twitch') == true) {
|
||||
userSettings.set('twitch', false);
|
||||
toggleTwitch.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('twitch', true);
|
||||
toggleTwitch.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchSoundCloud() {
|
||||
if (userSettings.get('soundcloud') == true) {
|
||||
userSettings.set('soundcloud', false);
|
||||
toggleSoundCloud.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('soundcloud', true);
|
||||
toggleSoundCloud.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchTitleMenubar() {
|
||||
if (userSettings.get('titleMenubar') == true) {
|
||||
userSettings.set('titleMenubar', false);
|
||||
toggleTitleMenubar.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('titleMenubar', true);
|
||||
toggleTitleMenubar.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchAutomaticStartup() {
|
||||
//* Add App to AutoLaunch
|
||||
let autoLaunch = new AutoLaunch({
|
||||
name: 'YT Presence',
|
||||
path: app.getPath('exe'),
|
||||
isHidden: true
|
||||
});
|
||||
|
||||
if (userSettings.get('autoLaunch') == true) {
|
||||
autoLaunch.isEnabled().then((isEnabled) => {
|
||||
if(isEnabled) autoLaunch.disable()
|
||||
}).catch((err) => {
|
||||
console.log("Error while adding App to autostart.")
|
||||
})
|
||||
|
||||
userSettings.set('autoLaunch', false);
|
||||
toggleAutoLaunch.prop("checked", false)
|
||||
} else {
|
||||
autoLaunch.isEnabled().then((isEnabled) => {
|
||||
if(!isEnabled) autoLaunch.enable()
|
||||
}).catch((err) => {
|
||||
console.log("Error while adding App to autostart.")
|
||||
})
|
||||
|
||||
userSettings.set('autoLaunch', true);
|
||||
toggleAutoLaunch.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchAutoUpdate() {
|
||||
if (userSettings.get('autoUpdateCheck') == true) {
|
||||
userSettings.set('autoUpdateCheck', false);
|
||||
toggleAutoUpdate.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('autoUpdateCheck', true);
|
||||
toggleAutoUpdate.prop("checked", true)
|
||||
}
|
||||
}
|
||||
5
src/windows/js/ripple.min.js
vendored
@@ -1,5 +0,0 @@
|
||||
(function(){function h(c){c=c.target;var a=c.childNodes.length;if("button"!==c.localName||!a)return c.classList.contains("rippleJS")?c:null;for(var b=0;b<a;++b){var g=c.childNodes[b],e=g.classList;if(e&&e.contains("rippleJS"))return g}return null}
|
||||
function n(c,a){var b=h(a);if(b){var g=b.classList,e=b.getAttribute("data-event");if(!e||e===c){b.setAttribute("data-event",c);var d=b.getBoundingClientRect();e=a.offsetX;void 0!==e?a=a.offsetY:(e=a.clientX-d.left,a=a.clientY-d.top);var f=document.createElement("div");d=d.width===d.height?1.412*d.width:Math.sqrt(d.width*d.width+d.height*d.height);var k=2*d+"px";f.style.width=k;f.style.height=k;f.style.marginLeft=-d+e+"px";f.style.marginTop=-d+a+"px";f.className="ripple";b.appendChild(f);window.setTimeout(function(){f.classList.add("held")},
|
||||
0);var l="mousedown"===c?"mouseup":"touchend",m=function(){document.removeEventListener(l,m);f.classList.add("done");window.setTimeout(function(){b.removeChild(f);b.children.length||(g.remove("active"),b.removeAttribute("data-event"))},650)};document.addEventListener(l,m)}}}
|
||||
function p(){var c=c||document;c.addEventListener("mousedown",function(a){0===a.button&&n(a.type,a)},{passive:!0});c.addEventListener("touchstart",function(a){for(var b=0;b<a.changedTouches.length;++b)n(a.type,a.changedTouches[b])},{passive:!0})};(function(){function c(){var a=document.createElement("div");a.className="rippleJS";document.body.appendChild(a);var b="absolute"===window.getComputedStyle(a).position;document.body.removeChild(a);b||(a=document.createElement("style"),a.textContent='/*rippleJS*/.rippleJS,.rippleJS.fill::after{position:absolute;top:0;left:0;right:0;bottom:0}.rippleJS{display:block;overflow:hidden;border-radius:inherit;-webkit-mask-image:-webkit-radial-gradient(circle,#fff,#000)}.rippleJS.fill::after{content:""}.rippleJS.fill{border-radius:1000000px}.rippleJS .ripple{position:absolute;border-radius:100%;background:currentColor;opacity:.2;width:0;height:0;-webkit-transition:-webkit-transform .4s ease-out,opacity .4s ease-out;transition:transform .4s ease-out,opacity .4s ease-out;-webkit-transform:scale(0);transform:scale(0);pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.rippleJS .ripple.held{opacity:.4;-webkit-transform:scale(1);transform:scale(1)}.rippleJS .ripple.done{opacity:0}',
|
||||
document.head.insertBefore(a,document.head.firstChild));p()}"complete"===document.readyState?c():window.addEventListener("load",c)})();}())
|
||||
3
src/windows/js/showdown.min.js
vendored
@@ -1,122 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Preferences • YT Presence</title>
|
||||
<link href="css/reset.css" rel="stylesheet">
|
||||
<link href="css/preferences.css" rel="stylesheet">
|
||||
<link href="css/inputs.css" rel="stylesheet">
|
||||
<link href="css/ripple.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<img draggable="false" src="../assets/images/logo.png">
|
||||
<h1>YT Presence</h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<table id="options">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Enabled</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="togglePresence" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>YouTube</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleYouTube" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="ytmToggle">
|
||||
<td>YouTube Music</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleYouTubeMusic" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="nflixToggle">
|
||||
<td>Netflix</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleNetflix" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="twitchToggle">
|
||||
<td>Twitch</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleTwitch" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="soundcloudToggle">
|
||||
<td>SoundCloud</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleSoundCloud" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Launch on system startup</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleAutoLaunch" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Automatically check for updates</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleAutoUpdate" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<button id="close-btn">
|
||||
Close
|
||||
<div class="rippleJS"></div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<script>if (typeof module === 'object') { window.module = module; module = undefined; }</script>
|
||||
|
||||
<script src="js/jquery-3.3.1.min.js"></script>
|
||||
<script src="js/preferences.js"></script>
|
||||
<script src="js/ripple.min.js"></script>
|
||||
|
||||
<script>if (window.module) module = window.module;</script>
|
||||
<script>
|
||||
document.getElementById("close-btn").addEventListener("click", function (e) {
|
||||
var window = remote.getCurrentWindow();
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,60 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>YT Presence • Update avaiable!</title>
|
||||
<link rel="stylesheet" href="css/reset.css">
|
||||
<link rel="stylesheet" href="css/update.css">
|
||||
<link href="css/ripple.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<img draggable="false" src="../assets/images/logo.png">
|
||||
<h1>YT Presence</h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p id="description"></p>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<button id="update">
|
||||
Update
|
||||
<div class="rippleJS"></div>
|
||||
</button>
|
||||
<button id="later">
|
||||
Later
|
||||
<div class="rippleJS"></div>
|
||||
</button>
|
||||
</div>
|
||||
<script>if (typeof module === 'object') { window.module = module; module = undefined; }</script>
|
||||
|
||||
<script src="js/jquery-3.3.1.min.js"></script>
|
||||
<script src="js/showdown.min.js"></script>
|
||||
<script src="js/ripple.min.js"></script>
|
||||
|
||||
<script>if (window.module) module = window.module;</script>
|
||||
<script>
|
||||
var converter = new showdown.Converter()
|
||||
|
||||
const ipc = require('electron').ipcRenderer;
|
||||
const remote = require('electron').remote
|
||||
|
||||
</script>
|
||||
<script>
|
||||
var shell = require('electron').shell;
|
||||
ipc.on('updateData', (event, message) => {
|
||||
$('#description').html(converter.makeHtml(message.body))
|
||||
$('#update').click(() => {
|
||||
console.log(message)
|
||||
shell.openExternal(`https://github.com/Timeraa/YT-Presence/releases/tag/${message.tag_name}`);
|
||||
remote.getCurrentWindow().close()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
$('#later').click(e => {
|
||||
remote.getCurrentWindow().close()
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||