Compare commits
768 Commits
v0.8.1
...
v0.9.8-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b266d2e83 | ||
|
|
7907d41ea8 | ||
|
|
32c6482dcf | ||
|
|
ea0c41a9f8 | ||
|
|
a1cb566761 | ||
|
|
01a96d92f4 | ||
|
|
0b1745bceb | ||
|
|
7d203f40cd | ||
|
|
b8b74402c1 | ||
|
|
08ee93a57b | ||
|
|
bced608c48 | ||
|
|
c576e07c85 | ||
|
|
cc87135b28 | ||
|
|
a63eb2621b | ||
|
|
42e317dab8 | ||
|
|
ec870039bf | ||
|
|
b65466bc4f | ||
|
|
515b57ba12 | ||
|
|
4d4da0d7ca | ||
|
|
778e7dcab0 | ||
|
|
fd5e94dfad | ||
|
|
f187a359e6 | ||
|
|
579e70e967 | ||
|
|
3407f66e82 | ||
|
|
8707cca7bc | ||
|
|
e40c6905dd | ||
|
|
84a0ef9695 | ||
|
|
546e2ab30b | ||
|
|
6380f1a24a | ||
|
|
e40d3852ff | ||
|
|
e248a7f029 | ||
|
|
91892ec18b | ||
|
|
ff2a9f4b20 | ||
|
|
a3040e22d3 | ||
|
|
2480831e2f | ||
|
|
c72a49d229 | ||
|
|
83b7f94609 | ||
|
|
8b50ed8006 | ||
|
|
d696196d72 | ||
|
|
abc5b2d5f4 | ||
|
|
f4134167a0 | ||
|
|
bc67b1c87e | ||
|
|
4326d7a182 | ||
|
|
8e3a68dbdc | ||
|
|
05148b6e93 | ||
|
|
89447b7bfc | ||
|
|
af122172f1 | ||
|
|
a9ed2e20cb | ||
|
|
be02ac3bc6 | ||
|
|
e3e2e3a56c | ||
|
|
49be954d31 | ||
|
|
ad306dd999 | ||
|
|
2efcf7023f | ||
|
|
f8298b2482 | ||
|
|
c4d3d66f31 | ||
|
|
1ade7a711c | ||
|
|
32b9ee7f6f | ||
|
|
e4c155a881 | ||
|
|
4e6541b404 | ||
|
|
df22c90016 | ||
|
|
ffba088192 | ||
|
|
d639eb1049 | ||
|
|
0a0293d8fb | ||
|
|
4ad825e4fe | ||
|
|
611bb3a857 | ||
|
|
e5b3ec83b3 | ||
|
|
3dc45886f7 | ||
|
|
927d305ed9 | ||
|
|
271fedd1e9 | ||
|
|
23422fdb86 | ||
|
|
7ff2871ad5 | ||
|
|
cbc31a6c41 | ||
|
|
6a1118218b | ||
|
|
eddf33a689 | ||
|
|
08852c6174 | ||
|
|
2bf96d4887 | ||
|
|
9d96baa613 | ||
|
|
a7db42d184 | ||
|
|
3d67234372 | ||
|
|
b1f14ba979 | ||
|
|
a1462946cd | ||
|
|
ae27667f48 | ||
|
|
c6da4d93f1 | ||
|
|
024fea0687 | ||
|
|
cfbcffac5a | ||
|
|
640c486bde | ||
|
|
66e93c8a8c | ||
|
|
8a7ec27dc7 | ||
|
|
9afbe8e3fc | ||
|
|
9b42fbe42f | ||
|
|
ae145ff32e | ||
|
|
a8e99109b1 | ||
|
|
bb4d8ee3e8 | ||
|
|
038f5767f2 | ||
|
|
e2cec7b69c | ||
|
|
6690df1203 | ||
|
|
c21cdf5b02 | ||
|
|
37f320c4a4 | ||
|
|
feb8115d24 | ||
|
|
5c87b8045a | ||
|
|
d8c877fe6e | ||
|
|
67a7ed1e34 | ||
|
|
eabe4f5c29 | ||
|
|
f91f5cb65e | ||
|
|
5951e8fb27 | ||
|
|
be79ccccf6 | ||
|
|
aba121aab0 | ||
|
|
c146ddf29b | ||
|
|
5469270e41 | ||
|
|
457b64037d | ||
|
|
a0f572c26e | ||
|
|
f51669664c | ||
|
|
75f2ba6b19 | ||
|
|
e8d5e8c8ab | ||
|
|
6aa5266029 | ||
|
|
03dd25624f | ||
|
|
0d1c53285b | ||
|
|
aad880b3b5 | ||
|
|
5c2049935a | ||
|
|
d876e4482b | ||
|
|
75097471b6 | ||
|
|
8224d7fc60 | ||
|
|
f2654616eb | ||
|
|
fc0e460222 | ||
|
|
827692b9b0 | ||
|
|
bfad7612c6 | ||
|
|
f1f54c95ab | ||
|
|
5ecf560675 | ||
|
|
b9dd419d04 | ||
|
|
324e596e28 | ||
|
|
1bc9ba46c7 | ||
|
|
c6ccfa0616 | ||
|
|
9e2793dfed | ||
|
|
6a7daaf6c4 | ||
|
|
b6741d9b10 | ||
|
|
78aaf6b47e | ||
|
|
36b08fece7 | ||
|
|
f2a6d2cc5a | ||
|
|
22b7b8efea | ||
|
|
e392d6c16b | ||
|
|
2eec9b10ef | ||
|
|
64f0beb1eb | ||
|
|
f6b6673a41 | ||
|
|
d8042b193b | ||
|
|
5f745ff733 | ||
|
|
bac142ad26 | ||
|
|
caa30a742b | ||
|
|
d7bc47c357 | ||
|
|
5f678eb838 | ||
|
|
64eb1f08a9 | ||
|
|
85e6057598 | ||
|
|
b080e5797b | ||
|
|
f629b2f631 | ||
|
|
c4ee47aa15 | ||
|
|
0c7c31e3bb | ||
|
|
0442258865 | ||
|
|
95f529f9a4 | ||
|
|
be71da5657 | ||
|
|
f16bb85f9b | ||
|
|
5b239adfb8 | ||
|
|
2f54034afe | ||
|
|
fa552ad5af | ||
|
|
35bc384c51 | ||
|
|
d490bd8638 | ||
|
|
8d4f81ff67 | ||
|
|
648204b6f9 | ||
|
|
3f49f020cf | ||
|
|
678eccf33d | ||
|
|
1f0b4853be | ||
|
|
db31f0a087 | ||
|
|
d4247e0179 | ||
|
|
af765c7522 | ||
|
|
dc1a0c554f | ||
|
|
08cdf21aee | ||
|
|
cd7bc3bfd3 | ||
|
|
18ac71e8c0 | ||
|
|
dea557619c | ||
|
|
961f279a82 | ||
|
|
e0be012737 | ||
|
|
d176e83e94 | ||
|
|
541eb45e1a | ||
|
|
53e5c7eebe | ||
|
|
640beeedda | ||
|
|
5285d56a45 | ||
|
|
c2d2287541 | ||
|
|
4d8bdfa07e | ||
|
|
51de4a3347 | ||
|
|
3d45aa7455 | ||
|
|
8f86cfa2d3 | ||
|
|
cad2d72bfe | ||
|
|
0c8223da03 | ||
|
|
7ceaabb166 | ||
|
|
67e14ff363 | ||
|
|
b20f6ff8c1 | ||
|
|
0050e1557d | ||
|
|
654a025a9f | ||
|
|
5368c87dc1 | ||
|
|
1c2de1e483 | ||
|
|
a64e1cb936 | ||
|
|
3903954bf2 | ||
|
|
7c27153ec5 | ||
|
|
4c3a723aa8 | ||
|
|
c4a590f6af | ||
|
|
00c26088b1 | ||
|
|
e77709bc71 | ||
|
|
a2622a556c | ||
|
|
6a9e5deb7b | ||
|
|
20a7e3adf9 | ||
|
|
c6def48fe0 | ||
|
|
f2e62ff439 | ||
|
|
874e32699a | ||
|
|
4a34bee2dc | ||
|
|
b137c82a7a | ||
|
|
23060a6833 | ||
|
|
0db97b8f5b | ||
|
|
3404521d5d | ||
|
|
40609d7da3 | ||
|
|
1f3ab4425a | ||
|
|
6369d76a74 | ||
|
|
6374526f3c | ||
|
|
78105bb4db | ||
|
|
87db89b67a | ||
|
|
87f7324065 | ||
|
|
02d6a10f67 | ||
|
|
029602fc73 | ||
|
|
5aa9592c71 | ||
|
|
bb70622b55 | ||
|
|
b16fa4171a | ||
|
|
7850f7e505 | ||
|
|
22bb0f9d30 | ||
|
|
f29e0bfe6d | ||
|
|
6a40ad8a20 | ||
|
|
f9db7f017d | ||
|
|
aae62ff94e | ||
|
|
71b149de76 | ||
|
|
e8c51a0b54 | ||
|
|
646ace6e59 | ||
|
|
baed5bec46 | ||
|
|
3c91f90dc9 | ||
|
|
ba5e7d4013 | ||
|
|
9797c2fb4b | ||
|
|
972a391296 | ||
|
|
4e41accc56 | ||
|
|
9d034c77a5 | ||
|
|
c1290fd24d | ||
|
|
0a9f02abcc | ||
|
|
0021fb37f3 | ||
|
|
527c988574 | ||
|
|
1c926941d3 | ||
|
|
80c1ec0502 | ||
|
|
eaff0abfb0 | ||
|
|
2ca871a028 | ||
|
|
e225d3e370 | ||
|
|
9a933e2ce5 | ||
|
|
efbea0e942 | ||
|
|
28939d3146 | ||
|
|
307c4f3dd1 | ||
|
|
536167a6c8 | ||
|
|
fe64b04339 | ||
|
|
31878d8a44 | ||
|
|
6f3b70dbb0 | ||
|
|
597705716b | ||
|
|
6db5329d9c | ||
|
|
ea82b90d35 | ||
|
|
706ffbec3c | ||
|
|
f3df86872b | ||
|
|
4c3ea13413 | ||
|
|
c31b65d093 | ||
|
|
bc714ba3a0 | ||
|
|
b7204bf868 | ||
|
|
c4d246cd72 | ||
|
|
b582cf0a5f | ||
|
|
f025afc297 | ||
|
|
57126efe86 | ||
|
|
2ecf65f057 | ||
|
|
d907421ad4 | ||
|
|
ef519231d6 | ||
|
|
83272f5cc5 | ||
|
|
5b1fea46cb | ||
|
|
a9c575b4d0 | ||
|
|
a24b568b73 | ||
|
|
afcf9de8d4 | ||
|
|
9ffedf5e7d | ||
|
|
956deca844 | ||
|
|
ea063ab8b0 | ||
|
|
378126e746 | ||
|
|
41c6294be2 | ||
|
|
ba1e166ac8 | ||
|
|
ea860807c4 | ||
|
|
01d4846526 | ||
|
|
9b70e2e25f | ||
|
|
4d8f5d4df1 | ||
|
|
fa535996ae | ||
|
|
17e215036d | ||
|
|
8ad0ff24f8 | ||
|
|
693285ac0e | ||
|
|
53a16158c7 | ||
|
|
beba4d2ae3 | ||
|
|
36450764f3 | ||
|
|
3996d23b19 | ||
|
|
bf887e82fe | ||
|
|
f5d7f3ca9f | ||
|
|
16bb75be66 | ||
|
|
537194608e | ||
|
|
789c7b60cc | ||
|
|
81d437ac1e | ||
|
|
61c5253dbf | ||
|
|
608c1b0208 | ||
|
|
d11bcdad5f | ||
|
|
686a3c693a | ||
|
|
bee4ca2b28 | ||
|
|
231adbcd31 | ||
|
|
89d514a532 | ||
|
|
6b1d138918 | ||
|
|
5978aff632 | ||
|
|
92096c40ac | ||
|
|
6c4bf58ba5 | ||
|
|
5f8170f4cd | ||
|
|
e08f97a549 | ||
|
|
971314d75a | ||
|
|
c3fa6ff805 | ||
|
|
d1fbbf90c0 | ||
|
|
c5032ba1bc | ||
|
|
237f4df08e | ||
|
|
5b95986705 | ||
|
|
ec1a2f6abf | ||
|
|
811086ac8e | ||
|
|
f20efc57f3 | ||
|
|
c0e5a1ba3b | ||
|
|
5828ab1077 | ||
|
|
acb85b7b72 | ||
|
|
e9884768f6 | ||
|
|
f10bc8eef1 | ||
|
|
708fd640f7 | ||
|
|
14eec6d982 | ||
|
|
69bedf0d37 | ||
|
|
83145e80e5 | ||
|
|
5206410f21 | ||
|
|
0cd895b417 | ||
|
|
6c88201e23 | ||
|
|
7bcd9ff3d6 | ||
|
|
641a5c244c | ||
|
|
323c5d0732 | ||
|
|
6257019926 | ||
|
|
c9c58ab0ec | ||
|
|
cf92e7f64b | ||
|
|
8371006d90 | ||
|
|
3b109f7612 | ||
|
|
ebc2ad54d6 | ||
|
|
4a1b04e57b | ||
|
|
205676a97d | ||
|
|
0456cadff6 | ||
|
|
aa6d584ae3 | ||
|
|
ef07a6035e | ||
|
|
86b66120d0 | ||
|
|
3bdb330f5b | ||
|
|
4f8d3b0e2b | ||
|
|
87fd136e21 | ||
|
|
cab5bf8849 | ||
|
|
d74dfc9ee7 | ||
|
|
c305b72b91 | ||
|
|
dc1563d916 | ||
|
|
906d42688e | ||
|
|
b3bff92cc2 | ||
|
|
ae7820e8f2 | ||
|
|
3023ea5335 | ||
|
|
22060ac5a4 | ||
|
|
3f3a31e475 | ||
|
|
231306ea7c | ||
|
|
002339fb86 | ||
|
|
8b38a326cb | ||
|
|
5edb5f6487 | ||
|
|
61251d20c1 | ||
|
|
ccf7db7cc2 | ||
|
|
e1c1937855 | ||
|
|
9471c30f89 | ||
|
|
40545bd48e | ||
|
|
6b02bf8e8c | ||
|
|
0d05e607f0 | ||
|
|
717aa94ba9 | ||
|
|
9caba57c14 | ||
|
|
70f48343ee | ||
|
|
f17f103d12 | ||
|
|
27e311f7e8 | ||
|
|
5258bf9c84 | ||
|
|
10f0631487 | ||
|
|
97fc92b1bb | ||
|
|
06718c580e | ||
|
|
15528ef8d7 | ||
|
|
b71f96e4e5 | ||
|
|
278de1398b | ||
|
|
c5459a2f19 | ||
|
|
c1d4a0dd28 | ||
|
|
691fe611d6 | ||
|
|
6a1af891b7 | ||
|
|
35b3013386 | ||
|
|
d1a9695a35 | ||
|
|
c6beaa1631 | ||
|
|
33f0eaada0 | ||
|
|
c5fa84cd28 | ||
|
|
bacb284415 | ||
|
|
650269d356 | ||
|
|
b0319ec0f1 | ||
|
|
6e0f83a298 | ||
|
|
747408871d | ||
|
|
0129da4dd6 | ||
|
|
3f3772463b | ||
|
|
4de042bf58 | ||
|
|
8c523be6f5 | ||
|
|
078493912c | ||
|
|
cbf105f2a0 | ||
|
|
bba6664b1c | ||
|
|
b06d045188 | ||
|
|
79d164309f | ||
|
|
f2afcc0bc8 | ||
|
|
43f82cd95d | ||
|
|
2b70cb436e | ||
|
|
9a861f46d0 | ||
|
|
bb28903c8e | ||
|
|
e8eadc5d20 | ||
|
|
e741a4f294 | ||
|
|
1678a25fd6 | ||
|
|
ff70b0a2c8 | ||
|
|
3803c64226 | ||
|
|
35a541c824 | ||
|
|
ab8420f5a9 | ||
|
|
fa46757830 | ||
|
|
ed35a90cfb | ||
|
|
d8bce0f202 | ||
|
|
e6f600bb47 | ||
|
|
519af6a5d0 | ||
|
|
c6c4aff8ae | ||
|
|
6d4abac016 | ||
|
|
d34cb80b68 | ||
|
|
57641f7228 | ||
|
|
9ae86f2585 | ||
|
|
1e7e9d6101 | ||
|
|
8bbc16ed4b | ||
|
|
4745b3efeb | ||
|
|
09f79b94dd | ||
|
|
42357dee0b | ||
|
|
2e73cd6c4d | ||
|
|
161978ab05 | ||
|
|
994bc9279f | ||
|
|
fb08910db3 | ||
|
|
e607f49ae6 | ||
|
|
52cf1f6a4b | ||
|
|
61f9966fe0 | ||
|
|
5f7cdb8d42 | ||
|
|
901c0e7e41 | ||
|
|
98cad8779c | ||
|
|
fc597ba86e | ||
|
|
f5bd8abfda | ||
|
|
8be72e6c27 | ||
|
|
2740013625 | ||
|
|
119e03b64f | ||
|
|
c6dbeee245 | ||
|
|
feb3a13a71 | ||
|
|
c80d1c15d2 | ||
|
|
b9ba795cb0 | ||
|
|
598b841bf7 | ||
|
|
93b3857a9b | ||
|
|
5414b5d189 | ||
|
|
b4e362d700 | ||
|
|
eabb91da1e | ||
|
|
fe574b008b | ||
|
|
b8fe8a4363 | ||
|
|
6acbdc442d | ||
|
|
f7cd5cb76f | ||
|
|
e2195de719 | ||
|
|
3921aa4e54 | ||
|
|
48ca0254fe | ||
|
|
375a7605ae | ||
|
|
8097b150a0 | ||
|
|
67cf4230ac | ||
|
|
b06cff7928 | ||
|
|
d65374f7f9 | ||
|
|
f0b0999f65 | ||
|
|
e55845ac52 | ||
|
|
229693dd71 | ||
|
|
5e8e6f4c8b | ||
|
|
98f9e2f870 | ||
|
|
2b51cda6da | ||
|
|
65a31cc8a9 | ||
|
|
737f912abb | ||
|
|
f6957aa367 | ||
|
|
ad79f67ab6 | ||
|
|
a9fcf106ab | ||
|
|
0f47c9956c | ||
|
|
d4ac5f829f | ||
|
|
d31a675ca8 | ||
|
|
96f620829f | ||
|
|
5fa0f62ccc | ||
|
|
b825862f95 | ||
|
|
8d06b54091 | ||
|
|
df5143c818 | ||
|
|
ca6a3a2ad9 | ||
|
|
6934b7ed56 | ||
|
|
987822bd5a | ||
|
|
189c8aca79 | ||
|
|
b6aa7f430c | ||
|
|
d8e772cfc4 | ||
|
|
ec959f0052 | ||
|
|
3d813e68e9 | ||
|
|
37b4734bbe | ||
|
|
b613a742f5 | ||
|
|
72de35a2a1 | ||
|
|
970a029cea | ||
|
|
d5a5abe202 | ||
|
|
6ff253d0d8 | ||
|
|
749d26c8f4 | ||
|
|
f1998497f2 | ||
|
|
d0c2ab4cf1 | ||
|
|
7871a3edb5 | ||
|
|
9f51e2c407 | ||
|
|
2930a94c79 | ||
|
|
9026cc4977 | ||
|
|
e3290c1117 | ||
|
|
bacd467b4c | ||
|
|
4988f0603f | ||
|
|
6a944d3e7d | ||
|
|
0e18a12472 | ||
|
|
f202197545 | ||
|
|
496f507684 | ||
|
|
55062c7ec5 | ||
|
|
6c21391ff5 | ||
|
|
a1347e7bf1 | ||
|
|
c7635a362f | ||
|
|
97c0e2dfcd | ||
|
|
dfa7c3b72e | ||
|
|
4073688ba6 | ||
|
|
693867f074 | ||
|
|
f9afa79b01 | ||
|
|
a870ea2389 | ||
|
|
ac2911c222 | ||
|
|
c786980454 | ||
|
|
47534decb3 | ||
|
|
0df242e0e9 | ||
|
|
10650d2cd1 | ||
|
|
186b4abfd8 | ||
|
|
9ce2adceef | ||
|
|
5cd4f88b8c | ||
|
|
683ecb3326 | ||
|
|
67c882648f | ||
|
|
8b0390f354 | ||
|
|
6d954ad7e0 | ||
|
|
646608bf8b | ||
|
|
be90badc8d | ||
|
|
3155d79a7e | ||
|
|
dace762a6c | ||
|
|
7577d2eb05 | ||
|
|
90019023c7 | ||
|
|
5d02c72687 | ||
|
|
81d70a921d | ||
|
|
363453fd06 | ||
|
|
1599f3a666 | ||
|
|
70d383fb1b | ||
|
|
f911f0cfca | ||
|
|
1fb14d5a40 | ||
|
|
616c20fc1e | ||
|
|
6cf14e6a2a | ||
|
|
9f812b7069 | ||
|
|
efabf35613 | ||
|
|
3f640139d2 | ||
|
|
b0c1097f86 | ||
|
|
68a3505091 | ||
|
|
6e47d2f1b5 | ||
|
|
2bcb27b24f | ||
|
|
6ac5fe60d9 | ||
|
|
8356ad7bfa | ||
|
|
69eee7ca0a | ||
|
|
4f944cf01c | ||
|
|
8676481aab | ||
|
|
e66e8b11cb | ||
|
|
1401de2e7d | ||
|
|
15c730a22a | ||
|
|
3b06563960 | ||
|
|
cf33ed58c1 | ||
|
|
c8a6be1454 | ||
|
|
5b7f629996 | ||
|
|
a4c16b896b | ||
|
|
d150ee0d05 | ||
|
|
7bf69d067a | ||
|
|
ccc43cc0ed | ||
|
|
f7091d2fdd | ||
|
|
1e2cd9c2d1 | ||
|
|
a2a3d7a0f9 | ||
|
|
abc306be6c | ||
|
|
ccea483f4f | ||
|
|
84aac88677 | ||
|
|
b30df2115c | ||
|
|
8d46077ac2 | ||
|
|
0441fcf3df | ||
|
|
b223d3b385 | ||
|
|
e033ce6c43 | ||
|
|
6681205337 | ||
|
|
6da1a1077d | ||
|
|
80bae0563d | ||
|
|
9a00ec128c | ||
|
|
bc092d5c77 | ||
|
|
1c9a78a2f1 | ||
|
|
11eb0a89eb | ||
|
|
d7d6b3b4a2 | ||
|
|
f5d95f7314 | ||
|
|
a6d029c556 | ||
|
|
ed9c29d365 | ||
|
|
527c390152 | ||
|
|
a6c794cb11 | ||
|
|
ff462580b0 | ||
|
|
6869c679ef | ||
|
|
4dab36d3b2 | ||
|
|
cfe63fa274 | ||
|
|
c1469f4e39 | ||
|
|
3601b44429 | ||
|
|
b3510d6973 | ||
|
|
d9780239b6 | ||
|
|
fb3ca441ba | ||
|
|
efd0dab316 | ||
|
|
f1b72dfa09 | ||
|
|
4d0b492ba0 | ||
|
|
3bcb447e03 | ||
|
|
108af83ae8 | ||
|
|
275a55266b | ||
|
|
18504ca14e | ||
|
|
6aba9f8eda | ||
|
|
e8494c3dc7 | ||
|
|
caa3cb7d89 | ||
|
|
67dbd9fba9 | ||
|
|
19238b9326 | ||
|
|
8c3fed7559 | ||
|
|
17bb47676e | ||
|
|
757604fd60 | ||
|
|
c75118caa2 | ||
|
|
0b5085ecbb | ||
|
|
64fdb290eb | ||
|
|
a714edbf2b | ||
|
|
735c298de3 | ||
|
|
db07ef7899 | ||
|
|
03caaeef07 | ||
|
|
91793a7a8e | ||
|
|
7323ae5bf5 | ||
|
|
d04cc03c1c | ||
|
|
4fb273284d | ||
|
|
3bfdbad5ba | ||
|
|
890751951c | ||
|
|
ba7e02c3b1 | ||
|
|
622ab27254 | ||
|
|
f17e851435 | ||
|
|
5e84a6c39e | ||
|
|
a86f2720bc | ||
|
|
b174d49f9d | ||
|
|
31ed719df1 | ||
|
|
c19538d6ce | ||
|
|
3adf5fe3fd | ||
|
|
bd0e121f0e | ||
|
|
de1f7861d6 | ||
|
|
5a58c8bda4 | ||
|
|
6396c60645 | ||
|
|
f700bb4efa | ||
|
|
53e5894759 | ||
|
|
8fe05fdff3 | ||
|
|
e002575eae | ||
|
|
e1919c5ea3 | ||
|
|
fcf683c8a7 | ||
|
|
e564d34ca8 | ||
|
|
61d7db6eb6 | ||
|
|
5768f73bbd | ||
|
|
df94dd7487 | ||
|
|
4221781d9b | ||
|
|
e0556789d2 | ||
|
|
9310d92605 | ||
|
|
8a2f57d234 | ||
|
|
d72323bfc5 | ||
|
|
dfd0356609 | ||
|
|
20a7aa03ed | ||
|
|
e02e0219a7 | ||
|
|
d04201d069 | ||
|
|
82de2ca4ec | ||
|
|
18450058d7 | ||
|
|
f20b2593bc | ||
|
|
4d51a5de7e | ||
|
|
8e0b61ca35 | ||
|
|
61a543a694 | ||
|
|
5608e97719 | ||
|
|
d6f27add66 | ||
|
|
740ab7e479 | ||
|
|
ea09a25563 | ||
|
|
5a08c62f1b | ||
|
|
be1d7781c5 | ||
|
|
40ac80a3e9 | ||
|
|
5f747e1a90 | ||
|
|
0c3537ac1a | ||
|
|
e6caf9ece4 | ||
|
|
34c60c69d8 | ||
|
|
5ff915476a | ||
|
|
e5d2ebc57c | ||
|
|
64815b1b0b | ||
|
|
59120d3019 | ||
|
|
9245ab01f1 | ||
|
|
59fe9279d1 | ||
|
|
046c9ef920 | ||
|
|
bca22f26c5 | ||
|
|
2b68b88b14 | ||
|
|
97cedfc712 | ||
|
|
86cb3e9376 | ||
|
|
42993a78ed | ||
|
|
2a5ca9d3df | ||
|
|
323bd79d0e | ||
|
|
60adbffacf | ||
|
|
f827a2963e | ||
|
|
5e293c0f45 | ||
|
|
cd7adfed0a | ||
|
|
902bf3a0a6 | ||
|
|
f736e5243c | ||
|
|
fb2c2ed09a | ||
|
|
ea38968be9 | ||
|
|
562b047362 | ||
|
|
381c9009fb | ||
|
|
c0a4574069 | ||
|
|
de9bf4bb47 | ||
|
|
c57bfccb9e | ||
|
|
52cae92dd7 | ||
|
|
b80b08f04f | ||
|
|
304e5b997a | ||
|
|
6b4dbfbd62 | ||
|
|
000ca35727 | ||
|
|
776fe2ad70 | ||
|
|
9174b32ef1 | ||
|
|
602727b7ad | ||
|
|
56deea9f10 | ||
|
|
8e0be29c13 | ||
|
|
b71b1b5535 | ||
|
|
5b3524f174 | ||
|
|
f9a70a8b04 | ||
|
|
b652ea5024 | ||
|
|
2a37a0cb19 | ||
|
|
761600f325 | ||
|
|
65f14c7d21 | ||
|
|
864ba52bc5 | ||
|
|
fdb5020c0c | ||
|
|
62344b5194 | ||
|
|
0db12fcd22 | ||
|
|
455ee4f91b | ||
|
|
5ca391f914 | ||
|
|
a32abae5a3 | ||
|
|
b2dd3ecf3a | ||
|
|
cc7017b62d | ||
|
|
f852e8a01d | ||
|
|
6ff1c30a4b | ||
|
|
85ea45a64a | ||
|
|
7b258bc229 | ||
|
|
5ba3499f56 | ||
|
|
f4a6a3c4b2 | ||
|
|
5967dc4983 | ||
|
|
bf58c340bc | ||
|
|
dc0b15bdfa | ||
|
|
be6fbc2432 | ||
|
|
51a5542446 | ||
|
|
3938abc5dd | ||
|
|
4961a97ed4 | ||
|
|
fb477fad1e | ||
|
|
a070bccffb | ||
|
|
8e1105b12a | ||
|
|
93e4a04118 | ||
|
|
6e3313b461 | ||
|
|
2e77b0a3c7 | ||
|
|
16c22e07b8 | ||
|
|
99b0f9eb7c |
4
.babelrc
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"presets": ["react", "es2015", "es2016"],
|
||||
"plugins": ["transform-class-properties", "transform-object-rest-spread", "transform-async-to-generator", "transform-runtime", "add-module-exports"]
|
||||
}
|
||||
23
.editorconfig
Normal file
@@ -0,0 +1,23 @@
|
||||
# Copyright 2017 Aviral Dasgupta
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset=utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
2
.eslintignore
Normal file
@@ -0,0 +1,2 @@
|
||||
src/vector/modernizr.js
|
||||
src/component-index.js
|
||||
3
.eslintrc.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ["./node_modules/matrix-react-sdk/.eslintrc.js"],
|
||||
}
|
||||
44
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<!-- This is a bug report template. By following the instructions below and
|
||||
filling out the sections with your information, you will help the us to get all
|
||||
the necessary data to fix your issue.
|
||||
|
||||
You can also preview your report before submitting it. You may remove sections
|
||||
that aren't relevant to your particular case.
|
||||
|
||||
Text between <!-- and --> marks will be invisible in the report.
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
Describe here the problem that you are experiencing, or the feature you are requesting.
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
- For bugs, list the steps
|
||||
- that reproduce the bug
|
||||
- using hyphens as bullet points
|
||||
|
||||
Describe how what happens differs from what you expected.
|
||||
|
||||
Log: sent/not sent? <!-- You can send us the app's logs via the 'Report bug'
|
||||
link on the 'Settings' page. Very important for hard-to-reproduce bugs. Please
|
||||
file a bug here too! -->
|
||||
|
||||
<!-- Include screenshots if possible: you can drag and drop images below. -->
|
||||
|
||||
### Version information
|
||||
|
||||
<!-- IMPORTANT: please answer the following questions, to help us narrow down the problem -->
|
||||
|
||||
- **Platform**: web (in-browser) or desktop?
|
||||
|
||||
For the web app:
|
||||
|
||||
- **Browser**: Chrome, Safari, Firefox? which version?
|
||||
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
|
||||
- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web?
|
||||
|
||||
For the desktop app:
|
||||
|
||||
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
|
||||
- **Version**: 0.x.y <!-- check the user settings panel if unsure -->
|
||||
12
.gitignore
vendored
@@ -1,12 +1,14 @@
|
||||
/build
|
||||
/cert.pem
|
||||
/dist
|
||||
/karma-reports
|
||||
/key.pem
|
||||
/lib
|
||||
/node_modules
|
||||
/packages/
|
||||
/vector/bundle.*
|
||||
/vector/components.css
|
||||
/vector/emojione/
|
||||
/vector/config.json
|
||||
/vector/olm.js
|
||||
/webapp
|
||||
/.npmrc
|
||||
.DS_Store
|
||||
npm-debug.log
|
||||
electron/dist
|
||||
electron/pub
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
example
|
||||
examples
|
||||
build/.module-cache
|
||||
|
||||
@@ -3,4 +3,5 @@ node_js:
|
||||
- 6 # node v6, to match jenkins
|
||||
install:
|
||||
- npm install
|
||||
- (cd node_modules/matrix-react-sdk && npm run build)
|
||||
- (cd node_modules/matrix-js-sdk && npm install)
|
||||
- (cd node_modules/matrix-react-sdk && npm install)
|
||||
|
||||
@@ -10,3 +10,6 @@ include:
|
||||
|
||||
* Florent VIOLLEAU (https://github.com/floviolleau) <floviolleau at gmail dot com>
|
||||
Improve README.md for a better understanding of installation instructions
|
||||
|
||||
* Michael Telatynski (https://github.com/t3chguy)
|
||||
Improved consistency of inverted elements in dark theme across browsers
|
||||
|
||||
461
CHANGELOG.md
@@ -1,3 +1,464 @@
|
||||
Changes in [0.9.8-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.9.8-rc.2) (2017-04-10)
|
||||
====================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.8-rc.1...v0.9.8-rc.2)
|
||||
|
||||
* Redacted events bg: black lozenge -> torn paper
|
||||
[\#3596](https://github.com/vector-im/riot-web/pull/3596)
|
||||
* Add 'app' parameter to rageshake report
|
||||
[\#3594](https://github.com/vector-im/riot-web/pull/3594)
|
||||
|
||||
Changes in [0.9.8-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.8-rc.1) (2017-04-07)
|
||||
====================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7...v0.9.8-rc.1)
|
||||
|
||||
* Add support for indexeddb sync in webworker
|
||||
[\#3578](https://github.com/vector-im/riot-web/pull/3578)
|
||||
* Add CSS to make Emote sender cursor : pointer
|
||||
[\#3574](https://github.com/vector-im/riot-web/pull/3574)
|
||||
* Remove rageshake server
|
||||
[\#3565](https://github.com/vector-im/riot-web/pull/3565)
|
||||
* Adjust CSS for matrix-org/matrix-react-sdk#789
|
||||
[\#3566](https://github.com/vector-im/riot-web/pull/3566)
|
||||
* Fix tests to reflect recent changes
|
||||
[\#3537](https://github.com/vector-im/riot-web/pull/3537)
|
||||
* Do not assume getTs will return comparable integer
|
||||
[\#3536](https://github.com/vector-im/riot-web/pull/3536)
|
||||
* Rename ReactPerf to Perf
|
||||
[\#3535](https://github.com/vector-im/riot-web/pull/3535)
|
||||
* Don't show phone number as target for email notifs
|
||||
[\#3530](https://github.com/vector-im/riot-web/pull/3530)
|
||||
* Fix people section again
|
||||
[\#3458](https://github.com/vector-im/riot-web/pull/3458)
|
||||
* dark theme invert inconsistent across browsers
|
||||
[\#3479](https://github.com/vector-im/riot-web/pull/3479)
|
||||
* CSS for adding phone number in UserSettings
|
||||
[\#3451](https://github.com/vector-im/riot-web/pull/3451)
|
||||
* Support for phone number registration/signin, mk2
|
||||
[\#3426](https://github.com/vector-im/riot-web/pull/3426)
|
||||
* Confirm redactions with a dialog
|
||||
[\#3470](https://github.com/vector-im/riot-web/pull/3470)
|
||||
* Better CSS for redactions
|
||||
[\#3453](https://github.com/vector-im/riot-web/pull/3453)
|
||||
* Fix the people section
|
||||
[\#3448](https://github.com/vector-im/riot-web/pull/3448)
|
||||
* Merge the two RoomTile context menus into one
|
||||
[\#3395](https://github.com/vector-im/riot-web/pull/3395)
|
||||
* Refactor screen set after login
|
||||
[\#3385](https://github.com/vector-im/riot-web/pull/3385)
|
||||
* CSS for redacted EventTiles
|
||||
[\#3379](https://github.com/vector-im/riot-web/pull/3379)
|
||||
* Height:100% for welcome pages on Safari
|
||||
[\#3340](https://github.com/vector-im/riot-web/pull/3340)
|
||||
* `view_room` dispatch from `onClick` RoomTile
|
||||
[\#3376](https://github.com/vector-im/riot-web/pull/3376)
|
||||
* Hide statusAreaBox_line entirely when inCall
|
||||
[\#3350](https://github.com/vector-im/riot-web/pull/3350)
|
||||
* Set padding-bottom: 0px for .mx_Dialog spinner
|
||||
[\#3351](https://github.com/vector-im/riot-web/pull/3351)
|
||||
* Support InteractiveAuth based registration
|
||||
[\#3333](https://github.com/vector-im/riot-web/pull/3333)
|
||||
* Expose notification option for username/MXID
|
||||
[\#3334](https://github.com/vector-im/riot-web/pull/3334)
|
||||
* Float the toggle in the top right of MELS
|
||||
[\#3190](https://github.com/vector-im/riot-web/pull/3190)
|
||||
* More aggressive rageshake log culling
|
||||
[\#3311](https://github.com/vector-im/riot-web/pull/3311)
|
||||
* Don't overflow directory network options
|
||||
[\#3282](https://github.com/vector-im/riot-web/pull/3282)
|
||||
* CSS for ban / kick reason prompt
|
||||
[\#3250](https://github.com/vector-im/riot-web/pull/3250)
|
||||
* Allow forgetting rooms you're banned from
|
||||
[\#3246](https://github.com/vector-im/riot-web/pull/3246)
|
||||
* Fix icon paths in manifest
|
||||
[\#3245](https://github.com/vector-im/riot-web/pull/3245)
|
||||
* Fix broken tests caused by adding IndexedDB support
|
||||
[\#3242](https://github.com/vector-im/riot-web/pull/3242)
|
||||
* CSS for un-ban button in RoomSettings
|
||||
[\#3227](https://github.com/vector-im/riot-web/pull/3227)
|
||||
* Remove z-index property on avatar initials
|
||||
[\#3239](https://github.com/vector-im/riot-web/pull/3239)
|
||||
* Reposition certain icons in the status bar
|
||||
[\#3233](https://github.com/vector-im/riot-web/pull/3233)
|
||||
* CSS for kick/ban confirmation dialog
|
||||
[\#3224](https://github.com/vector-im/riot-web/pull/3224)
|
||||
* Style for split-out interactive auth
|
||||
[\#3217](https://github.com/vector-im/riot-web/pull/3217)
|
||||
* Use the teamToken threaded through from react sdk
|
||||
[\#3196](https://github.com/vector-im/riot-web/pull/3196)
|
||||
* rageshake: Add file server with basic auth
|
||||
[\#3169](https://github.com/vector-im/riot-web/pull/3169)
|
||||
* Fix bug with home icon not appearing when logged in as team member
|
||||
[\#3162](https://github.com/vector-im/riot-web/pull/3162)
|
||||
* Add ISSUE_TEMPLATE
|
||||
[\#2836](https://github.com/vector-im/riot-web/pull/2836)
|
||||
* Store bug reports in separate directories
|
||||
[\#3150](https://github.com/vector-im/riot-web/pull/3150)
|
||||
* Quick and dirty support for custom welcome pages.
|
||||
[\#2575](https://github.com/vector-im/riot-web/pull/2575)
|
||||
* RTS Welcome Pages
|
||||
[\#3103](https://github.com/vector-im/riot-web/pull/3103)
|
||||
* rageshake: Abide by Go standards
|
||||
[\#3149](https://github.com/vector-im/riot-web/pull/3149)
|
||||
* Bug report server script
|
||||
[\#3072](https://github.com/vector-im/riot-web/pull/3072)
|
||||
* Bump olm version
|
||||
[\#3125](https://github.com/vector-im/riot-web/pull/3125)
|
||||
|
||||
Changes in [0.9.7](https://github.com/vector-im/riot-web/releases/tag/v0.9.7) (2017-02-04)
|
||||
==========================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.3...v0.9.7)
|
||||
|
||||
* Update to matrix-js-sdk 0.7.5 (no changes from 0.7.5-rc.3)
|
||||
* Update to matrix-react-sdk 0.8.6 (no changes from 0.8.6-rc.3)
|
||||
|
||||
Changes in [0.9.7-rc.3](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.3) (2017-02-03)
|
||||
====================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.2...v0.9.7-rc.3)
|
||||
* Update to latest Olm to fix key import/export and use of megolm sessions
|
||||
created on more recent versions
|
||||
* Update to latest matrix-react-sdk and matrix-js-sdk to fix e2e device
|
||||
handling
|
||||
|
||||
Changes in [0.9.7-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.2) (2017-02-03)
|
||||
====================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.1...v0.9.7-rc.2)
|
||||
|
||||
* Update matrix-js-sdk to get new device change
|
||||
notifications interface for more reliable e2e crypto
|
||||
|
||||
Changes in [0.9.7-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.1) (2017-02-03)
|
||||
====================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.6...v0.9.7-rc.1)
|
||||
|
||||
* Better user interface for screen readers and keyboard navigation
|
||||
[\#2946](https://github.com/vector-im/riot-web/pull/2946)
|
||||
* Allow mxc: URLs for icons in the NetworkDropdown
|
||||
[\#3118](https://github.com/vector-im/riot-web/pull/3118)
|
||||
* make TopRightMenu more intuitive
|
||||
[\#3117](https://github.com/vector-im/riot-web/pull/3117)
|
||||
* Handle icons with width > height
|
||||
[\#3110](https://github.com/vector-im/riot-web/pull/3110)
|
||||
* Fix jenkins build
|
||||
[\#3105](https://github.com/vector-im/riot-web/pull/3105)
|
||||
* Add CSS for a support box in login
|
||||
[\#3081](https://github.com/vector-im/riot-web/pull/3081)
|
||||
* Allow a custom login logo to be displayed on login
|
||||
[\#3082](https://github.com/vector-im/riot-web/pull/3082)
|
||||
* Fix the width of input fields within login/reg box
|
||||
[\#3080](https://github.com/vector-im/riot-web/pull/3080)
|
||||
* Set BaseAvatar_image bg colour = #fff
|
||||
[\#3057](https://github.com/vector-im/riot-web/pull/3057)
|
||||
* only recalculate favicon if it changes
|
||||
[\#3067](https://github.com/vector-im/riot-web/pull/3067)
|
||||
* CSS tweak for email address lookup
|
||||
[\#3064](https://github.com/vector-im/riot-web/pull/3064)
|
||||
* Glue the dialog to rageshake: honour sendLogs flag.
|
||||
[\#3061](https://github.com/vector-im/riot-web/pull/3061)
|
||||
* Don't use hash-named directory for dev server
|
||||
[\#3049](https://github.com/vector-im/riot-web/pull/3049)
|
||||
* Implement bug reporting logic
|
||||
[\#3000](https://github.com/vector-im/riot-web/pull/3000)
|
||||
* Add css for bug report dialog
|
||||
[\#3045](https://github.com/vector-im/riot-web/pull/3045)
|
||||
* Increase the max-height of the expanded status bar
|
||||
[\#3043](https://github.com/vector-im/riot-web/pull/3043)
|
||||
* Hopefully, fix intermittent test failure
|
||||
[\#3040](https://github.com/vector-im/riot-web/pull/3040)
|
||||
* CSS for 'searching known users'
|
||||
[\#2971](https://github.com/vector-im/riot-web/pull/2971)
|
||||
* Animate status bar max-height and margin-top
|
||||
[\#2981](https://github.com/vector-im/riot-web/pull/2981)
|
||||
* Add eslint config
|
||||
[\#3032](https://github.com/vector-im/riot-web/pull/3032)
|
||||
* Re-position typing avatars relative to "is typing"
|
||||
[\#3030](https://github.com/vector-im/riot-web/pull/3030)
|
||||
* CSS for avatars that appear when users are typing
|
||||
[\#2998](https://github.com/vector-im/riot-web/pull/2998)
|
||||
* Add StartupWMClass
|
||||
[\#3001](https://github.com/vector-im/riot-web/pull/3001)
|
||||
* Fix link to image for event options menu
|
||||
[\#3002](https://github.com/vector-im/riot-web/pull/3002)
|
||||
* Make riot desktop single instance
|
||||
[\#2999](https://github.com/vector-im/riot-web/pull/2999)
|
||||
* Add electron tray icon
|
||||
[\#2997](https://github.com/vector-im/riot-web/pull/2997)
|
||||
* Fixes to electron desktop notifs
|
||||
[\#2994](https://github.com/vector-im/riot-web/pull/2994)
|
||||
* Auto-hide the electron menu bar
|
||||
[\#2975](https://github.com/vector-im/riot-web/pull/2975)
|
||||
* A couple of tweaks to the karma config
|
||||
[\#2987](https://github.com/vector-im/riot-web/pull/2987)
|
||||
* Deploy script
|
||||
[\#2974](https://github.com/vector-im/riot-web/pull/2974)
|
||||
* Use the postcss-webpack-loader
|
||||
[\#2990](https://github.com/vector-im/riot-web/pull/2990)
|
||||
* Switch CSS to using postcss, and implement a dark theme.
|
||||
[\#2973](https://github.com/vector-im/riot-web/pull/2973)
|
||||
* Update redeploy script to keep old bundles
|
||||
[\#2969](https://github.com/vector-im/riot-web/pull/2969)
|
||||
* Include current version in update check explicitly
|
||||
[\#2967](https://github.com/vector-im/riot-web/pull/2967)
|
||||
* Add another layer of directory to webpack chunks
|
||||
[\#2966](https://github.com/vector-im/riot-web/pull/2966)
|
||||
* Fix links to fonts and images from CSS
|
||||
[\#2965](https://github.com/vector-im/riot-web/pull/2965)
|
||||
* Put parent build hash in webpack output filenames
|
||||
[\#2961](https://github.com/vector-im/riot-web/pull/2961)
|
||||
* update README to point to new names/locations
|
||||
[\#2846](https://github.com/vector-im/riot-web/pull/2846)
|
||||
|
||||
Changes in [0.9.6](https://github.com/vector-im/riot-web/releases/tag/v0.9.6) (2017-01-16)
|
||||
==========================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.6-rc.1...v0.9.6)
|
||||
|
||||
* Update to matrix-js-sdk 0.9.6 for video calling fix
|
||||
|
||||
Changes in [0.9.6-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.6-rc.1) (2017-01-13)
|
||||
====================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.5...v0.9.6-rc.1)
|
||||
|
||||
* Build the js-sdk in the CI script
|
||||
[\#2920](https://github.com/vector-im/riot-web/pull/2920)
|
||||
* Hopefully fix Windows shortcuts
|
||||
[\#2917](https://github.com/vector-im/riot-web/pull/2917)
|
||||
* Update README now the js-sdk has a transpile step
|
||||
[\#2921](https://github.com/vector-im/riot-web/pull/2921)
|
||||
* Use the role for 'toggle dev tools'
|
||||
[\#2915](https://github.com/vector-im/riot-web/pull/2915)
|
||||
* Enable screen sharing easter-egg in desktop app
|
||||
[\#2909](https://github.com/vector-im/riot-web/pull/2909)
|
||||
* make electron send email validation URLs with a nextlink of riot.im
|
||||
[\#2808](https://github.com/vector-im/riot-web/pull/2808)
|
||||
* add Debian Stretch install steps to readme
|
||||
[\#2809](https://github.com/vector-im/riot-web/pull/2809)
|
||||
* Update desktop build instructions fixes #2792
|
||||
[\#2793](https://github.com/vector-im/riot-web/pull/2793)
|
||||
* CSS for the delete threepid button
|
||||
[\#2784](https://github.com/vector-im/riot-web/pull/2784)
|
||||
|
||||
Changes in [0.9.5](https://github.com/vector-im/riot-web/releases/tag/v0.9.5) (2016-12-24)
|
||||
==========================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.4...v0.9.5)
|
||||
|
||||
* make electron send email validation URLs with a nextlink of riot.im rather than file:///
|
||||
* add gnu-tar to debian electron build deps
|
||||
* fix win32 shortcut in start menu
|
||||
|
||||
Changes in [0.9.4](https://github.com/vector-im/riot-web/releases/tag/v0.9.4) (2016-12-22)
|
||||
==========================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.3...v0.9.4)
|
||||
|
||||
* Update to libolm 2.1.0. This should help resolve a problem with browser
|
||||
sessions being logged out ([\#2726](https://github.com/vector-im/riot-web/issues/2726)).
|
||||
|
||||
Changes in [0.9.3](https://github.com/vector-im/riot-web/releases/tag/v0.9.3) (2016-12-22)
|
||||
==========================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.2...v0.9.3)
|
||||
|
||||
* (from matrix-react-sdk) Fix regression where the date separator would be displayed
|
||||
at the wrong time of day.
|
||||
* README.md: fix GFMD for nativefier
|
||||
[\#2755](https://github.com/vector-im/riot-web/pull/2755)
|
||||
|
||||
Changes in [0.9.2](https://github.com/vector-im/riot-web/releases/tag/v0.9.2) (2016-12-16)
|
||||
==========================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.1...v0.9.2)
|
||||
|
||||
* Remove the client side filtering from the room dir
|
||||
[\#2750](https://github.com/vector-im/riot-web/pull/2750)
|
||||
* Configure olm memory size
|
||||
[\#2745](https://github.com/vector-im/riot-web/pull/2745)
|
||||
* Support room dir 3rd party network filtering
|
||||
[\#2747](https://github.com/vector-im/riot-web/pull/2747)
|
||||
|
||||
Changes in [0.9.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.1) (2016-12-09)
|
||||
==========================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.1-rc.2...v0.9.1)
|
||||
|
||||
* Update README to say how to build the desktop app
|
||||
[\#2732](https://github.com/vector-im/riot-web/pull/2732)
|
||||
* Add signing ID in release_config.yaml
|
||||
[\#2731](https://github.com/vector-im/riot-web/pull/2731)
|
||||
* Makeover!
|
||||
[\#2722](https://github.com/vector-im/riot-web/pull/2722)
|
||||
* Fix broken tests
|
||||
[\#2730](https://github.com/vector-im/riot-web/pull/2730)
|
||||
* Make the 'loading' tests work in isolation
|
||||
[\#2727](https://github.com/vector-im/riot-web/pull/2727)
|
||||
* Use a PNG for the icon on non-Windows
|
||||
[\#2708](https://github.com/vector-im/riot-web/pull/2708)
|
||||
* Add missing brackets to call to toUpperCase
|
||||
[\#2703](https://github.com/vector-im/riot-web/pull/2703)
|
||||
|
||||
Changes in [0.9.1-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.9.1-rc.2) (2016-12-06)
|
||||
====================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.1-rc.1...v0.9.1-rc.2)
|
||||
|
||||
* Fix clicking on notifications
|
||||
[\#2700](https://github.com/vector-im/riot-web/pull/2700)
|
||||
* Desktop app: Only show window when ready
|
||||
[\#2697](https://github.com/vector-im/riot-web/pull/2697)
|
||||
|
||||
Changes in [0.9.1-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.1-rc.1) (2016-12-05)
|
||||
====================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.0...v0.9.1-rc.1)
|
||||
|
||||
* Final bits to prepare electron distribtion:
|
||||
[\#2653](https://github.com/vector-im/riot-web/pull/2653)
|
||||
* Update name & repo to reflect renamed repository
|
||||
[\#2692](https://github.com/vector-im/riot-web/pull/2692)
|
||||
* Document cross_origin_renderer_url
|
||||
[\#2680](https://github.com/vector-im/riot-web/pull/2680)
|
||||
* Add css for the iframes for e2e attachments
|
||||
[\#2659](https://github.com/vector-im/riot-web/pull/2659)
|
||||
* Fix config location in some more places
|
||||
[\#2670](https://github.com/vector-im/riot-web/pull/2670)
|
||||
* CSS updates for s/block/blacklist for e2e
|
||||
[\#2662](https://github.com/vector-im/riot-web/pull/2662)
|
||||
* Update to electron 1.4.8
|
||||
[\#2660](https://github.com/vector-im/riot-web/pull/2660)
|
||||
* Add electron config
|
||||
[\#2644](https://github.com/vector-im/riot-web/pull/2644)
|
||||
* Move getDefaultDeviceName into the Platforms
|
||||
[\#2643](https://github.com/vector-im/riot-web/pull/2643)
|
||||
* Add Freenode & Mozilla domains
|
||||
[\#2641](https://github.com/vector-im/riot-web/pull/2641)
|
||||
* Include config.sample.json in dist tarball
|
||||
[\#2614](https://github.com/vector-im/riot-web/pull/2614)
|
||||
|
||||
Changes in [0.9.0](https://github.com/vector-im/vector-web/releases/tag/v0.9.0) (2016-11-19)
|
||||
============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.8.4...v0.9.0)
|
||||
|
||||
* Add a cachebuster to /version
|
||||
[\#2596](https://github.com/vector-im/vector-web/pull/2596)
|
||||
* Add a 'View decrypted source' button
|
||||
[\#2587](https://github.com/vector-im/vector-web/pull/2587)
|
||||
* Fix changelog dialog to read new version format
|
||||
[\#2577](https://github.com/vector-im/vector-web/pull/2577)
|
||||
* Build all of the vector dir in the build process
|
||||
[\#2558](https://github.com/vector-im/vector-web/pull/2558)
|
||||
* Support for get_app_version
|
||||
[\#2553](https://github.com/vector-im/vector-web/pull/2553)
|
||||
* Add CSS for mlist truncation
|
||||
[\#2565](https://github.com/vector-im/vector-web/pull/2565)
|
||||
* Add menu option for `external_url` if present
|
||||
[\#2560](https://github.com/vector-im/vector-web/pull/2560)
|
||||
* Make auto-update configureable
|
||||
[\#2555](https://github.com/vector-im/vector-web/pull/2555)
|
||||
* Missed files electron windows fixes
|
||||
[\#2556](https://github.com/vector-im/vector-web/pull/2556)
|
||||
* Add some CSS for scalar error popup
|
||||
[\#2554](https://github.com/vector-im/vector-web/pull/2554)
|
||||
* Catch unhandled errors in the electron process
|
||||
[\#2552](https://github.com/vector-im/vector-web/pull/2552)
|
||||
* Slight grab-bag of fixes for electron on Windows
|
||||
[\#2551](https://github.com/vector-im/vector-web/pull/2551)
|
||||
* Electron app (take 3)
|
||||
[\#2535](https://github.com/vector-im/vector-web/pull/2535)
|
||||
* Use webpack-dev-server instead of http-server
|
||||
[\#2542](https://github.com/vector-im/vector-web/pull/2542)
|
||||
* Better support no-config when loading from file
|
||||
[\#2541](https://github.com/vector-im/vector-web/pull/2541)
|
||||
* Fix loading with no config from HTTP
|
||||
[\#2540](https://github.com/vector-im/vector-web/pull/2540)
|
||||
* Move 'new version' support into Platform
|
||||
[\#2532](https://github.com/vector-im/vector-web/pull/2532)
|
||||
* Add Notification support to the Web Platform
|
||||
[\#2533](https://github.com/vector-im/vector-web/pull/2533)
|
||||
* Use the defaults if given a blank config file
|
||||
[\#2534](https://github.com/vector-im/vector-web/pull/2534)
|
||||
* Implement Platforms
|
||||
[\#2531](https://github.com/vector-im/vector-web/pull/2531)
|
||||
|
||||
Changes in [0.8.4](https://github.com/vector-im/vector-web/releases/tag/v0.8.4) (2016-11-04)
|
||||
============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.8.4-rc.2...v0.8.4)
|
||||
|
||||
* No changes
|
||||
|
||||
Changes in [0.8.4-rc.2](https://github.com/vector-im/vector-web/releases/tag/v0.8.4-rc.2) (2016-11-02)
|
||||
======================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.8.4-rc.1...v0.8.4-rc.2)
|
||||
|
||||
* Fix the version in the generated distribution package
|
||||
|
||||
Changes in [0.8.4-rc.1](https://github.com/vector-im/vector-web/releases/tag/v0.8.4-rc.1) (2016-11-02)
|
||||
======================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.8.3...v0.8.4-rc.1)
|
||||
|
||||
Breaking Changes
|
||||
----------------
|
||||
* End-to-end encryption now requires one-time keys to be
|
||||
signed, so end-to-end encryption will not interoperate
|
||||
with previous releases of vector-web. End-to-end encryption
|
||||
remains in beta.
|
||||
|
||||
Other Changes
|
||||
-------------
|
||||
* Rename the package script/output dir to 'dist'
|
||||
[\#2528](https://github.com/vector-im/vector-web/pull/2528)
|
||||
* Avoid errors if olm is missing
|
||||
[\#2518](https://github.com/vector-im/vector-web/pull/2518)
|
||||
* Put a cachebuster in the names of CSS and JS files
|
||||
[\#2515](https://github.com/vector-im/vector-web/pull/2515)
|
||||
* Bump to olm 2.0.0
|
||||
[\#2517](https://github.com/vector-im/vector-web/pull/2517)
|
||||
* Don't include the world in the published packages
|
||||
[\#2516](https://github.com/vector-im/vector-web/pull/2516)
|
||||
* Use webpack to copy olm.js
|
||||
[\#2514](https://github.com/vector-im/vector-web/pull/2514)
|
||||
* Don't include two copies of the CSS in the tarball
|
||||
[\#2513](https://github.com/vector-im/vector-web/pull/2513)
|
||||
* Correct text alignment on room directory search
|
||||
[\#2512](https://github.com/vector-im/vector-web/pull/2512)
|
||||
* Correct spelling of 'rel'
|
||||
[\#2510](https://github.com/vector-im/vector-web/pull/2510)
|
||||
* readme tweaks
|
||||
[\#2507](https://github.com/vector-im/vector-web/pull/2507)
|
||||
* s/vector/riot/ in the readme
|
||||
[\#2491](https://github.com/vector-im/vector-web/pull/2491)
|
||||
* Switch to babel 6, again
|
||||
[\#2480](https://github.com/vector-im/vector-web/pull/2480)
|
||||
* Revert "Switch to babel 6"
|
||||
[\#2472](https://github.com/vector-im/vector-web/pull/2472)
|
||||
* Switch to babel 6
|
||||
[\#2461](https://github.com/vector-im/vector-web/pull/2461)
|
||||
|
||||
Changes in [0.8.3](https://github.com/vector-im/vector-web/releases/tag/v0.8.3) (2016-10-12)
|
||||
============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.8.2...v0.8.3)
|
||||
|
||||
* Centre images in dialog buttons
|
||||
[\#2453](https://github.com/vector-im/vector-web/pull/2453)
|
||||
* Only show quote option if RTE is enabled
|
||||
[\#2448](https://github.com/vector-im/vector-web/pull/2448)
|
||||
* Fix join button for 'matrix' networks
|
||||
[\#2443](https://github.com/vector-im/vector-web/pull/2443)
|
||||
* Don't stop paginating if no rooms match
|
||||
[\#2422](https://github.com/vector-im/vector-web/pull/2422)
|
||||
|
||||
Changes in [0.8.2](https://github.com/vector-im/vector-web/releases/tag/v0.8.2) (2016-10-05)
|
||||
============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.8.1...v0.8.2)
|
||||
|
||||
* Add native joining of 3p networks to room dir
|
||||
[\#2379](https://github.com/vector-im/vector-web/pull/2379)
|
||||
* Update to linkify 2.1.3
|
||||
[\#2406](https://github.com/vector-im/vector-web/pull/2406)
|
||||
* Use 'Sign In' / 'Sign Out' universally
|
||||
[\#2383](https://github.com/vector-im/vector-web/pull/2383)
|
||||
* Prevent network dropdown resizing slightly
|
||||
[\#2382](https://github.com/vector-im/vector-web/pull/2382)
|
||||
* Room directory: indicate when there are no results
|
||||
[\#2380](https://github.com/vector-im/vector-web/pull/2380)
|
||||
* Room dir: New filtering & 3rd party networks
|
||||
[\#2362](https://github.com/vector-im/vector-web/pull/2362)
|
||||
* Update linkify version
|
||||
[\#2359](https://github.com/vector-im/vector-web/pull/2359)
|
||||
* Directory search join button
|
||||
[\#2339](https://github.com/vector-im/vector-web/pull/2339)
|
||||
|
||||
Changes in [0.8.1](https://github.com/vector-im/vector-web/releases/tag/v0.8.1) (2016-09-21)
|
||||
============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.8.0...v0.8.1)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Contributing code to Vector
|
||||
===========================
|
||||
Contributing code to Riot
|
||||
=========================
|
||||
|
||||
Vector follows the same pattern as https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst
|
||||
Riot follows the same pattern as https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst.
|
||||
|
||||
276
README.md
@@ -1,67 +1,101 @@
|
||||
Vector/Web
|
||||
==========
|
||||
Riot
|
||||
====
|
||||
|
||||
Vector is a Matrix web client built using the Matrix React SDK (https://github.com/matrix-org/matrix-react-sdk).
|
||||
Riot (formerly known as Vector) is a Matrix web client built using the Matrix
|
||||
React SDK (https://github.com/matrix-org/matrix-react-sdk).
|
||||
|
||||
Getting Started
|
||||
===============
|
||||
|
||||
The easiest way to test Vector is to just use the hosted copy at https://vector.im/beta.
|
||||
The develop branch is continuously deployed by Jenkins at https://vector.im/develop for
|
||||
those who like living dangerously.
|
||||
The easiest way to test Riot is to just use the hosted copy at
|
||||
https://riot.im/app. The develop branch is continuously deployed by Jenkins at
|
||||
https://riot.im/develop for those who like living dangerously.
|
||||
|
||||
To host your own copy of Vector, the quickest bet is to use a pre-built released version
|
||||
of Vector:
|
||||
To host your own copy of Riot, the quickest bet is to use a pre-built
|
||||
released version of Riot:
|
||||
|
||||
1. Download the latest version from https://vector.im/packages/
|
||||
1. Download the latest version from https://github.com/vector-im/riot-web/releases
|
||||
1. Untar the tarball on your web server
|
||||
1. Move (or symlink) the vector-x.x.x directory to an appropriate name
|
||||
1. If desired, copy `config.sample.json` to `config.json` and edit it
|
||||
as desired. See below for details.
|
||||
1. Enter the URL into your browser and log into vector!
|
||||
1. Enter the URL into your browser and log into Riot!
|
||||
|
||||
Releases are signed by PGP, and can be checked against the public key
|
||||
at https://riot.im/packages/keys/riot-master.asc
|
||||
|
||||
Note that Chrome does not allow microphone or webcam access for sites served
|
||||
over http (except localhost), so for working VoIP you will need to serve Riot
|
||||
over https.
|
||||
|
||||
### Installation Steps for Debian Stretch
|
||||
1. Add the repository to your sources.list using either of the following two options:
|
||||
- Directly to sources.list: `echo "deb https://riot.im/packages/debian/ stretch main" | sudo tee -a /etc/apt/sources.list`
|
||||
- As a separate entry in sources.list.d: `echo "deb https://riot.im/packages/debian/ stretch main" | sudo tee /etc/apt/sources.list.d/riot.list`
|
||||
2. Add the gpg signing key for the riot repository: `curl -s https://riot.im/packages/debian/repo-key.asc | sudo apt-key add -`
|
||||
3. Update your package lists: `sudo apt-get update`
|
||||
4. Install Riot: `sudo apt-get install riot-web`
|
||||
|
||||
Important Security Note
|
||||
=======================
|
||||
|
||||
We do not recommend running Vector from the same domain name as your Matrix
|
||||
homeserver. The reason is the risk of XSS (cross-site-scripting) vulnerabilities
|
||||
that could occur if someone caused Vector to load and render malicious user generated
|
||||
content from a Matrix API which then had trusted access to Vector (or other apps) due
|
||||
to sharing the same domain.
|
||||
We do not recommend running Riot from the same domain name as your Matrix
|
||||
homeserver. The reason is the risk of XSS (cross-site-scripting)
|
||||
vulnerabilities that could occur if someone caused Riot to load and render
|
||||
malicious user generated content from a Matrix API which then had trusted
|
||||
access to Riot (or other apps) due to sharing the same domain.
|
||||
|
||||
We have put some coarse mitigations into place to try to protect against this situation,
|
||||
but it's still not good practice to do it in the first place.
|
||||
See https://github.com/vector-im/vector-web/issues/1977 for more details.
|
||||
We have put some coarse mitigations into place to try to protect against this
|
||||
situation, but it's still not good practice to do it in the first place. See
|
||||
https://github.com/vector-im/riot-web/issues/1977 for more details.
|
||||
|
||||
Building From Source
|
||||
====================
|
||||
|
||||
Vector is a modular webapp built with modern ES6 and requires a npm build system to build.
|
||||
Riot is a modular webapp built with modern ES6 and requires a npm build system
|
||||
to build.
|
||||
|
||||
1. Install or update `node.js` so that your `npm` is at least at version `2.0.0`
|
||||
1. Clone the repo: `git clone https://github.com/vector-im/vector-web.git`
|
||||
1. Switch to the vector directory: `cd vector-web`
|
||||
1. Clone the repo: `git clone https://github.com/vector-im/riot-web.git`
|
||||
1. Switch to the riot-web directory: `cd riot-web`
|
||||
1. Install the prerequisites: `npm install`
|
||||
1. If you are using the `develop` branch of vector, you will probably need to
|
||||
rebuild one of the dependencies, due to https://github.com/npm/npm/issues/3055:
|
||||
`(cd node_modules/matrix-react-sdk && npm install)`
|
||||
1. Configure the app by copying `config.sample.json` to `config.json` and modifying
|
||||
it (see below for details)
|
||||
1. `npm run package` to build a tarball to deploy. Untaring this file will give
|
||||
1. If you are using the `develop` branch of vector-web, you will probably need
|
||||
to rebuild some of the dependencies, due to
|
||||
https://github.com/npm/npm/issues/3055:
|
||||
|
||||
```
|
||||
(cd node_modules/matrix-js-sdk && npm install)
|
||||
(cd node_modules/matrix-react-sdk && npm install)
|
||||
```
|
||||
Whenever you git pull on riot-web you will also probably need to force an update
|
||||
to these dependencies - the easiest way is probably:
|
||||
```
|
||||
rm -rf node_modules/matrjx-{js,react}-sdk && npm i
|
||||
(cd node_modules/matrix-js-sdk && npm install)
|
||||
(cd node_modules/matrix-react-sdk && npm install)
|
||||
```
|
||||
However, we recommend setting up a proper development environment (see "Setting
|
||||
up a development environment" below) if you want to run your own copy of the
|
||||
`develop` branch, as it makes it much easier to keep these dependencies
|
||||
up-to-date. Or just use https://riot.im/develop - the continuous integration
|
||||
release of the develop branch.
|
||||
1. Configure the app by copying `config.sample.json` to `config.json` and
|
||||
modifying it (see below for details)
|
||||
1. `npm run dist` to build a tarball to deploy. Untaring this file will give
|
||||
a version-specific directory containing all the files that need to go on your
|
||||
web server.
|
||||
|
||||
Note that `npm run package` is not supported on Windows, so Windows users can run `npm
|
||||
run build`, which will build all the necessary files into the `vector`
|
||||
directory. The version of Vector will not appear in Settings without
|
||||
using the package script. You can then mount the vector directory on your
|
||||
Note that `npm run dist` is not supported on Windows, so Windows users can run `npm
|
||||
run build`, which will build all the necessary files into the `webapp`
|
||||
directory. The version of Riot will not appear in Settings without
|
||||
using the dist script. You can then mount the `webapp` directory on your
|
||||
webserver to actually serve up the app, which is entirely static content.
|
||||
|
||||
config.json
|
||||
===========
|
||||
|
||||
You can configure the app by copying `vector/config.sample.json` to
|
||||
`vector/config.json` and customising it:
|
||||
You can configure the app by copying `config.sample.json` to
|
||||
`config.json` and customising it:
|
||||
|
||||
1. `default_hs_url` is the default home server url.
|
||||
1. `default_is_url` is the default identity server url (this is the server used
|
||||
@@ -72,37 +106,84 @@ You can configure the app by copying `vector/config.sample.json` to
|
||||
addresses) to matrix IDs: see http://matrix.org/docs/spec/identity_service/unstable.html
|
||||
for more details. Currently the only public matrix identity servers are https://matrix.org
|
||||
and https://vector.im. In future identity servers will be decentralised.
|
||||
|
||||
1. `integrations_ui_url`: URL to the web interface for the integrations server.
|
||||
1. `integrations_rest_url`: URL to the REST interface for the integrations server.
|
||||
1. `roomDirectory`: config for the public room directory. This section is optional.
|
||||
1. `roomDirectory.servers`: List of other Home Servers' directories to include in the drop
|
||||
down list. Optional.
|
||||
1. `update_base_url` (electron app only): HTTPS URL to a web server to download
|
||||
updates from. This should be the path to the directory containing `macos`
|
||||
and `win32` (for update packages, not installer packages).
|
||||
1. `cross_origin_renderer_url`: URL to a static HTML page hosting code to help display
|
||||
encrypted file attachments. This MUST be hosted on a completely separate domain to
|
||||
anything else since it is used to isolate the privileges of file attachments to this
|
||||
domain. Default: `usercontent.riot.im`. This needs to contain v1.html from
|
||||
https://github.com/matrix-org/usercontent/blob/master/v1.html
|
||||
|
||||
Running as a Desktop app
|
||||
========================
|
||||
|
||||
In future we'll do an official distribution of Vector as an desktop app. Meanwhile,
|
||||
there are a few options:
|
||||
Riot can also be run as a desktop app, wrapped in electron. You can download a
|
||||
pre-built version from https://riot.im/desktop.html or, if you prefer,
|
||||
built it yourself.
|
||||
|
||||
@asdf:matrix.org points out that you can use nativefier and it just works(tm):
|
||||
To run as a desktop app:
|
||||
|
||||
1. Follow the instructions in 'Building From Source' above, but run
|
||||
`npm run build` instead of `npm run dist` (since we don't need the tarball).
|
||||
2. Install electron and run it:
|
||||
|
||||
```
|
||||
npm install electron
|
||||
node_modules/.bin/electron .
|
||||
```
|
||||
|
||||
To build packages, use electron-builder. This is configured to output:
|
||||
* dmg + zip for macOS
|
||||
* exe + nupkg for Windows
|
||||
* deb for Linux
|
||||
But this can be customised by editing the `build` section of package.json
|
||||
as per https://github.com/electron-userland/electron-builder/wiki/Options
|
||||
|
||||
See https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build
|
||||
for dependencies required for building packages for various platforms.
|
||||
|
||||
The only platform that can build packages for all three platforms is macOS:
|
||||
```
|
||||
brew install wine --without-x11
|
||||
brew install mono
|
||||
brew install gnu-tar
|
||||
npm install
|
||||
npm run build:electron
|
||||
```
|
||||
|
||||
For other packages, use electron-builder manually. For example, to build a package
|
||||
for 64 bit Linux:
|
||||
|
||||
1. Follow the instructions in 'Building From Source' above
|
||||
2. `node_modules/.bin/build -l --x64`
|
||||
|
||||
All electron packages go into `electron/dist/`
|
||||
|
||||
Many thanks to @aviraldg for the initial work on the electron integration.
|
||||
|
||||
Other options for running as a desktop app:
|
||||
* https://github.com/krisak/vector-electron-desktop
|
||||
* @asdf:matrix.org points out that you can use nativefier and it just works(tm)
|
||||
|
||||
```
|
||||
sudo npm install nativefier -g
|
||||
nativefier https://vector.im/beta/
|
||||
nativefier https://riot.im/app/
|
||||
```
|
||||
|
||||
krisa has a dedicated electron project at https://github.com/krisak/vector-electron-desktop
|
||||
(although you should swap out the 'vector' folder for the latest vector tarball you want to run.
|
||||
Get a tarball from https://vector.im/packages or build your own - see Building From Source
|
||||
above).
|
||||
|
||||
There's also a (much) older electron distribution at https://github.com/stevenhammerton/vector-desktop
|
||||
|
||||
|
||||
Development
|
||||
===========
|
||||
|
||||
Before attempting to develop on Vector you **must** read the developer guide
|
||||
Before attempting to develop on Riot you **must** read the developer guide
|
||||
for `matrix-react-sdk` at https://github.com/matrix-org/matrix-react-sdk, which
|
||||
also defines the design, architecture and style for Vector too.
|
||||
also defines the design, architecture and style for Riot too.
|
||||
|
||||
The idea of Vector is to be a relatively lightweight "skin" of customisations on
|
||||
The idea of Riot is to be a relatively lightweight "skin" of customisations on
|
||||
top of the underlying `matrix-react-sdk`. `matrix-react-sdk` provides both the
|
||||
higher and lower level React components useful for building Matrix communication
|
||||
apps using React.
|
||||
@@ -111,26 +192,26 @@ After creating a new component you must run `npm run reskindex` to regenerate
|
||||
the `component-index.js` for the app (used in future for skinning)
|
||||
|
||||
**However, as of July 2016 this layering abstraction is broken due to rapid
|
||||
development on Vector forcing `matrix-react-sdk` to move fast at the expense of
|
||||
maintaining a clear abstraction between the two.** Hacking on Vector inevitably
|
||||
development on Riot forcing `matrix-react-sdk` to move fast at the expense of
|
||||
maintaining a clear abstraction between the two.** Hacking on Riot inevitably
|
||||
means hacking equally on `matrix-react-sdk`, and there are bits of
|
||||
`matrix-react-sdk` behaviour incorrectly residing in the `vector-web` project
|
||||
(e.g. matrix-react-sdk specific CSS), and a bunch of Vector specific behaviour
|
||||
in the `matrix-react-sdk` (grep for Vector). This separation problem will be
|
||||
solved asap once development on Vector (and thus matrix-react-sdk) has
|
||||
`matrix-react-sdk` behaviour incorrectly residing in the `riot-web` project
|
||||
(e.g. matrix-react-sdk specific CSS), and a bunch of Riot specific behaviour
|
||||
in the `matrix-react-sdk` (grep for `vector` / `riot`). This separation problem will be
|
||||
solved asap once development on Riot (and thus matrix-react-sdk) has
|
||||
stabilised. Until then, the two projects should basically be considered as a
|
||||
single unit. In particular, `matrix-react-sdk` issues are currently filed
|
||||
against `vector-web` in github.
|
||||
against `riot-web` in github.
|
||||
|
||||
Please note that Vector is intended to run correctly without access to the public
|
||||
Please note that Riot is intended to run correctly without access to the public
|
||||
internet. So please don't depend on resources (JS libs, CSS, images, fonts)
|
||||
hosted by external CDNs or servers but instead please package all dependencies
|
||||
into Vector itself.
|
||||
into Riot itself.
|
||||
|
||||
Setting up a dev environment
|
||||
============================
|
||||
|
||||
Much of the functionality in Vector is actually in the `matrix-react-sdk` and
|
||||
Much of the functionality in Riot is actually in the `matrix-react-sdk` and
|
||||
`matrix-js-sdk` modules. It is possible to set these up in a way that makes it
|
||||
easy to track the `develop` branches in git and to make local changes without
|
||||
having to manually rebuild each time.
|
||||
@@ -153,10 +234,10 @@ Then similarly with `matrix-react-sdk`:
|
||||
1. `rm -r node_modules/matrix-js-sdk; ln -s ../../matrix-js-sdk node_modules/`
|
||||
1. `popd`
|
||||
|
||||
Finally, build and start vector itself:
|
||||
Finally, build and start Riot itself:
|
||||
|
||||
1. `git clone git@github.com:vector-im/vector-web.git`
|
||||
1. `cd vector-web`
|
||||
1. `git clone git@github.com:vector-im/riot-web.git`
|
||||
1. `cd riot-web`
|
||||
1. `git checkout develop`
|
||||
1. `npm install`
|
||||
1. `rm -r node_modules/matrix-js-sdk; ln -s ../../matrix-js-sdk node_modules/`
|
||||
@@ -178,25 +259,19 @@ Finally, build and start vector itself:
|
||||
Remember, the command will not terminate since it runs the web server
|
||||
and rebuilds source files when they change. This development server also
|
||||
disables caching, so do NOT use it in production.
|
||||
1. Open http://127.0.0.1:8080/ in your browser to see your newly built Vector.
|
||||
1. Open http://127.0.0.1:8080/ in your browser to see your newly built Riot.
|
||||
|
||||
When you make changes to `matrix-react-sdk`, you will need to run `npm run
|
||||
build` in the relevant directory. You can do this automatically by instead
|
||||
running `npm start` in the directory, to start a development builder which
|
||||
will watch for changes to the files and rebuild automatically.
|
||||
When you make changes to `matrix-react-sdk` or `matrix-js-sdk`, you will need
|
||||
to run `npm run build` in the relevant directory. You can do this automatically
|
||||
by instead running `npm start` in the directory, to start a development builder
|
||||
which will watch for changes to the files and rebuild automatically.
|
||||
|
||||
If you add or remove any components from the Vector skin, you will need to rebuild
|
||||
If you add or remove any components from the Riot skin, you will need to rebuild
|
||||
the skin's index by running, `npm run reskindex`.
|
||||
|
||||
If any of these steps error with, `file table overflow`, you are probably on a mac
|
||||
which has a very low limit on max open files. Run `ulimit -Sn 1024` and try again.
|
||||
You'll need to do this in each new terminal you open before building vector.
|
||||
|
||||
Filing issues
|
||||
=============
|
||||
|
||||
All issues for Vector-web and Matrix-react-sdk should be filed at
|
||||
https://github.com/matrix-org/matrix-react-sdk/issues
|
||||
You'll need to do this in each new terminal you open before building Riot.
|
||||
|
||||
Triaging issues
|
||||
===============
|
||||
@@ -204,41 +279,28 @@ Triaging issues
|
||||
Issues will be triaged by the core team using the following primary set of tags:
|
||||
|
||||
priority:
|
||||
P1: top priority; typically blocks releases.
|
||||
P2: one below that
|
||||
P3: non-urgent
|
||||
P4/P5: bluesky some day, who knows.
|
||||
|
||||
* P1: top priority; typically blocks releases
|
||||
* P2: still need to fix, but lower than P1
|
||||
* P3: non-urgent
|
||||
* P4: intereseting idea - bluesky some day
|
||||
* P5: recorded for posterity/to avoid duplicates. No intention to resolves right now.
|
||||
|
||||
bug or feature:
|
||||
bug severity:
|
||||
* cosmetic - feature works functionally but UI/UX is broken.
|
||||
* critical - whole app doesn't work
|
||||
* major - entire feature doesn't work
|
||||
* minor - partially broken feature (but still usable)
|
||||
|
||||
* release blocker
|
||||
* bug
|
||||
* feature
|
||||
|
||||
* ui/ux (think of this as cosmetic)
|
||||
bug severity:
|
||||
|
||||
* cosmetic - feature works functionally but UI/UX is broken
|
||||
* critical - whole app doesn't work
|
||||
* major - entire feature doesn't work
|
||||
* minor - partially broken feature (but still usable)
|
||||
|
||||
* network (specific to network conditions)
|
||||
* platform (platform specific)
|
||||
|
||||
Enabling encryption
|
||||
===================
|
||||
|
||||
End-to-end encryption in Vector and Matrix is not yet considered ready for
|
||||
day-to-day use; it is experimental and should be considered only as a
|
||||
proof-of-concept. See https://matrix.org/jira/browse/SPEC-162 for an overview
|
||||
of the current progress.
|
||||
|
||||
To enable the (very experimental) support, check the 'End-to-End Encryption'
|
||||
box in the 'Labs' section of the user settings (note that the labs are disabled
|
||||
on http://vector.im/beta: you will need to use http://vector.im/develop or your
|
||||
own deployment of vector). The Room Settings dialog will then show an
|
||||
'Encryption' setting; rooms for which you are an administrator will offer you
|
||||
the option of enabling encryption. Any messages sent in that room will then be
|
||||
encrypted.
|
||||
|
||||
Note that historical encrypted messages cannot currently be decoded - history
|
||||
is therefore lost when the page is reloaded.
|
||||
additional categories:
|
||||
|
||||
* release blocker
|
||||
* ui/ux (think of this as cosmetic)
|
||||
* network (specific to network conditions)
|
||||
* platform (platform specific)
|
||||
|
||||
14
config.sample.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"default_hs_url": "https://matrix.org",
|
||||
"default_is_url": "https://vector.im",
|
||||
"brand": "Riot",
|
||||
"integrations_ui_url": "https://scalar.vector.im/",
|
||||
"integrations_rest_url": "https://scalar.vector.im/api",
|
||||
"bug_report_endpoint_url": "https://vector.im/bugs",
|
||||
"enableLabs": true,
|
||||
"roomDirectory": {
|
||||
"servers": [
|
||||
"matrix.org"
|
||||
]
|
||||
}
|
||||
}
|
||||
25
docs/theming.md
Normal file
@@ -0,0 +1,25 @@
|
||||
Theming Riot
|
||||
============
|
||||
|
||||
Themes are a very basic way of providing simple alternative look & feels to the
|
||||
riot-web app via CSS & custom imagery.
|
||||
|
||||
They are *NOT* co be confused with 'skins', which describe apps which sit on top
|
||||
of matrix-react-sdk - e.g. in theory Riot itself is a react-sdk skin.
|
||||
As of Jan 2017, skins are not fully supported; riot is the only available skin.
|
||||
|
||||
To define a theme for Riot:
|
||||
|
||||
1. Pick a name, e.g. `teal`. at time of writing we have `light` and `dark`.
|
||||
2. Fork `src/skins/vector/css/themes/dark.scss` to be teal.scss
|
||||
3. Fork `src/skins/vector/css/themes/_base.scss` to be _teal.scss
|
||||
4. Override variables in _teal.scss as desired. You may wish to delete ones
|
||||
which don't differ from _base.scss, to make it clear which are being
|
||||
overridden. If every single colour is being changed (as per _dark.scss)
|
||||
then you might as well keep them all.
|
||||
5. Add the theme to the list of entrypoints in webpack.config.js
|
||||
6. Add the theme to the list of themes in matrix-react-sdk's UserSettings.js
|
||||
7. Sit back and admire your handywork.
|
||||
|
||||
In future, the assets for a theme will probably be gathered together into a
|
||||
single directory tree.
|
||||
BIN
electron/build/icon.icns
Normal file
BIN
electron/build/icon.ico
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
electron/build/icons/128x128.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
electron/build/icons/16x16.png
Normal file
|
After Width: | Height: | Size: 673 B |
BIN
electron/build/icons/24x24.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
electron/build/icons/256x256.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
electron/build/icons/48x48.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
electron/build/icons/512x512.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
electron/build/icons/64x64.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
electron/build/icons/96x96.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
electron/build/install-spinner.gif
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
electron/img/riot.ico
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
4
electron/riot.im/README
Normal file
@@ -0,0 +1,4 @@
|
||||
This directory contains the config file for the official riot.im distribution
|
||||
of Riot Desktop. You probably do not want to build with this config unless
|
||||
you're building the official riot.im distribution, or you'll find your builds
|
||||
will replace themselves with the riot.im build.
|
||||
73
electron/riot.im/config.json
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"update_base_url": "https://riot.im/download/desktop/update/",
|
||||
"default_hs_url": "https://matrix.org",
|
||||
"default_is_url": "https://vector.im",
|
||||
"brand": "Riot",
|
||||
"integrations_ui_url": "https://scalar.vector.im/",
|
||||
"integrations_rest_url": "https://scalar.vector.im/api",
|
||||
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
|
||||
"enableLabs": true,
|
||||
"roomDirectory": {
|
||||
"servers": [
|
||||
"matrix.org"
|
||||
],
|
||||
"serverConfig": {
|
||||
"matrix.org": {
|
||||
"networks": [
|
||||
"_matrix",
|
||||
"gitter",
|
||||
"irc:freenode",
|
||||
"irc:mozilla",
|
||||
"irc:snoonet",
|
||||
"irc:oftc"
|
||||
]
|
||||
}
|
||||
},
|
||||
"networks": {
|
||||
"gitter": {
|
||||
"protocol": "gitter",
|
||||
"portalRoomPattern": "#gitter_.*:matrix.org",
|
||||
"name": "Gitter",
|
||||
"icon": "https://gitter.im/favicon.ico",
|
||||
"example": "org/community",
|
||||
"nativePattern": "[^\\s]+/[^\\s]+$"
|
||||
},
|
||||
"irc:freenode": {
|
||||
"protocol": "irc",
|
||||
"domain": "chat.freenode.net",
|
||||
"portalRoomPattern": "#freenode_.*:matrix.org",
|
||||
"name": "Freenode",
|
||||
"icon": "https://matrix.org/_matrix/media/v1/download/matrix.org/DHLHpDDgWNNejFmrewvwEAHX",
|
||||
"example": "#channel",
|
||||
"nativePattern": "^#[^\\s]+$"
|
||||
},
|
||||
"irc:mozilla": {
|
||||
"protocol": "irc",
|
||||
"domain": "chat.freenode.net",
|
||||
"portalRoomPattern": "#mozilla_.*:matrix.org",
|
||||
"name": "Mozilla",
|
||||
"icon": "https://matrix.org/_matrix/media/v1/download/matrix.org/DHLHpDDgWNNejFmrewvwEAHX",
|
||||
"example": "#channel",
|
||||
"nativePattern": "^#[^\\s]+$"
|
||||
},
|
||||
"irc:snoonet": {
|
||||
"protocol": "irc",
|
||||
"domain": "ipv6-irc.snoonet.org",
|
||||
"portalRoomPattern": "#_snoonet_.*:matrix.org",
|
||||
"name": "Snoonet",
|
||||
"icon": "https://matrix.org/_matrix/media/v1/download/matrix.org/DHLHpDDgWNNejFmrewvwEAHX",
|
||||
"example": "#channel",
|
||||
"nativePattern": "^#[^\\s]+$"
|
||||
},
|
||||
"irc:oftc": {
|
||||
"protocol": "irc",
|
||||
"domain": "irc.oftc.net",
|
||||
"portalRoomPattern": "#_oftc_.*:matrix.org",
|
||||
"name": "OFTC",
|
||||
"icon": "https://matrix.org/_matrix/media/v1/download/matrix.org/DHLHpDDgWNNejFmrewvwEAHX",
|
||||
"example": "#channel",
|
||||
"nativePattern": "^#[^\\s]+$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
247
electron/src/electron-main.js
Normal file
@@ -0,0 +1,247 @@
|
||||
// @flow
|
||||
|
||||
/*
|
||||
Copyright 2016 Aviral Dasgupta
|
||||
Copyright 2016 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Squirrel on windows starts the app with various flags
|
||||
// as hooks to tell us when we've been installed/uninstalled
|
||||
// etc.
|
||||
const check_squirrel_hooks = require('./squirrelhooks');
|
||||
if (check_squirrel_hooks()) return;
|
||||
|
||||
const electron = require('electron');
|
||||
const url = require('url');
|
||||
|
||||
const tray = require('./tray');
|
||||
|
||||
const VectorMenu = require('./vectormenu');
|
||||
|
||||
let vectorConfig = {};
|
||||
try {
|
||||
vectorConfig = require('../../webapp/config.json');
|
||||
} catch (e) {
|
||||
// it would be nice to check the error code here and bail if the config
|
||||
// is unparseable, but we get MODULE_NOT_FOUND in the case of a missing
|
||||
// file or invalid json, so node is just very unhelpful.
|
||||
// Continue with the defaults (ie. an empty config)
|
||||
}
|
||||
|
||||
const PERMITTED_URL_SCHEMES = [
|
||||
'http:',
|
||||
'https:',
|
||||
'mailto:',
|
||||
];
|
||||
|
||||
const UPDATE_POLL_INTERVAL_MS = 60 * 60 * 1000;
|
||||
const INITIAL_UPDATE_DELAY_MS = 30 * 1000;
|
||||
|
||||
let mainWindow = null;
|
||||
let appQuitting = false;
|
||||
|
||||
function safeOpenURL(target) {
|
||||
// openExternal passes the target to open/start/xdg-open,
|
||||
// so put fairly stringent limits on what can be opened
|
||||
// (for instance, open /bin/sh does indeed open a terminal
|
||||
// with a shell, albeit with no arguments)
|
||||
const parsed_url = url.parse(target);
|
||||
if (PERMITTED_URL_SCHEMES.indexOf(parsed_url.protocol) > -1) {
|
||||
// explicitly use the URL re-assembled by the url library,
|
||||
// so we know the url parser has understood all the parts
|
||||
// of the input string
|
||||
const new_target = url.format(parsed_url);
|
||||
electron.shell.openExternal(new_target);
|
||||
}
|
||||
}
|
||||
|
||||
function onWindowOrNavigate(ev, target) {
|
||||
// always prevent the default: if something goes wrong,
|
||||
// we don't want to end up opening it in the electron
|
||||
// app, as we could end up opening any sort of random
|
||||
// url in a window that has node scripting access.
|
||||
ev.preventDefault();
|
||||
safeOpenURL(target);
|
||||
}
|
||||
|
||||
function onLinkContextMenu(ev, params) {
|
||||
const popup_menu = new electron.Menu();
|
||||
popup_menu.append(new electron.MenuItem({
|
||||
label: params.linkURL,
|
||||
click() {
|
||||
safeOpenURL(params.linkURL);
|
||||
},
|
||||
}));
|
||||
popup_menu.popup();
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
function installUpdate() {
|
||||
// for some reason, quitAndInstall does not fire the
|
||||
// before-quit event, so we need to set the flag here.
|
||||
appQuitting = true;
|
||||
electron.autoUpdater.quitAndInstall();
|
||||
}
|
||||
|
||||
function pollForUpdates() {
|
||||
try {
|
||||
electron.autoUpdater.checkForUpdates();
|
||||
} catch (e) {
|
||||
console.log("Couldn't check for update", e);
|
||||
}
|
||||
}
|
||||
|
||||
function startAutoUpdate(update_base_url) {
|
||||
if (update_base_url.slice(-1) !== '/') {
|
||||
update_base_url = update_base_url + '/';
|
||||
}
|
||||
try {
|
||||
// For reasons best known to Squirrel, the way it checks for updates
|
||||
// is completely different between macOS and windows. On macOS, it
|
||||
// hits a URL that either gives it a 200 with some json or
|
||||
// 204 No Content. On windows it takes a base path and looks for
|
||||
// files under that path.
|
||||
if (process.platform == 'darwin') {
|
||||
// include the current version in the URL we hit. Electron doesn't add
|
||||
// it anywhere (apart from the User-Agent) so it's up to us. We could
|
||||
// (and previously did) just use the User-Agent, but this doesn't
|
||||
// rely on NSURLConnection setting the User-Agent to what we expect,
|
||||
// and also acts as a convenient cache-buster to ensure that when the
|
||||
// app updates it always gets a fresh value to avoid update-looping.
|
||||
electron.autoUpdater.setFeedURL(
|
||||
update_base_url +
|
||||
'macos/?localVersion=' + encodeURIComponent(electron.app.getVersion())
|
||||
);
|
||||
} else if (process.platform == 'win32') {
|
||||
electron.autoUpdater.setFeedURL(update_base_url + 'win32/' + process.arch + '/');
|
||||
} else {
|
||||
// Squirrel / electron only supports auto-update on these two platforms.
|
||||
// I'm not even going to try to guess which feed style they'd use if they
|
||||
// implemented it on Linux, or if it would be different again.
|
||||
console.log("Auto update not supported on this platform");
|
||||
}
|
||||
// We check for updates ourselves rather than using 'updater' because we need to
|
||||
// do it in the main process (and we don't really need to check every 10 minutes:
|
||||
// every hour should be just fine for a desktop app)
|
||||
// However, we still let the main window listen for the update events.
|
||||
// We also wait a short time before checking for updates the first time because
|
||||
// of squirrel on windows and it taking a small amount of time to release a
|
||||
// lock file.
|
||||
setTimeout(pollForUpdates, INITIAL_UPDATE_DELAY_MS);
|
||||
setInterval(pollForUpdates, UPDATE_POLL_INTERVAL_MS);
|
||||
} catch (err) {
|
||||
// will fail if running in debug mode
|
||||
console.log("Couldn't enable update checking", err);
|
||||
}
|
||||
}
|
||||
|
||||
// handle uncaught errors otherwise it displays
|
||||
// stack traces in popup dialogs, which is terrible (which
|
||||
// it will do any time the auto update poke fails, and there's
|
||||
// no other way to catch this error).
|
||||
// Assuming we generally run from the console when developing,
|
||||
// this is far preferable.
|
||||
process.on('uncaughtException', function (error) {
|
||||
console.log("Unhandled exception", error);
|
||||
});
|
||||
|
||||
electron.ipcMain.on('install_update', installUpdate);
|
||||
|
||||
electron.app.commandLine.appendSwitch('--enable-usermedia-screen-capturing');
|
||||
|
||||
const shouldQuit = electron.app.makeSingleInstance((commandLine, workingDirectory) => {
|
||||
// Someone tried to run a second instance, we should focus our window.
|
||||
if (mainWindow) {
|
||||
if (!mainWindow.isVisible()) mainWindow.show();
|
||||
if (mainWindow.isMinimized()) mainWindow.restore();
|
||||
mainWindow.focus();
|
||||
}
|
||||
});
|
||||
|
||||
if (shouldQuit) {
|
||||
electron.app.quit()
|
||||
}
|
||||
|
||||
electron.app.on('ready', () => {
|
||||
if (vectorConfig.update_base_url) {
|
||||
console.log("Starting auto update with base URL: " + vectorConfig.update_base_url);
|
||||
startAutoUpdate(vectorConfig.update_base_url);
|
||||
} else {
|
||||
console.log("No update_base_url is defined: auto update is disabled");
|
||||
}
|
||||
|
||||
const icon_path = `${__dirname}/../img/riot.` + (
|
||||
process.platform == 'win32' ? 'ico' : 'png'
|
||||
);
|
||||
|
||||
mainWindow = new electron.BrowserWindow({
|
||||
icon: icon_path,
|
||||
width: 1024, height: 768,
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
});
|
||||
mainWindow.loadURL(`file://${__dirname}/../../webapp/index.html`);
|
||||
electron.Menu.setApplicationMenu(VectorMenu);
|
||||
|
||||
// Create trayIcon icon
|
||||
tray.create(mainWindow, {
|
||||
icon_path: icon_path,
|
||||
brand: vectorConfig.brand || 'Riot'
|
||||
});
|
||||
|
||||
mainWindow.once('ready-to-show', () => {
|
||||
mainWindow.show();
|
||||
});
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = null;
|
||||
});
|
||||
mainWindow.on('close', (e) => {
|
||||
if (!appQuitting && (tray.hasTray() || process.platform == 'darwin')) {
|
||||
// On Mac, closing the window just hides it
|
||||
// (this is generally how single-window Mac apps
|
||||
// behave, eg. Mail.app)
|
||||
e.preventDefault();
|
||||
mainWindow.hide();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
mainWindow.webContents.on('new-window', onWindowOrNavigate);
|
||||
mainWindow.webContents.on('will-navigate', onWindowOrNavigate);
|
||||
|
||||
mainWindow.webContents.on('context-menu', function(ev, params) {
|
||||
if (params.linkURL) {
|
||||
onLinkContextMenu(ev, params);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
electron.app.on('window-all-closed', () => {
|
||||
electron.app.quit();
|
||||
});
|
||||
|
||||
electron.app.on('activate', () => {
|
||||
mainWindow.show();
|
||||
});
|
||||
|
||||
electron.app.on('before-quit', () => {
|
||||
appQuitting = true;
|
||||
});
|
||||
|
||||
// Set the App User Model ID to match what the squirrel
|
||||
// installer uses for the shortcut icon.
|
||||
// This makes notifications work on windows 8.1 (and is
|
||||
// a noop on other platforms).
|
||||
electron.app.setAppUserModelId('com.squirrel.riot-web.Riot');
|
||||
51
electron/src/squirrelhooks.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
Copyright 2017 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const spawn = require('child_process').spawn;
|
||||
const app = require('electron').app;
|
||||
|
||||
function run_update_exe(args, done) {
|
||||
// Invokes Squirrel's Update.exe which will do things for us like create shortcuts
|
||||
// Note that there's an Update.exe in the app-x.x.x directory and one in the parent
|
||||
// directory: we need to run the one in the parent directory, because it discovers
|
||||
// information about the app by inspecting the directory it's run from.
|
||||
const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
|
||||
console.log('Spawning `%s` with args `%s`', updateExe, args);
|
||||
spawn(updateExe, args, {
|
||||
detached: true
|
||||
}).on('close', done);
|
||||
};
|
||||
|
||||
function check_squirrel_hooks() {
|
||||
if (process.platform != 'win32') return false;
|
||||
|
||||
const cmd = process.argv[1];
|
||||
const target = path.basename(process.execPath);
|
||||
if (cmd === '--squirrel-install' || cmd === '--squirrel-updated') {
|
||||
run_update_exe(['--createShortcut=' + target + ''], app.quit);
|
||||
return true;
|
||||
} else if (cmd === '--squirrel-uninstall') {
|
||||
run_update_exe(['--removeShortcut=' + target + ''], app.quit);
|
||||
return true;
|
||||
} else if (cmd === '--squirrel-obsolete') {
|
||||
app.quit();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = check_squirrel_hooks;
|
||||
67
electron/src/tray.js
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
Copyright 2017 Karl Glatz <karl@glatz.biz>
|
||||
Copyright 2017 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const electron = require('electron');
|
||||
|
||||
const app = electron.app;
|
||||
const Tray = electron.Tray;
|
||||
const MenuItem = electron.MenuItem;
|
||||
|
||||
let trayIcon = null;
|
||||
|
||||
exports.hasTray = function hasTray() {
|
||||
return (trayIcon !== null);
|
||||
}
|
||||
|
||||
exports.create = function (win, config) {
|
||||
// no trays on darwin
|
||||
if (process.platform === 'darwin' || trayIcon) {
|
||||
return;
|
||||
}
|
||||
|
||||
const toggleWin = function () {
|
||||
if (win.isVisible() && !win.isMinimized()) {
|
||||
win.hide();
|
||||
} else {
|
||||
if (win.isMinimized()) win.restore();
|
||||
if (!win.isVisible()) win.show();
|
||||
win.focus();
|
||||
}
|
||||
};
|
||||
|
||||
const contextMenu = electron.Menu.buildFromTemplate([
|
||||
{
|
||||
label: 'Show/Hide ' + config.brand,
|
||||
click: toggleWin
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Quit',
|
||||
click: function () {
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
trayIcon = new Tray(config.icon_path);
|
||||
trayIcon.setToolTip(config.brand);
|
||||
trayIcon.setContextMenu(contextMenu);
|
||||
trayIcon.on('click', toggleWin);
|
||||
};
|
||||
197
electron/src/vectormenu.js
Normal file
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
Copyright 2016 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const electron = require('electron');
|
||||
|
||||
// Menu template from http://electron.atom.io/docs/api/menu/, edited
|
||||
const template = [
|
||||
{
|
||||
label: 'Edit',
|
||||
submenu: [
|
||||
{
|
||||
role: 'undo'
|
||||
},
|
||||
{
|
||||
role: 'redo'
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
role: 'cut'
|
||||
},
|
||||
{
|
||||
role: 'copy'
|
||||
},
|
||||
{
|
||||
role: 'paste'
|
||||
},
|
||||
{
|
||||
role: 'pasteandmatchstyle'
|
||||
},
|
||||
{
|
||||
role: 'delete'
|
||||
},
|
||||
{
|
||||
role: 'selectall'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'View',
|
||||
submenu: [
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
role: 'resetzoom'
|
||||
},
|
||||
{
|
||||
role: 'zoomin'
|
||||
},
|
||||
{
|
||||
role: 'zoomout'
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
role: 'togglefullscreen'
|
||||
},
|
||||
{
|
||||
role: 'toggledevtools'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
role: 'window',
|
||||
submenu: [
|
||||
{
|
||||
role: 'minimize'
|
||||
},
|
||||
{
|
||||
role: 'close'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
role: 'help',
|
||||
submenu: [
|
||||
{
|
||||
label: 'riot.im',
|
||||
click () { electron.shell.openExternal('https://riot.im/') }
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// macOS has specific menu conventions...
|
||||
if (process.platform === 'darwin') {
|
||||
// first macOS menu is the name of the app
|
||||
const name = electron.app.getName()
|
||||
template.unshift({
|
||||
label: name,
|
||||
submenu: [
|
||||
{
|
||||
role: 'about'
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
role: 'services',
|
||||
submenu: []
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
role: 'hide'
|
||||
},
|
||||
{
|
||||
role: 'hideothers'
|
||||
},
|
||||
{
|
||||
role: 'unhide'
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
role: 'quit'
|
||||
}
|
||||
]
|
||||
})
|
||||
// Edit menu.
|
||||
// This has a 'speech' section on macOS
|
||||
template[1].submenu.push(
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Speech',
|
||||
submenu: [
|
||||
{
|
||||
role: 'startspeaking'
|
||||
},
|
||||
{
|
||||
role: 'stopspeaking'
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
// Window menu.
|
||||
// This also has specific functionality on macOS
|
||||
template[3].submenu = [
|
||||
{
|
||||
label: 'Close',
|
||||
accelerator: 'CmdOrCtrl+W',
|
||||
role: 'close'
|
||||
},
|
||||
{
|
||||
label: 'Minimize',
|
||||
accelerator: 'CmdOrCtrl+M',
|
||||
role: 'minimize'
|
||||
},
|
||||
{
|
||||
label: 'Zoom',
|
||||
role: 'zoom'
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Bring All to Front',
|
||||
role: 'front'
|
||||
}
|
||||
]
|
||||
} else {
|
||||
template.unshift({
|
||||
label: 'File',
|
||||
submenu: [
|
||||
// For some reason, 'about' does not seem to work on windows.
|
||||
/*{
|
||||
role: 'about'
|
||||
},*/
|
||||
{
|
||||
role: 'quit'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = electron.Menu.buildFromTemplate(template)
|
||||
|
||||
121
karma.conf.js
@@ -2,13 +2,14 @@
|
||||
|
||||
var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
var webpack_config = require('./webpack.config');
|
||||
|
||||
/*
|
||||
* We use webpack to build our tests. It's a pain to have to wait for webpack
|
||||
* to build everything; however it's the easiest way to load our dependencies
|
||||
* from node_modules.
|
||||
*
|
||||
* If you run karma in multi-run mode (with `npm run test:multi`), it will watch
|
||||
* If you run karma in multi-run mode (with `npm run test-multi`), it will watch
|
||||
* the tests for changes, and webpack will rebuild using a cache. This is much quicker
|
||||
* than a clean rebuild.
|
||||
*/
|
||||
@@ -19,8 +20,41 @@ var testFile = process.env.KARMA_TEST_FILE || 'test/all-tests.js';
|
||||
process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs';
|
||||
process.env.Q_DEBUG = 1;
|
||||
|
||||
/* the webpack config is based on the real one, to (a) try to simulate the
|
||||
* deployed environment as closely as possible, and (b) to avoid a shedload of
|
||||
* cut-and-paste.
|
||||
*/
|
||||
|
||||
// find out if we're shipping olm, and where it is, if so.
|
||||
const olm_entry = webpack_config.entry['olm'];
|
||||
|
||||
// remove the default entries - karma provides its own (via the 'files' and
|
||||
// 'preprocessors' config below)
|
||||
delete webpack_config['entry'];
|
||||
|
||||
// add ./test as a search path for js
|
||||
webpack_config.module.loaders.unshift({
|
||||
test: /\.js$/, loader: "babel",
|
||||
include: [path.resolve('./src'), path.resolve('./test')],
|
||||
});
|
||||
|
||||
// disable parsing for sinon, because it
|
||||
// tries to do voodoo with 'require' which upsets
|
||||
// webpack (https://github.com/webpack/webpack/issues/304)
|
||||
webpack_config.module.noParse.push(/sinon\/pkg\/sinon\.js$/);
|
||||
|
||||
// ?
|
||||
webpack_config.resolve.alias['sinon'] = 'sinon/pkg/sinon.js';
|
||||
|
||||
webpack_config.resolve.root = [
|
||||
path.resolve('./src'),
|
||||
path.resolve('./test'),
|
||||
];
|
||||
|
||||
webpack_config.devtool = 'inline-source-map';
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
const myconfig = {
|
||||
// frameworks to use
|
||||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
||||
frameworks: ['mocha'],
|
||||
@@ -29,19 +63,29 @@ module.exports = function (config) {
|
||||
files: [
|
||||
'node_modules/babel-polyfill/browser.js',
|
||||
testFile,
|
||||
{pattern: 'vector/img/*', watched: false, included: false, served: true, nocache: false},
|
||||
|
||||
// make the images available via our httpd. They will be avaliable
|
||||
// below http://localhost:[PORT]/base/. See also `proxies` which
|
||||
// defines alternative URLs for them.
|
||||
//
|
||||
// This isn't required by any of the tests, but it stops karma
|
||||
// logging warnings when it serves a 404 for them.
|
||||
{
|
||||
pattern: 'src/skins/vector/img/*',
|
||||
watched: false, included: false, served: true, nocache: false,
|
||||
},
|
||||
],
|
||||
|
||||
// redirect img links to the karma server
|
||||
proxies: {
|
||||
"/img/": "/base/vector/img/",
|
||||
// redirect img links to the karma server. See above.
|
||||
"/img/": "/base/src/skins/vector/img/",
|
||||
},
|
||||
|
||||
// preprocess matching files before serving them to the browser
|
||||
// available preprocessors:
|
||||
// https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
'test/**/*.js': ['webpack', 'sourcemap']
|
||||
'{src,test}/**/*.js': ['webpack'],
|
||||
},
|
||||
|
||||
// test results reporter to use
|
||||
@@ -84,59 +128,20 @@ module.exports = function (config) {
|
||||
outputDir: 'karma-reports',
|
||||
},
|
||||
|
||||
webpack: {
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.json$/, loader: "json" },
|
||||
{
|
||||
test: /\.js$/, loader: "babel",
|
||||
include: [path.resolve('./src'),
|
||||
path.resolve('./test'),
|
||||
],
|
||||
query: {
|
||||
// we're using babel 5, for consistency with
|
||||
// the release build, which doesn't use the
|
||||
// presets.
|
||||
// presets: ['react', 'es2015'],
|
||||
},
|
||||
},
|
||||
],
|
||||
noParse: [
|
||||
// don't parse the languages within highlight.js. They
|
||||
// cause stack overflows
|
||||
// (https://github.com/webpack/webpack/issues/1721), and
|
||||
// there is no need for webpack to parse them - they can
|
||||
// just be included as-is.
|
||||
/highlight\.js\/lib\/languages/,
|
||||
webpack: webpack_config,
|
||||
|
||||
// also disable parsing for sinon, because it
|
||||
// tries to do voodoo with 'require' which upsets
|
||||
// webpack (https://github.com/webpack/webpack/issues/304)
|
||||
/sinon\/pkg\/sinon\.js$/,
|
||||
],
|
||||
webpackMiddleware: {
|
||||
stats: {
|
||||
// don't fill the console up with a mahoosive list of modules
|
||||
chunks: false,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
// alias any requires to the react module to the one in our path, otherwise
|
||||
// we tend to get the react source included twice when using npm link.
|
||||
react: path.resolve('./node_modules/react'),
|
||||
|
||||
// same goes for js-sdk
|
||||
"matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'),
|
||||
|
||||
sinon: 'sinon/pkg/sinon.js',
|
||||
},
|
||||
root: [
|
||||
path.resolve('./src'),
|
||||
path.resolve('./test'),
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
// olm may not be installed, so avoid webpack warnings by
|
||||
// ignoring it.
|
||||
new webpack.IgnorePlugin(/^olm$/),
|
||||
],
|
||||
devtool: 'inline-source-map',
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// include the olm loader if we have it.
|
||||
if (olm_entry) {
|
||||
myconfig.files.unshift(olm_entry);
|
||||
}
|
||||
|
||||
config.set(myconfig);
|
||||
};
|
||||
|
||||
152
package.json
@@ -1,76 +1,109 @@
|
||||
{
|
||||
"name": "vector-web",
|
||||
"version": "0.8.1",
|
||||
"description": "Vector webapp",
|
||||
"author": "matrix.org",
|
||||
"name": "riot-web",
|
||||
"productName": "Riot",
|
||||
"main": "electron/src/electron-main.js",
|
||||
"version": "0.9.8-rc.2",
|
||||
"description": "A feature-rich client for Matrix.org",
|
||||
"author": "Vector Creations Ltd.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vector-im/vector-web"
|
||||
"url": "https://github.com/vector-im/riot-web"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
"AUTHORS.rst",
|
||||
"CONTRIBUTING.rst",
|
||||
"deploy",
|
||||
"docs",
|
||||
"karma.conf.js",
|
||||
"lib",
|
||||
"release.sh",
|
||||
"scripts",
|
||||
"src",
|
||||
"test",
|
||||
"webpack.config.js"
|
||||
],
|
||||
"style": "bundle.css",
|
||||
"matrix-react-parent": "matrix-react-sdk",
|
||||
"scripts": {
|
||||
"reskindex": "reskindex -h src/header",
|
||||
"build:emojione": "cpx \"node_modules/emojione/assets/svg/*\" vector/emojione/svg/",
|
||||
"build:res": "node scripts/copy-res.js",
|
||||
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
|
||||
"build:css": "catw \"src/skins/vector/css/**/*.css\" -o vector/components.css --no-watch",
|
||||
"build:compile": "babel --source-maps -d lib src",
|
||||
"build:bundle": "NODE_ENV=production webpack -p lib/vector/index.js vector/bundle.js",
|
||||
"build:bundle:dev": "webpack --optimize-occurence-order lib/vector/index.js vector/bundle.js",
|
||||
"build:staticfiles": "cpx -v node_modules/olm/olm.js vector/",
|
||||
"build": "npm run build:staticfiles && npm run build:emojione && npm run build:css && npm run build:compile && npm run build:bundle",
|
||||
"build:dev": "npm run build:staticfiles && npm run build:emojione && npm run build:css && npm run build:compile && npm run build:bundle:dev",
|
||||
"package": "scripts/package.sh",
|
||||
"start:emojione": "cpx \"node_modules/emojione/assets/svg/*\" vector/emojione/svg/ -w",
|
||||
"start:js": "webpack -w src/vector/index.js vector/bundle.js",
|
||||
"start:js:prod": "NODE_ENV=production webpack -w src/vector/index.js vector/bundle.js",
|
||||
"start:skins:css": "catw \"src/skins/vector/css/**/*.css\" -o vector/components.css",
|
||||
"start:staticfiles": "cpx -Lwv node_modules/olm/olm.js vector/",
|
||||
"//cache": "Note the -c 1 below due to https://code.google.com/p/chromium/issues/detail?id=508270",
|
||||
"start": "parallelshell \"npm run start:staticfiles\" \"npm run start:emojione\" \"npm run start:js\" \"npm run start:skins:css\" \"http-server -c 1 vector\"",
|
||||
"start:prod": "parallelshell \"npm run start:staticfiles\" \"npm run start:emojione\" \"npm run start:js:prod\" \"npm run start:skins:css\" \"http-server -c 1 vector\"",
|
||||
"clean": "rimraf lib vector/olm.js vector/bundle.css vector/bundle.js vector/bundle.js.map vector/webpack.css* vector/emojione",
|
||||
"prepublish": "npm run build:css && npm run build:compile",
|
||||
"build:bundle": "NODE_ENV=production webpack -p --progress",
|
||||
"build:bundle:dev": "webpack --optimize-occurence-order --progress",
|
||||
"build:electron": "npm run clean && npm run build && build -wml --ia32 --x64",
|
||||
"build": "node scripts/babelcheck.js && npm run build:res && npm run build:bundle",
|
||||
"build:dev": "node scripts/babelcheck.js && npm run build:res && npm run build:bundle:dev",
|
||||
"dist": "scripts/package.sh",
|
||||
"start:res": "node scripts/copy-res.js -w",
|
||||
"start:js": "webpack-dev-server --output-filename=bundles/_dev_/[name].js --output-chunk-file=bundles/_dev_/[name].js -w --progress",
|
||||
"start:js:prod": "NODE_ENV=production webpack-dev-server -w --progress",
|
||||
"start": "node scripts/babelcheck.js && parallelshell \"npm run start:res\" \"npm run start:js\"",
|
||||
"start:prod": "parallelshell \"npm run start:res\" \"npm run start:js:prod\"",
|
||||
"lint": "eslint src/",
|
||||
"lintall": "eslint src/ test/",
|
||||
"clean": "rimraf lib webapp electron/dist",
|
||||
"prepublish": "npm run build:compile",
|
||||
"test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false",
|
||||
"test:multi": "karma start"
|
||||
"test-multi": "karma start"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-polyfill": "^6.5.0",
|
||||
"babel-runtime": "^6.11.6",
|
||||
"browser-request": "^0.3.3",
|
||||
"classnames": "^2.1.2",
|
||||
"draft-js": "^0.8.1",
|
||||
"extract-text-webpack-plugin": "^0.9.1",
|
||||
"favico.js": "^0.3.10",
|
||||
"filesize": "^3.1.2",
|
||||
"flux": "~2.0.3",
|
||||
"gemini-scrollbar": "matrix-org/gemini-scrollbar#b302279",
|
||||
"gfm.css": "^1.1.1",
|
||||
"highlight.js": "^9.0.0",
|
||||
"linkifyjs": "2.0.0-beta.4",
|
||||
"matrix-js-sdk": "0.6.1",
|
||||
"matrix-react-sdk": "0.7.2",
|
||||
"linkifyjs": "^2.1.3",
|
||||
"matrix-js-sdk": "0.7.6-rc.2",
|
||||
"matrix-react-sdk": "0.8.7-rc.3",
|
||||
"modernizr": "^3.1.0",
|
||||
"q": "^1.4.1",
|
||||
"react": "^15.2.1",
|
||||
"react": "^15.4.0",
|
||||
"react-dnd": "^2.1.4",
|
||||
"react-dnd-html5-backend": "^2.1.2",
|
||||
"react-dom": "^15.2.1",
|
||||
"react-dom": "^15.4.0",
|
||||
"react-gemini-scrollbar": "matrix-org/react-gemini-scrollbar#5e97aef",
|
||||
"sanitize-html": "^1.11.1",
|
||||
"ua-parser-js": "^0.7.10",
|
||||
"url": "^0.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel": "^5.8.23",
|
||||
"babel-core": "^5.8.25",
|
||||
"babel-loader": "^5.3.2",
|
||||
"catw": "^1.0.1",
|
||||
"autoprefixer": "^6.6.0",
|
||||
"babel-cli": "^6.5.2",
|
||||
"babel-core": "^6.14.0",
|
||||
"babel-eslint": "^6.1.0",
|
||||
"babel-loader": "^6.2.5",
|
||||
"babel-plugin-add-module-exports": "^0.2.1",
|
||||
"babel-plugin-transform-async-to-generator": "^6.16.0",
|
||||
"babel-plugin-transform-class-properties": "^6.16.0",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.16.0",
|
||||
"babel-plugin-transform-runtime": "^6.15.0",
|
||||
"babel-preset-es2015": "^6.16.0",
|
||||
"babel-preset-es2016": "^6.16.0",
|
||||
"babel-preset-es2017": "^6.16.0",
|
||||
"babel-preset-react": "^6.16.0",
|
||||
"babel-preset-stage-2": "^6.17.0",
|
||||
"chokidar": "^1.6.1",
|
||||
"cpx": "^1.3.2",
|
||||
"css-raw-loader": "^0.1.1",
|
||||
"emojione": "^2.2.3",
|
||||
"electron-builder": "^11.2.4",
|
||||
"electron-builder-squirrel-windows": "^11.2.1",
|
||||
"emojione": "^2.2.7",
|
||||
"eslint": "^3.14.0",
|
||||
"eslint-config-google": "^0.7.1",
|
||||
"eslint-plugin-flowtype": "^2.30.0",
|
||||
"eslint-plugin-react": "^6.9.0",
|
||||
"expect": "^1.16.0",
|
||||
"fs-extra": "^0.30.0",
|
||||
"http-server": "^0.8.4",
|
||||
"html-webpack-plugin": "^2.24.0",
|
||||
"json-loader": "^0.5.3",
|
||||
"karma": "^0.13.22",
|
||||
"karma-chrome-launcher": "^0.2.3",
|
||||
@@ -78,18 +111,57 @@
|
||||
"karma-junit-reporter": "^0.4.1",
|
||||
"karma-mocha": "^0.2.2",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"karma-sourcemap-loader": "^0.3.7",
|
||||
"karma-webpack": "^1.7.0",
|
||||
"minimist": "^1.2.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mocha": "^2.4.5",
|
||||
"parallelshell": "^1.2.0",
|
||||
"phantomjs-prebuilt": "^2.1.7",
|
||||
"react-addons-perf": "^15.0",
|
||||
"react-addons-test-utils": "^15.0.1",
|
||||
"postcss-extend": "^1.0.5",
|
||||
"postcss-import": "^9.0.0",
|
||||
"postcss-loader": "^1.2.2",
|
||||
"postcss-mixins": "^5.4.1",
|
||||
"postcss-nested": "^1.0.0",
|
||||
"postcss-scss": "^0.4.0",
|
||||
"postcss-simple-vars": "^3.0.0",
|
||||
"postcss-strip-inline-comments": "^0.1.5",
|
||||
"react-addons-perf": "^15.4.0",
|
||||
"react-addons-test-utils": "^15.4.0",
|
||||
"rimraf": "^2.4.3",
|
||||
"source-map-loader": "^0.1.5",
|
||||
"webpack": "^1.12.14"
|
||||
"webpack": "^1.12.14",
|
||||
"webpack-dev-server": "^1.16.2"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"olm": "https://matrix.org/packages/npm/olm/olm-1.3.0.tgz"
|
||||
"olm": "https://matrix.org/packages/npm/olm/olm-2.2.1.tgz"
|
||||
},
|
||||
"build": {
|
||||
"appId": "im.riot.app",
|
||||
"category": "Network",
|
||||
"electronVersion": "1.6.2",
|
||||
"//asar=false": "https://github.com/electron-userland/electron-builder/issues/675",
|
||||
"asar": false,
|
||||
"dereference": true,
|
||||
"//files": "We bundle everything, so we only need to include webapp/",
|
||||
"files": [
|
||||
"electron/src/**",
|
||||
"electron/img/**",
|
||||
"webapp/**",
|
||||
"package.json"
|
||||
],
|
||||
"linux": {
|
||||
"target": "deb",
|
||||
"maintainer": "support@riot.im",
|
||||
"desktop": {
|
||||
"StartupWMClass": "riot-web"
|
||||
}
|
||||
},
|
||||
"win": {
|
||||
"target": "squirrel"
|
||||
}
|
||||
},
|
||||
"directories": {
|
||||
"buildResources": "electron/build",
|
||||
"output": "electron/dist"
|
||||
}
|
||||
}
|
||||
|
||||
13
postcss.config.js
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require("postcss-import")(),
|
||||
require("autoprefixer")(),
|
||||
require("postcss-simple-vars")(),
|
||||
require("postcss-extend")(),
|
||||
require("postcss-nested")(),
|
||||
require("postcss-mixins")(),
|
||||
require("postcss-strip-inline-comments")(),
|
||||
],
|
||||
"parser": "postcss-scss",
|
||||
"local-plugins": true,
|
||||
};
|
||||
1
release_config.yaml
Normal file
@@ -0,0 +1 @@
|
||||
signing_id: packages@riot.im
|
||||
BIN
res/media/ring.mp3
Normal file
BIN
res/media/ring.ogg
Normal file
BIN
res/vector-icons/android-chrome-144x144.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
res/vector-icons/android-chrome-192x192.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
res/vector-icons/android-chrome-36x36.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
res/vector-icons/android-chrome-48x48.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
res/vector-icons/android-chrome-72x72.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
res/vector-icons/android-chrome-96x96.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
res/vector-icons/apple-touch-icon-114x114.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
res/vector-icons/apple-touch-icon-120x120.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
res/vector-icons/apple-touch-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
res/vector-icons/apple-touch-icon-152x152.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
res/vector-icons/apple-touch-icon-180x180.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
res/vector-icons/apple-touch-icon-57x57.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
res/vector-icons/apple-touch-icon-60x60.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
res/vector-icons/apple-touch-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
res/vector-icons/apple-touch-icon-76x76.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
res/vector-icons/apple-touch-icon-precomposed.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
res/vector-icons/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
res/vector-icons/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 673 B |
BIN
res/vector-icons/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
res/vector-icons/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
res/vector-icons/favicon.ico
Normal file
|
After Width: | Height: | Size: 102 KiB |
@@ -1,38 +1,38 @@
|
||||
{
|
||||
"name": "Vector",
|
||||
"name": "Riot",
|
||||
"icons": [
|
||||
{
|
||||
"src": "\/icons\/android-chrome-36x36.png",
|
||||
"src": "android-chrome-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "\/icons\/android-chrome-48x48.png",
|
||||
"src": "android-chrome-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "\/icons\/android-chrome-72x72.png",
|
||||
"src": "android-chrome-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "\/icons\/android-chrome-96x96.png",
|
||||
"src": "android-chrome-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "\/icons\/android-chrome-144x144.png",
|
||||
"src": "android-chrome-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "\/icons\/android-chrome-192x192.png",
|
||||
"src": "android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
BIN
res/vector-icons/mstile-144x144.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
res/vector-icons/mstile-150x150.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
res/vector-icons/mstile-310x150.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
res/vector-icons/mstile-310x310.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
res/vector-icons/mstile-70x70.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
26
scripts/babelcheck.js
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
// Makes sure the babel executable in the path is babel 6 (or greater), not
|
||||
// babel 5, which it is if you upgrade from an older version of react-sdk and
|
||||
// run 'npm install' since the package has changed to babel-cli, so 'babel'
|
||||
// remains installed and the executable in node_modules/.bin remains as babel
|
||||
// 5.
|
||||
|
||||
// This script is duplicated from matrix-react-sdk because it can't reliably
|
||||
// be pulled in from react-sdk while npm install is failing, as it will do
|
||||
// if the environment is in the erroneous state this script checks for.
|
||||
|
||||
exec("babel -V", function (error, stdout, stderr) {
|
||||
if ((error && error.code) || parseInt(stdout.substr(0,1), 10) < 6) {
|
||||
console.log("\033[31m\033[1m"+
|
||||
'*****************************************\n'+
|
||||
'* vector-web has moved to babel 6 *\n'+
|
||||
'* Please "rm -rf node_modules && npm i" *\n'+
|
||||
'* then restore links as appropriate *\n'+
|
||||
'*****************************************\n'+
|
||||
"\033[91m");
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
81
scripts/copy-res.js
Executable file
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// copies the resources into the webapp directory.
|
||||
//
|
||||
|
||||
// cpx includes globbed parts of the filename in the destination, but excludes
|
||||
// common parents. Hence, "res/{a,b}/**": the output will be "dest/a/..." and
|
||||
// "dest/b/...".
|
||||
const COPY_LIST = [
|
||||
["res/{media,vector-icons}/**", "webapp"],
|
||||
["src/skins/vector/{fonts,img}/**", "webapp"],
|
||||
["node_modules/emojione/assets/svg/*", "webapp/emojione/svg/"],
|
||||
["./config.json", "webapp", {directwatch: 1}],
|
||||
];
|
||||
|
||||
const parseArgs = require('minimist');
|
||||
const Cpx = require('cpx');
|
||||
const chokidar = require('chokidar');
|
||||
|
||||
const argv = parseArgs(
|
||||
process.argv.slice(2), {}
|
||||
);
|
||||
|
||||
var watch = argv.w;
|
||||
var verbose = argv.v;
|
||||
|
||||
function errCheck(err) {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
function next(i, err) {
|
||||
errCheck(err);
|
||||
|
||||
if (i >= COPY_LIST.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ent = COPY_LIST[i];
|
||||
const source = ent[0];
|
||||
const dest = ent[1];
|
||||
const opts = ent[2] || {};
|
||||
|
||||
const cpx = new Cpx.Cpx(source, dest);
|
||||
|
||||
if (verbose) {
|
||||
cpx.on("copy", (event) => {
|
||||
console.log(`Copied: ${event.srcPath} --> ${event.dstPath}`);
|
||||
});
|
||||
cpx.on("remove", (event) => {
|
||||
console.log(`Removed: ${event.path}`);
|
||||
});
|
||||
}
|
||||
|
||||
const cb = (err) => {next(i+1, err)};
|
||||
|
||||
if (watch) {
|
||||
if (opts.directwatch) {
|
||||
// cpx -w creates a watcher for the parent of any files specified,
|
||||
// which in the case of config.json is '.', which inevitably takes
|
||||
// ages to crawl. So we create our own watcher on the files
|
||||
// instead.
|
||||
const copy = () => {cpx.copy(errCheck)};
|
||||
chokidar.watch(source)
|
||||
.on('add', copy)
|
||||
.on('change', copy)
|
||||
.on('ready', cb)
|
||||
.on('error', errCheck);
|
||||
} else {
|
||||
cpx.on('watch-ready', cb);
|
||||
cpx.on("watch-error", cb);
|
||||
cpx.watch();
|
||||
}
|
||||
} else {
|
||||
cpx.copy(cb);
|
||||
}
|
||||
}
|
||||
|
||||
next(0);
|
||||
183
scripts/deploy.py
Executable file
@@ -0,0 +1,183 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# download and unpack a riot-web tarball.
|
||||
#
|
||||
# Allows `bundles` to be extracted to a common directory, and a link to
|
||||
# config.json to be added.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
|
||||
try:
|
||||
# python3
|
||||
from urllib.request import urlretrieve
|
||||
except ImportError:
|
||||
# python2
|
||||
from urllib import urlretrieve
|
||||
|
||||
class DeployException(Exception):
|
||||
pass
|
||||
|
||||
def create_relative_symlink(linkname, target):
|
||||
relpath = os.path.relpath(target, os.path.dirname(linkname))
|
||||
print ("Symlink %s -> %s" % (linkname, relpath))
|
||||
os.symlink(relpath, linkname)
|
||||
|
||||
|
||||
def move_bundles(source, dest):
|
||||
"""Move the contents of the 'bundles' directory to a common dir
|
||||
|
||||
We check that we will not be overwriting anything before we proceed.
|
||||
|
||||
Args:
|
||||
source (str): path to 'bundles' within the extracted tarball
|
||||
dest (str): target common directory
|
||||
"""
|
||||
|
||||
if not os.path.isdir(dest):
|
||||
os.mkdir(dest)
|
||||
|
||||
# build a map from source to destination, checking for non-existence as we go.
|
||||
renames = {}
|
||||
for f in os.listdir(source):
|
||||
dst = os.path.join(dest, f)
|
||||
if os.path.exists(dst):
|
||||
raise DeployException(
|
||||
"Not deploying. The bundle includes '%s' which we have previously deployed."
|
||||
% f
|
||||
)
|
||||
renames[os.path.join(source, f)] = dst
|
||||
|
||||
for (src, dst) in renames.iteritems():
|
||||
print ("Move %s -> %s" % (src, dst))
|
||||
os.rename(src, dst)
|
||||
|
||||
class Deployer:
|
||||
def __init__(self):
|
||||
self.packages_path = "."
|
||||
self.bundles_path = None
|
||||
self.should_clean = False
|
||||
self.config_location = None
|
||||
self.verify_signature = True
|
||||
|
||||
def deploy(self, tarball, extract_path):
|
||||
"""Download a tarball if necessary, and unpack it
|
||||
|
||||
Returns:
|
||||
(str) the path to the unpacked deployment
|
||||
"""
|
||||
print("Deploying %s to %s" % (tarball, extract_path))
|
||||
|
||||
name_str = os.path.basename(tarball).replace(".tar.gz", "")
|
||||
extracted_dir = os.path.join(extract_path, name_str)
|
||||
if os.path.exists(extracted_dir):
|
||||
raise DeployException('Cannot unpack %s: %s already exists' % (
|
||||
tarball, extracted_dir))
|
||||
|
||||
downloaded = False
|
||||
if tarball.startswith("http://") or tarball.startswith("https://"):
|
||||
tarball = self.download_and_verify(tarball)
|
||||
print("Downloaded file: %s" % tarball)
|
||||
downloaded = True
|
||||
|
||||
try:
|
||||
with tarfile.open(tarball) as tar:
|
||||
tar.extractall(extract_path)
|
||||
finally:
|
||||
if self.should_clean and downloaded:
|
||||
os.remove(tarball)
|
||||
|
||||
print ("Extracted into: %s" % extracted_dir)
|
||||
|
||||
if self.config_location:
|
||||
create_relative_symlink(
|
||||
target=self.config_location,
|
||||
linkname=os.path.join(extracted_dir, 'config.json')
|
||||
)
|
||||
|
||||
if self.bundles_path:
|
||||
extracted_bundles = os.path.join(extracted_dir, 'bundles')
|
||||
move_bundles(source=extracted_bundles, dest=self.bundles_path)
|
||||
|
||||
# replace the (hopefully now empty) extracted_bundles dir with a
|
||||
# symlink to the common dir.
|
||||
os.rmdir(extracted_bundles)
|
||||
create_relative_symlink(
|
||||
target=self.bundles_path,
|
||||
linkname=extracted_bundles,
|
||||
)
|
||||
return extracted_dir
|
||||
|
||||
def download_and_verify(self, url):
|
||||
tarball = self.download_file(url)
|
||||
|
||||
if self.verify_signature:
|
||||
sigfile = self.download_file(url + ".asc")
|
||||
subprocess.check_call(["gpg", "--verify", sigfile, tarball])
|
||||
|
||||
return tarball
|
||||
|
||||
def download_file(self, url):
|
||||
if not os.path.isdir(self.packages_path):
|
||||
os.mkdir(self.packages_path)
|
||||
local_filename = os.path.join(self.packages_path,
|
||||
url.split('/')[-1])
|
||||
sys.stdout.write("Downloading %s -> %s..." % (url, local_filename))
|
||||
sys.stdout.flush()
|
||||
urlretrieve(url, local_filename)
|
||||
print ("Done")
|
||||
return local_filename
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser("Deploy a Riot build on a web server.")
|
||||
parser.add_argument(
|
||||
"-p", "--packages-dir", default="./packages", help=(
|
||||
"The directory to download the tarball into. (Default: '%(default)s')"
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"-e", "--extract-path", default="./deploys", help=(
|
||||
"The location to extract .tar.gz files to. (Default: '%(default)s')"
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"-b", "--bundles-dir", nargs='?', default="./bundles", help=(
|
||||
"A directory to move the contents of the 'bundles' directory to. A \
|
||||
symlink to the bundles directory will also be written inside the \
|
||||
extracted tarball. Example: './bundles'. \
|
||||
(Default: '%(default)s')"
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"-c", "--clean", action="store_true", default=False, help=(
|
||||
"Remove .tar.gz files after they have been downloaded and extracted. \
|
||||
(Default: %(default)s)"
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"--config", nargs='?', default='./config.json', help=(
|
||||
"Write a symlink at config.json in the extracted tarball to this \
|
||||
location. (Default: '%(default)s')"
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"tarball", help=(
|
||||
"filename of tarball, or URL to download."
|
||||
),
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
deployer = Deployer()
|
||||
deployer.packages_path = args.packages_dir
|
||||
deployer.bundles_path = args.bundles_dir
|
||||
deployer.should_clean = args.clean
|
||||
deployer.config_location = args.config
|
||||
|
||||
deployer.deploy(args.tarball, args.extract_path)
|
||||
130
scripts/electron-package.sh
Executable file
@@ -0,0 +1,130 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 -v <version> -c <config file> [-n]"
|
||||
echo
|
||||
echo "version: commit-ish to check out and build"
|
||||
echo "config file: a path to a json config file to"
|
||||
echo "ship with the build. In addition, update_base_url:"
|
||||
echo "from this file is used to set up auto-update."
|
||||
echo "-n: build with no config file."
|
||||
echo
|
||||
echo "Values may also be passed as environment variables"
|
||||
}
|
||||
|
||||
conffile=
|
||||
version=
|
||||
skipcfg=0
|
||||
while getopts "c:v:n" opt; do
|
||||
case $opt in
|
||||
c)
|
||||
conffile=$OPTARG
|
||||
;;
|
||||
v)
|
||||
version=$OPTARG
|
||||
;;
|
||||
n)
|
||||
skipcfg=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
usage
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo "No version supplied"
|
||||
usage
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -z "$conffile" ] && [ "$skipcfg" = 0 ]; then
|
||||
echo "No config file given. Use -c to supply a config file or"
|
||||
echo "-n to build with no config file (and no auto update)."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -n "$conffile" ]; then
|
||||
update_base_url=`jq -r .update_base_url $conffile`
|
||||
|
||||
if [ -z "$update_base_url" ]; then
|
||||
echo "No update URL supplied. Use update_base_url: null if you really"
|
||||
echo "want a build with no auto-update."
|
||||
usage
|
||||
exit
|
||||
fi
|
||||
# Make sure the base URL ends in a slash if it doesn't already
|
||||
update_base_url=`echo $update_base_url | sed -e 's#\([^\/]\)$#\1\/#'`
|
||||
fi
|
||||
|
||||
if [ ! -f package.json ]; then
|
||||
echo "No package.json found. This script must be run from"
|
||||
echo "the vector-web directory."
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Building $version using Update base URL $update_base_url"
|
||||
|
||||
projdir=`pwd`
|
||||
builddir=`mktemp -d 2>/dev/null || mktemp -d -t 'buildtmp'`
|
||||
pushd "$builddir"
|
||||
|
||||
git clone "$projdir" .
|
||||
git checkout "$version"
|
||||
|
||||
# Figure out what version we're building
|
||||
vername=`jq -r .version package.json`
|
||||
|
||||
if [ -n "$conffile" ]; then
|
||||
popd
|
||||
cp "$conffile" "$builddir/"
|
||||
pushd "$builddir"
|
||||
fi
|
||||
|
||||
npm install
|
||||
npm run build:electron
|
||||
|
||||
popd
|
||||
|
||||
distdir="$builddir/electron/dist"
|
||||
pubdir="$projdir/electron/pub"
|
||||
rm -r "$pubdir" || true
|
||||
mkdir -p "$pubdir"
|
||||
|
||||
# Install packages: what the user downloads the first time,
|
||||
# (DMGs for mac, exe installer for windows)
|
||||
mkdir -p "$pubdir/install/macos"
|
||||
cp $distdir/mac/*.dmg "$pubdir/install/macos/"
|
||||
|
||||
mkdir -p "$pubdir/install/win32/ia32/"
|
||||
cp $distdir/win-ia32/*.exe "$pubdir/install/win32/ia32/"
|
||||
|
||||
mkdir -p "$pubdir/install/win32/x64/"
|
||||
cp $distdir/win/*.exe "$pubdir/install/win32/x64/"
|
||||
|
||||
# Packages for auto-update
|
||||
mkdir -p "$pubdir/update/macos"
|
||||
cp $distdir/mac/*.zip "$pubdir/update/macos/"
|
||||
echo "$vername" > "$pubdir/update/macos/latest"
|
||||
|
||||
mkdir -p "$pubdir/update/win32/ia32/"
|
||||
cp $distdir/win-ia32/*.nupkg "$pubdir/update/win32/ia32/"
|
||||
cp $distdir/win-ia32/RELEASES "$pubdir/update/win32/ia32/"
|
||||
|
||||
mkdir -p "$pubdir/update/win32/x64/"
|
||||
cp $distdir/win/*.nupkg "$pubdir/update/win32/x64/"
|
||||
cp $distdir/win/RELEASES "$pubdir/update/win32/x64/"
|
||||
|
||||
# Move the debs to the main project dir's dist folder
|
||||
rm -r "$projdir/electron/dist" || true
|
||||
mkdir -p "$projdir/electron/dist"
|
||||
cp $distdir/*.deb "$projdir/electron/dist/"
|
||||
|
||||
rm -rf "$builddir"
|
||||
|
||||
echo "Riot Desktop is ready to go in $pubdir: this directory can be hosted on your web server."
|
||||
echo "deb archives are in electron/dist/ - these should be added into your debian repository"
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
export NVM_DIR="/home/jenkins/.nvm"
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||
nvm use 6
|
||||
|
||||
@@ -11,25 +11,30 @@ set -x
|
||||
npm install
|
||||
|
||||
# apparently npm 3.10.3 on node 6.4.0 doesn't upgrade #develop target with npm install unless explicitly asked.
|
||||
npm install matrix-react-sdk matrix-js-sdk
|
||||
npm install matrix-react-sdk matrix-js-sdk olm
|
||||
|
||||
# install olm. A naive 'npm i ./olm/olm-*.tgz' fails because it uses the url
|
||||
# from our package.json (or even matrix-js-sdk's) in preference.
|
||||
tar -C olm -xz < olm/olm-*.tgz
|
||||
rm -r node_modules/olm
|
||||
cp -r olm/package node_modules/olm
|
||||
#
|
||||
# disabled for now, to avoid the annoying scenario of a release doing something
|
||||
# different to /develop. Instead, add it to the 'npm install' list above.
|
||||
# -- rav 2016/02/03
|
||||
#tar -C olm -xz < olm/olm-*.tgz
|
||||
#rm -r node_modules/olm
|
||||
#cp -r olm/package node_modules/olm
|
||||
|
||||
# we may be using a dev branch of react-sdk, in which case we need to build it
|
||||
(cd node_modules/matrix-react-sdk && npm run build)
|
||||
|
||||
# we may be using dev branches of js-sdk and react-sdk, in which case we need to build them
|
||||
(cd node_modules/matrix-js-sdk && npm install)
|
||||
(cd node_modules/matrix-react-sdk && npm install)
|
||||
|
||||
# run the mocha tests
|
||||
npm run test
|
||||
|
||||
# build our artifacts; dumps them in ./vector
|
||||
npm run build:dev
|
||||
# run eslint
|
||||
npm run lintall -- -f checkstyle -o eslint.xml || true
|
||||
|
||||
# gzip up ./vector
|
||||
rm vector-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist
|
||||
rm dist/vector-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist
|
||||
|
||||
# node_modules deps from 'npm install' don't have a .git dir so can't
|
||||
# rev-parse; but they do set the commit in package.json under 'gitHead' which
|
||||
@@ -39,4 +44,4 @@ JSSDK_SHA=$(grep 'gitHead' node_modules/matrix-js-sdk/package.json | cut -d \" -
|
||||
|
||||
VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop
|
||||
|
||||
tar -zcvhf vector-$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA.tar.gz vector #g[z]ip, [c]reate archive, [v]erbose, [f]ilename, [h]ard-dereference (do not archive symlinks)
|
||||
DIST_VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA scripts/package.sh -d
|
||||
93
scripts/make-icons.sh
Executable file
@@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# != 1 ]
|
||||
then
|
||||
echo "Usage: $0 <svg file>"
|
||||
exit
|
||||
fi
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
tmpdir=`mktemp -d 2>/dev/null || mktemp -d -t 'icontmp'`
|
||||
|
||||
for i in 1024 512 310 256 192 180 152 150 144 128 120 114 96 76 72 70 64 60 57 48 36 32 24 16
|
||||
do
|
||||
#convert -background none -density 1000 -resize $i -extent $i -gravity center "$1" "$tmpdir/$i.png"
|
||||
|
||||
# Above is the imagemagick command to render an svg to png. Unfortunately, its support for SVGs
|
||||
# with CSS isn't very good (with rsvg and even moreso the built in renderer) so we use cairosvg.
|
||||
# This can be installed with:
|
||||
# pip install cairosvg==1.0.22 # Version 2 doesn't support python 2
|
||||
# pip install tinycss
|
||||
# pip install cssselect # These are necessary for CSS support
|
||||
# You'll also need xmlstarlet from your favourite package manager
|
||||
#
|
||||
# Cairosvg doesn't suport rendering at a specific size (https://github.com/Kozea/CairoSVG/issues/83#issuecomment-215720176)
|
||||
# so we have to 'resize the svg' first (add width and height attributes to the svg element) to make it render at the
|
||||
# size we need.
|
||||
# XXX: This will break if the svg already has width and height attributes
|
||||
cp "$1" "$tmpdir/tmp.svg"
|
||||
xmlstarlet ed -N x="http://www.w3.org/2000/svg" --insert "/x:svg" --type attr -n width -v $i "$tmpdir/tmp.svg" > "$tmpdir/tmp2.svg"
|
||||
xmlstarlet ed -N x="http://www.w3.org/2000/svg" --insert "/x:svg" --type attr -n height -v $i "$tmpdir/tmp2.svg" > "$tmpdir/tmp3.svg"
|
||||
cairosvg -f png -o "$tmpdir/$i.png" "$tmpdir/tmp3.svg"
|
||||
rm "$tmpdir/tmp.svg" "$tmpdir/tmp2.svg" "$tmpdir/tmp3.svg"
|
||||
done
|
||||
|
||||
# one more for the non-square mstile
|
||||
cp "$1" "$tmpdir/tmp.svg"
|
||||
xmlstarlet ed -N x="http://www.w3.org/2000/svg" --insert "/x:svg" --type attr -n width -v 310 "$tmpdir/tmp.svg" > "$tmpdir/tmp2.svg"
|
||||
xmlstarlet ed -N x="http://www.w3.org/2000/svg" --insert "/x:svg" --type attr -n height -v 150 "$tmpdir/tmp2.svg" > "$tmpdir/tmp3.svg"
|
||||
cairosvg -f png -o "$tmpdir/310x150.png" "$tmpdir/tmp3.svg"
|
||||
rm "$tmpdir/tmp.svg" "$tmpdir/tmp2.svg" "$tmpdir/tmp3.svg"
|
||||
|
||||
mkdir "$tmpdir/Riot.iconset"
|
||||
cp "$tmpdir/16.png" "$tmpdir/Riot.iconset/icon_16x16.png"
|
||||
cp "$tmpdir/32.png" "$tmpdir/Riot.iconset/icon_16x16@2x.png"
|
||||
cp "$tmpdir/32.png" "$tmpdir/Riot.iconset/icon_32x32.png"
|
||||
cp "$tmpdir/64.png" "$tmpdir/Riot.iconset/icon_32x32@2x.png"
|
||||
cp "$tmpdir/128.png" "$tmpdir/Riot.iconset/icon_128x128.png"
|
||||
cp "$tmpdir/256.png" "$tmpdir/Riot.iconset/icon_128x128@2x.png"
|
||||
cp "$tmpdir/256.png" "$tmpdir/Riot.iconset/icon_256x256.png"
|
||||
cp "$tmpdir/512.png" "$tmpdir/Riot.iconset/icon_256x256@2x.png"
|
||||
cp "$tmpdir/512.png" "$tmpdir/Riot.iconset/icon_512x512.png"
|
||||
cp "$tmpdir/1024.png" "$tmpdir/Riot.iconset/icon_512x512@2x.png"
|
||||
iconutil -c icns -o electron/build/icon.icns "$tmpdir/Riot.iconset"
|
||||
|
||||
cp "$tmpdir/36.png" "res/vector-icons/android-chrome-36x36.png"
|
||||
cp "$tmpdir/48.png" "res/vector-icons/android-chrome-48x48.png"
|
||||
cp "$tmpdir/72.png" "res/vector-icons/android-chrome-72x72.png"
|
||||
cp "$tmpdir/96.png" "res/vector-icons/android-chrome-96x96.png"
|
||||
cp "$tmpdir/144.png" "res/vector-icons/android-chrome-144x144.png"
|
||||
cp "$tmpdir/192.png" "res/vector-icons/android-chrome-192x192.png"
|
||||
cp "$tmpdir/180.png" "res/vector-icons/apple-touch-icon.png"
|
||||
cp "$tmpdir/180.png" "res/vector-icons/apple-touch-icon-precomposed.png"
|
||||
cp "$tmpdir/57.png" "res/vector-icons/apple-touch-icon-57x57.png"
|
||||
cp "$tmpdir/60.png" "res/vector-icons/apple-touch-icon-60x60.png"
|
||||
cp "$tmpdir/72.png" "res/vector-icons/apple-touch-icon-72x72.png"
|
||||
cp "$tmpdir/76.png" "res/vector-icons/apple-touch-icon-76x76.png"
|
||||
cp "$tmpdir/114.png" "res/vector-icons/apple-touch-icon-114x114.png"
|
||||
cp "$tmpdir/120.png" "res/vector-icons/apple-touch-icon-120x120.png"
|
||||
cp "$tmpdir/144.png" "res/vector-icons/apple-touch-icon-144x144.png"
|
||||
cp "$tmpdir/152.png" "res/vector-icons/apple-touch-icon-152x152.png"
|
||||
cp "$tmpdir/180.png" "res/vector-icons/apple-touch-icon-180x180.png"
|
||||
cp "$tmpdir/16.png" "res/vector-icons/favicon-16x16.png"
|
||||
cp "$tmpdir/32.png" "res/vector-icons/favicon-32x32.png"
|
||||
cp "$tmpdir/96.png" "res/vector-icons/favicon-96x96.png"
|
||||
cp "$tmpdir/70.png" "res/vector-icons/mstile-70x70.png"
|
||||
cp "$tmpdir/144.png" "res/vector-icons/mstile-144x144.png"
|
||||
cp "$tmpdir/150.png" "res/vector-icons/mstile-150x150.png"
|
||||
cp "$tmpdir/310.png" "res/vector-icons/mstile-310x310.png"
|
||||
cp "$tmpdir/310x150.png" "res/vector-icons/mstile-310x150.png"
|
||||
|
||||
convert "$tmpdir/16.png" "$tmpdir/32.png" "$tmpdir/64.png" "$tmpdir/128.png" "$tmpdir/256.png" "res/vector-icons/favicon.ico"
|
||||
|
||||
cp "res/vector-icons/favicon.ico" "electron/build/icon.ico"
|
||||
|
||||
# https://github.com/electron-userland/electron-builder/blob/3f97b86993d4ea5172e562b182230a194de0f621/src/targets/LinuxTargetHelper.ts#L127
|
||||
for i in 24 96 16 48 64 128 256 512
|
||||
do
|
||||
cp "$tmpdir/$i.png" "electron/build/icons/${i}x${i}.png"
|
||||
done
|
||||
|
||||
rm -r "$tmpdir"
|
||||
@@ -2,14 +2,29 @@
|
||||
|
||||
set -e
|
||||
|
||||
version=`git describe --dirty --tags || echo unknown`
|
||||
dev=""
|
||||
if [ "$1" = '-d' ]; then
|
||||
dev=":dev"
|
||||
fi
|
||||
|
||||
npm run build
|
||||
mkdir -p packages
|
||||
cp -r vector vector-$version
|
||||
if [ -n "$DIST_VERSION" ]; then
|
||||
version=$DIST_VERSION
|
||||
else
|
||||
version=`git describe --dirty --tags || echo unknown`
|
||||
fi
|
||||
|
||||
npm run clean
|
||||
npm run build$dev
|
||||
|
||||
# include the sample config in the tarball. Arguably this should be done by
|
||||
# `npm run build`, but it's just too painful.
|
||||
cp config.sample.json webapp/
|
||||
|
||||
mkdir -p dist
|
||||
cp -r webapp vector-$version
|
||||
echo $version > vector-$version/version
|
||||
tar chvzf packages/vector-$version.tar.gz vector-$version
|
||||
tar chvzf dist/vector-$version.tar.gz vector-$version
|
||||
rm -r vector-$version
|
||||
|
||||
echo
|
||||
echo "Packaged packages/vector-$version.tar.gz"
|
||||
echo "Packaged dist/vector-$version.tar.gz"
|
||||
|
||||
@@ -1,26 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# auto-deploy script for https://riot.im/develop
|
||||
#
|
||||
# Listens for HTTP hits. When it gets one, downloads the artifact from jenkins
|
||||
# and deploys it as the new version.
|
||||
#
|
||||
# Requires the following python packages:
|
||||
#
|
||||
# - requests
|
||||
# - flask
|
||||
#
|
||||
from __future__ import print_function
|
||||
import json, requests, tarfile, argparse, os, errno
|
||||
import time
|
||||
from urlparse import urljoin
|
||||
|
||||
from flask import Flask, jsonify, request, abort
|
||||
|
||||
from deploy import Deployer, DeployException
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
arg_jenkins_url, arg_extract_path, arg_should_clean, arg_symlink, arg_config_location = (
|
||||
None, None, None, None, None
|
||||
)
|
||||
|
||||
def download_file(url):
|
||||
local_filename = url.split('/')[-1]
|
||||
r = requests.get(url, stream=True)
|
||||
with open(local_filename, 'wb') as f:
|
||||
for chunk in r.iter_content(chunk_size=1024):
|
||||
if chunk: # filter out keep-alive new chunks
|
||||
f.write(chunk)
|
||||
return local_filename
|
||||
|
||||
def untar_to(tarball, dest):
|
||||
with tarfile.open(tarball) as tar:
|
||||
tar.extractall(dest)
|
||||
arg_jenkins_url = None
|
||||
deployer = None
|
||||
arg_extract_path = None
|
||||
arg_symlink = None
|
||||
|
||||
def create_symlink(source, linkname):
|
||||
try:
|
||||
@@ -57,6 +61,9 @@ def on_receive_jenkins_poke():
|
||||
abort(400, "Missing or bad build number")
|
||||
return
|
||||
|
||||
return fetch_jenkins_build(job_name, build_num)
|
||||
|
||||
def fetch_jenkins_build(job_name, build_num):
|
||||
artifact_url = urljoin(
|
||||
arg_jenkins_url, "job/%s/%s/api/json" % (job_name, build_num)
|
||||
)
|
||||
@@ -106,31 +113,45 @@ def on_receive_jenkins_poke():
|
||||
arg_jenkins_url, "job/%s/%s/artifact/%s" % (job_name, build_num, tar_gz_path)
|
||||
)
|
||||
|
||||
print("Retrieving .tar.gz file: %s" % tar_gz_url)
|
||||
filename = download_file(tar_gz_url)
|
||||
print("Downloaded file: %s" % filename)
|
||||
name_str = filename.replace(".tar.gz", "")
|
||||
untar_location = os.path.join(arg_extract_path, name_str)
|
||||
untar_to(filename, untar_location)
|
||||
# we extract into a directory based on the build number. This avoids the
|
||||
# problem of multiple builds building the same git version and thus having
|
||||
# the same tarball name. That would lead to two potential problems:
|
||||
# (a) sometimes jenkins serves corrupted artifacts; we would replace
|
||||
# a good deploy with a bad one
|
||||
# (b) we'll be overwriting the live deployment, which means people might
|
||||
# see half-written files.
|
||||
build_dir = os.path.join(arg_extract_path, "%s-#%s" % (job_name, build_num))
|
||||
try:
|
||||
extracted_dir = deploy_tarball(tar_gz_url, build_dir)
|
||||
except DeployException as e:
|
||||
abort(400, e.message)
|
||||
|
||||
if arg_should_clean:
|
||||
os.remove(filename)
|
||||
|
||||
# stamp the version somewhere JS can get to it
|
||||
with open(os.path.join(untar_location, "vector/version"), "w") as stamp_file:
|
||||
stamp_file.write(name_str)
|
||||
|
||||
create_symlink(source=os.path.join(untar_location, "vector"), linkname=arg_symlink)
|
||||
|
||||
if arg_config_location:
|
||||
create_symlink(source=arg_config_location, linkname=os.path.join(untar_location, "vector", 'config.json'))
|
||||
create_symlink(source=extracted_dir, linkname=arg_symlink)
|
||||
|
||||
return jsonify({})
|
||||
|
||||
def deploy_tarball(tar_gz_url, build_dir):
|
||||
"""Download a tarball from jenkins and unpack it
|
||||
|
||||
Returns:
|
||||
(str) the path to the unpacked deployment
|
||||
"""
|
||||
if os.path.exists(build_dir):
|
||||
raise DeployException(
|
||||
"Not deploying. We have previously deployed this build."
|
||||
)
|
||||
os.mkdir(build_dir)
|
||||
|
||||
# we rely on the fact that flask only serves one request at a time to
|
||||
# ensure that we do not overwrite a tarball from a concurrent request.
|
||||
|
||||
return deployer.deploy(tar_gz_url, build_dir)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser("Runs a Vector redeployment server.")
|
||||
parser.add_argument(
|
||||
"-j", "--jenkins", dest="jenkins", default="http://matrix.org/jenkins/", help=(
|
||||
"-j", "--jenkins", dest="jenkins", default="https://matrix.org/jenkins/", help=(
|
||||
"The base URL of the Jenkins web server. This will be hit to get the\
|
||||
built artifacts (the .gz file) for redeploying."
|
||||
)
|
||||
@@ -145,6 +166,13 @@ if __name__ == "__main__":
|
||||
"The location to extract .tar.gz files to."
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"-b", "--bundles-dir", dest="bundles_dir", help=(
|
||||
"A directory to move the contents of the 'bundles' directory to. A \
|
||||
symlink to the bundles directory will also be written inside the \
|
||||
extracted tarball. Example: './bundles'."
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"-c", "--clean", dest="clean", action="store_true", default=False, help=(
|
||||
"Remove .tar.gz files after they have been downloaded and extracted."
|
||||
@@ -163,18 +191,47 @@ if __name__ == "__main__":
|
||||
To this location."
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"--test", dest="tarball_uri", help=(
|
||||
"Don't start an HTTP listener. Instead download a build from Jenkins \
|
||||
immediately."
|
||||
),
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
if args.jenkins.endswith("/"): # important for urljoin
|
||||
arg_jenkins_url = args.jenkins
|
||||
else:
|
||||
arg_jenkins_url = args.jenkins + "/"
|
||||
arg_extract_path = args.extract
|
||||
arg_should_clean = args.clean
|
||||
arg_symlink = args.symlink
|
||||
arg_config_location = args.config
|
||||
print(
|
||||
"Listening on port %s. Extracting to %s%s. Symlinking to %s. Jenkins URL: %s. Config location: %s" %
|
||||
(args.port, arg_extract_path,
|
||||
" (clean after)" if arg_should_clean else "", arg_symlink, arg_jenkins_url, arg_config_location)
|
||||
)
|
||||
app.run(host="0.0.0.0", port=args.port, debug=True)
|
||||
|
||||
if not os.path.isdir(arg_extract_path):
|
||||
os.mkdir(arg_extract_path)
|
||||
|
||||
deployer = Deployer()
|
||||
deployer.bundles_path = args.bundles_dir
|
||||
deployer.should_clean = args.clean
|
||||
deployer.config_location = args.config
|
||||
|
||||
# we don't pgp-sign jenkins artifacts; instead we rely on HTTPS access to
|
||||
# the jenkins server (and the jenkins server not being compromised and/or
|
||||
# github not serving it compromised source). If that's not good enough for
|
||||
# you, don't use riot.im/develop.
|
||||
deployer.verify_signature = False
|
||||
|
||||
if args.tarball_uri is not None:
|
||||
build_dir = os.path.join(arg_extract_path, "test-%i" % (time.time()))
|
||||
deploy_tarball(args.tarball_uri, build_dir)
|
||||
else:
|
||||
print(
|
||||
"Listening on port %s. Extracting to %s%s. Symlinking to %s. Jenkins URL: %s. Config location: %s" %
|
||||
(args.port,
|
||||
arg_extract_path,
|
||||
" (clean after)" if deployer.should_clean else "",
|
||||
arg_symlink,
|
||||
arg_jenkins_url,
|
||||
deployer.config_location,
|
||||
)
|
||||
)
|
||||
app.run(host="0.0.0.0", port=args.port, debug=True)
|
||||
@@ -26,32 +26,63 @@ limitations under the License.
|
||||
|
||||
module.exports.components = require('matrix-react-sdk/lib/component-index').components;
|
||||
|
||||
module.exports.components['structures.BottomLeftMenu'] = require('./components/structures/BottomLeftMenu');
|
||||
module.exports.components['structures.CompatibilityPage'] = require('./components/structures/CompatibilityPage');
|
||||
module.exports.components['structures.LeftPanel'] = require('./components/structures/LeftPanel');
|
||||
module.exports.components['structures.RightPanel'] = require('./components/structures/RightPanel');
|
||||
module.exports.components['structures.RoomDirectory'] = require('./components/structures/RoomDirectory');
|
||||
module.exports.components['structures.RoomSubList'] = require('./components/structures/RoomSubList');
|
||||
module.exports.components['structures.SearchBox'] = require('./components/structures/SearchBox');
|
||||
module.exports.components['structures.ViewSource'] = require('./components/structures/ViewSource');
|
||||
module.exports.components['views.context_menus.MessageContextMenu'] = require('./components/views/context_menus/MessageContextMenu');
|
||||
module.exports.components['views.context_menus.NotificationStateContextMenu'] = require('./components/views/context_menus/NotificationStateContextMenu');
|
||||
module.exports.components['views.context_menus.RoomTagContextMenu'] = require('./components/views/context_menus/RoomTagContextMenu');
|
||||
module.exports.components['views.dialogs.ChangelogDialog'] = require('./components/views/dialogs/ChangelogDialog');
|
||||
module.exports.components['views.directory.NetworkDropdown'] = require('./components/views/directory/NetworkDropdown');
|
||||
module.exports.components['views.elements.ImageView'] = require('./components/views/elements/ImageView');
|
||||
module.exports.components['views.elements.Spinner'] = require('./components/views/elements/Spinner');
|
||||
module.exports.components['views.globals.GuestWarningBar'] = require('./components/views/globals/GuestWarningBar');
|
||||
module.exports.components['views.globals.MatrixToolbar'] = require('./components/views/globals/MatrixToolbar');
|
||||
module.exports.components['views.globals.NewVersionBar'] = require('./components/views/globals/NewVersionBar');
|
||||
module.exports.components['views.login.VectorCustomServerDialog'] = require('./components/views/login/VectorCustomServerDialog');
|
||||
module.exports.components['views.login.VectorLoginFooter'] = require('./components/views/login/VectorLoginFooter');
|
||||
module.exports.components['views.login.VectorLoginHeader'] = require('./components/views/login/VectorLoginHeader');
|
||||
module.exports.components['views.messages.DateSeparator'] = require('./components/views/messages/DateSeparator');
|
||||
module.exports.components['views.messages.MessageTimestamp'] = require('./components/views/messages/MessageTimestamp');
|
||||
module.exports.components['views.rooms.DNDRoomTile'] = require('./components/views/rooms/DNDRoomTile');
|
||||
module.exports.components['views.rooms.RoomDropTarget'] = require('./components/views/rooms/RoomDropTarget');
|
||||
module.exports.components['views.rooms.RoomTooltip'] = require('./components/views/rooms/RoomTooltip');
|
||||
module.exports.components['views.rooms.SearchBar'] = require('./components/views/rooms/SearchBar');
|
||||
module.exports.components['views.settings.IntegrationsManager'] = require('./components/views/settings/IntegrationsManager');
|
||||
module.exports.components['views.settings.Notifications'] = require('./components/views/settings/Notifications');
|
||||
import structures$BottomLeftMenu from './components/structures/BottomLeftMenu';
|
||||
structures$BottomLeftMenu && (module.exports.components['structures.BottomLeftMenu'] = structures$BottomLeftMenu);
|
||||
import structures$CompatibilityPage from './components/structures/CompatibilityPage';
|
||||
structures$CompatibilityPage && (module.exports.components['structures.CompatibilityPage'] = structures$CompatibilityPage);
|
||||
import structures$HomePage from './components/structures/HomePage';
|
||||
structures$HomePage && (module.exports.components['structures.HomePage'] = structures$HomePage);
|
||||
import structures$LeftPanel from './components/structures/LeftPanel';
|
||||
structures$LeftPanel && (module.exports.components['structures.LeftPanel'] = structures$LeftPanel);
|
||||
import structures$RightPanel from './components/structures/RightPanel';
|
||||
structures$RightPanel && (module.exports.components['structures.RightPanel'] = structures$RightPanel);
|
||||
import structures$RoomDirectory from './components/structures/RoomDirectory';
|
||||
structures$RoomDirectory && (module.exports.components['structures.RoomDirectory'] = structures$RoomDirectory);
|
||||
import structures$RoomSubList from './components/structures/RoomSubList';
|
||||
structures$RoomSubList && (module.exports.components['structures.RoomSubList'] = structures$RoomSubList);
|
||||
import structures$SearchBox from './components/structures/SearchBox';
|
||||
structures$SearchBox && (module.exports.components['structures.SearchBox'] = structures$SearchBox);
|
||||
import structures$ViewSource from './components/structures/ViewSource';
|
||||
structures$ViewSource && (module.exports.components['structures.ViewSource'] = structures$ViewSource);
|
||||
import views$context_menus$MessageContextMenu from './components/views/context_menus/MessageContextMenu';
|
||||
views$context_menus$MessageContextMenu && (module.exports.components['views.context_menus.MessageContextMenu'] = views$context_menus$MessageContextMenu);
|
||||
import views$context_menus$RoomTileContextMenu from './components/views/context_menus/RoomTileContextMenu';
|
||||
views$context_menus$RoomTileContextMenu && (module.exports.components['views.context_menus.RoomTileContextMenu'] = views$context_menus$RoomTileContextMenu);
|
||||
import views$dialogs$BugReportDialog from './components/views/dialogs/BugReportDialog';
|
||||
views$dialogs$BugReportDialog && (module.exports.components['views.dialogs.BugReportDialog'] = views$dialogs$BugReportDialog);
|
||||
import views$dialogs$ChangelogDialog from './components/views/dialogs/ChangelogDialog';
|
||||
views$dialogs$ChangelogDialog && (module.exports.components['views.dialogs.ChangelogDialog'] = views$dialogs$ChangelogDialog);
|
||||
import views$directory$NetworkDropdown from './components/views/directory/NetworkDropdown';
|
||||
views$directory$NetworkDropdown && (module.exports.components['views.directory.NetworkDropdown'] = views$directory$NetworkDropdown);
|
||||
import views$elements$ImageView from './components/views/elements/ImageView';
|
||||
views$elements$ImageView && (module.exports.components['views.elements.ImageView'] = views$elements$ImageView);
|
||||
import views$elements$Spinner from './components/views/elements/Spinner';
|
||||
views$elements$Spinner && (module.exports.components['views.elements.Spinner'] = views$elements$Spinner);
|
||||
import views$globals$GuestWarningBar from './components/views/globals/GuestWarningBar';
|
||||
views$globals$GuestWarningBar && (module.exports.components['views.globals.GuestWarningBar'] = views$globals$GuestWarningBar);
|
||||
import views$globals$MatrixToolbar from './components/views/globals/MatrixToolbar';
|
||||
views$globals$MatrixToolbar && (module.exports.components['views.globals.MatrixToolbar'] = views$globals$MatrixToolbar);
|
||||
import views$globals$NewVersionBar from './components/views/globals/NewVersionBar';
|
||||
views$globals$NewVersionBar && (module.exports.components['views.globals.NewVersionBar'] = views$globals$NewVersionBar);
|
||||
import views$login$VectorCustomServerDialog from './components/views/login/VectorCustomServerDialog';
|
||||
views$login$VectorCustomServerDialog && (module.exports.components['views.login.VectorCustomServerDialog'] = views$login$VectorCustomServerDialog);
|
||||
import views$login$VectorLoginFooter from './components/views/login/VectorLoginFooter';
|
||||
views$login$VectorLoginFooter && (module.exports.components['views.login.VectorLoginFooter'] = views$login$VectorLoginFooter);
|
||||
import views$login$VectorLoginHeader from './components/views/login/VectorLoginHeader';
|
||||
views$login$VectorLoginHeader && (module.exports.components['views.login.VectorLoginHeader'] = views$login$VectorLoginHeader);
|
||||
import views$messages$DateSeparator from './components/views/messages/DateSeparator';
|
||||
views$messages$DateSeparator && (module.exports.components['views.messages.DateSeparator'] = views$messages$DateSeparator);
|
||||
import views$messages$MessageTimestamp from './components/views/messages/MessageTimestamp';
|
||||
views$messages$MessageTimestamp && (module.exports.components['views.messages.MessageTimestamp'] = views$messages$MessageTimestamp);
|
||||
import views$rooms$DNDRoomTile from './components/views/rooms/DNDRoomTile';
|
||||
views$rooms$DNDRoomTile && (module.exports.components['views.rooms.DNDRoomTile'] = views$rooms$DNDRoomTile);
|
||||
import views$rooms$RoomDropTarget from './components/views/rooms/RoomDropTarget';
|
||||
views$rooms$RoomDropTarget && (module.exports.components['views.rooms.RoomDropTarget'] = views$rooms$RoomDropTarget);
|
||||
import views$rooms$RoomTooltip from './components/views/rooms/RoomTooltip';
|
||||
views$rooms$RoomTooltip && (module.exports.components['views.rooms.RoomTooltip'] = views$rooms$RoomTooltip);
|
||||
import views$rooms$SearchBar from './components/views/rooms/SearchBar';
|
||||
views$rooms$SearchBar && (module.exports.components['views.rooms.SearchBar'] = views$rooms$SearchBar);
|
||||
import views$settings$IntegrationsManager from './components/views/settings/IntegrationsManager';
|
||||
views$settings$IntegrationsManager && (module.exports.components['views.settings.IntegrationsManager'] = views$settings$IntegrationsManager);
|
||||
import views$settings$Notifications from './components/views/settings/Notifications';
|
||||
views$settings$Notifications && (module.exports.components['views.settings.Notifications'] = views$settings$Notifications);
|
||||
|
||||
@@ -20,18 +20,21 @@ var React = require('react');
|
||||
var ReactDOM = require('react-dom');
|
||||
var sdk = require('matrix-react-sdk')
|
||||
var dis = require('matrix-react-sdk/lib/dispatcher');
|
||||
var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton');
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'BottomLeftMenu',
|
||||
|
||||
propTypes: {
|
||||
collapsed: React.PropTypes.bool.isRequired,
|
||||
teamToken: React.PropTypes.string,
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
return({
|
||||
directoryHover : false,
|
||||
roomsHover : false,
|
||||
homeHover: false,
|
||||
peopleHover : false,
|
||||
settingsHover : false,
|
||||
});
|
||||
@@ -62,6 +65,19 @@ module.exports = React.createClass({
|
||||
this.setState({ roomsHover: false });
|
||||
},
|
||||
|
||||
// Home button events
|
||||
onHomeClick: function() {
|
||||
dis.dispatch({ action: 'view_home_page' });
|
||||
},
|
||||
|
||||
onHomeMouseEnter: function() {
|
||||
this.setState({ homeHover: true });
|
||||
},
|
||||
|
||||
onHomeMouseLeave: function() {
|
||||
this.setState({ homeHover: false });
|
||||
},
|
||||
|
||||
// People events
|
||||
onPeopleClick: function() {
|
||||
dis.dispatch({ action: 'view_create_chat' });
|
||||
@@ -98,25 +114,37 @@ module.exports = React.createClass({
|
||||
|
||||
render: function() {
|
||||
var TintableSvg = sdk.getComponent('elements.TintableSvg');
|
||||
|
||||
var homeButton;
|
||||
if (this.props.teamToken) {
|
||||
homeButton = (
|
||||
<AccessibleButton className="mx_BottomLeftMenu_homePage" onClick={ this.onHomeClick } onMouseEnter={ this.onHomeMouseEnter } onMouseLeave={ this.onHomeMouseLeave } >
|
||||
<TintableSvg src="img/icons-home.svg" width="25" height="25" />
|
||||
{ this.getLabel("Welcome page", this.state.homeHover) }
|
||||
</AccessibleButton>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx_BottomLeftMenu">
|
||||
<div className="mx_BottomLeftMenu_options">
|
||||
<div className="mx_BottomLeftMenu_people" onClick={ this.onPeopleClick } onMouseEnter={ this.onPeopleMouseEnter } onMouseLeave={ this.onPeopleMouseLeave } >
|
||||
{ homeButton }
|
||||
<AccessibleButton className="mx_BottomLeftMenu_people" onClick={ this.onPeopleClick } onMouseEnter={ this.onPeopleMouseEnter } onMouseLeave={ this.onPeopleMouseLeave } >
|
||||
<TintableSvg src="img/icons-people.svg" width="25" height="25" />
|
||||
{ this.getLabel("Start chat", this.state.peopleHover) }
|
||||
</div>
|
||||
<div className="mx_BottomLeftMenu_directory" onClick={ this.onDirectoryClick } onMouseEnter={ this.onDirectoryMouseEnter } onMouseLeave={ this.onDirectoryMouseLeave } >
|
||||
</AccessibleButton>
|
||||
<AccessibleButton className="mx_BottomLeftMenu_directory" onClick={ this.onDirectoryClick } onMouseEnter={ this.onDirectoryMouseEnter } onMouseLeave={ this.onDirectoryMouseLeave } >
|
||||
<TintableSvg src="img/icons-directory.svg" width="25" height="25"/>
|
||||
{ this.getLabel("Room directory", this.state.directoryHover) }
|
||||
</div>
|
||||
<div className="mx_BottomLeftMenu_createRoom" onClick={ this.onRoomsClick } onMouseEnter={ this.onRoomsMouseEnter } onMouseLeave={ this.onRoomsMouseLeave } >
|
||||
</AccessibleButton>
|
||||
<AccessibleButton className="mx_BottomLeftMenu_createRoom" onClick={ this.onRoomsClick } onMouseEnter={ this.onRoomsMouseEnter } onMouseLeave={ this.onRoomsMouseLeave } >
|
||||
<TintableSvg src="img/icons-create-room.svg" width="25" height="25" />
|
||||
{ this.getLabel("Create new room", this.state.roomsHover) }
|
||||
</div>
|
||||
<div className="mx_BottomLeftMenu_settings" onClick={ this.onSettingsClick } onMouseEnter={ this.onSettingsMouseEnter } onMouseLeave={ this.onSettingsMouseLeave } >
|
||||
</AccessibleButton>
|
||||
<AccessibleButton className="mx_BottomLeftMenu_settings" onClick={ this.onSettingsClick } onMouseEnter={ this.onSettingsMouseEnter } onMouseLeave={ this.onSettingsMouseLeave } >
|
||||
<TintableSvg src="img/icons-settings.svg" width="25" height="25" />
|
||||
{ this.getLabel("Settings", this.state.settingsHover) }
|
||||
</div>
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -45,10 +45,8 @@ module.exports = React.createClass({
|
||||
available or experimental in your current browser.
|
||||
</p>
|
||||
<p>
|
||||
Please install <a href="https://www.google.com/chrome">Chrome</a> or
|
||||
<a href="https://getfirefox.com">Firefox</a> for the best experience.
|
||||
<a href="http://apple.com/safari">Safari</a> and
|
||||
<a href="http://opera.com">Opera</a> work too.
|
||||
Please install <a href="https://www.google.com/chrome">Chrome</a> or <a href="https://getfirefox.com">Firefox</a> for
|
||||
the best experience. <a href="http://apple.com/safari">Safari</a> and <a href="http://opera.com">Opera</a> work too.
|
||||
</p>
|
||||
<p>
|
||||
With your current browser, the look and feel of the application may
|
||||
|
||||
40
src/components/structures/HomePage.js
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2016 OpenMarket Ltd
|
||||
Copyright 2017 Vector Creations Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
|
||||
import sdk from 'matrix-react-sdk';
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'HomePage',
|
||||
|
||||
propTypes: {
|
||||
teamServerUrl: React.PropTypes.string.isRequired,
|
||||
teamToken: React.PropTypes.string.isRequired,
|
||||
collapsedRhs: React.PropTypes.bool,
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<div className="mx_HomePage">
|
||||
<iframe src={`${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -28,6 +28,11 @@ var CallHandler = require("matrix-react-sdk/lib/CallHandler");
|
||||
var LeftPanel = React.createClass({
|
||||
displayName: 'LeftPanel',
|
||||
|
||||
propTypes: {
|
||||
collapsed: React.PropTypes.bool.isRequired,
|
||||
teamToken: React.PropTypes.string,
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
showCallElement: null,
|
||||
@@ -124,7 +129,7 @@ var LeftPanel = React.createClass({
|
||||
collapsed={this.props.collapsed}
|
||||
searchFilter={this.state.searchFilter}
|
||||
ConferenceHandler={VectorConferenceHandler} />
|
||||
<BottomLeftMenu collapsed={this.props.collapsed}/>
|
||||
<BottomLeftMenu collapsed={this.props.collapsed} teamToken={this.props.teamToken}/>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ var dis = require('matrix-react-sdk/lib/dispatcher');
|
||||
var MatrixClientPeg = require("matrix-react-sdk/lib/MatrixClientPeg");
|
||||
var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc');
|
||||
var Modal = require('matrix-react-sdk/lib/Modal');
|
||||
var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton');
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'RightPanel',
|
||||
@@ -69,45 +70,21 @@ module.exports = React.createClass({
|
||||
},
|
||||
|
||||
onMemberListButtonClick: function() {
|
||||
if (this.props.collapsed || this.state.phase !== this.Phase.MemberList) {
|
||||
this.setState({ phase: this.Phase.MemberList });
|
||||
dis.dispatch({
|
||||
action: 'show_right_panel',
|
||||
});
|
||||
}
|
||||
else {
|
||||
dis.dispatch({
|
||||
action: 'hide_right_panel',
|
||||
});
|
||||
}
|
||||
this.setState({ phase: this.Phase.MemberList });
|
||||
},
|
||||
|
||||
onFileListButtonClick: function() {
|
||||
if (this.props.collapsed || this.state.phase !== this.Phase.FilePanel) {
|
||||
this.setState({ phase: this.Phase.FilePanel });
|
||||
dis.dispatch({
|
||||
action: 'show_right_panel',
|
||||
});
|
||||
}
|
||||
else {
|
||||
dis.dispatch({
|
||||
action: 'hide_right_panel',
|
||||
});
|
||||
}
|
||||
this.setState({ phase: this.Phase.FilePanel });
|
||||
},
|
||||
|
||||
onNotificationListButtonClick: function() {
|
||||
if (this.props.collapsed || this.state.phase !== this.Phase.NotificationPanel) {
|
||||
this.setState({ phase: this.Phase.NotificationPanel });
|
||||
dis.dispatch({
|
||||
action: 'show_right_panel',
|
||||
});
|
||||
}
|
||||
else {
|
||||
dis.dispatch({
|
||||
action: 'hide_right_panel',
|
||||
});
|
||||
}
|
||||
this.setState({ phase: this.Phase.NotificationPanel });
|
||||
},
|
||||
|
||||
onCollapseClick: function() {
|
||||
dis.dispatch({
|
||||
action: 'hide_right_panel',
|
||||
});
|
||||
},
|
||||
|
||||
onInviteButtonClick: function() {
|
||||
@@ -207,12 +184,12 @@ module.exports = React.createClass({
|
||||
|
||||
if (user_is_in_room) {
|
||||
inviteGroup =
|
||||
<div className="mx_RightPanel_invite" onClick={ this.onInviteButtonClick } >
|
||||
<AccessibleButton className="mx_RightPanel_invite" onClick={ this.onInviteButtonClick } >
|
||||
<div className="mx_RightPanel_icon" >
|
||||
<TintableSvg src="img/icon-invite-people.svg" width="35" height="35" />
|
||||
</div>
|
||||
<div className="mx_RightPanel_message">Invite to this room</div>
|
||||
</div>;
|
||||
</AccessibleButton>;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -220,20 +197,28 @@ module.exports = React.createClass({
|
||||
if (this.props.roomId) {
|
||||
buttonGroup =
|
||||
<div className="mx_RightPanel_headerButtonGroup">
|
||||
<div className="mx_RightPanel_headerButton" title="Members" onClick={ this.onMemberListButtonClick }>
|
||||
<AccessibleButton className="mx_RightPanel_headerButton"
|
||||
title="Members" onClick={ this.onMemberListButtonClick }>
|
||||
<div className="mx_RightPanel_headerButton_badge">{ membersBadge ? membersBadge : <span> </span>}</div>
|
||||
<TintableSvg src="img/icons-people.svg" width="25" height="25"/>
|
||||
{ membersHighlight }
|
||||
</div>
|
||||
<div className="mx_RightPanel_headerButton mx_RightPanel_filebutton" title="Files" onClick={ this.onFileListButtonClick }>
|
||||
</AccessibleButton>
|
||||
<AccessibleButton
|
||||
className="mx_RightPanel_headerButton mx_RightPanel_filebutton"
|
||||
title="Files" onClick={ this.onFileListButtonClick }>
|
||||
<div className="mx_RightPanel_headerButton_badge"> </div>
|
||||
<TintableSvg src="img/icons-files.svg" width="25" height="25"/>
|
||||
{ filesHighlight }
|
||||
</div>
|
||||
<div className="mx_RightPanel_headerButton mx_RightPanel_notificationbutton" title="Notifications" onClick={ this.onNotificationListButtonClick }>
|
||||
</AccessibleButton>
|
||||
<AccessibleButton
|
||||
className="mx_RightPanel_headerButton mx_RightPanel_notificationbutton"
|
||||
title="Notifications" onClick={ this.onNotificationListButtonClick }>
|
||||
<div className="mx_RightPanel_headerButton_badge"> </div>
|
||||
<TintableSvg src="img/icons-notifications.svg" width="25" height="25"/>
|
||||
{ notificationsHighlight }
|
||||
</AccessibleButton>
|
||||
<div className="mx_RightPanel_headerButton mx_RightPanel_collapsebutton" title="Hide panel" onClick={ this.onCollapseClick }>
|
||||
<TintableSvg src="img/minimise.svg" width="10" height="16"/>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
@@ -276,4 +261,3 @@ module.exports = React.createClass({
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ var linkifyMatrix = require('matrix-react-sdk/lib/linkify-matrix');
|
||||
var sanitizeHtml = require('sanitize-html');
|
||||
var q = require('q');
|
||||
|
||||
import {instanceForInstanceId, protocolNameForInstanceId} from '../../utils/DirectoryUtils';
|
||||
|
||||
linkifyMatrix(linkify);
|
||||
|
||||
module.exports = React.createClass({
|
||||
@@ -42,9 +44,7 @@ module.exports = React.createClass({
|
||||
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
config: {
|
||||
networks: [],
|
||||
},
|
||||
config: {},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -52,22 +52,38 @@ module.exports = React.createClass({
|
||||
return {
|
||||
publicRooms: [],
|
||||
loading: true,
|
||||
filterByNetwork: null,
|
||||
protocolsLoading: true,
|
||||
instanceId: null,
|
||||
includeAll: false,
|
||||
roomServer: null,
|
||||
filterString: null,
|
||||
}
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
// precompile Regexps
|
||||
this.networkPatterns = {};
|
||||
if (this.props.config.networkPatterns) {
|
||||
for (const network of Object.keys(this.props.config.networkPatterns)) {
|
||||
this.networkPatterns[network] = new RegExp(this.props.config.networkPatterns[network]);
|
||||
}
|
||||
}
|
||||
this.nextBatch = null;
|
||||
this.filterString = null;
|
||||
this.filterTimeout = null;
|
||||
this.scrollPanel = null;
|
||||
this.protocols = null;
|
||||
|
||||
this.setState({protocolsLoading: true});
|
||||
MatrixClientPeg.get().getThirdpartyProtocols().done((response) => {
|
||||
this.protocols = response;
|
||||
this.setState({protocolsLoading: false});
|
||||
}, (err) => {
|
||||
this.setState({protocolsLoading: false});
|
||||
if (MatrixClientPeg.get().isGuest()) {
|
||||
// Guests currently aren't allowed to use this API, so
|
||||
// ignore this as otherwise this error is literally the
|
||||
// thing you see when loading the client!
|
||||
return;
|
||||
}
|
||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to get protocol list from Home Server",
|
||||
description: "The Home Server may be too old to support third party networks",
|
||||
});
|
||||
});
|
||||
|
||||
// dis.dispatch({
|
||||
// action: 'ui_opacity',
|
||||
@@ -76,10 +92,6 @@ module.exports = React.createClass({
|
||||
// });
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.refreshRoomList();
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
// dis.dispatch({
|
||||
// action: 'ui_opacity',
|
||||
@@ -98,13 +110,31 @@ module.exports = React.createClass({
|
||||
},
|
||||
|
||||
getMoreRooms: function() {
|
||||
const my_filter_string = this.filterString;
|
||||
if (!MatrixClientPeg.get()) return q();
|
||||
|
||||
const my_filter_string = this.state.filterString;
|
||||
const my_server = this.state.roomServer;
|
||||
// remember the next batch token when we sent the request
|
||||
// too. If it's changed, appending to the list will corrupt it.
|
||||
const my_next_batch = this.nextBatch;
|
||||
const opts = {limit: 20};
|
||||
if (my_server != MatrixClientPeg.getHomeServerName()) {
|
||||
opts.server = my_server;
|
||||
}
|
||||
if (this.state.instanceId) {
|
||||
opts.third_party_instance_id = this.state.instanceId;
|
||||
} else if (this.state.includeAll) {
|
||||
opts.include_all_networks = true;
|
||||
}
|
||||
if (this.nextBatch) opts.since = this.nextBatch;
|
||||
if (this.filterString) opts.filter = { generic_search_term: my_filter_string } ;
|
||||
if (my_filter_string) opts.filter = { generic_search_term: my_filter_string } ;
|
||||
return MatrixClientPeg.get().publicRooms(opts).then((data) => {
|
||||
if (my_filter_string != this.filterString) {
|
||||
// if the filter has changed since this request was sent,
|
||||
if (
|
||||
my_filter_string != this.state.filterString ||
|
||||
my_server != this.state.roomServer ||
|
||||
my_next_batch != this.nextBatch)
|
||||
{
|
||||
// if the filter or server has changed since this request was sent,
|
||||
// throw away the result (don't even clear the busy flag
|
||||
// since we must still have a request in flight)
|
||||
return;
|
||||
@@ -118,7 +148,11 @@ module.exports = React.createClass({
|
||||
});
|
||||
return Boolean(data.next_batch);
|
||||
}, (err) => {
|
||||
if (my_filter_string != this.filterString) {
|
||||
if (
|
||||
my_filter_string != this.state.filterString ||
|
||||
my_server != this.state.roomServer ||
|
||||
my_next_batch != this.nextBatch)
|
||||
{
|
||||
// as above: we don't care about errors for old
|
||||
// requests either
|
||||
return;
|
||||
@@ -128,7 +162,7 @@ module.exports = React.createClass({
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to get public room list",
|
||||
description: err.message
|
||||
description: "The server may be unavailable or overloaded",
|
||||
});
|
||||
});
|
||||
},
|
||||
@@ -174,9 +208,10 @@ module.exports = React.createClass({
|
||||
}, function(err) {
|
||||
modal.close();
|
||||
this.refreshRoomList();
|
||||
console.error("Failed to " + step + ": " + err);
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to "+step,
|
||||
description: err.toString()
|
||||
title: "Error",
|
||||
description: "Failed to " + step,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -192,18 +227,24 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
onNetworkChange: function(network) {
|
||||
onOptionChange: function(server, instanceId, includeAll) {
|
||||
// clear next batch so we don't try to load more rooms
|
||||
this.nextBatch = null;
|
||||
this.setState({
|
||||
filterByNetwork: network,
|
||||
}, () => {
|
||||
// we just filtered out a bunch of rooms, so check to see if
|
||||
// we need to fill up the scrollpanel again
|
||||
// NB. Because we filter the results, the HS can keep giving
|
||||
// us more rooms and we'll keep requesting more if none match
|
||||
// the filter, which is pretty terrible. We need a way
|
||||
// to filter by network on the server.
|
||||
if (this.scrollPanel) this.scrollPanel.checkFillState();
|
||||
});
|
||||
// Clear the public rooms out here otherwise we needlessly
|
||||
// spend time filtering lots of rooms when we're about to
|
||||
// to clear the list anyway.
|
||||
publicRooms: [],
|
||||
roomServer: server,
|
||||
instanceId: instanceId,
|
||||
includeAll: includeAll,
|
||||
}, this.refreshRoomList);
|
||||
// We also refresh the room list each time even though this
|
||||
// filtering is client-side. It hopefully won't be client side
|
||||
// for very long, and we may have fetched a thousand rooms to
|
||||
// find the five gitter ones, at which point we do not want
|
||||
// to render all those rooms when switching back to 'all networks'.
|
||||
// Easiest to just blow away the state & re-fetch.
|
||||
},
|
||||
|
||||
onFillRequest: function(backwards) {
|
||||
@@ -212,10 +253,10 @@ module.exports = React.createClass({
|
||||
return this.getMoreRooms();
|
||||
},
|
||||
|
||||
onFilterChange: function(ev) {
|
||||
const alias = ev.target.value;
|
||||
|
||||
this.filterString = alias || null;
|
||||
onFilterChange: function(alias) {
|
||||
this.setState({
|
||||
filterString: alias || null,
|
||||
});
|
||||
|
||||
// don't send the request for a little bit,
|
||||
// no point hammering the server with a
|
||||
@@ -227,12 +268,59 @@ module.exports = React.createClass({
|
||||
this.filterTimeout = setTimeout(() => {
|
||||
this.filterTimeout = null;
|
||||
this.refreshRoomList();
|
||||
}, 300);
|
||||
}, 700);
|
||||
},
|
||||
|
||||
onFilterKeyUp: function(ev) {
|
||||
if (ev.key == "Enter") {
|
||||
this.showRoomAlias(ev.target.value);
|
||||
onFilterClear: function() {
|
||||
// update immediately
|
||||
this.setState({
|
||||
filterString: null,
|
||||
}, this.refreshRoomList);
|
||||
|
||||
if (this.filterTimeout) {
|
||||
clearTimeout(this.filterTimeout);
|
||||
}
|
||||
},
|
||||
|
||||
onJoinClick: function(alias) {
|
||||
// If we don't have a particular instance id selected, just show that rooms alias
|
||||
if (!this.state.instanceId) {
|
||||
// If the user specified an alias without a domain, add on whichever server is selected
|
||||
// in the dropdown
|
||||
if (alias.indexOf(':') == -1) {
|
||||
alias = alias + ':' + this.state.roomServer;
|
||||
}
|
||||
this.showRoomAlias(alias);
|
||||
} else {
|
||||
// This is a 3rd party protocol. Let's see if we can join it
|
||||
const protocolName = protocolNameForInstanceId(this.protocols, this.state.instanceId);
|
||||
const instance = instanceForInstanceId(this.protocols, this.state.instanceId);
|
||||
const fields = protocolName ? this._getFieldsForThirdPartyLocation(alias, this.protocols[protocolName], instance) : null;
|
||||
if (!fields) {
|
||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Unable to join network",
|
||||
description: "Riot does not know how to join a room on this network",
|
||||
});
|
||||
return;
|
||||
}
|
||||
MatrixClientPeg.get().getThirdpartyLocation(protocolName, fields).done((resp) => {
|
||||
if (resp.length > 0 && resp[0].alias) {
|
||||
this.showRoomAlias(resp[0].alias);
|
||||
} else {
|
||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Room not found",
|
||||
description: "Couldn't find a matching Matrix room",
|
||||
});
|
||||
}
|
||||
}, (e) => {
|
||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Fetching third party location failed",
|
||||
description: "Unable to look up room ID from server",
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -285,13 +373,7 @@ module.exports = React.createClass({
|
||||
|
||||
if (!this.state.publicRooms) return [];
|
||||
|
||||
var rooms = this.state.publicRooms.filter((a) => {
|
||||
if (this.state.filterByNetwork) {
|
||||
if (!this._isRoomInNetwork(a, this.state.filterByNetwork)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
var rooms = this.state.publicRooms;
|
||||
var rows = [];
|
||||
var self = this;
|
||||
var guestRead, guestJoin, perms;
|
||||
@@ -353,28 +435,64 @@ module.exports = React.createClass({
|
||||
this.scrollPanel = element;
|
||||
},
|
||||
|
||||
/**
|
||||
* Terrible temporary function that guess what network a public room
|
||||
* entry is in, until synapse is able to tell us
|
||||
*/
|
||||
_isRoomInNetwork(room, network) {
|
||||
if (room.aliases && this.networkPatterns[network]) {
|
||||
for (const alias of room.aliases) {
|
||||
if (this.networkPatterns[network].test(alias)) return true;
|
||||
}
|
||||
_stringLooksLikeId: function(s, field_type) {
|
||||
let pat = /^#[^\s]+:[^\s]/;
|
||||
if (field_type && field_type.regexp) {
|
||||
pat = new RegExp(field_type.regexp);
|
||||
}
|
||||
|
||||
return false;
|
||||
return pat.test(s);
|
||||
},
|
||||
|
||||
_getFieldsForThirdPartyLocation: function(userInput, protocol, instance) {
|
||||
// make an object with the fields specified by that protocol. We
|
||||
// require that the values of all but the last field come from the
|
||||
// instance. The last is the user input.
|
||||
const requiredFields = protocol.location_fields;
|
||||
if (!requiredFields) return null;
|
||||
const fields = {};
|
||||
for (let i = 0; i < requiredFields.length - 1; ++i) {
|
||||
const thisField = requiredFields[i];
|
||||
if (instance.fields[thisField] === undefined) return null;
|
||||
fields[thisField] = instance.fields[thisField];
|
||||
}
|
||||
fields[requiredFields[requiredFields.length - 1]] = userInput;
|
||||
return fields;
|
||||
},
|
||||
|
||||
render: function() {
|
||||
const SimpleRoomHeader = sdk.getComponent('rooms.SimpleRoomHeader');
|
||||
const Loader = sdk.getComponent("elements.Spinner");
|
||||
|
||||
if (this.state.protocolsLoading) {
|
||||
return (
|
||||
<div className="mx_RoomDirectory">
|
||||
<SimpleRoomHeader title="Directory" />
|
||||
<Loader />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
let content;
|
||||
if (this.state.loading) {
|
||||
const Loader = sdk.getComponent("elements.Spinner");
|
||||
content = <div className="mx_RoomDirectory">
|
||||
<Loader />
|
||||
</div>;
|
||||
} else {
|
||||
const rows = this.getRows();
|
||||
// we still show the scrollpanel, at least for now, because
|
||||
// otherwise we don't fetch more because we don't get a fill
|
||||
// request from the scrollpanel because there isn't one
|
||||
let scrollpanel_content;
|
||||
if (rows.length == 0) {
|
||||
scrollpanel_content = <i>No rooms to show</i>;
|
||||
} else {
|
||||
scrollpanel_content = <table ref="directory_table" className="mx_RoomDirectory_table">
|
||||
<tbody>
|
||||
{ this.getRows() }
|
||||
</tbody>
|
||||
</table>;
|
||||
}
|
||||
const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
|
||||
content = <ScrollPanel ref={this.collectScrollPanel}
|
||||
className="mx_RoomDirectory_tableWrapper"
|
||||
@@ -383,25 +501,52 @@ module.exports = React.createClass({
|
||||
startAtBottom={false}
|
||||
onResize={function(){}}
|
||||
>
|
||||
<table ref="directory_table" className="mx_RoomDirectory_table">
|
||||
<tbody>
|
||||
{ this.getRows() }
|
||||
</tbody>
|
||||
</table>
|
||||
{ scrollpanel_content }
|
||||
</ScrollPanel>;
|
||||
}
|
||||
|
||||
const SimpleRoomHeader = sdk.getComponent('rooms.SimpleRoomHeader');
|
||||
const protocolName = protocolNameForInstanceId(this.protocols, this.state.instanceId);
|
||||
let instance_expected_field_type;
|
||||
if (
|
||||
protocolName &&
|
||||
this.protocols &&
|
||||
this.protocols[protocolName] &&
|
||||
this.protocols[protocolName].location_fields.length > 0 &&
|
||||
this.protocols[protocolName].field_types
|
||||
) {
|
||||
const last_field = this.protocols[protocolName].location_fields.slice(-1)[0];
|
||||
instance_expected_field_type = this.protocols[protocolName].field_types[last_field];
|
||||
}
|
||||
|
||||
|
||||
let placeholder = 'Search for a room';
|
||||
if (!this.state.instanceId) {
|
||||
placeholder = '#example:' + this.state.roomServer;
|
||||
} else if (instance_expected_field_type) {
|
||||
placeholder = instance_expected_field_type.placeholder;
|
||||
}
|
||||
|
||||
let showJoinButton = this._stringLooksLikeId(this.state.filterString, instance_expected_field_type);
|
||||
if (protocolName) {
|
||||
const instance = instanceForInstanceId(this.protocols, this.state.instanceId);
|
||||
if (this._getFieldsForThirdPartyLocation(this.state.filterString, this.protocols[protocolName], instance) === null) {
|
||||
showJoinButton = false;
|
||||
}
|
||||
}
|
||||
|
||||
const NetworkDropdown = sdk.getComponent('directory.NetworkDropdown');
|
||||
const DirectorySearchBox = sdk.getComponent('elements.DirectorySearchBox');
|
||||
return (
|
||||
<div className="mx_RoomDirectory">
|
||||
<SimpleRoomHeader title="Directory" />
|
||||
<div className="mx_RoomDirectory_list">
|
||||
<div className="mx_RoomDirectory_listheader">
|
||||
<input type="text" placeholder="Find a room by keyword or room ID (#foo:matrix.org)"
|
||||
className="mx_RoomDirectory_input" size="64" onChange={this.onFilterChange} onKeyUp={this.onFilterKeyUp}
|
||||
<DirectorySearchBox
|
||||
className="mx_RoomDirectory_searchbox"
|
||||
onChange={this.onFilterChange} onClear={this.onFilterClear} onJoinClick={this.onJoinClick}
|
||||
placeholder={placeholder} showJoinButton={showJoinButton}
|
||||
/>
|
||||
<NetworkDropdown config={this.props.config} onNetworkChange={this.onNetworkChange} />
|
||||
<NetworkDropdown config={this.props.config} protocols={this.protocols} onOptionChange={this.onOptionChange} />
|
||||
</div>
|
||||
{content}
|
||||
</div>
|
||||
|
||||
@@ -26,6 +26,7 @@ var Unread = require('matrix-react-sdk/lib/Unread');
|
||||
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
|
||||
var RoomNotifs = require('matrix-react-sdk/lib/RoomNotifs');
|
||||
var FormattingUtils = require('matrix-react-sdk/lib/utils/FormattingUtils');
|
||||
var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton');
|
||||
|
||||
// turn this on for drop & drag console debugging galore
|
||||
var debug = false;
|
||||
@@ -145,12 +146,20 @@ var RoomSubList = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
onRoomTileClick(roomId) {
|
||||
dis.dispatch({
|
||||
action: 'view_room',
|
||||
room_id: roomId,
|
||||
});
|
||||
},
|
||||
|
||||
tsOfNewestEvent: function(room) {
|
||||
for (var i = room.timeline.length - 1; i >= 0; --i) {
|
||||
var ev = room.timeline[i];
|
||||
if (Unread.eventTriggersUnreadCount(ev) ||
|
||||
(ev.sender && ev.sender.userId === MatrixClientPeg.get().credentials.userId))
|
||||
{
|
||||
if (ev.getTs() &&
|
||||
(Unread.eventTriggersUnreadCount(ev) ||
|
||||
(ev.getSender() === MatrixClientPeg.get().credentials.userId))
|
||||
) {
|
||||
return ev.getTs();
|
||||
}
|
||||
}
|
||||
@@ -158,7 +167,7 @@ var RoomSubList = React.createClass({
|
||||
// we might only have events that don't trigger the unread indicator,
|
||||
// in which case use the oldest event even if normally it wouldn't count.
|
||||
// This is better than just assuming the last event was forever ago.
|
||||
if (room.timeline.length) {
|
||||
if (room.timeline.length && room.timeline[0].getTs()) {
|
||||
return room.timeline[0].getTs();
|
||||
} else {
|
||||
return Number.MAX_SAFE_INTEGER;
|
||||
@@ -363,7 +372,9 @@ var RoomSubList = React.createClass({
|
||||
highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' }
|
||||
isInvite={ self.props.label === 'Invites' }
|
||||
refreshSubList={ self._updateSubListCount }
|
||||
incomingCall={ null } />
|
||||
incomingCall={ null }
|
||||
onClick={ self.onRoomTileClick }
|
||||
/>
|
||||
);
|
||||
});
|
||||
},
|
||||
@@ -407,7 +418,7 @@ var RoomSubList = React.createClass({
|
||||
if (this.props.incomingCall) {
|
||||
var self = this;
|
||||
// Check if the incoming call is for this section
|
||||
var incomingCallRoom = this.state.sortedList.filter(function(room) {
|
||||
var incomingCallRoom = this.props.list.filter(function(room) {
|
||||
return self.props.incomingCall.roomId === room.roomId;
|
||||
});
|
||||
|
||||
@@ -417,15 +428,17 @@ var RoomSubList = React.createClass({
|
||||
}
|
||||
}
|
||||
|
||||
var tabindex = this.props.searchFilter === "" ? "0" : "-1";
|
||||
|
||||
return (
|
||||
<div className="mx_RoomSubList_labelContainer" title={ title } ref="header">
|
||||
<div onClick={ this.onClick } className="mx_RoomSubList_label">
|
||||
<AccessibleButton onClick={ this.onClick } className="mx_RoomSubList_label" tabIndex={tabindex}>
|
||||
{ this.props.collapsed ? '' : this.props.label }
|
||||
<div className="mx_RoomSubList_roomCount">{ roomCount }</div>
|
||||
<div className={chevronClasses}></div>
|
||||
{ badge }
|
||||
{ incomingCall }
|
||||
</div>
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
@@ -447,11 +460,11 @@ var RoomSubList = React.createClass({
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="mx_RoomSubList_ellipsis" onClick={this._showFullMemberList}>
|
||||
<AccessibleButton className="mx_RoomSubList_ellipsis" onClick={this._showFullMemberList}>
|
||||
<div className="mx_RoomSubList_line"></div>
|
||||
<div className="mx_RoomSubList_more">more</div>
|
||||
<div className={ badgeClasses }>{ content }</div>
|
||||
</div>
|
||||
<div className={ badgeClasses }>{ content }</div>
|
||||
</AccessibleButton>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -493,9 +506,10 @@ var RoomSubList = React.createClass({
|
||||
// Do any final stuff here
|
||||
}).fail(function(err) {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
console.error("Failed to add tag " + self.props.tagName + " to room" + err);
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to add tag " + self.props.tagName + " to room",
|
||||
description: err.toString()
|
||||
title: "Error",
|
||||
description: "Failed to add tag " + self.props.tagName + " to room",
|
||||
});
|
||||
});
|
||||
break;
|
||||
|
||||
@@ -20,6 +20,7 @@ var React = require('react');
|
||||
var sdk = require('matrix-react-sdk')
|
||||
var dis = require('matrix-react-sdk/lib/dispatcher');
|
||||
var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc');
|
||||
var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton');
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'SearchBox',
|
||||
@@ -35,6 +36,29 @@ module.exports = React.createClass({
|
||||
};
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.dispatcherRef = dis.register(this.onAction);
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
dis.unregister(this.dispatcherRef);
|
||||
},
|
||||
|
||||
onAction: function(payload) {
|
||||
// Disabling this as I find it really really annoying, and was used to the
|
||||
// previous behaviour - see https://github.com/vector-im/riot-web/issues/3348
|
||||
/*
|
||||
switch (payload.action) {
|
||||
// Clear up the text field when a room is selected.
|
||||
case 'view_room':
|
||||
if (this.refs.search) {
|
||||
this._clearSearch();
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
},
|
||||
|
||||
onChange: function() {
|
||||
if (!this.refs.search) return;
|
||||
this.setState({ searchTerm: this.refs.search.value });
|
||||
@@ -61,35 +85,42 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
_clearSearch: function() {
|
||||
this.refs.search.value = "";
|
||||
this.onChange();
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var TintableSvg = sdk.getComponent('elements.TintableSvg');
|
||||
|
||||
var collapseTabIndex = this.refs.search && this.refs.search.value !== "" ? "-1" : "0";
|
||||
|
||||
var toggleCollapse;
|
||||
if (this.props.collapsed) {
|
||||
toggleCollapse =
|
||||
<div className="mx_SearchBox_maximise" onClick={ this.onToggleCollapse.bind(this, true) }>
|
||||
<TintableSvg src="img/maximise.svg" width="10" height="16" alt="<"/>
|
||||
</div>
|
||||
<AccessibleButton className="mx_SearchBox_maximise" tabIndex={collapseTabIndex} onClick={ this.onToggleCollapse.bind(this, true) }>
|
||||
<TintableSvg src="img/maximise.svg" width="10" height="16" alt="Expand panel"/>
|
||||
</AccessibleButton>
|
||||
}
|
||||
else {
|
||||
toggleCollapse =
|
||||
<div className="mx_SearchBox_minimise" onClick={ this.onToggleCollapse.bind(this, false) }>
|
||||
<TintableSvg src="img/minimise.svg" width="10" height="16" alt="<"/>
|
||||
</div>
|
||||
<AccessibleButton className="mx_SearchBox_minimise" tabIndex={collapseTabIndex} onClick={ this.onToggleCollapse.bind(this, false) }>
|
||||
<TintableSvg src="img/minimise.svg" width="10" height="16" alt="Collapse panel"/>
|
||||
</AccessibleButton>
|
||||
}
|
||||
|
||||
var searchControls;
|
||||
if (!this.props.collapsed) {
|
||||
searchControls = [
|
||||
this.state.searchTerm.length > 0 ?
|
||||
<div key="button"
|
||||
className="mx_SearchBox_closeButton"
|
||||
onClick={ ()=>{ this.refs.search.value = ""; this.onChange(); } }>
|
||||
<AccessibleButton key="button"
|
||||
className="mx_SearchBox_closeButton"
|
||||
onClick={ ()=>{ this._clearSearch(); } }>
|
||||
<TintableSvg
|
||||
className="mx_SearchBox_searchButton"
|
||||
src="img/icons-close.svg" width="24" height="24"
|
||||
/>
|
||||
</div>
|
||||
</AccessibleButton>
|
||||
:
|
||||
<TintableSvg
|
||||
key="button"
|
||||
|
||||
@@ -22,7 +22,8 @@ module.exports = React.createClass({
|
||||
displayName: 'ViewSource',
|
||||
|
||||
propTypes: {
|
||||
onFinished: React.PropTypes.func.isRequired
|
||||
content: React.PropTypes.object.isRequired,
|
||||
onFinished: React.PropTypes.func.isRequired,
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
@@ -45,10 +46,9 @@ module.exports = React.createClass({
|
||||
return (
|
||||
<div className="mx_ViewSource">
|
||||
<pre>
|
||||
{JSON.stringify(this.props.mxEvent.event, null, 2)}
|
||||
{JSON.stringify(this.props.content, null, 2)}
|
||||
</pre>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -20,9 +20,10 @@ var React = require('react');
|
||||
|
||||
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
|
||||
var dis = require('matrix-react-sdk/lib/dispatcher');
|
||||
var sdk = require('matrix-react-sdk')
|
||||
var sdk = require('matrix-react-sdk');
|
||||
var Modal = require('matrix-react-sdk/lib/Modal');
|
||||
var Resend = require("matrix-react-sdk/lib/Resend");
|
||||
import * as UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore';
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'MessageContextMenu',
|
||||
@@ -46,25 +47,39 @@ module.exports = React.createClass({
|
||||
onViewSourceClick: function() {
|
||||
var ViewSource = sdk.getComponent('structures.ViewSource');
|
||||
Modal.createDialog(ViewSource, {
|
||||
mxEvent: this.props.mxEvent
|
||||
content: this.props.mxEvent.event,
|
||||
}, 'mx_Dialog_viewsource');
|
||||
if (this.props.onFinished) this.props.onFinished();
|
||||
},
|
||||
|
||||
onViewClearSourceClick: function() {
|
||||
const ViewSource = sdk.getComponent('structures.ViewSource');
|
||||
Modal.createDialog(ViewSource, {
|
||||
// FIXME: _clearEvent is private
|
||||
content: this.props.mxEvent._clearEvent,
|
||||
}, 'mx_Dialog_viewsource');
|
||||
if (this.props.onFinished) this.props.onFinished();
|
||||
},
|
||||
|
||||
onRedactClick: function() {
|
||||
MatrixClientPeg.get().redactEvent(
|
||||
this.props.mxEvent.getRoomId(), this.props.mxEvent.getId()
|
||||
).done(function() {
|
||||
// message should disappear by itself
|
||||
}, function(e) {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
// display error message stating you couldn't delete this.
|
||||
var code = e.errcode || e.statusCode;
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Error",
|
||||
description: "You cannot delete this message. (" + code + ")"
|
||||
});
|
||||
});
|
||||
const ConfirmRedactDialog = sdk.getComponent("dialogs.ConfirmRedactDialog");
|
||||
Modal.createDialog(ConfirmRedactDialog, {
|
||||
onFinished: (proceed) => {
|
||||
if (!proceed) return;
|
||||
|
||||
MatrixClientPeg.get().redactEvent(
|
||||
this.props.mxEvent.getRoomId(), this.props.mxEvent.getId()
|
||||
).catch(function(e) {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
// display error message stating you couldn't delete this.
|
||||
var code = e.errcode || e.statusCode;
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Error",
|
||||
description: "You cannot delete this message. (" + code + ")"
|
||||
});
|
||||
}).done();
|
||||
},
|
||||
}, 'mx_Dialog_confirmredact');
|
||||
if (this.props.onFinished) this.props.onFinished();
|
||||
},
|
||||
|
||||
@@ -73,7 +88,7 @@ module.exports = React.createClass({
|
||||
if (this.props.onFinished) this.props.onFinished();
|
||||
},
|
||||
|
||||
onPermalinkClick: function() {
|
||||
closeMenu: function() {
|
||||
if (this.props.onFinished) this.props.onFinished();
|
||||
},
|
||||
|
||||
@@ -96,10 +111,12 @@ module.exports = React.createClass({
|
||||
var eventStatus = this.props.mxEvent.status;
|
||||
var resendButton;
|
||||
var viewSourceButton;
|
||||
var viewClearSourceButton;
|
||||
var redactButton;
|
||||
var cancelButton;
|
||||
var permalinkButton;
|
||||
var unhidePreviewButton;
|
||||
var externalURLButton;
|
||||
|
||||
if (eventStatus === 'not_sent') {
|
||||
resendButton = (
|
||||
@@ -109,7 +126,7 @@ module.exports = React.createClass({
|
||||
);
|
||||
}
|
||||
|
||||
if (!eventStatus) { // sent
|
||||
if (!eventStatus && !this.props.mxEvent.isRedacted()) { // sent and not redacted
|
||||
redactButton = (
|
||||
<div className="mx_MessageContextMenu_field" onClick={this.onRedactClick}>
|
||||
Redact
|
||||
@@ -131,6 +148,14 @@ module.exports = React.createClass({
|
||||
</div>
|
||||
);
|
||||
|
||||
if (this.props.mxEvent.getType() !== this.props.mxEvent.getWireType()) {
|
||||
viewClearSourceButton = (
|
||||
<div className="mx_MessageContextMenu_field" onClick={this.onViewClearSourceClick}>
|
||||
View Decrypted Source
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (this.props.eventTileOps) {
|
||||
if (this.props.eventTileOps.isWidgetHidden()) {
|
||||
unhidePreviewButton = (
|
||||
@@ -145,7 +170,7 @@ module.exports = React.createClass({
|
||||
permalinkButton = (
|
||||
<div className="mx_MessageContextMenu_field">
|
||||
<a href={ "https://matrix.to/#/" + this.props.mxEvent.getRoomId() +"/"+ this.props.mxEvent.getId() }
|
||||
target="_blank" onClick={ this.onPermalinkClick }>Permalink</a>
|
||||
target="_blank" rel="noopener" onClick={ this.closeMenu }>Permalink</a>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -155,15 +180,28 @@ module.exports = React.createClass({
|
||||
</div>
|
||||
);
|
||||
|
||||
// Bridges can provide a 'external_url' to link back to the source.
|
||||
if( typeof(this.props.mxEvent.event.content.external_url) === "string") {
|
||||
externalURLButton = (
|
||||
<div className="mx_MessageContextMenu_field">
|
||||
<a href={ this.props.mxEvent.event.content.external_url }
|
||||
rel="noopener" target="_blank" onClick={ this.closeMenu }>Source URL</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
{resendButton}
|
||||
{redactButton}
|
||||
{cancelButton}
|
||||
{viewSourceButton}
|
||||
{viewClearSourceButton}
|
||||
{unhidePreviewButton}
|
||||
{permalinkButton}
|
||||
{quoteButton}
|
||||
{UserSettingsStore.isFeatureEnabled('rich_text_editor') ? quoteButton : null}
|
||||
{externalURLButton}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
Copyright 2015, 2016 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var q = require("q");
|
||||
var React = require('react');
|
||||
var classNames = require('classnames');
|
||||
var RoomNotifs = require('matrix-react-sdk/lib/RoomNotifs');
|
||||
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'NotificationStateContextMenu',
|
||||
|
||||
propTypes: {
|
||||
room: React.PropTypes.object.isRequired,
|
||||
/* callback called when the menu is dismissed */
|
||||
onFinished: React.PropTypes.func,
|
||||
},
|
||||
|
||||
getInitialState() {
|
||||
return {
|
||||
roomNotifState: RoomNotifs.getRoomNotifsState(this.props.room.roomId),
|
||||
}
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
this._unmounted = false;
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
this._unmounted = true;
|
||||
},
|
||||
|
||||
_save: function(newState) {
|
||||
const oldState = this.state.roomNotifState;
|
||||
const roomId = this.props.room.roomId;
|
||||
var cli = MatrixClientPeg.get();
|
||||
|
||||
if (cli.isGuest()) return;
|
||||
|
||||
this.setState({
|
||||
roomNotifState: newState,
|
||||
});
|
||||
RoomNotifs.setRoomNotifsState(this.props.room.roomId, newState).done(() => {
|
||||
// delay slightly so that the user can see their state change
|
||||
// before closing the menu
|
||||
return q.delay(500).then(() => {
|
||||
if (this._unmounted) return;
|
||||
// Close the context menu
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished();
|
||||
};
|
||||
});
|
||||
}, (error) => {
|
||||
// TODO: some form of error notification to the user
|
||||
// to inform them that their state change failed.
|
||||
// For now we at least set the state back
|
||||
if (this._unmounted) return;
|
||||
this.setState({
|
||||
roomNotifState: oldState,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
_onClickAlertMe: function() {
|
||||
this._save(RoomNotifs.ALL_MESSAGES_LOUD);
|
||||
},
|
||||
|
||||
_onClickAllNotifs: function() {
|
||||
this._save(RoomNotifs.ALL_MESSAGES);
|
||||
},
|
||||
|
||||
_onClickMentions: function() {
|
||||
this._save(RoomNotifs.MENTIONS_ONLY);
|
||||
},
|
||||
|
||||
_onClickMute: function() {
|
||||
this._save(RoomNotifs.MUTE);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var alertMeClasses = classNames({
|
||||
'mx_NotificationStateContextMenu_field': true,
|
||||
'mx_NotificationStateContextMenu_fieldSet': this.state.roomNotifState == RoomNotifs.ALL_MESSAGES_LOUD,
|
||||
});
|
||||
|
||||
var allNotifsClasses = classNames({
|
||||
'mx_NotificationStateContextMenu_field': true,
|
||||
'mx_NotificationStateContextMenu_fieldSet': this.state.roomNotifState == RoomNotifs.ALL_MESSAGES,
|
||||
});
|
||||
|
||||
var mentionsClasses = classNames({
|
||||
'mx_NotificationStateContextMenu_field': true,
|
||||
'mx_NotificationStateContextMenu_fieldSet': this.state.roomNotifState == RoomNotifs.MENTIONS_ONLY,
|
||||
});
|
||||
|
||||
var muteNotifsClasses = classNames({
|
||||
'mx_NotificationStateContextMenu_field': true,
|
||||
'mx_NotificationStateContextMenu_fieldSet': this.state.roomNotifState == RoomNotifs.MUTE,
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="mx_NotificationStateContextMenu_picker" >
|
||||
<img src="img/notif-slider.svg" width="20" height="107" />
|
||||
</div>
|
||||
<div className={ alertMeClasses } onClick={this._onClickAlertMe} >
|
||||
<img className="mx_NotificationStateContextMenu_activeIcon" src="img/notif-active.svg" width="12" height="12" />
|
||||
<img className="mx_NotificationStateContextMenu_icon" src="img/icon-context-mute-off-copy.svg" width="16" height="12" />
|
||||
All messages (loud)
|
||||
</div>
|
||||
<div className={ allNotifsClasses } onClick={this._onClickAllNotifs} >
|
||||
<img className="mx_NotificationStateContextMenu_activeIcon" src="img/notif-active.svg" width="12" height="12" />
|
||||
<img className="mx_NotificationStateContextMenu_icon" src="img/icon-context-mute-off.svg" width="16" height="12" />
|
||||
All messages
|
||||
</div>
|
||||
<div className={ mentionsClasses } onClick={this._onClickMentions} >
|
||||
<img className="mx_NotificationStateContextMenu_activeIcon" src="img/notif-active.svg" width="12" height="12" />
|
||||
<img className="mx_NotificationStateContextMenu_icon" src="img/icon-context-mute-mentions.svg" width="16" height="12" />
|
||||
Mentions only
|
||||
</div>
|
||||
<div className={ muteNotifsClasses } onClick={this._onClickMute} >
|
||||
<img className="mx_NotificationStateContextMenu_activeIcon" src="img/notif-active.svg" width="12" height="12" />
|
||||
<img className="mx_NotificationStateContextMenu_icon" src="img/icon-context-mute.svg" width="16" height="12" />
|
||||
Mute
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -1,253 +0,0 @@
|
||||
/*
|
||||
Copyright 2015, 2016 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var q = require("q");
|
||||
var React = require('react');
|
||||
var classNames = require('classnames');
|
||||
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
|
||||
var dis = require('matrix-react-sdk/lib/dispatcher');
|
||||
var DMRoomMap = require('matrix-react-sdk/lib/utils/DMRoomMap');
|
||||
var Rooms = require('matrix-react-sdk/lib/Rooms');
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'RoomTagContextMenu',
|
||||
|
||||
propTypes: {
|
||||
room: React.PropTypes.object.isRequired,
|
||||
/* callback called when the menu is dismissed */
|
||||
onFinished: React.PropTypes.func,
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
const dmRoomMap = new DMRoomMap(MatrixClientPeg.get());
|
||||
return {
|
||||
isFavourite: this.props.room.tags.hasOwnProperty("m.favourite"),
|
||||
isLowPriority: this.props.room.tags.hasOwnProperty("m.lowpriority"),
|
||||
isDirectMessage: Boolean(dmRoomMap.getUserIdForRoomId(this.props.room.roomId)),
|
||||
};
|
||||
},
|
||||
|
||||
_toggleTag: function(tagNameOn, tagNameOff) {
|
||||
var self = this;
|
||||
const roomId = this.props.room.roomId;
|
||||
var cli = MatrixClientPeg.get();
|
||||
if (!cli.isGuest()) {
|
||||
q.delay(500).then(function() {
|
||||
if (tagNameOff !== null && tagNameOff !== undefined) {
|
||||
cli.deleteRoomTag(roomId, tagNameOff).finally(function() {
|
||||
// Close the context menu
|
||||
if (self.props.onFinished) {
|
||||
self.props.onFinished();
|
||||
};
|
||||
}).fail(function(err) {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to remove tag " + tagNameOff + " from room",
|
||||
description: err.toString()
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (tagNameOn !== null && tagNameOn !== undefined) {
|
||||
// If the tag ordering meta data is required, it is added by
|
||||
// the RoomSubList when it sorts its rooms
|
||||
cli.setRoomTag(roomId, tagNameOn, {}).finally(function() {
|
||||
// Close the context menu
|
||||
if (self.props.onFinished) {
|
||||
self.props.onFinished();
|
||||
};
|
||||
}).fail(function(err) {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to add tag " + tagNameOn + " to room",
|
||||
description: err.toString()
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_onClickFavourite: function() {
|
||||
// Tag room as 'Favourite'
|
||||
if (!this.state.isFavourite && this.state.isLowPriority) {
|
||||
this.setState({
|
||||
isFavourite: true,
|
||||
isLowPriority: false,
|
||||
});
|
||||
this._toggleTag("m.favourite", "m.lowpriority");
|
||||
} else if (this.state.isFavourite) {
|
||||
this.setState({isFavourite: false});
|
||||
this._toggleTag(null, "m.favourite");
|
||||
} else if (!this.state.isFavourite) {
|
||||
this.setState({isFavourite: true});
|
||||
this._toggleTag("m.favourite");
|
||||
}
|
||||
},
|
||||
|
||||
_onClickLowPriority: function() {
|
||||
// Tag room as 'Low Priority'
|
||||
if (!this.state.isLowPriority && this.state.isFavourite) {
|
||||
this.setState({
|
||||
isFavourite: false,
|
||||
isLowPriority: true,
|
||||
});
|
||||
this._toggleTag("m.lowpriority", "m.favourite");
|
||||
} else if (this.state.isLowPriority) {
|
||||
this.setState({isLowPriority: false});
|
||||
this._toggleTag(null, "m.lowpriority");
|
||||
} else if (!this.state.isLowPriority) {
|
||||
this.setState({isLowPriority: true});
|
||||
this._toggleTag("m.lowpriority");
|
||||
}
|
||||
},
|
||||
|
||||
_onClickDM: function() {
|
||||
const newIsDirectMessage = !this.state.isDirectMessage;
|
||||
this.setState({
|
||||
isDirectMessage: newIsDirectMessage,
|
||||
});
|
||||
|
||||
if (MatrixClientPeg.get().isGuest()) return;
|
||||
|
||||
let newTarget;
|
||||
if (newIsDirectMessage) {
|
||||
const guessedTarget = Rooms.guessDMRoomTarget(
|
||||
this.props.room,
|
||||
this.props.room.getMember(MatrixClientPeg.get().credentials.userId),
|
||||
);
|
||||
newTarget = guessedTarget.userId;
|
||||
} else {
|
||||
newTarget = null;
|
||||
}
|
||||
|
||||
// give some time for the user to see the icon change first, since
|
||||
// this will hide the context menu once it completes
|
||||
q.delay(500).done(() => {
|
||||
return Rooms.setDMRoom(this.props.room.roomId, newTarget).finally(() => {
|
||||
// Close the context menu
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished();
|
||||
};
|
||||
}, (err) => {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to set Direct Message status of room",
|
||||
description: err.toString()
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
_onClickLeave: function() {
|
||||
// Leave room
|
||||
dis.dispatch({
|
||||
action: 'leave_room',
|
||||
room_id: this.props.room.roomId,
|
||||
});
|
||||
|
||||
// Close the context menu
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished();
|
||||
};
|
||||
},
|
||||
|
||||
_onClickForget: function() {
|
||||
// FIXME: duplicated with RoomSettings (and dead code in RoomView)
|
||||
MatrixClientPeg.get().forget(this.props.room.roomId).done(function() {
|
||||
dis.dispatch({ action: 'view_next_room' });
|
||||
}, function(err) {
|
||||
var errCode = err.errcode || "unknown error code";
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Error",
|
||||
description: `Failed to forget room (${errCode})`
|
||||
});
|
||||
});
|
||||
|
||||
// Close the context menu
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished();
|
||||
};
|
||||
},
|
||||
|
||||
render: function() {
|
||||
const myUserId = MatrixClientPeg.get().credentials.userId;
|
||||
const myMember = this.props.room.getMember(myUserId);
|
||||
|
||||
const favouriteClasses = classNames({
|
||||
'mx_RoomTagContextMenu_field': true,
|
||||
'mx_RoomTagContextMenu_fieldSet': this.state.isFavourite,
|
||||
'mx_RoomTagContextMenu_fieldDisabled': false,
|
||||
});
|
||||
|
||||
const lowPriorityClasses = classNames({
|
||||
'mx_RoomTagContextMenu_field': true,
|
||||
'mx_RoomTagContextMenu_fieldSet': this.state.isLowPriority,
|
||||
'mx_RoomTagContextMenu_fieldDisabled': false,
|
||||
});
|
||||
|
||||
const leaveClasses = classNames({
|
||||
'mx_RoomTagContextMenu_field': true,
|
||||
'mx_RoomTagContextMenu_fieldSet': false,
|
||||
'mx_RoomTagContextMenu_fieldDisabled': false,
|
||||
});
|
||||
|
||||
const dmClasses = classNames({
|
||||
'mx_RoomTagContextMenu_field': true,
|
||||
'mx_RoomTagContextMenu_fieldSet': this.state.isDirectMessage,
|
||||
'mx_RoomTagContextMenu_fieldDisabled': false,
|
||||
});
|
||||
|
||||
if (myMember && myMember.membership === "leave") {
|
||||
return (
|
||||
<div>
|
||||
<div className={ leaveClasses } onClick={ this._onClickForget } >
|
||||
<img className="mx_RoomTagContextMenu_icon" src="img/icon_context_delete.svg" width="15" height="15" />
|
||||
Forget
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={ favouriteClasses } onClick={this._onClickFavourite} >
|
||||
<img className="mx_RoomTagContextMenu_icon" src="img/icon_context_fave.svg" width="15" height="15" />
|
||||
<img className="mx_RoomTagContextMenu_icon_set" src="img/icon_context_fave_on.svg" width="15" height="15" />
|
||||
Favourite
|
||||
</div>
|
||||
<div className={ lowPriorityClasses } onClick={this._onClickLowPriority} >
|
||||
<img className="mx_RoomTagContextMenu_icon" src="img/icon_context_low.svg" width="15" height="15" />
|
||||
<img className="mx_RoomTagContextMenu_icon_set" src="img/icon_context_low_on.svg" width="15" height="15" />
|
||||
Low Priority
|
||||
</div>
|
||||
<div className={ dmClasses } onClick={this._onClickDM} >
|
||||
<img className="mx_RoomTagContextMenu_icon" src="img/icon_context_person.svg" width="15" height="15" />
|
||||
<img className="mx_RoomTagContextMenu_icon_set" src="img/icon_context_person_on.svg" width="15" height="15" />
|
||||
Direct Chat
|
||||
</div>
|
||||
<hr className="mx_RoomTagContextMenu_separator" />
|
||||
<div className={ leaveClasses } onClick={(myMember && myMember.membership === "join") ? this._onClickLeave : null} >
|
||||
<img className="mx_RoomTagContextMenu_icon" src="img/icon_context_delete.svg" width="15" height="15" />
|
||||
Leave
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
392
src/components/views/context_menus/RoomTileContextMenu.js
Normal file
@@ -0,0 +1,392 @@
|
||||
/*
|
||||
Copyright 2015, 2016 OpenMarket Ltd
|
||||
Copyright 2017 Vector Creations Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import q from 'q';
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import sdk from 'matrix-react-sdk';
|
||||
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
|
||||
import dis from 'matrix-react-sdk/lib/dispatcher';
|
||||
import DMRoomMap from 'matrix-react-sdk/lib/utils/DMRoomMap';
|
||||
import * as Rooms from 'matrix-react-sdk/lib/Rooms';
|
||||
import * as RoomNotifs from 'matrix-react-sdk/lib/RoomNotifs';
|
||||
import Modal from 'matrix-react-sdk/lib/Modal';
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'RoomTileContextMenu',
|
||||
|
||||
propTypes: {
|
||||
room: React.PropTypes.object.isRequired,
|
||||
/* callback called when the menu is dismissed */
|
||||
onFinished: React.PropTypes.func,
|
||||
},
|
||||
|
||||
getInitialState() {
|
||||
const dmRoomMap = new DMRoomMap(MatrixClientPeg.get());
|
||||
return {
|
||||
roomNotifState: RoomNotifs.getRoomNotifsState(this.props.room.roomId),
|
||||
isFavourite: this.props.room.tags.hasOwnProperty("m.favourite"),
|
||||
isLowPriority: this.props.room.tags.hasOwnProperty("m.lowpriority"),
|
||||
isDirectMessage: Boolean(dmRoomMap.getUserIdForRoomId(this.props.room.roomId)),
|
||||
}
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
this._unmounted = false;
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
this._unmounted = true;
|
||||
},
|
||||
|
||||
_toggleTag: function(tagNameOn, tagNameOff) {
|
||||
var self = this;
|
||||
const roomId = this.props.room.roomId;
|
||||
var cli = MatrixClientPeg.get();
|
||||
if (!cli.isGuest()) {
|
||||
q.delay(500).then(function() {
|
||||
if (tagNameOff !== null && tagNameOff !== undefined) {
|
||||
cli.deleteRoomTag(roomId, tagNameOff).finally(function() {
|
||||
// Close the context menu
|
||||
if (self.props.onFinished) {
|
||||
self.props.onFinished();
|
||||
};
|
||||
}).fail(function(err) {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to remove tag " + tagNameOff + " from room",
|
||||
description: err.toString()
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (tagNameOn !== null && tagNameOn !== undefined) {
|
||||
// If the tag ordering meta data is required, it is added by
|
||||
// the RoomSubList when it sorts its rooms
|
||||
cli.setRoomTag(roomId, tagNameOn, {}).finally(function() {
|
||||
// Close the context menu
|
||||
if (self.props.onFinished) {
|
||||
self.props.onFinished();
|
||||
};
|
||||
}).fail(function(err) {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to add tag " + tagNameOn + " to room",
|
||||
description: err.toString()
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_onClickFavourite: function() {
|
||||
// Tag room as 'Favourite'
|
||||
if (!this.state.isFavourite && this.state.isLowPriority) {
|
||||
this.setState({
|
||||
isFavourite: true,
|
||||
isLowPriority: false,
|
||||
});
|
||||
this._toggleTag("m.favourite", "m.lowpriority");
|
||||
} else if (this.state.isFavourite) {
|
||||
this.setState({isFavourite: false});
|
||||
this._toggleTag(null, "m.favourite");
|
||||
} else if (!this.state.isFavourite) {
|
||||
this.setState({isFavourite: true});
|
||||
this._toggleTag("m.favourite");
|
||||
}
|
||||
},
|
||||
|
||||
_onClickLowPriority: function() {
|
||||
// Tag room as 'Low Priority'
|
||||
if (!this.state.isLowPriority && this.state.isFavourite) {
|
||||
this.setState({
|
||||
isFavourite: false,
|
||||
isLowPriority: true,
|
||||
});
|
||||
this._toggleTag("m.lowpriority", "m.favourite");
|
||||
} else if (this.state.isLowPriority) {
|
||||
this.setState({isLowPriority: false});
|
||||
this._toggleTag(null, "m.lowpriority");
|
||||
} else if (!this.state.isLowPriority) {
|
||||
this.setState({isLowPriority: true});
|
||||
this._toggleTag("m.lowpriority");
|
||||
}
|
||||
},
|
||||
|
||||
_onClickDM: function() {
|
||||
const newIsDirectMessage = !this.state.isDirectMessage;
|
||||
this.setState({
|
||||
isDirectMessage: newIsDirectMessage,
|
||||
});
|
||||
|
||||
if (MatrixClientPeg.get().isGuest()) return;
|
||||
|
||||
Rooms.guessAndSetDMRoom(
|
||||
this.props.room, newIsDirectMessage
|
||||
).delay(500).finally(() => {
|
||||
// Close the context menu
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished();
|
||||
};
|
||||
}, (err) => {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failed to set Direct Message status of room",
|
||||
description: err.toString()
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
_onClickLeave: function() {
|
||||
// Leave room
|
||||
dis.dispatch({
|
||||
action: 'leave_room',
|
||||
room_id: this.props.room.roomId,
|
||||
});
|
||||
|
||||
// Close the context menu
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished();
|
||||
};
|
||||
},
|
||||
|
||||
_onClickReject: function() {
|
||||
dis.dispatch({
|
||||
action: 'reject_invite',
|
||||
room_id: this.props.room.roomId,
|
||||
});
|
||||
|
||||
// Close the context menu
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished();
|
||||
};
|
||||
},
|
||||
|
||||
_onClickForget: function() {
|
||||
// FIXME: duplicated with RoomSettings (and dead code in RoomView)
|
||||
MatrixClientPeg.get().forget(this.props.room.roomId).done(function() {
|
||||
dis.dispatch({ action: 'view_next_room' });
|
||||
}, function(err) {
|
||||
var errCode = err.errcode || "unknown error code";
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Error",
|
||||
description: `Failed to forget room (${errCode})`
|
||||
});
|
||||
});
|
||||
|
||||
// Close the context menu
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished();
|
||||
};
|
||||
},
|
||||
|
||||
_saveNotifState: function(newState) {
|
||||
const oldState = this.state.roomNotifState;
|
||||
const roomId = this.props.room.roomId;
|
||||
var cli = MatrixClientPeg.get();
|
||||
|
||||
if (cli.isGuest()) return;
|
||||
|
||||
this.setState({
|
||||
roomNotifState: newState,
|
||||
});
|
||||
RoomNotifs.setRoomNotifsState(this.props.room.roomId, newState).done(() => {
|
||||
// delay slightly so that the user can see their state change
|
||||
// before closing the menu
|
||||
return q.delay(500).then(() => {
|
||||
if (this._unmounted) return;
|
||||
// Close the context menu
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished();
|
||||
};
|
||||
});
|
||||
}, (error) => {
|
||||
// TODO: some form of error notification to the user
|
||||
// to inform them that their state change failed.
|
||||
// For now we at least set the state back
|
||||
if (this._unmounted) return;
|
||||
this.setState({
|
||||
roomNotifState: oldState,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
_onClickAlertMe: function() {
|
||||
this._saveNotifState(RoomNotifs.ALL_MESSAGES_LOUD);
|
||||
},
|
||||
|
||||
_onClickAllNotifs: function() {
|
||||
this._saveNotifState(RoomNotifs.ALL_MESSAGES);
|
||||
},
|
||||
|
||||
_onClickMentions: function() {
|
||||
this._saveNotifState(RoomNotifs.MENTIONS_ONLY);
|
||||
},
|
||||
|
||||
_onClickMute: function() {
|
||||
this._saveNotifState(RoomNotifs.MUTE);
|
||||
},
|
||||
|
||||
_renderNotifMenu: function() {
|
||||
var alertMeClasses = classNames({
|
||||
'mx_RoomTileContextMenu_notif_field': true,
|
||||
'mx_RoomTileContextMenu_notif_fieldSet': this.state.roomNotifState == RoomNotifs.ALL_MESSAGES_LOUD,
|
||||
});
|
||||
|
||||
var allNotifsClasses = classNames({
|
||||
'mx_RoomTileContextMenu_notif_field': true,
|
||||
'mx_RoomTileContextMenu_notif_fieldSet': this.state.roomNotifState == RoomNotifs.ALL_MESSAGES,
|
||||
});
|
||||
|
||||
var mentionsClasses = classNames({
|
||||
'mx_RoomTileContextMenu_notif_field': true,
|
||||
'mx_RoomTileContextMenu_notif_fieldSet': this.state.roomNotifState == RoomNotifs.MENTIONS_ONLY,
|
||||
});
|
||||
|
||||
var muteNotifsClasses = classNames({
|
||||
'mx_RoomTileContextMenu_notif_field': true,
|
||||
'mx_RoomTileContextMenu_notif_fieldSet': this.state.roomNotifState == RoomNotifs.MUTE,
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="mx_RoomTileContextMenu_notif_picker" >
|
||||
<img src="img/notif-slider.svg" width="20" height="107" />
|
||||
</div>
|
||||
<div className={ alertMeClasses } onClick={this._onClickAlertMe} >
|
||||
<img className="mx_RoomTileContextMenu_notif_activeIcon" src="img/notif-active.svg" width="12" height="12" />
|
||||
<img className="mx_RoomTileContextMenu_notif_icon mx_filterFlipColor" src="img/icon-context-mute-off-copy.svg" width="16" height="12" />
|
||||
All messages (loud)
|
||||
</div>
|
||||
<div className={ allNotifsClasses } onClick={this._onClickAllNotifs} >
|
||||
<img className="mx_RoomTileContextMenu_notif_activeIcon" src="img/notif-active.svg" width="12" height="12" />
|
||||
<img className="mx_RoomTileContextMenu_notif_icon mx_filterFlipColor" src="img/icon-context-mute-off.svg" width="16" height="12" />
|
||||
All messages
|
||||
</div>
|
||||
<div className={ mentionsClasses } onClick={this._onClickMentions} >
|
||||
<img className="mx_RoomTileContextMenu_notif_activeIcon" src="img/notif-active.svg" width="12" height="12" />
|
||||
<img className="mx_RoomTileContextMenu_notif_icon mx_filterFlipColor" src="img/icon-context-mute-mentions.svg" width="16" height="12" />
|
||||
Mentions only
|
||||
</div>
|
||||
<div className={ muteNotifsClasses } onClick={this._onClickMute} >
|
||||
<img className="mx_RoomTileContextMenu_notif_activeIcon" src="img/notif-active.svg" width="12" height="12" />
|
||||
<img className="mx_RoomTileContextMenu_notif_icon mx_filterFlipColor" src="img/icon-context-mute.svg" width="16" height="12" />
|
||||
Mute
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
_renderLeaveMenu: function(membership) {
|
||||
if (!membership) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let leaveClickHandler = null;
|
||||
let leaveText = null;
|
||||
|
||||
switch (membership) {
|
||||
case "join":
|
||||
leaveClickHandler = this._onClickLeave;
|
||||
leaveText = "Leave";
|
||||
break;
|
||||
case "leave":
|
||||
case "ban":
|
||||
leaveClickHandler = this._onClickForget;
|
||||
leaveText = "Forget";
|
||||
break;
|
||||
case "invite":
|
||||
leaveClickHandler = this._onClickReject;
|
||||
leaveText = "Reject";
|
||||
break;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="mx_RoomTileContextMenu_leave" onClick={ leaveClickHandler } >
|
||||
<img className="mx_RoomTileContextMenu_tag_icon" src="img/icon_context_delete.svg" width="15" height="15" />
|
||||
{ leaveText }
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
_renderRoomTagMenu: function() {
|
||||
const favouriteClasses = classNames({
|
||||
'mx_RoomTileContextMenu_tag_field': true,
|
||||
'mx_RoomTileContextMenu_tag_fieldSet': this.state.isFavourite,
|
||||
'mx_RoomTileContextMenu_tag_fieldDisabled': false,
|
||||
});
|
||||
|
||||
const lowPriorityClasses = classNames({
|
||||
'mx_RoomTileContextMenu_tag_field': true,
|
||||
'mx_RoomTileContextMenu_tag_fieldSet': this.state.isLowPriority,
|
||||
'mx_RoomTileContextMenu_tag_fieldDisabled': false,
|
||||
});
|
||||
|
||||
const dmClasses = classNames({
|
||||
'mx_RoomTileContextMenu_tag_field': true,
|
||||
'mx_RoomTileContextMenu_tag_fieldSet': this.state.isDirectMessage,
|
||||
'mx_RoomTileContextMenu_tag_fieldDisabled': false,
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={ favouriteClasses } onClick={this._onClickFavourite} >
|
||||
<img className="mx_RoomTileContextMenu_tag_icon" src="img/icon_context_fave.svg" width="15" height="15" />
|
||||
<img className="mx_RoomTileContextMenu_tag_icon_set" src="img/icon_context_fave_on.svg" width="15" height="15" />
|
||||
Favourite
|
||||
</div>
|
||||
<div className={ lowPriorityClasses } onClick={this._onClickLowPriority} >
|
||||
<img className="mx_RoomTileContextMenu_tag_icon" src="img/icon_context_low.svg" width="15" height="15" />
|
||||
<img className="mx_RoomTileContextMenu_tag_icon_set" src="img/icon_context_low_on.svg" width="15" height="15" />
|
||||
Low Priority
|
||||
</div>
|
||||
<div className={ dmClasses } onClick={this._onClickDM} >
|
||||
<img className="mx_RoomTileContextMenu_tag_icon" src="img/icon_context_person.svg" width="15" height="15" />
|
||||
<img className="mx_RoomTileContextMenu_tag_icon_set" src="img/icon_context_person_on.svg" width="15" height="15" />
|
||||
Direct Chat
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
const myMember = this.props.room.getMember(
|
||||
MatrixClientPeg.get().credentials.userId
|
||||
);
|
||||
|
||||
// Can't set notif level or tags on non-join rooms
|
||||
if (myMember.membership !== 'join') {
|
||||
return this._renderLeaveMenu(myMember.membership);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
{ this._renderNotifMenu() }
|
||||
<hr className="mx_RoomTileContextMenu_separator" />
|
||||
{ this._renderLeaveMenu(myMember.membership) }
|
||||
<hr className="mx_RoomTileContextMenu_separator" />
|
||||
{ this._renderRoomTagMenu() }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
127
src/components/views/dialogs/BugReportDialog.js
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
Copyright 2017 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import sdk from 'matrix-react-sdk';
|
||||
import rageshake from '../../../vector/rageshake';
|
||||
|
||||
export default class BugReportDialog extends React.Component {
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
this.state = {
|
||||
sendLogs: true,
|
||||
busy: false,
|
||||
err: null,
|
||||
text: "",
|
||||
};
|
||||
this._onSubmit = this._onSubmit.bind(this);
|
||||
this._onCancel = this._onCancel.bind(this);
|
||||
this._onTextChange = this._onTextChange.bind(this);
|
||||
this._onSendLogsChange = this._onSendLogsChange.bind(this);
|
||||
}
|
||||
|
||||
_onCancel(ev) {
|
||||
this.props.onFinished(false);
|
||||
}
|
||||
|
||||
_onSubmit(ev) {
|
||||
const sendLogs = this.state.sendLogs;
|
||||
const userText = this.state.text;
|
||||
if (!sendLogs && userText.trim().length === 0) {
|
||||
this.setState({
|
||||
err: "Please describe the bug and/or send logs.",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.setState({ busy: true, err: null });
|
||||
rageshake.sendBugReport(userText, sendLogs).then(() => {
|
||||
this.setState({ busy: false });
|
||||
this.props.onFinished(false);
|
||||
}, (err) => {
|
||||
this.setState({ busy: false, err: `Failed: ${err.message}` });
|
||||
});
|
||||
}
|
||||
|
||||
_onTextChange(ev) {
|
||||
this.setState({ text: ev.target.value });
|
||||
}
|
||||
|
||||
_onSendLogsChange(ev) {
|
||||
this.setState({ sendLogs: ev.target.checked });
|
||||
}
|
||||
|
||||
render() {
|
||||
const Loader = sdk.getComponent("elements.Spinner");
|
||||
|
||||
let error = null;
|
||||
if (this.state.err) {
|
||||
error = <div className="error">
|
||||
{this.state.err}
|
||||
</div>;
|
||||
}
|
||||
|
||||
const okLabel = this.state.busy ? <Loader /> : 'Send';
|
||||
|
||||
let cancelButton = null;
|
||||
if (!this.state.busy) {
|
||||
cancelButton = <button onClick={this._onCancel}>
|
||||
Cancel
|
||||
</button>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx_BugReportDialog">
|
||||
<div className="mx_Dialog_title">
|
||||
Report a bug
|
||||
</div>
|
||||
<div className="mx_Dialog_content">
|
||||
<p>Please describe the bug. What did you do?
|
||||
What did you expect to happen?
|
||||
What actually happened?</p>
|
||||
<textarea
|
||||
className="mx_BugReportDialog_input"
|
||||
rows={5}
|
||||
onChange={this._onTextChange}
|
||||
value={this.state.text}
|
||||
placeholder="Describe your problem here."
|
||||
/>
|
||||
<p>In order to diagnose problems, logs from this client will be sent with
|
||||
this bug report.
|
||||
If you would prefer to only send the text above, please untick:</p>
|
||||
<input type="checkbox" checked={this.state.sendLogs}
|
||||
onChange={this._onSendLogsChange} id="mx_BugReportDialog_logs"/>
|
||||
<label htmlFor="mx_BugReportDialog_logs">Send logs</label>
|
||||
{error}
|
||||
</div>
|
||||
<div className="mx_Dialog_buttons">
|
||||
<button
|
||||
className="mx_Dialog_primary danger"
|
||||
onClick={this._onSubmit}
|
||||
autoFocus={true}
|
||||
>
|
||||
{okLabel}
|
||||
</button>
|
||||
|
||||
{cancelButton}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
BugReportDialog.propTypes = {
|
||||
onFinished: React.PropTypes.func.isRequired,
|
||||
};
|
||||
@@ -31,9 +31,10 @@ export default class ChangelogDialog extends React.Component {
|
||||
const version = this.props.newVersion.split('-');
|
||||
const version2 = this.props.version.split('-');
|
||||
if(version == null || version2 == null) return;
|
||||
// parse versions of form: [vectorversion]-react-[react-sdk-version]-js-[js-sdk-version]
|
||||
for(let i=0; i<REPOS.length; i++) {
|
||||
const oldVersion = version2[2*i+1];
|
||||
const newVersion = version[2*i+1];
|
||||
const oldVersion = version2[2*i];
|
||||
const newVersion = version[2*i];
|
||||
request(`https://api.github.com/repos/${REPOS[i]}/compare/${oldVersion}...${newVersion}`, (a, b, body) => {
|
||||
if(body == null) return;
|
||||
this.setState({[REPOS[i]]: JSON.parse(body).commits});
|
||||
@@ -44,7 +45,7 @@ export default class ChangelogDialog extends React.Component {
|
||||
_elementsForCommit(commit) {
|
||||
return (
|
||||
<li key={commit.sha} className="mx_ChangelogDialog_li">
|
||||
<a href={commit.html_url} target="_blank" ref="noopener">
|
||||
<a href={commit.html_url} target="_blank" rel="noopener">
|
||||
{commit.commit.message}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -15,10 +15,14 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
|
||||
import {instanceForInstanceId} from '../../../utils/DirectoryUtils';
|
||||
|
||||
const DEFAULT_ICON_URL = "img/network-matrix.svg";
|
||||
|
||||
export default class NetworkDropdown extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.dropdownRootElement = null;
|
||||
this.ignoreEvent = null;
|
||||
@@ -26,12 +30,19 @@ export default class NetworkDropdown extends React.Component {
|
||||
this.onInputClick = this.onInputClick.bind(this);
|
||||
this.onRootClick = this.onRootClick.bind(this);
|
||||
this.onDocumentClick = this.onDocumentClick.bind(this);
|
||||
this.onNetworkClick = this.onNetworkClick.bind(this);
|
||||
this.onMenuOptionClick = this.onMenuOptionClick.bind(this);
|
||||
this.onInputKeyUp = this.onInputKeyUp.bind(this);
|
||||
this.collectRoot = this.collectRoot.bind(this);
|
||||
this.collectInputTextBox = this.collectInputTextBox.bind(this);
|
||||
|
||||
this.inputTextBox = null;
|
||||
|
||||
const server = MatrixClientPeg.getHomeServerName();
|
||||
this.state = {
|
||||
expanded: false,
|
||||
selectedNetwork: null,
|
||||
selectedServer: server,
|
||||
selectedInstance: null,
|
||||
includeAllNetworks: false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -39,12 +50,21 @@ export default class NetworkDropdown extends React.Component {
|
||||
// Listen for all clicks on the document so we can close the
|
||||
// menu when the user clicks somewhere else
|
||||
document.addEventListener('click', this.onDocumentClick, false);
|
||||
|
||||
// fire this now so the defaults can be set up
|
||||
this.props.onOptionChange(this.state.selectedServer, this.state.selectedInstance, this.state.includeAllNetworks);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener('click', this.onDocumentClick, false);
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
if (this.state.expanded && this.inputTextBox) {
|
||||
this.inputTextBox.focus();
|
||||
}
|
||||
}
|
||||
|
||||
onDocumentClick(ev) {
|
||||
// Close the dropdown if the user clicks anywhere that isn't
|
||||
// within our root element
|
||||
@@ -72,12 +92,25 @@ export default class NetworkDropdown extends React.Component {
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
onNetworkClick(network, ev) {
|
||||
onMenuOptionClick(server, instance, includeAll) {
|
||||
this.setState({
|
||||
expanded: false,
|
||||
selectedNetwork: network,
|
||||
selectedServer: server,
|
||||
selectedInstanceId: instance ? instance.instance_id : null,
|
||||
includeAll: includeAll,
|
||||
});
|
||||
this.props.onNetworkChange(network);
|
||||
this.props.onOptionChange(server, instance ? instance.instance_id : null, includeAll);
|
||||
}
|
||||
|
||||
onInputKeyUp(e) {
|
||||
if (e.key == 'Enter') {
|
||||
this.setState({
|
||||
expanded: false,
|
||||
selectedServer: e.target.value,
|
||||
selectedNetwork: null,
|
||||
});
|
||||
this.props.onOptionChange(e.target.value, null);
|
||||
}
|
||||
}
|
||||
|
||||
collectRoot(e) {
|
||||
@@ -90,41 +123,98 @@ export default class NetworkDropdown extends React.Component {
|
||||
this.dropdownRootElement = e;
|
||||
}
|
||||
|
||||
_optionForNetwork(network, wire_onclick) {
|
||||
if (wire_onclick === undefined) wire_onclick = true;
|
||||
collectInputTextBox(e) {
|
||||
this.inputTextBox = e;
|
||||
}
|
||||
|
||||
_getMenuOptions() {
|
||||
const options = [];
|
||||
|
||||
let servers = [];
|
||||
if (this.props.config.servers) {
|
||||
servers = servers.concat(this.props.config.servers);
|
||||
}
|
||||
|
||||
if (servers.indexOf(MatrixClientPeg.getHomeServerName()) == -1) {
|
||||
servers.unshift(MatrixClientPeg.getHomeServerName());
|
||||
}
|
||||
|
||||
// For our own HS, we can use the instance_ids given in the third party protocols
|
||||
// response to get the server to filter the room list by network for us.
|
||||
// We can't get thirdparty protocols for remote server yet though, so for those
|
||||
// we can only show the default room list.
|
||||
for (const server of servers) {
|
||||
options.push(this._makeMenuOption(server, null, true));
|
||||
if (server == MatrixClientPeg.getHomeServerName()) {
|
||||
options.push(this._makeMenuOption(server, null, false));
|
||||
if (this.props.protocols) {
|
||||
for (const proto of Object.keys(this.props.protocols)) {
|
||||
if (!this.props.protocols[proto].instances) continue;
|
||||
for (const instance of this.props.protocols[proto].instances) {
|
||||
if (!instance.instance_id) continue;
|
||||
options.push(this._makeMenuOption(server, instance, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
_makeMenuOption(server, instance, includeAll, handleClicks) {
|
||||
if (handleClicks === undefined) handleClicks = true;
|
||||
|
||||
let icon;
|
||||
let name;
|
||||
let span_class;
|
||||
let key;
|
||||
|
||||
if (network === null) {
|
||||
name = 'All networks';
|
||||
if (!instance && includeAll) {
|
||||
key = server;
|
||||
name = server;
|
||||
span_class = 'mx_NetworkDropdown_menu_all';
|
||||
} else if (!instance) {
|
||||
key = server + '_all';
|
||||
name = 'Matrix';
|
||||
icon = <img src="img/network-matrix.svg" />;
|
||||
span_class = 'mx_NetworkDropdown_menu_network';
|
||||
} else {
|
||||
name = this.props.config.networkNames[network];
|
||||
icon = <img src={this.props.config.networkIcons[network]} />;
|
||||
key = server + '_inst_' + instance.instance_id;
|
||||
const imgUrl = instance.icon ?
|
||||
MatrixClientPeg.get().mxcUrlToHttp(instance.icon, 25, 25, 'crop', true) :
|
||||
DEFAULT_ICON_URL;
|
||||
icon = <img src={imgUrl} />;
|
||||
name = instance.desc;
|
||||
span_class = 'mx_NetworkDropdown_menu_network';
|
||||
}
|
||||
|
||||
const click_handler = wire_onclick ? this.onNetworkClick.bind(this, network) : null;
|
||||
const click_handler = handleClicks ? this.onMenuOptionClick.bind(this, server, instance, includeAll) : null;
|
||||
|
||||
return <div key={network} className="mx_NetworkDropdown_networkoption" onClick={click_handler}>
|
||||
return <div key={key} className="mx_NetworkDropdown_networkoption" onClick={click_handler}>
|
||||
{icon}
|
||||
<span className={span_class}>{name}</span>
|
||||
</div>;
|
||||
<span className="mx_NetworkDropdown_menu_network">{name}</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
render() {
|
||||
const current_value = this._optionForNetwork(this.state.selectedNetwork, false);
|
||||
let current_value;
|
||||
|
||||
let menu;
|
||||
if (this.state.expanded) {
|
||||
const menu_options = [this._optionForNetwork(null)];
|
||||
for (const network of this.props.config.networks) {
|
||||
menu_options.push(this._optionForNetwork(network));
|
||||
}
|
||||
const menu_options = this._getMenuOptions();
|
||||
menu = <div className="mx_NetworkDropdown_menu">
|
||||
{menu_options}
|
||||
</div>;
|
||||
current_value = <input type="text" className="mx_NetworkDropdown_networkoption"
|
||||
ref={this.collectInputTextBox} onKeyUp={this.onInputKeyUp}
|
||||
placeholder="matrix.org" // 'matrix.org' as an example of an HS name
|
||||
/>
|
||||
} else {
|
||||
const instance = instanceForInstanceId(this.props.protocols, this.state.selectedInstanceId);
|
||||
current_value = this._makeMenuOption(
|
||||
this.state.selectedServer, instance, this.state.includeAll, false
|
||||
);
|
||||
}
|
||||
|
||||
return <div className="mx_NetworkDropdown" ref={this.collectRoot}>
|
||||
@@ -138,13 +228,13 @@ export default class NetworkDropdown extends React.Component {
|
||||
}
|
||||
|
||||
NetworkDropdown.propTypes = {
|
||||
onNetworkChange: React.PropTypes.func.isRequired,
|
||||
onOptionChange: React.PropTypes.func.isRequired,
|
||||
protocols: React.PropTypes.object,
|
||||
// The room directory config. May have a 'servers' key that is a list of server names to include in the dropdown
|
||||
config: React.PropTypes.object,
|
||||
};
|
||||
|
||||
NetworkDropdown.defaultProps = {
|
||||
config: {
|
||||
networks: [],
|
||||
}
|
||||
protocols: {},
|
||||
config: {},
|
||||
};
|
||||
|
||||
|
||||