Compare commits
775 commits
vue3compat
...
develop
Author | SHA1 | Date | |
---|---|---|---|
|
96a24ec625 | ||
|
91f833d1f0 | ||
|
92b04ba7df | ||
|
895eda3714 | ||
|
fb63e81ed1 | ||
|
a4ea0a30bf | ||
|
1041a38f14 | ||
|
0bb69d7fe0 | ||
|
d175e86901 | ||
|
c2a4051d72 | ||
|
169d13680a | ||
|
4d15cbcbbd | ||
|
3b02566e16 | ||
|
87311cff09 | ||
|
6951fda0d6 | ||
|
2d99cbc640 | ||
|
22c70ae22a | ||
|
d8324dd80b | ||
|
caacaf238c | ||
|
e4b8aaece6 | ||
|
bfc7b6af8f | ||
|
fce9c5eeb2 | ||
|
6de87e8b65 | ||
|
041c72b07c | ||
|
741a59e0cc | ||
|
4ddb6189dc | ||
|
0e56ac1c2b | ||
|
853f5145be | ||
|
b213d25711 | ||
|
bd77f3a1a6 | ||
|
78817e37f7 | ||
|
2b0dd2cbae | ||
|
a613447105 | ||
|
a3233e31d0 | ||
|
f71f101fce | ||
|
afdc61b9b7 | ||
|
1d1ea7e703 | ||
|
052ad2fe3f | ||
|
a0099ecb66 | ||
|
9940739f1f | ||
|
afbe1a96ac | ||
|
e029c2864f | ||
|
dadf2f407f | ||
|
6751c22a23 | ||
|
1943991077 | ||
|
115170f35d | ||
|
c3690b456e | ||
|
70593e71e6 | ||
|
1c60609547 | ||
|
b84acfd7b7 | ||
|
97e072d93a | ||
|
2179054384 | ||
|
a3f48fc3f4 | ||
|
de2f968645 | ||
|
e1483488c7 | ||
|
a1822f073d | ||
|
218b15b5fd | ||
|
bc029b0fa2 | ||
|
2d7f242713 | ||
|
0afc955ebd | ||
|
e80e53d9d2 | ||
|
afcfcce2e6 | ||
|
3171241c6f | ||
|
3e0bb91ff2 | ||
|
5bbc0e0bb5 | ||
|
3799983d4f | ||
|
3f04ebd89a | ||
|
b93e5437bd | ||
|
64d56e6515 | ||
|
d9d4d8954e | ||
|
b132581b3a | ||
|
f20ae34400 | ||
|
dc8bef7928 | ||
|
650e69c336 | ||
|
f21dc21a83 | ||
|
9afbb12f95 | ||
|
7b10e47b21 | ||
|
4b630c3c36 | ||
|
bdd240a230 | ||
|
c57af7e242 | ||
|
f706234d77 | ||
|
805615d52b | ||
|
8424b772b0 | ||
|
115f38c422 | ||
|
48fd8a66ad | ||
|
53cde52027 | ||
|
75f6506bc7 | ||
|
1d77063a4b | ||
|
ccd7378347 | ||
|
8e711e0587 | ||
|
87d420a92b | ||
|
d6bbccdd71 | ||
|
913749739f | ||
|
0b7a8dca15 | ||
|
dd4672dc9a | ||
|
9ac7046521 | ||
|
e4c804fac0 | ||
|
fd77c583bf | ||
|
b319c0c72b | ||
|
c5551e834b | ||
|
e58422889b | ||
|
b7755314b1 | ||
|
3fb647b34b | ||
|
0eb9c019e4 | ||
|
aa0b2e0723 | ||
|
4539feed40 | ||
|
20c14a1d99 | ||
|
9793002070 | ||
|
01d8fa4e54 | ||
|
961ca3a71b | ||
|
08811e5a27 | ||
|
a6fae395da | ||
|
d690b88c1c | ||
|
322ec8681a | ||
|
e1bfa6fbd3 | ||
|
db0e1a2534 | ||
|
d524e98348 | ||
|
7afa6c9f40 | ||
|
538903f9d8 | ||
|
c5a6f40dff | ||
|
b817e09ee8 | ||
|
6b5791fda6 | ||
|
3250e59266 | ||
|
e5ae0671ce | ||
|
9d7a7e2019 | ||
|
c2cf13fc00 | ||
|
c3546ea856 | ||
|
edb66ecade | ||
|
c6a4a0a320 | ||
|
6a31962ca0 | ||
|
fa99abf106 | ||
|
9be06d9f71 | ||
|
966919874e | ||
|
a253c95170 | ||
|
c6e0dcf08e | ||
|
0147226b3d | ||
|
1571053fba | ||
|
623aa3d20d | ||
|
636a55e72d | ||
|
304f871332 | ||
|
2cd8a3ec8d | ||
|
971cec024c | ||
|
7a17eb7fec | ||
|
4cb14c257c | ||
|
1187727b60 | ||
|
54fd7e2be6 | ||
|
0ef58696bf | ||
|
9478a462a7 | ||
|
4e2fd7baf9 | ||
|
66fb3987d6 | ||
|
1e60a491c4 | ||
|
12ce58a5a0 | ||
|
2f24f3312d | ||
|
1cc35b6df8 | ||
|
4f2be206df | ||
|
6074ad67ab | ||
|
c5cb76ac3b | ||
|
e4b010321d | ||
|
5e4ff5de7c | ||
|
6b14b645be | ||
|
79258f61be | ||
|
3ea442667f | ||
|
6c120cc576 | ||
|
89d6e624f2 | ||
|
060aa41f35 | ||
|
67f5cf3c03 | ||
|
5948d20f00 | ||
|
b3ed29ff02 | ||
|
5d973df5bd | ||
|
26bfbdc2ad | ||
|
50ea6dd142 | ||
|
6f1d953642 | ||
|
86f1b88d79 | ||
|
4610b6e547 | ||
|
be02516776 | ||
|
4e100b9ea2 | ||
|
8ae1f7e192 | ||
|
fea0c91f74 | ||
|
051d51bcd9 | ||
|
5718c6491e | ||
|
a97c07bfdf | ||
|
d815f984fb | ||
|
4993dc37e2 | ||
|
0671aa0dd0 | ||
|
b62653c202 | ||
|
be4244acde | ||
|
8311d4deba | ||
|
e51144809f | ||
|
cd4ad2df11 | ||
|
b632d740c1 | ||
|
123de8aad0 | ||
|
186078ae2a | ||
|
23c80794d5 | ||
|
3e1415ef89 | ||
|
2439f55342 | ||
|
b0babee98a | ||
|
47bb08514b | ||
|
60eb164bdc | ||
|
3101456a85 | ||
|
5e851e643b | ||
|
bfa62db274 | ||
|
b349bcd427 | ||
|
7e6e6292f8 | ||
|
34592fa63a | ||
|
71c0b59866 | ||
|
a97db1efd6 | ||
|
e34d71fc1f | ||
|
89efb0d2f4 | ||
|
1b204012ea | ||
|
b67a557a8c | ||
|
5fb302d0f1 | ||
|
7e21853cca | ||
|
7dd1a0dd30 | ||
|
90b066a744 | ||
|
1128cc463c | ||
|
22d8961c5e | ||
|
76727cd39c | ||
|
5829cd98af | ||
|
49fa9c47e9 | ||
|
495960c83a | ||
|
3b4afdf567 | ||
|
a485ebc2bb | ||
|
6980e4ddf1 | ||
|
cb19db1006 | ||
|
ddf6c9cef0 | ||
|
9f3a983fef | ||
|
839627ffc4 | ||
|
f3269cdc10 | ||
|
3502d374e3 | ||
|
0190a36070 | ||
|
23a6b86ef3 | ||
|
29cd8fbd3b | ||
|
a36673a6a8 | ||
|
544db06294 | ||
|
d9030b4fdd | ||
|
a7570f5eb2 | ||
|
f96e5882d1 | ||
|
f16f35a4d4 | ||
|
51b14cc615 | ||
|
80bd6433aa | ||
|
50b3a30d1a | ||
|
5930b667a1 | ||
|
9b5ae4d4a3 | ||
|
22c8ad4583 | ||
|
726fdbea15 | ||
|
67c2b52682 | ||
|
238e557d2b | ||
|
c8d87e7ef9 | ||
|
a83b07a629 | ||
|
3bd2f3c36d | ||
|
465c5f194c | ||
|
ec3df8e5f2 | ||
|
c194568daf | ||
|
63039aea37 | ||
|
fb803b2ff2 | ||
|
fabac8524d | ||
|
35ad2a1957 | ||
|
e4d40fbba4 | ||
|
d4076e5df5 | ||
|
2ced27e734 | ||
|
04d4f5525c | ||
|
949f11ea1e | ||
|
00a5dfc36f | ||
|
e29f33ed0c | ||
|
6946d09f55 | ||
|
450145dd6b | ||
|
551b8f3690 | ||
|
48178bdc53 | ||
|
a511250b63 | ||
|
415a823af0 | ||
|
0e323ef248 | ||
|
d157f67381 | ||
|
fa20ea76b1 | ||
|
e7f5033c7d | ||
|
9432fcec7d | ||
|
5768806d1b | ||
|
f8c5cbcd0d | ||
|
20880cdf0b | ||
|
cc5cff2038 | ||
|
2a510205c3 | ||
|
0db5a5a581 | ||
|
ba858a894c | ||
|
654996fdbe | ||
|
cebb4224ac | ||
|
9b27ac9aaf | ||
|
863255d52f | ||
|
c4bd004cbc | ||
|
244174a32b | ||
|
22bdcda9c0 | ||
|
ba8598858b | ||
|
17863f54fe | ||
|
26670e9003 | ||
|
10cd03c718 | ||
|
f1db5e8f4b | ||
|
d78c8e8ea4 | ||
|
e560fbc935 | ||
|
4adffb4835 | ||
|
0e4a7c3d05 | ||
|
8780246ce5 | ||
|
61bb69c88f | ||
|
bdf631c2c4 | ||
|
3addc36c96 | ||
|
f851bc92c9 | ||
|
2e54cf12c7 | ||
|
ff5f69b8fd | ||
|
d7da9f80a7 | ||
|
6b990ba368 | ||
|
cd3e6d0073 | ||
|
0aaef50ee5 | ||
|
05b2351e08 | ||
|
d9a9f97751 | ||
|
8c0deb905e | ||
|
d15d24c11c | ||
|
31c4300456 | ||
|
84a3cd92a3 | ||
|
ace1f5067c | ||
|
cd0f6a4f78 | ||
|
414ee55957 | ||
|
0f2fd8a352 | ||
|
0582f19e7c | ||
|
7e1e8ea429 | ||
|
7a8c975f61 | ||
|
1e41c2b99e | ||
|
f0f1066bc8 | ||
|
2b7f12613e | ||
|
fe0ed7e8f0 | ||
|
514d7d3f88 | ||
|
77b55a559b | ||
|
77bb0b5530 | ||
|
39909c8a85 | ||
|
f4b36a9ebf | ||
|
67319d0e5b | ||
|
cf58df17f6 | ||
|
8bb97fbfeb | ||
|
3a5ad18aca | ||
|
e3d602fdcc | ||
|
c07c0b2260 | ||
|
f626da838a | ||
|
9623b0e140 | ||
|
b1b9260a1d | ||
|
9c1814d122 | ||
|
0300db6c63 | ||
|
c7690aecd0 | ||
|
1b32bb9c51 | ||
|
9bc7d99e16 | ||
|
965bc5573f | ||
|
2559d03d7e | ||
|
58d0f9678b | ||
|
ddee8bb686 | ||
|
56616787ec | ||
|
d3659b5597 | ||
|
373c30be69 | ||
|
7b60adb480 | ||
|
5864dc52f7 | ||
|
a31ff20f50 | ||
|
2a97bdb39d | ||
|
86e3aefdab | ||
|
a8d1987686 | ||
|
0d073d607c | ||
|
769a9a14fe | ||
|
a61f6e1590 | ||
|
ee86f56469 | ||
|
17d6f1b53b | ||
|
befd4d5fc7 | ||
|
4c7edfc9a9 | ||
|
d361a4d7dc | ||
|
571e73a346 | ||
|
39ecb33883 | ||
|
0f01931309 | ||
|
a9830ff491 | ||
|
9a6363431d | ||
|
ea6114f63c | ||
|
bfb3a4364b | ||
|
6d3229b1a1 | ||
|
06042569f1 | ||
|
8ade11783a | ||
|
a5e20a4eb2 | ||
|
dd75e43c57 | ||
|
0e6af68a0f | ||
|
f886135bb7 | ||
|
c3f1765b21 | ||
|
7cc0d0763c | ||
|
c8983d5606 | ||
|
0c60b31eee | ||
|
aaf0b985ad | ||
|
9fde13c968 | ||
|
8896afd8d8 | ||
|
95007059d1 | ||
|
1d4b1b296e | ||
|
76547fe66d | ||
|
d1f02221cb | ||
|
efd558f394 | ||
|
28ee5721bb | ||
|
94c37e8adf | ||
|
e5f731c97d | ||
|
3cf7f9e3c8 | ||
|
56de3d2f52 | ||
|
c551e3e697 | ||
|
f7e2ac1c48 | ||
|
2f8aae371b | ||
|
9ea0f10abb | ||
|
182fcca5da | ||
|
6509542dbd | ||
|
2ac78219ee | ||
|
756f7bf7c2 | ||
|
4cd27acf7f | ||
|
030c374def | ||
|
056f5f547a | ||
|
af2a408b78 | ||
|
d22e04eaf6 | ||
|
4587f37dd7 | ||
|
a20f1794d0 | ||
|
b4cfda4a20 | ||
|
ea0887a15e | ||
|
d36b45ad43 | ||
|
d2730d5bad | ||
|
1c75c74c91 | ||
|
ef684dff61 | ||
|
241b4957e1 | ||
|
45eda03d1c | ||
|
1d0e4bada8 | ||
|
3c8ced53b9 | ||
|
80dd6b2500 | ||
|
ad64b91d66 | ||
|
4988268f5f | ||
|
50adf0ddf2 | ||
|
ef5bbc4e5f | ||
|
370f1e55ad | ||
|
a8a82ad12f | ||
|
1c53528433 | ||
|
8af1f08539 | ||
|
25a8b48bf2 | ||
|
59bab829a6 | ||
|
13468f2a89 | ||
|
5bb471a68e | ||
|
ff5ed29ec1 | ||
|
fa75a3a615 | ||
|
057e3dac85 | ||
|
6e57170626 | ||
|
98da3ad124 | ||
|
144cee6d34 | ||
|
0543c8d536 | ||
|
9319666f04 | ||
|
ca9652b30b | ||
|
21af736fe1 | ||
|
78ba8be969 | ||
|
29f229daad | ||
|
5049ee575f | ||
|
32ed71501a | ||
|
a7a736c7b8 | ||
|
5cbb71e588 | ||
|
fa2e5deae2 | ||
|
a3bfa63d05 | ||
|
1ef2bb93fe | ||
|
c38ab7234d | ||
|
791293c709 | ||
|
8574db1cf1 | ||
|
90d553f4be | ||
|
d3139a92b3 | ||
|
bc08f998cf | ||
|
f72671a1aa | ||
|
738e7923e4 | ||
|
b3f15fe3e1 | ||
|
761f91f7ef | ||
|
c509ed357a | ||
|
18871684c7 | ||
|
33e2bcce31 | ||
|
4d529c13ba | ||
|
0e53b2916e | ||
|
04a49e4c42 | ||
|
f57f61ca53 | ||
|
4302db5975 | ||
|
cdcefc2b73 | ||
|
4d73eaa6ce | ||
|
39494439d3 | ||
|
c3576211cb | ||
|
cbb34e2b0e | ||
|
e98a2af39e | ||
|
dbdc5e050f | ||
|
49fe334186 | ||
|
14ec7d6a41 | ||
|
7cc19ef2ea | ||
|
0507eb6550 | ||
|
830a03a0d1 | ||
|
34d265467a | ||
|
f5823a96e9 | ||
|
777f6c0162 | ||
|
0087d33c75 | ||
|
299c00cf74 | ||
|
07c12ae162 | ||
|
c8a7b6f433 | ||
|
5431d8fe55 | ||
|
8cc1ad67df | ||
|
6aa6f6f300 | ||
|
17d2eed06a | ||
|
f16658adfc | ||
|
68b4323181 | ||
|
7d67e8f1cc | ||
|
530ac4442b | ||
|
4465de5241 | ||
|
97e86381c8 | ||
|
4c974f5ca2 | ||
|
6c6df29ed3 | ||
|
add5921b8b | ||
|
2182af4058 | ||
|
2cfff1b8b9 | ||
|
4686993334 | ||
|
435f80133a | ||
|
ef277ae4e2 | ||
|
f35e3d0f3f | ||
|
179af131ee | ||
|
425919a0d2 | ||
|
ba961b784f | ||
|
891611816c | ||
|
373b14e1e4 | ||
|
a0eaac2216 | ||
|
b67db47c88 | ||
|
dd3fe61cf3 | ||
|
a2f21f4e13 | ||
|
628b99d117 | ||
|
5118eee19a | ||
|
4ba8d95a10 | ||
|
4016182b89 | ||
|
a258182522 | ||
|
6125dc885a | ||
|
19475ba356 | ||
|
cd9dd352e3 | ||
|
c6831a3810 | ||
|
8fe4355a6b | ||
|
6b8b9c017f | ||
|
44b741e270 | ||
|
8bab8658e8 | ||
|
bfe31e20ea | ||
|
5c2744b426 | ||
|
b68fb7738b | ||
|
f35c090caa | ||
|
c1293c3afa | ||
|
f15599e6e5 | ||
|
90345f158f | ||
|
85e2f8f78c | ||
|
b2ebfc1fd6 | ||
|
e1361a1cae | ||
|
e654fead23 | ||
|
9c4957268d | ||
|
6689fed513 | ||
|
4ecbb58086 | ||
|
0a3ce9cc8b | ||
|
dcfd178314 | ||
|
1b26c713ef | ||
|
9e9ab5cec9 | ||
|
a96a62929d | ||
|
1717a3aaf2 | ||
|
25bf28f051 | ||
|
ad3a2fd4e5 | ||
|
139a0d1562 | ||
|
cab0095989 | ||
|
338134acfb | ||
|
d7a53aec61 | ||
|
4aac0125e5 | ||
|
7e3393b5a2 | ||
|
5047663c51 | ||
|
e67f295497 | ||
|
312a237ca4 | ||
|
4639e30cb8 | ||
|
cbccea0546 | ||
|
b88e6b8ab0 | ||
|
8fa0331771 | ||
|
1668315bf8 | ||
|
1fcccd7570 | ||
|
0c10145242 | ||
|
67c9d8bd55 | ||
|
adfe56a3a3 | ||
|
63c22ad131 | ||
|
7309f8ce1a | ||
|
c21b1cf898 | ||
|
a3c703bd37 | ||
|
636dbdaba8 | ||
|
1fdfc42159 | ||
|
609dc5da0c | ||
|
bebafa1a2c | ||
|
e825021ef1 | ||
|
9c70f3e4df | ||
|
2c60a9b638 | ||
|
18fb7516cc | ||
|
418f029789 | ||
|
90a188f2c3 | ||
|
cd44556750 | ||
|
ca6c7d5b10 | ||
|
24f3681ac1 | ||
|
647e4476f9 | ||
|
c1bd36dc6f | ||
|
ffc501eb23 | ||
|
9421501c1e | ||
|
5834790d0b | ||
|
f819227bed | ||
|
255f47fe56 | ||
|
f883d2f75c | ||
|
b84aeff6bf | ||
|
cc00af7a31 | ||
|
0f73e96194 | ||
|
0263834faa | ||
|
6bff7cc6ef | ||
|
0260693f51 | ||
|
394fd462dc | ||
|
c6c478f4cf | ||
|
aec867b300 | ||
|
566964992a | ||
|
5c655b6675 | ||
|
8c8237418c | ||
|
963f1679e0 | ||
|
a3b8e7ad99 | ||
|
b87a9d6675 | ||
|
7ae85c8318 | ||
|
0ae3985a52 | ||
|
2f383c2c01 | ||
|
73127f0e25 | ||
|
9ea370033a | ||
|
3abd357694 | ||
|
0583a6b863 | ||
|
6bc9886db4 | ||
|
ccdf892483 | ||
|
38d9ea8b17 | ||
|
5740a79dbd | ||
|
e6d5ddcbb6 | ||
|
59d046b163 | ||
|
c3e122ff6f | ||
|
7d6fc044fb | ||
|
6199788f28 | ||
|
8045d1866e | ||
|
6090327236 | ||
|
5e83672274 | ||
|
aa38223e87 | ||
|
8e9f5d7580 | ||
|
50aa379038 | ||
|
04fa1f0b2d | ||
|
aec05686d0 | ||
|
b0ae32e309 | ||
|
22c8f71945 | ||
|
1923ed84d4 | ||
|
a2459c2187 | ||
|
be79643bcf | ||
|
35dedf8416 | ||
|
5970ddf9ac | ||
|
20ce646852 | ||
|
2725a0c639 | ||
|
bd98ecb3f0 | ||
|
2a2483f4c9 | ||
|
008e711e11 | ||
|
21477d07e9 | ||
|
ed824d964e | ||
|
e0cde9a29b | ||
|
0604b1d5b7 | ||
|
32d1a0e181 | ||
|
7bd18cda64 | ||
|
e95412a03c | ||
|
0ca0e642a4 | ||
|
4e96af0442 | ||
|
80220c1b07 | ||
|
c039656460 | ||
|
dc611dffdb | ||
|
159bbed2f9 | ||
|
245addb530 | ||
|
0741d1d93d | ||
|
477e22aa9c | ||
|
7341b8a551 | ||
|
711bf0910a | ||
|
330665dacb | ||
|
e338f6be75 | ||
|
eda817cc18 | ||
|
1e0479b171 | ||
|
64aba422d5 | ||
|
98da8fd441 | ||
|
b50a9a1d56 | ||
|
fdd4be3dcb | ||
|
407bdbf996 | ||
|
cec13609cd | ||
|
e55644f153 | ||
|
98d12beb9e | ||
|
d7607792fe | ||
|
f28f632e86 | ||
|
62ba237217 | ||
|
e053ac9865 | ||
|
e8449166e1 | ||
|
fd3b806c24 | ||
|
39b6214447 | ||
|
f8fde93c51 | ||
|
a6f66cfa2a | ||
|
acfd70bd3e | ||
|
303cf39142 | ||
|
31e342a005 | ||
|
61b60f8aa3 | ||
|
98735bf340 | ||
|
4cebc94324 | ||
|
be09a42253 | ||
|
3a0d4fdc24 | ||
|
6d40c4f9be | ||
|
5e82b7e316 | ||
|
dc81367260 | ||
|
e262103e7d | ||
|
2d8c325926 | ||
|
78fbee36aa | ||
|
099b5a7d38 | ||
|
55fa353469 | ||
|
70cef8d9b5 | ||
|
e958c8e943 | ||
|
a0453f7af8 | ||
|
225f8c44d6 | ||
|
8830a1652c | ||
|
3f68af086a | ||
|
b780f76b37 | ||
|
b406ebdc39 | ||
|
323cc8271f | ||
|
0578467ecf | ||
|
35438d93f0 | ||
|
110a37f68f | ||
|
4d54ae91d7 | ||
|
62679e24ab | ||
|
c1da12e2cd | ||
|
5ef0184469 | ||
|
b65ee94f93 | ||
|
8a9115b58e | ||
|
b6e8c12dbc | ||
|
e73cb423b6 | ||
|
e47d5ba53b | ||
|
8d46fd78c7 | ||
|
95e74319e1 | ||
|
709b75198d | ||
|
caed89f0ae | ||
|
72956e2343 | ||
|
4b18e0f36e | ||
|
b479d80366 | ||
|
9e8513b312 | ||
|
52835cf8bf | ||
|
905b9771ec | ||
|
fca885e665 | ||
|
6e687c0663 | ||
|
180da297f6 | ||
|
b774472fff | ||
|
76a2e6befb | ||
|
1f5f612163 | ||
|
509ec99574 | ||
|
ced9c0fa7e | ||
|
e00c3ccf36 | ||
|
b486788ed9 | ||
|
7acad87806 | ||
|
2d10084939 | ||
|
7a46e81edf | ||
|
0775970476 | ||
|
3f4487b5b8 | ||
|
2435d93d2d | ||
|
29faa6f124 | ||
|
b97dfec5f6 | ||
|
43b4223f16 | ||
|
86a851849a | ||
|
3dca3639fd | ||
|
06d0254cc5 | ||
|
40ac9ef499 | ||
|
09ef284af7 | ||
|
87903fbf6d | ||
|
6b250762f0 | ||
|
f0641d05df | ||
|
5fdc4a1904 | ||
|
adafae977a | ||
|
2f549774ab | ||
|
d695dcaff9 | ||
|
61dcdbf992 | ||
|
1afda1ac6d | ||
|
0c77a3e1d6 | ||
|
4e56e64034 | ||
|
2da37f15ab | ||
|
8e88d8110b | ||
|
1f0ac68fcd | ||
|
3870a30aea | ||
|
5d3bf43fdc | ||
|
c6d4c20982 |
254 changed files with 14776 additions and 5929 deletions
2
.babelrc
2
.babelrc
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"presets": ["@babel/preset-env"],
|
"presets": ["@babel/preset-env"],
|
||||||
"plugins": ["@babel/plugin-transform-runtime", "lodash", "@vue/babel-plugin-transform-vue-jsx"],
|
"plugins": ["@babel/plugin-transform-runtime", "lodash", "@vue/babel-plugin-jsx"],
|
||||||
"comments": false
|
"comments": false
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# This file is a template, and might need editing before it works on your project.
|
# This file is a template, and might need editing before it works on your project.
|
||||||
# Official framework image. Look for the different tagged releases at:
|
# Official framework image. Look for the different tagged releases at:
|
||||||
# https://hub.docker.com/r/library/node/tags/
|
# https://hub.docker.com/r/library/node/tags/
|
||||||
image: node:10
|
image: node:12
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- lint
|
- lint
|
||||||
|
|
58
CHANGELOG.md
58
CHANGELOG.md
|
@ -3,11 +3,67 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
## [Unreleased]
|
## Unreleased
|
||||||
|
### Fixed
|
||||||
|
- AdminFE button no longer scrolls page to top when clicked
|
||||||
|
- Pinned statuses no longer appear at bottom of user timeline (still appear as part of the timeline when fetched deep enough)
|
||||||
|
- Fixed many many bugs related to new mentions, including spacing and alignment issues
|
||||||
|
- Links in profile bios now properly open in new tabs
|
||||||
|
- Inline images now respect their intended width/height attributes
|
||||||
|
- Links with `&` in them work properly now
|
||||||
|
- Interaction list popovers now properly emojify names
|
||||||
|
- Completely hidden posts still had 1px border
|
||||||
|
- Attachments are ALWAYS in same order as user uploaded, no more "videos first"
|
||||||
|
- Attachment description is prefilled with backend-provided default when uploading
|
||||||
|
- Proper visual feedback that next image is loading when browsing
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- (You)s are optional (opt-in) now, bolding your nickname is also optional (opt-out)
|
||||||
|
- User highlight background now also covers the `@`
|
||||||
|
- Reverted back to textual `@`, svg version is opt-in.
|
||||||
|
- Settings window has been throughly rearranged to make make more sense and make navication settings easier.
|
||||||
|
- Uploaded attachments are uniform with displayed attachments
|
||||||
|
- Flash is watchable in media-modal (takes up nearly full screen though due to sizing issues)
|
||||||
|
- Notifications about likes/repeats/emoji reacts are now minimized so they always take up same amount of space irrelevant to size of post.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Options to show domains in mentions
|
||||||
|
- Option to show user avatars in mention links (opt-in)
|
||||||
|
- Option to disable the tooltip for mentions
|
||||||
|
- Option to completely hide muted threads
|
||||||
|
- Ability to open videos in modal even if you disabled that feature, via an icon button
|
||||||
|
- New button on attachment that indicates that attachment has a description and shows a bar filled with description
|
||||||
|
- Attachments are truncated just like post contents
|
||||||
|
- Media modal now also displays description and counter position in gallery (i.e. 1/5)
|
||||||
|
- Ability to rearrange order of attachments when uploading
|
||||||
|
- Enabled users to zoom and pan images in media viewer with mouse and touch
|
||||||
|
|
||||||
|
|
||||||
|
## [2.4.2] - 2022-01-09
|
||||||
|
### Added
|
||||||
|
- Added Apply and Reset buttons to the bottom of theme tab to minimize UI travel
|
||||||
|
- Implemented user option to always show floating New Post button (normally mobile-only)
|
||||||
|
- Display reasons for instance specific policies
|
||||||
|
- Added functionality to cancel follow request
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed link to external profile not working on user profiles
|
||||||
|
- Fixed mobile shoutbox display
|
||||||
|
- Fixed favicon badge not working in Chrome
|
||||||
|
- Escape html more properly in subject/display name
|
||||||
|
|
||||||
|
|
||||||
|
## [2.4.0] - 2021-08-08
|
||||||
### Added
|
### Added
|
||||||
- Added a quick settings to timeline header for easier access
|
- Added a quick settings to timeline header for easier access
|
||||||
- Added option to mark posts as sensitive by default
|
- Added option to mark posts as sensitive by default
|
||||||
- Added quick filters for notifications
|
- Added quick filters for notifications
|
||||||
|
- Implemented user option to change sidebar position to the right side
|
||||||
|
- Implemented user option to hide floating shout panel
|
||||||
|
- Implemented "edit profile" button if viewing own profile which opens profile settings
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed follow request count showing in the wrong location in mobile view
|
||||||
|
|
||||||
|
|
||||||
## [2.3.0] - 2021-03-01
|
## [2.3.0] - 2021-03-01
|
||||||
|
|
|
@ -3,6 +3,7 @@ Contributors of this project.
|
||||||
- Constance Variable (lambadalambda@social.heldscal.la): Code
|
- Constance Variable (lambadalambda@social.heldscal.la): Code
|
||||||
- Coco Snuss (cocosnuss@social.heldscal.la): Code
|
- Coco Snuss (cocosnuss@social.heldscal.la): Code
|
||||||
- wakarimasen (wakarimasen@shitposter.club): NSFW hiding image
|
- wakarimasen (wakarimasen@shitposter.club): NSFW hiding image
|
||||||
|
- eris (eris@disqordia.space): Code
|
||||||
- dtluna (dtluna@social.heldscal.la): Code
|
- dtluna (dtluna@social.heldscal.la): Code
|
||||||
- sonyam (sonyam@social.heldscal.la): Background images
|
- sonyam (sonyam@social.heldscal.la): Background images
|
||||||
- hakui (hakui@freezepeach.xyz): CSS and styling
|
- hakui (hakui@freezepeach.xyz): CSS and styling
|
||||||
|
|
|
@ -21,6 +21,7 @@ var compiler = webpack(webpackConfig)
|
||||||
|
|
||||||
var devMiddleware = require('webpack-dev-middleware')(compiler, {
|
var devMiddleware = require('webpack-dev-middleware')(compiler, {
|
||||||
publicPath: webpackConfig.output.publicPath,
|
publicPath: webpackConfig.output.publicPath,
|
||||||
|
writeToDisk: true,
|
||||||
stats: {
|
stats: {
|
||||||
colors: true,
|
colors: true,
|
||||||
chunks: false
|
chunks: false
|
||||||
|
|
|
@ -3,6 +3,8 @@ var config = require('../config')
|
||||||
var utils = require('./utils')
|
var utils = require('./utils')
|
||||||
var projectRoot = path.resolve(__dirname, '../')
|
var projectRoot = path.resolve(__dirname, '../')
|
||||||
var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin')
|
var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin')
|
||||||
|
var CopyPlugin = require('copy-webpack-plugin');
|
||||||
|
var { VueLoaderPlugin } = require('vue-loader')
|
||||||
|
|
||||||
var env = process.env.NODE_ENV
|
var env = process.env.NODE_ENV
|
||||||
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
|
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
|
||||||
|
@ -28,16 +30,16 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.js', '.vue'],
|
extensions: ['.js', '.jsx', '.vue'],
|
||||||
modules: [
|
modules: [
|
||||||
path.join(__dirname, '../node_modules')
|
path.join(__dirname, '../node_modules')
|
||||||
],
|
],
|
||||||
alias: {
|
alias: {
|
||||||
'vue$': 'vue/dist/vue.runtime.common',
|
|
||||||
'static': path.resolve(__dirname, '../static'),
|
'static': path.resolve(__dirname, '../static'),
|
||||||
'src': path.resolve(__dirname, '../src'),
|
'src': path.resolve(__dirname, '../src'),
|
||||||
'assets': path.resolve(__dirname, '../src/assets'),
|
'assets': path.resolve(__dirname, '../src/assets'),
|
||||||
'components': path.resolve(__dirname, '../src/components')
|
'components': path.resolve(__dirname, '../src/components'),
|
||||||
|
'vue-i18n': 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
|
@ -57,9 +59,28 @@ module.exports = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
enforce: 'post',
|
||||||
|
test: /\.(json5?|ya?ml)$/, // target json, json5, yaml and yml files
|
||||||
|
type: 'javascript/auto',
|
||||||
|
loader: '@intlify/vue-i18n-loader',
|
||||||
|
include: [ // Use `Rule.include` to specify the files of locale messages to be pre-compiled
|
||||||
|
path.resolve(__dirname, '../src/i18n')
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.vue$/,
|
test: /\.vue$/,
|
||||||
use: 'vue-loader'
|
loader: 'vue-loader',
|
||||||
|
options: {
|
||||||
|
compilerOptions: {
|
||||||
|
isCustomElement(tag) {
|
||||||
|
if (tag === 'pinch-zoom') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.jsx?$/,
|
test: /\.jsx?$/,
|
||||||
|
@ -93,6 +114,20 @@ module.exports = {
|
||||||
new ServiceWorkerWebpackPlugin({
|
new ServiceWorkerWebpackPlugin({
|
||||||
entry: path.join(__dirname, '..', 'src/sw.js'),
|
entry: path.join(__dirname, '..', 'src/sw.js'),
|
||||||
filename: 'sw-pleroma.js'
|
filename: 'sw-pleroma.js'
|
||||||
|
}),
|
||||||
|
new VueLoaderPlugin(),
|
||||||
|
// This copies Ruffle's WASM to a directory so that JS side can access it
|
||||||
|
new CopyPlugin({
|
||||||
|
patterns: [
|
||||||
|
{
|
||||||
|
from: "node_modules/ruffle-mirror/*",
|
||||||
|
to: "static/ruffle",
|
||||||
|
flatten: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
options: {
|
||||||
|
concurrency: 100,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,9 @@ module.exports = merge(baseWebpackConfig, {
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': config.dev.env,
|
'process.env': config.dev.env,
|
||||||
'COMMIT_HASH': JSON.stringify('DEV'),
|
'COMMIT_HASH': JSON.stringify('DEV'),
|
||||||
'DEV_OVERRIDES': JSON.stringify(config.dev.settings)
|
'DEV_OVERRIDES': JSON.stringify(config.dev.settings),
|
||||||
|
'__VUE_OPTIONS_API__': true,
|
||||||
|
'__VUE_PROD_DEVTOOLS__': false
|
||||||
}),
|
}),
|
||||||
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
|
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
|
|
|
@ -36,7 +36,9 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': env,
|
'process.env': env,
|
||||||
'COMMIT_HASH': JSON.stringify(commitHash),
|
'COMMIT_HASH': JSON.stringify(commitHash),
|
||||||
'DEV_OVERRIDES': JSON.stringify(undefined)
|
'DEV_OVERRIDES': JSON.stringify(undefined),
|
||||||
|
'__VUE_OPTIONS_API__': true,
|
||||||
|
'__VUE_PROD_DEVTOOLS__': false
|
||||||
}),
|
}),
|
||||||
// extract css into its own file
|
// extract css into its own file
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
|
|
|
@ -52,7 +52,10 @@ module.exports = {
|
||||||
target,
|
target,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
cookieDomainRewrite: 'localhost',
|
cookieDomainRewrite: 'localhost',
|
||||||
ws: true
|
ws: true,
|
||||||
|
headers: {
|
||||||
|
'Origin': target
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'/oauth/revoke': {
|
'/oauth/revoke': {
|
||||||
target,
|
target,
|
||||||
|
|
198
package.json
198
package.json
|
@ -16,105 +16,111 @@
|
||||||
"lint-fix": "eslint --fix --ext .js,.vue src test/unit/specs test/e2e/specs"
|
"lint-fix": "eslint --fix --ext .js,.vue src test/unit/specs test/e2e/specs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.7.6",
|
"@babel/runtime": "7.17.8",
|
||||||
"@chenfengyuan/vue-qrcode": "^1.0.0",
|
"@chenfengyuan/vue-qrcode": "2.0.0",
|
||||||
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
"@fortawesome/fontawesome-svg-core": "1.3.0",
|
||||||
"@fortawesome/free-regular-svg-icons": "^5.15.1",
|
"@fortawesome/free-regular-svg-icons": "5.15.4",
|
||||||
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
"@fortawesome/free-solid-svg-icons": "5.15.4",
|
||||||
"@fortawesome/vue-fontawesome": "^2.0.0",
|
"@fortawesome/vue-fontawesome": "3.0.0-5",
|
||||||
"body-scroll-lock": "^2.6.4",
|
"@kazvmoe-infra/pinch-zoom-element": "1.2.0",
|
||||||
"chromatism": "^3.0.0",
|
"@vuelidate/core": "2.0.0-alpha.35",
|
||||||
"cropperjs": "^1.4.3",
|
"@vuelidate/validators": "2.0.0-alpha.27",
|
||||||
"diff": "^3.0.1",
|
"body-scroll-lock": "2.7.1",
|
||||||
"escape-html": "^1.0.3",
|
"chromatism": "3.0.0",
|
||||||
"localforage": "^1.5.0",
|
"click-outside-vue3": "4.0.1",
|
||||||
"parse-link-header": "^1.0.1",
|
"cropperjs": "1.5.12",
|
||||||
"phoenix": "^1.3.0",
|
"diff": "3.5.0",
|
||||||
"portal-vue": "^2.1.4",
|
"escape-html": "1.0.3",
|
||||||
"punycode.js": "^2.1.0",
|
"localforage": "1.10.0",
|
||||||
"v-click-outside": "^2.1.1",
|
"parse-link-header": "1.0.1",
|
||||||
"vue": "^2.6.11",
|
"phoenix": "1.6.2",
|
||||||
"vue-i18n": "^7.3.2",
|
"punycode.js": "2.1.0",
|
||||||
"vue-router": "^3.0.1",
|
"qrcode": "1",
|
||||||
"vue-template-compiler": "^2.6.11",
|
"ruffle-mirror": "2021.12.31",
|
||||||
"vuelidate": "^0.7.4",
|
"vue": "^3.2.31",
|
||||||
"vuex": "^3.0.1"
|
"vue-i18n": "^9.2.0-beta.34",
|
||||||
|
"vue-router": "4.0.14",
|
||||||
|
"vue-template-compiler": "2.6.11",
|
||||||
|
"vuex": "4.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.7.5",
|
"@babel/core": "7.17.8",
|
||||||
"@babel/plugin-transform-runtime": "^7.7.6",
|
"@babel/plugin-transform-runtime": "7.17.0",
|
||||||
"@babel/preset-env": "^7.7.6",
|
"@babel/preset-env": "7.16.11",
|
||||||
"@babel/register": "^7.7.4",
|
"@babel/register": "7.17.7",
|
||||||
"@ungap/event-target": "^0.1.0",
|
"@intlify/vue-i18n-loader": "^5.0.0",
|
||||||
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
|
"@ungap/event-target": "0.2.3",
|
||||||
"@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
|
"@vue/babel-helper-vue-jsx-merge-props": "1.2.1",
|
||||||
"@vue/test-utils": "^1.0.0-beta.26",
|
"@vue/babel-plugin-jsx": "1.1.1",
|
||||||
"autoprefixer": "^6.4.0",
|
"@vue/compiler-sfc": "^3.1.0",
|
||||||
"babel-eslint": "^7.0.0",
|
"@vue/test-utils": "2.0.0-rc.17",
|
||||||
"babel-loader": "^8.0.6",
|
"autoprefixer": "6.7.7",
|
||||||
"babel-plugin-lodash": "^3.3.4",
|
"babel-eslint": "7.2.3",
|
||||||
"chai": "^3.5.0",
|
"babel-loader": "8.2.4",
|
||||||
"chalk": "^1.1.3",
|
"babel-plugin-lodash": "3.3.4",
|
||||||
"chromedriver": "^87.0.1",
|
"chai": "3.5.0",
|
||||||
"connect-history-api-fallback": "^1.1.0",
|
"chalk": "1.1.3",
|
||||||
"cross-spawn": "^4.0.2",
|
"chromedriver": "87.0.7",
|
||||||
"css-loader": "^0.28.0",
|
"connect-history-api-fallback": "1.6.0",
|
||||||
"custom-event-polyfill": "^1.0.7",
|
"copy-webpack-plugin": "6.4.1",
|
||||||
"eslint": "^5.16.0",
|
"cross-spawn": "4.0.2",
|
||||||
"eslint-config-standard": "^12.0.0",
|
"css-loader": "0.28.11",
|
||||||
"eslint-friendly-formatter": "^2.0.5",
|
"custom-event-polyfill": "1.0.7",
|
||||||
"eslint-loader": "^2.1.0",
|
"eslint": "5.16.0",
|
||||||
"eslint-plugin-import": "^2.13.0",
|
"eslint-config-standard": "12.0.0",
|
||||||
"eslint-plugin-node": "^7.0.0",
|
"eslint-friendly-formatter": "2.0.7",
|
||||||
"eslint-plugin-promise": "^4.0.0",
|
"eslint-loader": "2.2.1",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"eslint-plugin-import": "2.25.4",
|
||||||
"eslint-plugin-vue": "^5.2.2",
|
"eslint-plugin-node": "7.0.1",
|
||||||
"eventsource-polyfill": "^0.9.6",
|
"eslint-plugin-promise": "4.3.1",
|
||||||
"express": "^4.13.3",
|
"eslint-plugin-standard": "4.1.0",
|
||||||
"file-loader": "^3.0.1",
|
"eslint-plugin-vue": "5.2.3",
|
||||||
"function-bind": "^1.0.2",
|
"eventsource-polyfill": "0.9.6",
|
||||||
"html-webpack-plugin": "^3.0.0",
|
"express": "4.17.3",
|
||||||
"http-proxy-middleware": "^0.17.2",
|
"file-loader": "3.0.1",
|
||||||
"inject-loader": "^2.0.1",
|
"function-bind": "1.1.1",
|
||||||
"iso-639-1": "^2.0.3",
|
"html-webpack-plugin": "3.2.0",
|
||||||
"isparta-loader": "^2.0.0",
|
"http-proxy-middleware": "0.21.0",
|
||||||
"json-loader": "^0.5.4",
|
"inject-loader": "2.0.1",
|
||||||
"karma": "^3.0.0",
|
"iso-639-1": "2.1.13",
|
||||||
"karma-coverage": "^1.1.1",
|
"isparta-loader": "2.0.0",
|
||||||
"karma-firefox-launcher": "^1.1.0",
|
"json-loader": "0.5.7",
|
||||||
"karma-mocha": "^1.2.0",
|
"karma": "6.3.17",
|
||||||
"karma-mocha-reporter": "^2.2.1",
|
"karma-coverage": "1.1.2",
|
||||||
"karma-sinon-chai": "^2.0.2",
|
"karma-firefox-launcher": "1.3.0",
|
||||||
"karma-sourcemap-loader": "^0.3.7",
|
"karma-mocha": "2.0.1",
|
||||||
"karma-spec-reporter": "0.0.26",
|
"karma-mocha-reporter": "2.2.5",
|
||||||
"karma-webpack": "^4.0.0-rc.3",
|
"karma-sinon-chai": "2.0.2",
|
||||||
"lodash": "^4.16.4",
|
"karma-sourcemap-loader": "0.3.8",
|
||||||
"lolex": "^1.4.0",
|
"karma-spec-reporter": "0.0.33",
|
||||||
"mini-css-extract-plugin": "^0.5.0",
|
"karma-webpack": "4.0.2",
|
||||||
"mocha": "^3.1.0",
|
"lodash": "4.17.21",
|
||||||
"nightwatch": "^0.9.8",
|
"lolex": "1.6.0",
|
||||||
"opn": "^4.0.2",
|
"mini-css-extract-plugin": "0.12.0",
|
||||||
"ora": "^0.3.0",
|
"mocha": "3.5.3",
|
||||||
"postcss-loader": "^3.0.0",
|
"nightwatch": "0.9.21",
|
||||||
"raw-loader": "^0.5.1",
|
"opn": "4.0.2",
|
||||||
"sass": "^1.17.3",
|
"ora": "0.4.1",
|
||||||
"sass-loader": "git://github.com/webpack-contrib/sass-loader",
|
"postcss-loader": "3.0.0",
|
||||||
|
"raw-loader": "0.5.1",
|
||||||
|
"sass": "1.20.1",
|
||||||
|
"sass-loader": "7.2.0",
|
||||||
"selenium-server": "2.53.1",
|
"selenium-server": "2.53.1",
|
||||||
"semver": "^5.3.0",
|
"semver": "5.6.0",
|
||||||
"serviceworker-webpack-plugin": "^1.0.0",
|
"serviceworker-webpack-plugin": "1.0.1",
|
||||||
"shelljs": "^0.8.4",
|
"shelljs": "0.8.5",
|
||||||
"sinon": "^2.1.0",
|
"sinon": "2.4.1",
|
||||||
"sinon-chai": "^2.8.0",
|
"sinon-chai": "2.14.0",
|
||||||
"stylelint": "^13.6.1",
|
"stylelint": "13.6.1",
|
||||||
"stylelint-config-standard": "^20.0.0",
|
"stylelint-config-standard": "20.0.0",
|
||||||
"stylelint-rscss": "^0.4.0",
|
"stylelint-rscss": "0.4.0",
|
||||||
"url-loader": "^1.1.2",
|
"url-loader": "1.1.2",
|
||||||
"vue-loader": "^14.0.0",
|
"vue-loader": "^16.0.0",
|
||||||
"vue-style-loader": "^4.0.0",
|
"vue-style-loader": "4.1.2",
|
||||||
"webpack": "^4.0.0",
|
"webpack": "4.46.0",
|
||||||
"webpack-dev-middleware": "^3.6.0",
|
"webpack-dev-middleware": "3.7.3",
|
||||||
"webpack-hot-middleware": "^2.12.2",
|
"webpack-hot-middleware": "2.24.3",
|
||||||
"webpack-merge": "^0.14.1"
|
"webpack-merge": "0.14.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 4.0.0",
|
"node": ">= 4.0.0",
|
||||||
|
|
6
renovate.json
Normal file
6
renovate.json
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"config:base"
|
||||||
|
]
|
||||||
|
}
|
16
src/App.js
16
src/App.js
|
@ -4,7 +4,7 @@ import Notifications from './components/notifications/notifications.vue'
|
||||||
import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
|
import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
|
||||||
import FeaturesPanel from './components/features_panel/features_panel.vue'
|
import FeaturesPanel from './components/features_panel/features_panel.vue'
|
||||||
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
|
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
|
||||||
import ChatPanel from './components/chat_panel/chat_panel.vue'
|
import ShoutPanel from './components/shout_panel/shout_panel.vue'
|
||||||
import SettingsModal from './components/settings_modal/settings_modal.vue'
|
import SettingsModal from './components/settings_modal/settings_modal.vue'
|
||||||
import MediaModal from './components/media_modal/media_modal.vue'
|
import MediaModal from './components/media_modal/media_modal.vue'
|
||||||
import SideDrawer from './components/side_drawer/side_drawer.vue'
|
import SideDrawer from './components/side_drawer/side_drawer.vue'
|
||||||
|
@ -26,7 +26,7 @@ export default {
|
||||||
InstanceSpecificPanel,
|
InstanceSpecificPanel,
|
||||||
FeaturesPanel,
|
FeaturesPanel,
|
||||||
WhoToFollowPanel,
|
WhoToFollowPanel,
|
||||||
ChatPanel,
|
ShoutPanel,
|
||||||
MediaModal,
|
MediaModal,
|
||||||
SideDrawer,
|
SideDrawer,
|
||||||
MobilePostStatusButton,
|
MobilePostStatusButton,
|
||||||
|
@ -46,7 +46,7 @@ export default {
|
||||||
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
|
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
|
||||||
window.addEventListener('resize', this.updateMobileState)
|
window.addEventListener('resize', this.updateMobileState)
|
||||||
},
|
},
|
||||||
destroyed () {
|
unmounted () {
|
||||||
window.removeEventListener('resize', this.updateMobileState)
|
window.removeEventListener('resize', this.updateMobileState)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -65,7 +65,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
chat () { return this.$store.state.chat.channel.state === 'joined' },
|
shout () { return this.$store.state.shout.joined },
|
||||||
suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },
|
suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },
|
||||||
showInstanceSpecificPanel () {
|
showInstanceSpecificPanel () {
|
||||||
return this.$store.state.instance.showInstanceSpecificPanel &&
|
return this.$store.state.instance.showInstanceSpecificPanel &&
|
||||||
|
@ -73,11 +73,17 @@ export default {
|
||||||
this.$store.state.instance.instanceSpecificPanelContent
|
this.$store.state.instance.instanceSpecificPanelContent
|
||||||
},
|
},
|
||||||
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
|
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
|
||||||
|
shoutboxPosition () {
|
||||||
|
return this.$store.getters.mergedConfig.showNewPostButton || false
|
||||||
|
},
|
||||||
|
hideShoutbox () {
|
||||||
|
return this.$store.getters.mergedConfig.hideShoutbox
|
||||||
|
},
|
||||||
isMobileLayout () { return this.$store.state.interface.mobileLayout },
|
isMobileLayout () { return this.$store.state.interface.mobileLayout },
|
||||||
privateMode () { return this.$store.state.instance.private },
|
privateMode () { return this.$store.state.instance.private },
|
||||||
sidebarAlign () {
|
sidebarAlign () {
|
||||||
return {
|
return {
|
||||||
'order': this.$store.state.instance.sidebarRight ? 99 : 0
|
'order': this.$store.getters.mergedConfig.sidebarRight ? 99 : 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
...mapGetters(['mergedConfig'])
|
...mapGetters(['mergedConfig'])
|
||||||
|
|
53
src/App.scss
53
src/App.scss
|
@ -88,6 +88,10 @@ a {
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
font-family: var(--interfaceFont, sans-serif);
|
font-family: var(--interfaceFont, sans-serif);
|
||||||
|
|
||||||
|
&.-sublime {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
i[class*=icon-],
|
i[class*=icon-],
|
||||||
.svg-inline--fa {
|
.svg-inline--fa {
|
||||||
color: $fallback--text;
|
color: $fallback--text;
|
||||||
|
@ -187,7 +191,7 @@ a {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input, textarea, .select, .input {
|
input, textarea, .input {
|
||||||
|
|
||||||
&.unstyled {
|
&.unstyled {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
@ -217,47 +221,11 @@ input, textarea, .select, .input {
|
||||||
hyphens: none;
|
hyphens: none;
|
||||||
padding: 8px .5em;
|
padding: 8px .5em;
|
||||||
|
|
||||||
&.select {
|
&:disabled, &[disabled=disabled], &.disabled {
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:disabled, &[disabled=disabled] {
|
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-down-icon {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 5px;
|
|
||||||
height: 100%;
|
|
||||||
color: $fallback--text;
|
|
||||||
color: var(--inputText, $fallback--text);
|
|
||||||
line-height: 28px;
|
|
||||||
z-index: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
-moz-appearance: none;
|
|
||||||
appearance: none;
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
color: $fallback--text;
|
|
||||||
color: var(--inputText, --text, $fallback--text);
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 2em 0 .2em;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-family: var(--inputFont, sans-serif);
|
|
||||||
font-size: 14px;
|
|
||||||
width: 100%;
|
|
||||||
z-index: 1;
|
|
||||||
height: 28px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&[type=range] {
|
&[type=range] {
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
|
@ -604,7 +572,7 @@ nav {
|
||||||
.fade-enter-active, .fade-leave-active {
|
.fade-enter-active, .fade-leave-active {
|
||||||
transition: opacity .2s
|
transition: opacity .2s
|
||||||
}
|
}
|
||||||
.fade-enter, .fade-leave-active {
|
.fade-enter-from, .fade-leave-active {
|
||||||
opacity: 0
|
opacity: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -830,13 +798,6 @@ nav {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-multiple {
|
|
||||||
display: flex;
|
|
||||||
.option-list {
|
|
||||||
margin: 0;
|
|
||||||
padding-left: .5em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.setting-list,
|
.setting-list,
|
||||||
.option-list{
|
.option-list{
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
|
11
src/App.vue
11
src/App.vue
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
id="app"
|
id="app-loaded"
|
||||||
:style="bgStyle"
|
:style="bgStyle"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
@ -49,16 +49,17 @@
|
||||||
</div>
|
</div>
|
||||||
<media-modal />
|
<media-modal />
|
||||||
</div>
|
</div>
|
||||||
<chat-panel
|
<shout-panel
|
||||||
v-if="currentUser && chat"
|
v-if="currentUser && shout && !hideShoutbox"
|
||||||
:floating="true"
|
:floating="true"
|
||||||
class="floating-chat mobile-hidden"
|
class="floating-shout mobile-hidden"
|
||||||
|
:class="{ 'left': shoutboxPosition }"
|
||||||
/>
|
/>
|
||||||
<MobilePostStatusButton />
|
<MobilePostStatusButton />
|
||||||
<UserReportingModal />
|
<UserReportingModal />
|
||||||
<PostStatusModal />
|
<PostStatusModal />
|
||||||
<SettingsModal />
|
<SettingsModal />
|
||||||
<portal-target name="modal" />
|
<div id="modal" />
|
||||||
<GlobalNoticeList />
|
<GlobalNoticeList />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -30,3 +30,5 @@ $fallback--attachmentRadius: 10px;
|
||||||
$fallback--chatMessageRadius: 10px;
|
$fallback--chatMessageRadius: 10px;
|
||||||
|
|
||||||
$fallback--buttonShadow: 0px 0px 2px 0px rgba(0, 0, 0, 1), 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset, 0px -1px 0px 0px rgba(0, 0, 0, 0.2) inset;
|
$fallback--buttonShadow: 0px 0px 2px 0px rgba(0, 0, 0, 1), 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset, 0px -1px 0px 0px rgba(0, 0, 0, 0.2) inset;
|
||||||
|
|
||||||
|
$status-margin: 0.75em;
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
import Vue from 'vue'
|
import { createApp } from 'vue'
|
||||||
import VueRouter from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
import routes from './routes'
|
import vClickOutside from 'click-outside-vue3'
|
||||||
|
|
||||||
|
import { FontAwesomeIcon, FontAwesomeLayers } from '@fortawesome/vue-fontawesome'
|
||||||
|
|
||||||
import App from '../App.vue'
|
import App from '../App.vue'
|
||||||
|
import routes from './routes'
|
||||||
|
import VBodyScrollLock from 'src/directives/body_scroll_lock'
|
||||||
|
|
||||||
import { windowWidth } from '../services/window_utils/window_utils'
|
import { windowWidth } from '../services/window_utils/window_utils'
|
||||||
import { getOrCreateApp, getClientToken } from '../services/new_api/oauth.js'
|
import { getOrCreateApp, getClientToken } from '../services/new_api/oauth.js'
|
||||||
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
||||||
|
@ -115,6 +121,7 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
copyInstanceOption('nsfwCensorImage')
|
copyInstanceOption('nsfwCensorImage')
|
||||||
copyInstanceOption('background')
|
copyInstanceOption('background')
|
||||||
copyInstanceOption('hidePostStats')
|
copyInstanceOption('hidePostStats')
|
||||||
|
copyInstanceOption('hideBotIndication')
|
||||||
copyInstanceOption('hideUserStats')
|
copyInstanceOption('hideUserStats')
|
||||||
copyInstanceOption('hideFilteredStatuses')
|
copyInstanceOption('hideFilteredStatuses')
|
||||||
copyInstanceOption('logo')
|
copyInstanceOption('logo')
|
||||||
|
@ -240,7 +247,7 @@ const getNodeInfo = async ({ store }) => {
|
||||||
store.dispatch('setInstanceOption', { name: 'registrationOpen', value: data.openRegistrations })
|
store.dispatch('setInstanceOption', { name: 'registrationOpen', value: data.openRegistrations })
|
||||||
store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') })
|
store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') })
|
||||||
store.dispatch('setInstanceOption', { name: 'safeDM', value: features.includes('safe_dm_mentions') })
|
store.dispatch('setInstanceOption', { name: 'safeDM', value: features.includes('safe_dm_mentions') })
|
||||||
store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') })
|
store.dispatch('setInstanceOption', { name: 'shoutAvailable', value: features.includes('chat') })
|
||||||
store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') })
|
store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') })
|
||||||
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
|
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
|
||||||
store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') })
|
store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') })
|
||||||
|
@ -366,25 +373,32 @@ const afterStoreSetup = async ({ store, i18n }) => {
|
||||||
getTOS({ store })
|
getTOS({ store })
|
||||||
getStickers({ store })
|
getStickers({ store })
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = createRouter({
|
||||||
mode: 'history',
|
history: createWebHistory(),
|
||||||
routes: routes(store),
|
routes: routes(store),
|
||||||
scrollBehavior: (to, _from, savedPosition) => {
|
scrollBehavior: (to, _from, savedPosition) => {
|
||||||
if (to.matched.some(m => m.meta.dontScroll)) {
|
if (to.matched.some(m => m.meta.dontScroll)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return savedPosition || { x: 0, y: 0 }
|
return savedPosition || { left: 0, top: 0 }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/* eslint-disable no-new */
|
const app = createApp(App)
|
||||||
return new Vue({
|
|
||||||
router,
|
app.use(router)
|
||||||
store,
|
app.use(store)
|
||||||
i18n,
|
app.use(i18n)
|
||||||
el: '#app',
|
|
||||||
render: h => h(App)
|
app.use(vClickOutside)
|
||||||
})
|
app.use(VBodyScrollLock)
|
||||||
|
|
||||||
|
app.component('FAIcon', FontAwesomeIcon)
|
||||||
|
app.component('FALayers', FontAwesomeLayers)
|
||||||
|
|
||||||
|
app.mount('#app')
|
||||||
|
|
||||||
|
return app
|
||||||
}
|
}
|
||||||
|
|
||||||
export default afterStoreSetup
|
export default afterStoreSetup
|
||||||
|
|
|
@ -16,7 +16,7 @@ import FollowRequests from 'components/follow_requests/follow_requests.vue'
|
||||||
import OAuthCallback from 'components/oauth_callback/oauth_callback.vue'
|
import OAuthCallback from 'components/oauth_callback/oauth_callback.vue'
|
||||||
import Notifications from 'components/notifications/notifications.vue'
|
import Notifications from 'components/notifications/notifications.vue'
|
||||||
import AuthForm from 'components/auth_form/auth_form.js'
|
import AuthForm from 'components/auth_form/auth_form.js'
|
||||||
import ChatPanel from 'components/chat_panel/chat_panel.vue'
|
import ShoutPanel from 'components/shout_panel/shout_panel.vue'
|
||||||
import WhoToFollow from 'components/who_to_follow/who_to_follow.vue'
|
import WhoToFollow from 'components/who_to_follow/who_to_follow.vue'
|
||||||
import About from 'components/about/about.vue'
|
import About from 'components/about/about.vue'
|
||||||
import RemoteUserResolver from 'components/remote_user_resolver/remote_user_resolver.vue'
|
import RemoteUserResolver from 'components/remote_user_resolver/remote_user_resolver.vue'
|
||||||
|
@ -46,7 +46,7 @@ export default (store) => {
|
||||||
{ name: 'bookmarks', path: '/bookmarks', component: BookmarkTimeline },
|
{ name: 'bookmarks', path: '/bookmarks', component: BookmarkTimeline },
|
||||||
{ name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } },
|
{ name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } },
|
||||||
{ name: 'remote-user-profile-acct',
|
{ name: 'remote-user-profile-acct',
|
||||||
path: '/remote-users/(@?):username([^/@]+)@:hostname([^/@]+)',
|
path: '/remote-users/:_(@)?:username([^/@]+)@:hostname([^/@]+)',
|
||||||
component: RemoteUserResolver,
|
component: RemoteUserResolver,
|
||||||
beforeEnter: validateAuthenticatedRoute
|
beforeEnter: validateAuthenticatedRoute
|
||||||
},
|
},
|
||||||
|
@ -64,12 +64,12 @@ export default (store) => {
|
||||||
{ name: 'friend-requests', path: '/friend-requests', component: FollowRequests, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'friend-requests', path: '/friend-requests', component: FollowRequests, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'notifications', path: '/:username/notifications', component: Notifications, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'notifications', path: '/:username/notifications', component: Notifications, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'login', path: '/login', component: AuthForm },
|
{ name: 'login', path: '/login', component: AuthForm },
|
||||||
{ name: 'chat-panel', path: '/chat-panel', component: ChatPanel, props: () => ({ floating: false }) },
|
{ name: 'shout-panel', path: '/shout-panel', component: ShoutPanel, props: () => ({ floating: false }) },
|
||||||
{ name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) },
|
{ name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) },
|
||||||
{ name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) },
|
{ name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) },
|
||||||
{ name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'about', path: '/about', component: About },
|
{ name: 'about', path: '/about', component: About },
|
||||||
{ name: 'user-profile', path: '/(users/)?:name', component: UserProfile }
|
{ name: 'user-profile', path: '/:_(users)?/:name', component: UserProfile }
|
||||||
]
|
]
|
||||||
|
|
||||||
if (store.state.instance.pleromaChatMessagesAvailable) {
|
if (store.state.instance.pleromaChatMessagesAvailable) {
|
||||||
|
|
|
@ -6,10 +6,7 @@
|
||||||
:bound-to="{ x: 'container' }"
|
:bound-to="{ x: 'container' }"
|
||||||
remove-padding
|
remove-padding
|
||||||
>
|
>
|
||||||
<div
|
<template v-slot:content>
|
||||||
slot="content"
|
|
||||||
class="account-tools-popover"
|
|
||||||
>
|
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<template v-if="relationship.following">
|
<template v-if="relationship.following">
|
||||||
<button
|
<button
|
||||||
|
@ -59,16 +56,15 @@
|
||||||
{{ $t('user_card.message') }}
|
{{ $t('user_card.message') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
<div
|
<template v-slot:trigger>
|
||||||
slot="trigger"
|
<button class="button-unstyled ellipsis-button">
|
||||||
class="ellipsis-button"
|
<FAIcon
|
||||||
>
|
class="icon"
|
||||||
<FAIcon
|
icon="ellipsis-v"
|
||||||
class="icon"
|
/>
|
||||||
icon="ellipsis-v"
|
</button>
|
||||||
/>
|
</template>
|
||||||
</div>
|
|
||||||
</Popover>
|
</Popover>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -83,7 +79,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.ellipsis-button {
|
.ellipsis-button {
|
||||||
cursor: pointer;
|
|
||||||
width: 2.5em;
|
width: 2.5em;
|
||||||
margin: -0.5em 0;
|
margin: -0.5em 0;
|
||||||
padding: 0.5em 0;
|
padding: 0.5em 0;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
emits: ['resetAsyncComponent'],
|
||||||
methods: {
|
methods: {
|
||||||
retry () {
|
retry () {
|
||||||
this.$emit('resetAsyncComponent')
|
this.$emit('resetAsyncComponent')
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import StillImage from '../still-image/still-image.vue'
|
import StillImage from '../still-image/still-image.vue'
|
||||||
|
import Flash from '../flash/flash.vue'
|
||||||
import VideoAttachment from '../video_attachment/video_attachment.vue'
|
import VideoAttachment from '../video_attachment/video_attachment.vue'
|
||||||
import nsfwImage from '../../assets/nsfw.png'
|
import nsfwImage from '../../assets/nsfw.png'
|
||||||
import fileTypeService from '../../services/file_type/file_type.service.js'
|
import fileTypeService from '../../services/file_type/file_type.service.js'
|
||||||
|
@ -10,7 +11,12 @@ import {
|
||||||
faImage,
|
faImage,
|
||||||
faVideo,
|
faVideo,
|
||||||
faPlayCircle,
|
faPlayCircle,
|
||||||
faTimes
|
faTimes,
|
||||||
|
faStop,
|
||||||
|
faSearchPlus,
|
||||||
|
faTrashAlt,
|
||||||
|
faPencilAlt,
|
||||||
|
faAlignRight
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
library.add(
|
library.add(
|
||||||
|
@ -19,36 +25,64 @@ library.add(
|
||||||
faImage,
|
faImage,
|
||||||
faVideo,
|
faVideo,
|
||||||
faPlayCircle,
|
faPlayCircle,
|
||||||
faTimes
|
faTimes,
|
||||||
|
faStop,
|
||||||
|
faSearchPlus,
|
||||||
|
faTrashAlt,
|
||||||
|
faPencilAlt,
|
||||||
|
faAlignRight
|
||||||
)
|
)
|
||||||
|
|
||||||
const Attachment = {
|
const Attachment = {
|
||||||
props: [
|
props: [
|
||||||
'attachment',
|
'attachment',
|
||||||
|
'description',
|
||||||
|
'hideDescription',
|
||||||
'nsfw',
|
'nsfw',
|
||||||
'size',
|
'size',
|
||||||
'allowPlay',
|
|
||||||
'setMedia',
|
'setMedia',
|
||||||
'naturalSizeLoad'
|
'remove',
|
||||||
|
'shiftUp',
|
||||||
|
'shiftDn',
|
||||||
|
'edit'
|
||||||
],
|
],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
localDescription: this.description || this.attachment.description,
|
||||||
nsfwImage: this.$store.state.instance.nsfwCensorImage || nsfwImage,
|
nsfwImage: this.$store.state.instance.nsfwCensorImage || nsfwImage,
|
||||||
hideNsfwLocal: this.$store.getters.mergedConfig.hideNsfw,
|
hideNsfwLocal: this.$store.getters.mergedConfig.hideNsfw,
|
||||||
preloadImage: this.$store.getters.mergedConfig.preloadImage,
|
preloadImage: this.$store.getters.mergedConfig.preloadImage,
|
||||||
loading: false,
|
loading: false,
|
||||||
img: fileTypeService.fileType(this.attachment.mimetype) === 'image' && document.createElement('img'),
|
img: fileTypeService.fileType(this.attachment.mimetype) === 'image' && document.createElement('img'),
|
||||||
modalOpen: false,
|
modalOpen: false,
|
||||||
showHidden: false
|
showHidden: false,
|
||||||
|
flashLoaded: false,
|
||||||
|
showDescription: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
Flash,
|
||||||
StillImage,
|
StillImage,
|
||||||
VideoAttachment
|
VideoAttachment
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
classNames () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
'-loading': this.loading,
|
||||||
|
'-nsfw-placeholder': this.hidden,
|
||||||
|
'-editable': this.edit !== undefined
|
||||||
|
},
|
||||||
|
'-type-' + this.type,
|
||||||
|
this.size && '-size-' + this.size,
|
||||||
|
`-${this.useContainFit ? 'contain' : 'cover'}-fit`
|
||||||
|
]
|
||||||
|
},
|
||||||
usePlaceholder () {
|
usePlaceholder () {
|
||||||
return this.size === 'hide' || this.type === 'unknown'
|
return this.size === 'hide'
|
||||||
|
},
|
||||||
|
useContainFit () {
|
||||||
|
return this.$store.getters.mergedConfig.useContainFit
|
||||||
},
|
},
|
||||||
placeholderName () {
|
placeholderName () {
|
||||||
if (this.attachment.description === '' || !this.attachment.description) {
|
if (this.attachment.description === '' || !this.attachment.description) {
|
||||||
|
@ -72,24 +106,33 @@ const Attachment = {
|
||||||
return this.nsfw && this.hideNsfwLocal && !this.showHidden
|
return this.nsfw && this.hideNsfwLocal && !this.showHidden
|
||||||
},
|
},
|
||||||
isEmpty () {
|
isEmpty () {
|
||||||
return (this.type === 'html' && !this.attachment.oembed) || this.type === 'unknown'
|
return (this.type === 'html' && !this.attachment.oembed)
|
||||||
},
|
|
||||||
isSmall () {
|
|
||||||
return this.size === 'small'
|
|
||||||
},
|
|
||||||
fullwidth () {
|
|
||||||
if (this.size === 'hide') return false
|
|
||||||
return this.type === 'html' || this.type === 'audio' || this.type === 'unknown'
|
|
||||||
},
|
},
|
||||||
useModal () {
|
useModal () {
|
||||||
const modalTypes = this.size === 'hide' ? ['image', 'video', 'audio']
|
let modalTypes = []
|
||||||
: this.mergedConfig.playVideosInModal
|
switch (this.size) {
|
||||||
? ['image', 'video']
|
case 'hide':
|
||||||
: ['image']
|
case 'small':
|
||||||
|
modalTypes = ['image', 'video', 'audio', 'flash']
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
modalTypes = this.mergedConfig.playVideosInModal
|
||||||
|
? ['image', 'video', 'flash']
|
||||||
|
: ['image']
|
||||||
|
break
|
||||||
|
}
|
||||||
return modalTypes.includes(this.type)
|
return modalTypes.includes(this.type)
|
||||||
},
|
},
|
||||||
|
videoTag () {
|
||||||
|
return this.useModal ? 'button' : 'span'
|
||||||
|
},
|
||||||
...mapGetters(['mergedConfig'])
|
...mapGetters(['mergedConfig'])
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
localDescription (newVal) {
|
||||||
|
this.onEdit(newVal)
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
linkClicked ({ target }) {
|
linkClicked ({ target }) {
|
||||||
if (target.tagName === 'A') {
|
if (target.tagName === 'A') {
|
||||||
|
@ -98,12 +141,37 @@ const Attachment = {
|
||||||
},
|
},
|
||||||
openModal (event) {
|
openModal (event) {
|
||||||
if (this.useModal) {
|
if (this.useModal) {
|
||||||
event.stopPropagation()
|
this.$emit('setMedia')
|
||||||
event.preventDefault()
|
this.$store.dispatch('setCurrentMedia', this.attachment)
|
||||||
this.setMedia()
|
} else if (this.type === 'unknown') {
|
||||||
this.$store.dispatch('setCurrent', this.attachment)
|
window.open(this.attachment.url)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
openModalForce (event) {
|
||||||
|
this.$emit('setMedia')
|
||||||
|
this.$store.dispatch('setCurrentMedia', this.attachment)
|
||||||
|
},
|
||||||
|
onEdit (event) {
|
||||||
|
this.edit && this.edit(this.attachment, event)
|
||||||
|
},
|
||||||
|
onRemove () {
|
||||||
|
this.remove && this.remove(this.attachment)
|
||||||
|
},
|
||||||
|
onShiftUp () {
|
||||||
|
this.shiftUp && this.shiftUp(this.attachment)
|
||||||
|
},
|
||||||
|
onShiftDn () {
|
||||||
|
this.shiftDn && this.shiftDn(this.attachment)
|
||||||
|
},
|
||||||
|
stopFlash () {
|
||||||
|
this.$refs.flash.closePlayer()
|
||||||
|
},
|
||||||
|
setFlashLoaded (event) {
|
||||||
|
this.flashLoaded = event
|
||||||
|
},
|
||||||
|
toggleDescription () {
|
||||||
|
this.showDescription = !this.showDescription
|
||||||
|
},
|
||||||
toggleHidden (event) {
|
toggleHidden (event) {
|
||||||
if (
|
if (
|
||||||
(this.mergedConfig.useOneClickNsfw && !this.showHidden) &&
|
(this.mergedConfig.useOneClickNsfw && !this.showHidden) &&
|
||||||
|
@ -130,7 +198,7 @@ const Attachment = {
|
||||||
onImageLoad (image) {
|
onImageLoad (image) {
|
||||||
const width = image.naturalWidth
|
const width = image.naturalWidth
|
||||||
const height = image.naturalHeight
|
const height = image.naturalHeight
|
||||||
this.naturalSizeLoad && this.naturalSizeLoad({ width, height })
|
this.$emit('naturalSizeLoad', { id: this.attachment.id, width, height })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
268
src/components/attachment/attachment.scss
Normal file
268
src/components/attachment/attachment.scss
Normal file
|
@ -0,0 +1,268 @@
|
||||||
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
|
.Attachment {
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
align-self: flex-start;
|
||||||
|
line-height: 0;
|
||||||
|
height: 100%;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: $fallback--attachmentRadius;
|
||||||
|
border-radius: var(--attachmentRadius, $fallback--attachmentRadius);
|
||||||
|
border-color: $fallback--border;
|
||||||
|
border-color: var(--border, $fallback--border);
|
||||||
|
|
||||||
|
.attachment-wrapper {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description-container {
|
||||||
|
flex: 0 1 0;
|
||||||
|
display: flex;
|
||||||
|
padding-top: 0.5em;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
p {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 1.5;
|
||||||
|
padding: 0.5em;
|
||||||
|
margin: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-static {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
padding-top: 0;
|
||||||
|
background: var(--popover);
|
||||||
|
box-shadow: var(--popupShadow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.description-field {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
& .placeholder-container,
|
||||||
|
& .image-container,
|
||||||
|
& .audio-container,
|
||||||
|
& .video-container,
|
||||||
|
& .flash-container,
|
||||||
|
& .oembed-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-container {
|
||||||
|
.image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& .flash-container,
|
||||||
|
& .video-container {
|
||||||
|
& .flash,
|
||||||
|
& video {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.audio-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
|
||||||
|
audio {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.placeholder-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding-top: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.play-icon {
|
||||||
|
position: absolute;
|
||||||
|
font-size: 64px;
|
||||||
|
top: calc(50% - 32px);
|
||||||
|
left: calc(50% - 32px);
|
||||||
|
color: rgba(255, 255, 255, 0.75);
|
||||||
|
text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachment-buttons {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
margin-top: 0.5em;
|
||||||
|
margin-right: 0.5em;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
.attachment-button {
|
||||||
|
padding: 0;
|
||||||
|
border-radius: $fallback--tooltipRadius;
|
||||||
|
border-radius: var(--tooltipRadius, $fallback--tooltipRadius);
|
||||||
|
text-align: center;
|
||||||
|
width: 2em;
|
||||||
|
height: 2em;
|
||||||
|
margin-left: 0.5em;
|
||||||
|
font-size: 1.25em;
|
||||||
|
// TODO: theming? hard to theme with unknown background image color
|
||||||
|
background: rgba(230, 230, 230, 0.7);
|
||||||
|
|
||||||
|
.svg-inline--fa {
|
||||||
|
color: rgba(0, 0, 0, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover .svg-inline--fa {
|
||||||
|
color: rgba(0, 0, 0, 0.9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.oembed-container {
|
||||||
|
line-height: 1.2em;
|
||||||
|
flex: 1 0 100%;
|
||||||
|
width: 100%;
|
||||||
|
margin-right: 15px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
flex: 1;
|
||||||
|
img {
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 5px;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
flex: 2;
|
||||||
|
margin: 8px;
|
||||||
|
word-break: break-all;
|
||||||
|
h1 {
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-size-small {
|
||||||
|
.play-icon {
|
||||||
|
zoom: 0.5;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachment-buttons {
|
||||||
|
zoom: 0.7;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-editable {
|
||||||
|
padding: 0.5em;
|
||||||
|
|
||||||
|
& .description-container,
|
||||||
|
& .attachment-buttons {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-placeholder {
|
||||||
|
display: inline-block;
|
||||||
|
color: $fallback--link;
|
||||||
|
color: var(--postLink, $fallback--link);
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
height: auto;
|
||||||
|
line-height: 1.5;
|
||||||
|
|
||||||
|
&:not(.-editable) {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-editable {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: baseline;
|
||||||
|
|
||||||
|
& .description-container,
|
||||||
|
& .attachment-buttons {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description-container {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachment-buttons {
|
||||||
|
order: 99;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-loading {
|
||||||
|
cursor: progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-contain-fit {
|
||||||
|
img,
|
||||||
|
canvas {
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-cover-fit {
|
||||||
|
img,
|
||||||
|
canvas {
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<button
|
||||||
v-if="usePlaceholder"
|
v-if="usePlaceholder"
|
||||||
:class="{ 'fullwidth': fullwidth }"
|
class="Attachment -placeholder button-unstyled"
|
||||||
|
:class="classNames"
|
||||||
@click="openModal"
|
@click="openModal"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
|
@ -11,312 +12,257 @@
|
||||||
:href="attachment.url"
|
:href="attachment.url"
|
||||||
:alt="attachment.description"
|
:alt="attachment.description"
|
||||||
:title="attachment.description"
|
:title="attachment.description"
|
||||||
|
@click.prevent
|
||||||
>
|
>
|
||||||
<FAIcon :icon="placeholderIconClass" />
|
<FAIcon :icon="placeholderIconClass" />
|
||||||
<b>{{ nsfw ? "NSFW / " : "" }}</b>{{ placeholderName }}
|
<b>{{ nsfw ? "NSFW / " : "" }}</b>{{ edit ? '' : placeholderName }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
<div
|
||||||
|
v-if="edit || remove"
|
||||||
|
class="attachment-buttons"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
v-if="remove"
|
||||||
|
class="button-unstyled attachment-button"
|
||||||
|
@click.prevent="onRemove"
|
||||||
|
>
|
||||||
|
<FAIcon icon="trash-alt" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="size !== 'hide' && !hideDescription && (edit || localDescription || showDescription)"
|
||||||
|
class="description-container"
|
||||||
|
:class="{ '-static': !edit }"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
v-if="edit"
|
||||||
|
v-model="localDescription"
|
||||||
|
type="text"
|
||||||
|
class="description-field"
|
||||||
|
:placeholder="$t('post_status.media_description')"
|
||||||
|
@keydown.enter.prevent=""
|
||||||
|
>
|
||||||
|
<p v-else>
|
||||||
|
{{ localDescription }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
v-show="!isEmpty"
|
class="Attachment"
|
||||||
class="attachment"
|
:class="classNames"
|
||||||
:class="{[type]: true, loading, 'fullwidth': fullwidth, 'nsfw-placeholder': hidden}"
|
|
||||||
>
|
>
|
||||||
<a
|
|
||||||
v-if="hidden"
|
|
||||||
class="image-attachment"
|
|
||||||
:href="attachment.url"
|
|
||||||
:alt="attachment.description"
|
|
||||||
:title="attachment.description"
|
|
||||||
@click.prevent.stop="toggleHidden"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
:key="nsfwImage"
|
|
||||||
class="nsfw"
|
|
||||||
:src="nsfwImage"
|
|
||||||
:class="{'small': isSmall}"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
v-if="type === 'video'"
|
|
||||||
class="play-icon"
|
|
||||||
icon="play-circle"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
<button
|
|
||||||
v-if="nsfw && hideNsfwLocal && !hidden"
|
|
||||||
class="button-unstyled hider"
|
|
||||||
@click.prevent="toggleHidden"
|
|
||||||
>
|
|
||||||
<FAIcon icon="times" />
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<a
|
|
||||||
v-if="type === 'image' && (!hidden || preloadImage)"
|
|
||||||
class="image-attachment"
|
|
||||||
:class="{'hidden': hidden && preloadImage }"
|
|
||||||
:href="attachment.url"
|
|
||||||
target="_blank"
|
|
||||||
@click="openModal"
|
|
||||||
>
|
|
||||||
<StillImage
|
|
||||||
class="image"
|
|
||||||
:referrerpolicy="referrerpolicy"
|
|
||||||
:mimetype="attachment.mimetype"
|
|
||||||
:src="attachment.large_thumb_url || attachment.url"
|
|
||||||
:image-load-handler="onImageLoad"
|
|
||||||
:alt="attachment.description"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a
|
|
||||||
v-if="type === 'video' && !hidden"
|
|
||||||
class="video-container"
|
|
||||||
:class="{'small': isSmall}"
|
|
||||||
:href="allowPlay ? undefined : attachment.url"
|
|
||||||
@click="openModal"
|
|
||||||
>
|
|
||||||
<VideoAttachment
|
|
||||||
class="video"
|
|
||||||
:attachment="attachment"
|
|
||||||
:controls="allowPlay"
|
|
||||||
@play="$emit('play')"
|
|
||||||
@pause="$emit('pause')"
|
|
||||||
/>
|
|
||||||
<FAIcon
|
|
||||||
v-if="!allowPlay"
|
|
||||||
class="play-icon"
|
|
||||||
icon="play-circle"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<audio
|
|
||||||
v-if="type === 'audio'"
|
|
||||||
:src="attachment.url"
|
|
||||||
:alt="attachment.description"
|
|
||||||
:title="attachment.description"
|
|
||||||
controls
|
|
||||||
@play="$emit('play')"
|
|
||||||
@pause="$emit('pause')"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="type === 'html' && attachment.oembed"
|
v-show="!isEmpty"
|
||||||
class="oembed"
|
class="attachment-wrapper"
|
||||||
@click.prevent="linkClicked"
|
|
||||||
>
|
>
|
||||||
<div
|
<a
|
||||||
v-if="attachment.thumb_url"
|
v-if="hidden"
|
||||||
class="image"
|
class="image-container"
|
||||||
|
:href="attachment.url"
|
||||||
|
:alt="attachment.description"
|
||||||
|
:title="attachment.description"
|
||||||
|
@click.prevent.stop="toggleHidden"
|
||||||
>
|
>
|
||||||
<img :src="attachment.thumb_url">
|
<img
|
||||||
|
:key="nsfwImage"
|
||||||
|
class="nsfw"
|
||||||
|
:src="nsfwImage"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
v-if="type === 'video'"
|
||||||
|
class="play-icon"
|
||||||
|
icon="play-circle"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<div
|
||||||
|
v-if="!hidden"
|
||||||
|
class="attachment-buttons"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
v-if="type === 'flash' && flashLoaded"
|
||||||
|
class="button-unstyled attachment-button"
|
||||||
|
:title="$t('status.attachment_stop_flash')"
|
||||||
|
@click.prevent="stopFlash"
|
||||||
|
>
|
||||||
|
<FAIcon icon="stop" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="attachment.description && size !== 'small' && !edit && type !== 'unknown'"
|
||||||
|
class="button-unstyled attachment-button"
|
||||||
|
:title="$t('status.show_attachment_description')"
|
||||||
|
@click.prevent="toggleDescription"
|
||||||
|
>
|
||||||
|
<FAIcon icon="align-right" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="!useModal && type !== 'unknown'"
|
||||||
|
class="button-unstyled attachment-button"
|
||||||
|
:title="$t('status.show_attachment_in_modal')"
|
||||||
|
@click.prevent="openModalForce"
|
||||||
|
>
|
||||||
|
<FAIcon icon="search-plus" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="nsfw && hideNsfwLocal"
|
||||||
|
class="button-unstyled attachment-button"
|
||||||
|
:title="$t('status.hide_attachment')"
|
||||||
|
@click.prevent="toggleHidden"
|
||||||
|
>
|
||||||
|
<FAIcon icon="times" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="shiftUp"
|
||||||
|
class="button-unstyled attachment-button"
|
||||||
|
:title="$t('status.move_up')"
|
||||||
|
@click.prevent="onShiftUp"
|
||||||
|
>
|
||||||
|
<FAIcon icon="chevron-left" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="shiftDn"
|
||||||
|
class="button-unstyled attachment-button"
|
||||||
|
:title="$t('status.move_down')"
|
||||||
|
@click.prevent="onShiftDn"
|
||||||
|
>
|
||||||
|
<FAIcon icon="chevron-right" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="remove"
|
||||||
|
class="button-unstyled attachment-button"
|
||||||
|
:title="$t('status.remove_attachment')"
|
||||||
|
@click.prevent="onRemove"
|
||||||
|
>
|
||||||
|
<FAIcon icon="trash-alt" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="text">
|
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
<a
|
||||||
<h1><a :href="attachment.url">{{ attachment.oembed.title }}</a></h1>
|
v-if="type === 'image' && (!hidden || preloadImage)"
|
||||||
<div v-html="attachment.oembed.oembedHTML" />
|
class="image-container"
|
||||||
<!-- eslint-enable vue/no-v-html -->
|
:class="{'-hidden': hidden && preloadImage }"
|
||||||
|
:href="attachment.url"
|
||||||
|
target="_blank"
|
||||||
|
@click.stop.prevent="openModal"
|
||||||
|
>
|
||||||
|
<StillImage
|
||||||
|
class="image"
|
||||||
|
:referrerpolicy="referrerpolicy"
|
||||||
|
:mimetype="attachment.mimetype"
|
||||||
|
:src="attachment.large_thumb_url || attachment.url"
|
||||||
|
:image-load-handler="onImageLoad"
|
||||||
|
:alt="attachment.description"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a
|
||||||
|
v-if="type === 'unknown' && !hidden"
|
||||||
|
class="placeholder-container"
|
||||||
|
:href="attachment.url"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
size="5x"
|
||||||
|
:icon="placeholderIconClass"
|
||||||
|
/>
|
||||||
|
<p>
|
||||||
|
{{ localDescription }}
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<component
|
||||||
|
:is="videoTag"
|
||||||
|
v-if="type === 'video' && !hidden"
|
||||||
|
class="video-container"
|
||||||
|
:class="{ 'button-unstyled': 'isModal' }"
|
||||||
|
:href="attachment.url"
|
||||||
|
@click.stop.prevent="openModal"
|
||||||
|
>
|
||||||
|
<VideoAttachment
|
||||||
|
class="video"
|
||||||
|
:attachment="attachment"
|
||||||
|
:controls="!useModal"
|
||||||
|
@play="$emit('play')"
|
||||||
|
@pause="$emit('pause')"
|
||||||
|
/>
|
||||||
|
<FAIcon
|
||||||
|
v-if="useModal"
|
||||||
|
class="play-icon"
|
||||||
|
icon="play-circle"
|
||||||
|
/>
|
||||||
|
</component>
|
||||||
|
|
||||||
|
<span
|
||||||
|
v-if="type === 'audio' && !hidden"
|
||||||
|
class="audio-container"
|
||||||
|
:href="attachment.url"
|
||||||
|
@click.stop.prevent="openModal"
|
||||||
|
>
|
||||||
|
<audio
|
||||||
|
v-if="type === 'audio'"
|
||||||
|
:src="attachment.url"
|
||||||
|
:alt="attachment.description"
|
||||||
|
:title="attachment.description"
|
||||||
|
controls
|
||||||
|
@play="$emit('play')"
|
||||||
|
@pause="$emit('pause')"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="type === 'html' && attachment.oembed"
|
||||||
|
class="oembed-container"
|
||||||
|
@click.prevent="linkClicked"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="attachment.thumb_url"
|
||||||
|
class="image"
|
||||||
|
>
|
||||||
|
<img :src="attachment.thumb_url">
|
||||||
|
</div>
|
||||||
|
<div class="text">
|
||||||
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
|
<h1><a :href="attachment.url">{{ attachment.oembed.title }}</a></h1>
|
||||||
|
<div v-html="attachment.oembed.oembedHTML" />
|
||||||
|
<!-- eslint-enable vue/no-v-html -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<span
|
||||||
|
v-if="type === 'flash' && !hidden"
|
||||||
|
class="flash-container"
|
||||||
|
:href="attachment.url"
|
||||||
|
@click.stop.prevent="openModal"
|
||||||
|
>
|
||||||
|
<Flash
|
||||||
|
ref="flash"
|
||||||
|
class="flash"
|
||||||
|
:src="attachment.large_thumb_url || attachment.url"
|
||||||
|
@playerOpened="setFlashLoaded(true)"
|
||||||
|
@playerClosed="setFlashLoaded(false)"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="size !== 'hide' && !hideDescription && (edit || (localDescription && showDescription))"
|
||||||
|
class="description-container"
|
||||||
|
:class="{ '-static': !edit }"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
v-if="edit"
|
||||||
|
v-model="localDescription"
|
||||||
|
type="text"
|
||||||
|
class="description-field"
|
||||||
|
:placeholder="$t('post_status.media_description')"
|
||||||
|
@keydown.enter.prevent=""
|
||||||
|
>
|
||||||
|
<p v-else>
|
||||||
|
{{ localDescription }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./attachment.js"></script>
|
<script src="./attachment.js"></script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style src="./attachment.scss" lang="scss"></style>
|
||||||
@import '../../_variables.scss';
|
|
||||||
|
|
||||||
.attachments {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
.non-gallery {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.placeholder {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0.3em 1em 0.3em 0;
|
|
||||||
color: $fallback--link;
|
|
||||||
color: var(--postLink, $fallback--link);
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
max-width: 100%;
|
|
||||||
|
|
||||||
svg {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.nsfw-placeholder {
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&.loading {
|
|
||||||
cursor: progress;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.attachment {
|
|
||||||
position: relative;
|
|
||||||
margin-top: 0.5em;
|
|
||||||
align-self: flex-start;
|
|
||||||
line-height: 0;
|
|
||||||
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 1px;
|
|
||||||
border-radius: $fallback--attachmentRadius;
|
|
||||||
border-radius: var(--attachmentRadius, $fallback--attachmentRadius);
|
|
||||||
border-color: $fallback--border;
|
|
||||||
border-color: var(--border, $fallback--border);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.non-gallery.attachment {
|
|
||||||
&.video {
|
|
||||||
flex: 1 0 40%;
|
|
||||||
}
|
|
||||||
.nsfw {
|
|
||||||
height: 260px;
|
|
||||||
}
|
|
||||||
.small {
|
|
||||||
height: 120px;
|
|
||||||
flex-grow: 0;
|
|
||||||
}
|
|
||||||
.video {
|
|
||||||
height: 260px;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
video {
|
|
||||||
max-height: 100%;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fullwidth {
|
|
||||||
flex-basis: 100%;
|
|
||||||
}
|
|
||||||
// fixes small gap below video
|
|
||||||
&.video {
|
|
||||||
line-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-container {
|
|
||||||
display: flex;
|
|
||||||
max-height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.play-icon {
|
|
||||||
position: absolute;
|
|
||||||
font-size: 64px;
|
|
||||||
top: calc(50% - 32px);
|
|
||||||
left: calc(50% - 32px);
|
|
||||||
color: rgba(255, 255, 255, 0.75);
|
|
||||||
text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.play-icon::before {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.html {
|
|
||||||
flex-basis: 90%;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hider {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
margin: 10px;
|
|
||||||
padding: 0;
|
|
||||||
z-index: 4;
|
|
||||||
border-radius: $fallback--tooltipRadius;
|
|
||||||
border-radius: var(--tooltipRadius, $fallback--tooltipRadius);
|
|
||||||
text-align: center;
|
|
||||||
width: 2em;
|
|
||||||
height: 2em;
|
|
||||||
font-size: 1.25em;
|
|
||||||
// TODO: theming? hard to theme with unknown background image color
|
|
||||||
background: rgba(230, 230, 230, 0.7);
|
|
||||||
.svg-inline--fa {
|
|
||||||
color: rgba(0, 0, 0, 0.6);
|
|
||||||
}
|
|
||||||
&:hover .svg-inline--fa {
|
|
||||||
color: rgba(0, 0, 0, 0.9);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
video {
|
|
||||||
z-index: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
audio {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.media-upload {
|
|
||||||
line-height: 0;
|
|
||||||
max-height: 200px;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oembed {
|
|
||||||
line-height: 1.2em;
|
|
||||||
flex: 1 0 100%;
|
|
||||||
width: 100%;
|
|
||||||
margin-right: 15px;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
flex: 1;
|
|
||||||
img {
|
|
||||||
border: 0px;
|
|
||||||
border-radius: 5px;
|
|
||||||
height: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.text {
|
|
||||||
flex: 2;
|
|
||||||
margin: 8px;
|
|
||||||
word-break: break-all;
|
|
||||||
h1 {
|
|
||||||
font-size: 14px;
|
|
||||||
margin: 0px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-attachment {
|
|
||||||
&,
|
|
||||||
& .image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nsfw {
|
|
||||||
object-fit: cover;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
image-orientation: from-image; // NOTE: only FF supports this
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { h, resolveComponent } from 'vue'
|
||||||
import LoginForm from '../login_form/login_form.vue'
|
import LoginForm from '../login_form/login_form.vue'
|
||||||
import MFARecoveryForm from '../mfa_form/recovery_form.vue'
|
import MFARecoveryForm from '../mfa_form/recovery_form.vue'
|
||||||
import MFATOTPForm from '../mfa_form/totp_form.vue'
|
import MFATOTPForm from '../mfa_form/totp_form.vue'
|
||||||
|
@ -5,8 +6,8 @@ import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
const AuthForm = {
|
const AuthForm = {
|
||||||
name: 'AuthForm',
|
name: 'AuthForm',
|
||||||
render (createElement) {
|
render () {
|
||||||
return createElement('component', { is: this.authForm })
|
return h(resolveComponent(this.authForm))
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
authForm () {
|
authForm () {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import UserCard from '../user_card/user_card.vue'
|
import UserCard from '../user_card/user_card.vue'
|
||||||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
import UserAvatar from '../user_avatar/user_avatar.vue'
|
||||||
|
import RichContent from 'src/components/rich_content/rich_content.jsx'
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||||
|
|
||||||
const BasicUserCard = {
|
const BasicUserCard = {
|
||||||
|
@ -13,7 +14,8 @@ const BasicUserCard = {
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
UserCard,
|
UserCard,
|
||||||
UserAvatar
|
UserAvatar,
|
||||||
|
RichContent
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleUserExpanded () {
|
toggleUserExpanded () {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<UserAvatar
|
<UserAvatar
|
||||||
class="avatar"
|
class="avatar"
|
||||||
:user="user"
|
:user="user"
|
||||||
@click.prevent.native="toggleUserExpanded"
|
@click.prevent="toggleUserExpanded"
|
||||||
/>
|
/>
|
||||||
</router-link>
|
</router-link>
|
||||||
<div
|
<div
|
||||||
|
@ -25,17 +25,11 @@
|
||||||
:title="user.name"
|
:title="user.name"
|
||||||
class="basic-user-card-user-name"
|
class="basic-user-card-user-name"
|
||||||
>
|
>
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
<RichContent
|
||||||
<span
|
|
||||||
v-if="user.name_html"
|
|
||||||
class="basic-user-card-user-name-value"
|
class="basic-user-card-user-name-value"
|
||||||
v-html="user.name_html"
|
:html="user.name"
|
||||||
|
:emoji="user.emoji"
|
||||||
/>
|
/>
|
||||||
<!-- eslint-enable vue/no-v-html -->
|
|
||||||
<span
|
|
||||||
v-else
|
|
||||||
class="basic-user-card-user-name-value"
|
|
||||||
>{{ user.name }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<router-link
|
<router-link
|
||||||
|
|
|
@ -9,7 +9,7 @@ const Bookmarks = {
|
||||||
components: {
|
components: {
|
||||||
Timeline
|
Timeline
|
||||||
},
|
},
|
||||||
destroyed () {
|
unmounted () {
|
||||||
this.$store.commit('clearTimeline', { timeline: 'bookmarks' })
|
this.$store.commit('clearTimeline', { timeline: 'bookmarks' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ const Chat = {
|
||||||
})
|
})
|
||||||
this.setChatLayout()
|
this.setChatLayout()
|
||||||
},
|
},
|
||||||
destroyed () {
|
unmounted () {
|
||||||
window.removeEventListener('scroll', this.handleScroll)
|
window.removeEventListener('scroll', this.handleScroll)
|
||||||
window.removeEventListener('resize', this.handleLayoutChange)
|
window.removeEventListener('resize', this.handleLayoutChange)
|
||||||
this.unsetChatLayout()
|
this.unsetChatLayout()
|
||||||
|
|
|
@ -26,73 +26,71 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template>
|
<div
|
||||||
<div
|
ref="scrollable"
|
||||||
ref="scrollable"
|
class="scrollable-message-list"
|
||||||
class="scrollable-message-list"
|
:style="{ height: scrollableContainerHeight }"
|
||||||
:style="{ height: scrollableContainerHeight }"
|
@scroll="handleScroll"
|
||||||
@scroll="handleScroll"
|
>
|
||||||
>
|
<template v-if="!errorLoadingChat">
|
||||||
<template v-if="!errorLoadingChat">
|
<ChatMessage
|
||||||
<ChatMessage
|
v-for="chatViewItem in chatViewItems"
|
||||||
v-for="chatViewItem in chatViewItems"
|
:key="chatViewItem.id"
|
||||||
:key="chatViewItem.id"
|
:author="recipient"
|
||||||
:author="recipient"
|
:chat-view-item="chatViewItem"
|
||||||
:chat-view-item="chatViewItem"
|
:hovered-message-chain="chatViewItem.messageChainId === hoveredMessageChainId"
|
||||||
:hovered-message-chain="chatViewItem.messageChainId === hoveredMessageChainId"
|
@hover="onMessageHover"
|
||||||
@hover="onMessageHover"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="chat-loading-error"
|
|
||||||
>
|
|
||||||
<div class="alert error">
|
|
||||||
{{ $t('chats.error_loading_chat') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
ref="footer"
|
|
||||||
class="panel-body footer"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="jump-to-bottom-button"
|
|
||||||
:class="{ 'visible': jumpToBottomButtonVisible }"
|
|
||||||
@click="scrollDown({ behavior: 'smooth' })"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<FAIcon icon="chevron-down" />
|
|
||||||
<div
|
|
||||||
v-if="newMessageCount"
|
|
||||||
class="badge badge-notification unread-chat-count unread-message-count"
|
|
||||||
>
|
|
||||||
{{ newMessageCount }}
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<PostStatusForm
|
|
||||||
:disable-subject="true"
|
|
||||||
:disable-scope-selector="true"
|
|
||||||
:disable-notice="true"
|
|
||||||
:disable-lock-warning="true"
|
|
||||||
:disable-polls="true"
|
|
||||||
:disable-sensitivity-checkbox="true"
|
|
||||||
:disable-submit="errorLoadingChat || !currentChat"
|
|
||||||
:disable-preview="true"
|
|
||||||
:optimistic-posting="true"
|
|
||||||
:post-handler="sendMessage"
|
|
||||||
:submit-on-enter="!mobileLayout"
|
|
||||||
:preserve-focus="!mobileLayout"
|
|
||||||
:auto-focus="!mobileLayout"
|
|
||||||
:placeholder="formPlaceholder"
|
|
||||||
:file-limit="1"
|
|
||||||
max-height="160"
|
|
||||||
emoji-picker-placement="top"
|
|
||||||
@resize="handleResize"
|
|
||||||
/>
|
/>
|
||||||
|
</template>
|
||||||
|
<div
|
||||||
|
v-else
|
||||||
|
class="chat-loading-error"
|
||||||
|
>
|
||||||
|
<div class="alert error">
|
||||||
|
{{ $t('chats.error_loading_chat') }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</div>
|
||||||
|
<div
|
||||||
|
ref="footer"
|
||||||
|
class="panel-body footer"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="jump-to-bottom-button"
|
||||||
|
:class="{ 'visible': jumpToBottomButtonVisible }"
|
||||||
|
@click="scrollDown({ behavior: 'smooth' })"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
<FAIcon icon="chevron-down" />
|
||||||
|
<div
|
||||||
|
v-if="newMessageCount"
|
||||||
|
class="badge badge-notification unread-chat-count unread-message-count"
|
||||||
|
>
|
||||||
|
{{ newMessageCount }}
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<PostStatusForm
|
||||||
|
:disable-subject="true"
|
||||||
|
:disable-scope-selector="true"
|
||||||
|
:disable-notice="true"
|
||||||
|
:disable-lock-warning="true"
|
||||||
|
:disable-polls="true"
|
||||||
|
:disable-sensitivity-checkbox="true"
|
||||||
|
:disable-submit="errorLoadingChat || !currentChat"
|
||||||
|
:disable-preview="true"
|
||||||
|
:optimistic-posting="true"
|
||||||
|
:post-handler="sendMessage"
|
||||||
|
:submit-on-enter="!mobileLayout"
|
||||||
|
:preserve-focus="!mobileLayout"
|
||||||
|
:auto-focus="!mobileLayout"
|
||||||
|
:placeholder="formPlaceholder"
|
||||||
|
:file-limit="1"
|
||||||
|
max-height="160"
|
||||||
|
emoji-picker-placement="top"
|
||||||
|
@resize="handleResize"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,10 +23,7 @@
|
||||||
class="timeline"
|
class="timeline"
|
||||||
>
|
>
|
||||||
<List :items="sortedChatList">
|
<List :items="sortedChatList">
|
||||||
<template
|
<template v-slot:item="{item}">
|
||||||
slot="item"
|
|
||||||
slot-scope="{item}"
|
|
||||||
>
|
|
||||||
<ChatListItem
|
<ChatListItem
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:compact="false"
|
:compact="false"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import StatusContent from '../status_content/status_content.vue'
|
import StatusBody from '../status_content/status_content.vue'
|
||||||
import fileType from 'src/services/file_type/file_type.service'
|
import fileType from 'src/services/file_type/file_type.service'
|
||||||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
import UserAvatar from '../user_avatar/user_avatar.vue'
|
||||||
import AvatarList from '../avatar_list/avatar_list.vue'
|
import AvatarList from '../avatar_list/avatar_list.vue'
|
||||||
|
@ -16,7 +16,7 @@ const ChatListItem = {
|
||||||
AvatarList,
|
AvatarList,
|
||||||
Timeago,
|
Timeago,
|
||||||
ChatTitle,
|
ChatTitle,
|
||||||
StatusContent
|
StatusBody
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
|
@ -38,12 +38,14 @@ const ChatListItem = {
|
||||||
},
|
},
|
||||||
messageForStatusContent () {
|
messageForStatusContent () {
|
||||||
const message = this.chat.lastMessage
|
const message = this.chat.lastMessage
|
||||||
|
const messageEmojis = message ? message.emojis : []
|
||||||
const isYou = message && message.account_id === this.currentUser.id
|
const isYou = message && message.account_id === this.currentUser.id
|
||||||
const content = message ? (this.attachmentInfo || message.content) : ''
|
const content = message ? (this.attachmentInfo || message.content) : ''
|
||||||
const messagePreview = isYou ? `<i>${this.$t('chats.you')}</i> ${content}` : content
|
const messagePreview = isYou ? `<i>${this.$t('chats.you')}</i> ${content}` : content
|
||||||
return {
|
return {
|
||||||
summary: '',
|
summary: '',
|
||||||
statusnet_html: messagePreview,
|
emojis: messageEmojis,
|
||||||
|
raw_html: messagePreview,
|
||||||
text: messagePreview,
|
text: messagePreview,
|
||||||
attachments: []
|
attachments: []
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,18 +77,15 @@
|
||||||
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
|
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
|
||||||
}
|
}
|
||||||
|
|
||||||
.StatusContent {
|
.chat-preview-body {
|
||||||
img.emoji {
|
--emoji-size: 1.4em;
|
||||||
width: 1.4em;
|
|
||||||
height: 1.4em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.time-wrapper {
|
.time-wrapper {
|
||||||
line-height: 1.4em;
|
line-height: 1.4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single-line {
|
.chat-preview-body {
|
||||||
padding-right: 1em;
|
padding-right: 1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-preview">
|
<div class="chat-preview">
|
||||||
<StatusContent
|
<StatusBody
|
||||||
|
class="chat-preview-body"
|
||||||
:status="messageForStatusContent"
|
:status="messageForStatusContent"
|
||||||
:single-line="true"
|
:single-line="true"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -27,6 +27,7 @@ const ChatMessage = {
|
||||||
'chatViewItem',
|
'chatViewItem',
|
||||||
'hoveredMessageChain'
|
'hoveredMessageChain'
|
||||||
],
|
],
|
||||||
|
emits: ['hover'],
|
||||||
components: {
|
components: {
|
||||||
Popover,
|
Popover,
|
||||||
Attachment,
|
Attachment,
|
||||||
|
@ -57,8 +58,9 @@ const ChatMessage = {
|
||||||
messageForStatusContent () {
|
messageForStatusContent () {
|
||||||
return {
|
return {
|
||||||
summary: '',
|
summary: '',
|
||||||
statusnet_html: this.message.content,
|
emojis: this.message.emojis,
|
||||||
text: this.message.content,
|
raw_html: this.message.content || '',
|
||||||
|
text: this.message.content || '',
|
||||||
attachments: this.message.attachments
|
attachments: this.message.attachments
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
@import '../../_variables.scss';
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
.chat-message-wrapper {
|
.chat-message-wrapper {
|
||||||
|
|
||||||
&.hovered-message-chain {
|
&.hovered-message-chain {
|
||||||
.animated.Avatar {
|
.animated.Avatar {
|
||||||
canvas {
|
canvas {
|
||||||
|
@ -40,6 +41,12 @@
|
||||||
.chat-message {
|
.chat-message {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-bottom: 0.5em;
|
padding-bottom: 0.5em;
|
||||||
|
|
||||||
|
.status-body:hover {
|
||||||
|
--_still-image-img-visibility: visible;
|
||||||
|
--_still-image-canvas-visibility: hidden;
|
||||||
|
--_still-image-label-visibility: hidden;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar-wrapper {
|
.avatar-wrapper {
|
||||||
|
@ -62,10 +69,6 @@
|
||||||
&.with-media {
|
&.with-media {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.gallery-row {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@ -89,8 +92,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.without-attachment {
|
.without-attachment {
|
||||||
.status-content {
|
.message-content {
|
||||||
&::after {
|
// TODO figure out how to do it properly
|
||||||
|
.RichContent::after {
|
||||||
margin-right: 5.4em;
|
margin-right: 5.4em;
|
||||||
content: " ";
|
content: " ";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -162,6 +166,7 @@
|
||||||
.visible {
|
.visible {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-message-date-separator {
|
.chat-message-date-separator {
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
@show="menuOpened = true"
|
@show="menuOpened = true"
|
||||||
@close="menuOpened = false"
|
@close="menuOpened = false"
|
||||||
>
|
>
|
||||||
<div slot="content">
|
<template v-slot:content>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<button
|
<button
|
||||||
class="button-default dropdown-item dropdown-item-icon"
|
class="button-default dropdown-item dropdown-item-icon"
|
||||||
|
@ -59,26 +59,29 @@
|
||||||
<FAIcon icon="times" /> {{ $t("chats.delete") }}
|
<FAIcon icon="times" /> {{ $t("chats.delete") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
<button
|
<template v-slot:trigger>
|
||||||
slot="trigger"
|
<button
|
||||||
class="button-default menu-icon"
|
class="button-default menu-icon"
|
||||||
:title="$t('chats.more')"
|
:title="$t('chats.more')"
|
||||||
>
|
>
|
||||||
<FAIcon icon="ellipsis-h" />
|
<FAIcon icon="ellipsis-h" />
|
||||||
</button>
|
</button>
|
||||||
|
</template>
|
||||||
</Popover>
|
</Popover>
|
||||||
</div>
|
</div>
|
||||||
<StatusContent
|
<StatusContent
|
||||||
|
class="message-content"
|
||||||
:status="messageForStatusContent"
|
:status="messageForStatusContent"
|
||||||
:full-content="true"
|
:full-content="true"
|
||||||
>
|
>
|
||||||
<span
|
<template v-slot:footer>
|
||||||
slot="footer"
|
<span
|
||||||
class="created-at"
|
class="created-at"
|
||||||
>
|
>
|
||||||
{{ createdAt }}
|
{{ createdAt }}
|
||||||
</span>
|
</span>
|
||||||
|
</template>
|
||||||
</StatusContent>
|
</StatusContent>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import Vue from 'vue'
|
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
import UserAvatar from '../user_avatar/user_avatar.vue'
|
||||||
|
import RichContent from 'src/components/rich_content/rich_content.jsx'
|
||||||
|
|
||||||
export default Vue.component('chat-title', {
|
export default {
|
||||||
name: 'ChatTitle',
|
name: 'ChatTitle',
|
||||||
components: {
|
components: {
|
||||||
UserAvatar
|
UserAvatar,
|
||||||
|
RichContent
|
||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
'user', 'withAvatar'
|
'user', 'withAvatar'
|
||||||
|
@ -23,4 +24,4 @@ export default Vue.component('chat-title', {
|
||||||
return generateProfileLink(user.id, user.screen_name)
|
return generateProfileLink(user.id, user.screen_name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
|
||||||
<div
|
<div
|
||||||
class="chat-title"
|
class="chat-title"
|
||||||
:title="title"
|
:title="title"
|
||||||
|
@ -14,12 +13,14 @@
|
||||||
height="23px"
|
height="23px"
|
||||||
/>
|
/>
|
||||||
</router-link>
|
</router-link>
|
||||||
<span
|
<RichContent
|
||||||
|
v-if="user"
|
||||||
class="username"
|
class="username"
|
||||||
v-html="htmlTitle"
|
:title="'@'+user.screen_name_ui"
|
||||||
|
:html="htmlTitle"
|
||||||
|
:emoji="user.emoji || []"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- eslint-enable vue/no-v-html -->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./chat_title.js"></script>
|
<script src="./chat_title.js"></script>
|
||||||
|
@ -34,6 +35,8 @@
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
--emoji-size: 14px;
|
||||||
|
|
||||||
.username {
|
.username {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
@ -41,14 +44,6 @@
|
||||||
display: inline;
|
display: inline;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
.emoji {
|
|
||||||
width: 14px;
|
|
||||||
height: 14px;
|
|
||||||
vertical-align: middle;
|
|
||||||
object-fit: contain
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.Avatar {
|
.Avatar {
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:checked="checked"
|
:checked="modelValue"
|
||||||
:indeterminate.prop="indeterminate"
|
:indeterminate="indeterminate"
|
||||||
@change="$emit('change', $event.target.checked)"
|
@change="$emit('update:modelValue', $event.target.checked)"
|
||||||
>
|
>
|
||||||
<i class="checkbox-indicator" />
|
<i class="checkbox-indicator" />
|
||||||
<span
|
<span
|
||||||
|
@ -22,12 +22,9 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
model: {
|
emits: ['update:modelValue'],
|
||||||
prop: 'checked',
|
|
||||||
event: 'change'
|
|
||||||
},
|
|
||||||
props: [
|
props: [
|
||||||
'checked',
|
'modelValue',
|
||||||
'indeterminate',
|
'indeterminate',
|
||||||
'disabled'
|
'disabled'
|
||||||
]
|
]
|
||||||
|
|
|
@ -11,28 +11,28 @@
|
||||||
</label>
|
</label>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
v-if="typeof fallback !== 'undefined' && showOptionalTickbox"
|
v-if="typeof fallback !== 'undefined' && showOptionalTickbox"
|
||||||
:checked="present"
|
:model-value="present"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
class="opt"
|
class="opt"
|
||||||
@change="$emit('input', typeof value === 'undefined' ? fallback : undefined)"
|
@update:modelValue="$emit('update:modelValue', typeof modelValue === 'undefined' ? fallback : undefined)"
|
||||||
/>
|
/>
|
||||||
<div class="input color-input-field">
|
<div class="input color-input-field">
|
||||||
<input
|
<input
|
||||||
:id="name + '-t'"
|
:id="name + '-t'"
|
||||||
class="textColor unstyled"
|
class="textColor unstyled"
|
||||||
type="text"
|
type="text"
|
||||||
:value="value || fallback"
|
:value="modelValue || fallback"
|
||||||
:disabled="!present || disabled"
|
:disabled="!present || disabled"
|
||||||
@input="$emit('input', $event.target.value)"
|
@input="$emit('update:modelValue', $event.target.value)"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
v-if="validColor"
|
v-if="validColor"
|
||||||
:id="name"
|
:id="name"
|
||||||
class="nativeColor unstyled"
|
class="nativeColor unstyled"
|
||||||
type="color"
|
type="color"
|
||||||
:value="value || fallback"
|
:value="modelValue || fallback"
|
||||||
:disabled="!present || disabled"
|
:disabled="!present || disabled"
|
||||||
@input="$emit('input', $event.target.value)"
|
@input="$emit('update:modelValue', $event.target.value)"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="transparentColor"
|
v-if="transparentColor"
|
||||||
|
@ -67,7 +67,7 @@ export default {
|
||||||
},
|
},
|
||||||
// Color value, should be required but vue cannot tell the difference
|
// Color value, should be required but vue cannot tell the difference
|
||||||
// between "property missing" and "property set to undefined"
|
// between "property missing" and "property set to undefined"
|
||||||
value: {
|
modelValue: {
|
||||||
required: false,
|
required: false,
|
||||||
type: String,
|
type: String,
|
||||||
default: undefined
|
default: undefined
|
||||||
|
@ -91,18 +91,19 @@ export default {
|
||||||
default: true
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['update:modelValue'],
|
||||||
computed: {
|
computed: {
|
||||||
present () {
|
present () {
|
||||||
return typeof this.value !== 'undefined'
|
return typeof this.modelValue !== 'undefined'
|
||||||
},
|
},
|
||||||
validColor () {
|
validColor () {
|
||||||
return hex2rgb(this.value || this.fallback)
|
return hex2rgb(this.modelValue || this.fallback)
|
||||||
},
|
},
|
||||||
transparentColor () {
|
transparentColor () {
|
||||||
return this.value === 'transparent'
|
return this.modelValue === 'transparent'
|
||||||
},
|
},
|
||||||
computedColor () {
|
computedColor () {
|
||||||
return this.value && this.value.startsWith('--')
|
return this.modelValue && this.modelValue.startsWith('--')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,19 @@
|
||||||
import { reduce, filter, findIndex, clone, get } from 'lodash'
|
import { reduce, filter, findIndex, clone, get } from 'lodash'
|
||||||
import Status from '../status/status.vue'
|
import Status from '../status/status.vue'
|
||||||
|
import ThreadTree from '../thread_tree/thread_tree.vue'
|
||||||
|
|
||||||
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import {
|
||||||
|
faAngleDoubleDown,
|
||||||
|
faAngleDoubleLeft,
|
||||||
|
faChevronLeft
|
||||||
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
|
library.add(
|
||||||
|
faAngleDoubleDown,
|
||||||
|
faAngleDoubleLeft,
|
||||||
|
faChevronLeft
|
||||||
|
)
|
||||||
|
|
||||||
const sortById = (a, b) => {
|
const sortById = (a, b) => {
|
||||||
const idA = a.type === 'retweet' ? a.retweeted_status.id : a.id
|
const idA = a.type === 'retweet' ? a.retweeted_status.id : a.id
|
||||||
|
@ -35,7 +49,10 @@ const conversation = {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
highlight: null,
|
highlight: null,
|
||||||
expanded: false
|
expanded: false,
|
||||||
|
threadDisplayStatusObject: {}, // id => 'showing' | 'hidden'
|
||||||
|
statusContentPropertiesObject: {},
|
||||||
|
inlineDivePosition: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
|
@ -53,12 +70,50 @@ const conversation = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hideStatus () {
|
maxDepthToShowByDefault () {
|
||||||
if (this.$refs.statusComponent && this.$refs.statusComponent[0]) {
|
// maxDepthInThread = max number of depths that is *visible*
|
||||||
return this.virtualHidden && this.$refs.statusComponent[0].suspendable
|
// since our depth starts with 0 and "showing" means "showing children"
|
||||||
} else {
|
// there is a -2 here
|
||||||
return this.virtualHidden
|
const maxDepth = this.$store.getters.mergedConfig.maxDepthInThread - 2
|
||||||
|
return maxDepth >= 1 ? maxDepth : 1
|
||||||
|
},
|
||||||
|
displayStyle () {
|
||||||
|
return this.$store.getters.mergedConfig.conversationDisplay
|
||||||
|
},
|
||||||
|
isTreeView () {
|
||||||
|
return !this.isLinearView
|
||||||
|
},
|
||||||
|
treeViewIsSimple () {
|
||||||
|
return !this.$store.getters.mergedConfig.conversationTreeAdvanced
|
||||||
|
},
|
||||||
|
isLinearView () {
|
||||||
|
return this.displayStyle === 'linear'
|
||||||
|
},
|
||||||
|
shouldFadeAncestors () {
|
||||||
|
return this.$store.getters.mergedConfig.conversationTreeFadeAncestors
|
||||||
|
},
|
||||||
|
otherRepliesButtonPosition () {
|
||||||
|
return this.$store.getters.mergedConfig.conversationOtherRepliesButton
|
||||||
|
},
|
||||||
|
showOtherRepliesButtonBelowStatus () {
|
||||||
|
return this.otherRepliesButtonPosition === 'below'
|
||||||
|
},
|
||||||
|
showOtherRepliesButtonInsideStatus () {
|
||||||
|
return this.otherRepliesButtonPosition === 'inside'
|
||||||
|
},
|
||||||
|
suspendable () {
|
||||||
|
if (this.isTreeView) {
|
||||||
|
return Object.entries(this.statusContentProperties)
|
||||||
|
.every(([k, prop]) => !prop.replying && prop.mediaPlaying.length === 0)
|
||||||
}
|
}
|
||||||
|
if (this.$refs.statusComponent && this.$refs.statusComponent[0]) {
|
||||||
|
return this.$refs.statusComponent.every(s => s.suspendable)
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hideStatus () {
|
||||||
|
return this.virtualHidden && this.suspendable
|
||||||
},
|
},
|
||||||
status () {
|
status () {
|
||||||
return this.$store.state.statuses.allStatusesObject[this.statusId]
|
return this.$store.state.statuses.allStatusesObject[this.statusId]
|
||||||
|
@ -90,6 +145,121 @@ const conversation = {
|
||||||
|
|
||||||
return sortAndFilterConversation(conversation, this.status)
|
return sortAndFilterConversation(conversation, this.status)
|
||||||
},
|
},
|
||||||
|
statusMap () {
|
||||||
|
return this.conversation.reduce((res, s) => {
|
||||||
|
res[s.id] = s
|
||||||
|
return res
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
|
threadTree () {
|
||||||
|
const reverseLookupTable = this.conversation.reduce((table, status, index) => {
|
||||||
|
table[status.id] = index
|
||||||
|
return table
|
||||||
|
}, {})
|
||||||
|
|
||||||
|
const threads = this.conversation.reduce((a, cur) => {
|
||||||
|
const id = cur.id
|
||||||
|
a.forest[id] = this.getReplies(id)
|
||||||
|
.map(s => s.id)
|
||||||
|
|
||||||
|
return a
|
||||||
|
}, {
|
||||||
|
forest: {}
|
||||||
|
})
|
||||||
|
|
||||||
|
const walk = (forest, topLevel, depth = 0, processed = {}) => topLevel.map(id => {
|
||||||
|
if (processed[id]) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
processed[id] = true
|
||||||
|
return [{
|
||||||
|
status: this.conversation[reverseLookupTable[id]],
|
||||||
|
id,
|
||||||
|
depth
|
||||||
|
}, walk(forest, forest[id], depth + 1, processed)].reduce((a, b) => a.concat(b), [])
|
||||||
|
}).reduce((a, b) => a.concat(b), [])
|
||||||
|
|
||||||
|
const linearized = walk(threads.forest, this.topLevel.map(k => k.id))
|
||||||
|
|
||||||
|
return linearized
|
||||||
|
},
|
||||||
|
replyIds () {
|
||||||
|
return this.conversation.map(k => k.id)
|
||||||
|
.reduce((res, id) => {
|
||||||
|
res[id] = (this.replies[id] || []).map(k => k.id)
|
||||||
|
return res
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
|
totalReplyCount () {
|
||||||
|
const sizes = {}
|
||||||
|
const subTreeSizeFor = (id) => {
|
||||||
|
if (sizes[id]) {
|
||||||
|
return sizes[id]
|
||||||
|
}
|
||||||
|
sizes[id] = 1 + this.replyIds[id].map(cid => subTreeSizeFor(cid)).reduce((a, b) => a + b, 0)
|
||||||
|
return sizes[id]
|
||||||
|
}
|
||||||
|
this.conversation.map(k => k.id).map(subTreeSizeFor)
|
||||||
|
return Object.keys(sizes).reduce((res, id) => {
|
||||||
|
res[id] = sizes[id] - 1 // exclude itself
|
||||||
|
return res
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
|
totalReplyDepth () {
|
||||||
|
const depths = {}
|
||||||
|
const subTreeDepthFor = (id) => {
|
||||||
|
if (depths[id]) {
|
||||||
|
return depths[id]
|
||||||
|
}
|
||||||
|
depths[id] = 1 + this.replyIds[id].map(cid => subTreeDepthFor(cid)).reduce((a, b) => a > b ? a : b, 0)
|
||||||
|
return depths[id]
|
||||||
|
}
|
||||||
|
this.conversation.map(k => k.id).map(subTreeDepthFor)
|
||||||
|
return Object.keys(depths).reduce((res, id) => {
|
||||||
|
res[id] = depths[id] - 1 // exclude itself
|
||||||
|
return res
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
|
depths () {
|
||||||
|
return this.threadTree.reduce((a, k) => {
|
||||||
|
a[k.id] = k.depth
|
||||||
|
return a
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
|
topLevel () {
|
||||||
|
const topLevel = this.conversation.reduce((tl, cur) =>
|
||||||
|
tl.filter(k => this.getReplies(cur.id).map(v => v.id).indexOf(k.id) === -1), this.conversation)
|
||||||
|
return topLevel
|
||||||
|
},
|
||||||
|
otherTopLevelCount () {
|
||||||
|
return this.topLevel.length - 1
|
||||||
|
},
|
||||||
|
showingTopLevel () {
|
||||||
|
if (this.canDive && this.diveRoot) {
|
||||||
|
return [this.statusMap[this.diveRoot]]
|
||||||
|
}
|
||||||
|
return this.topLevel
|
||||||
|
},
|
||||||
|
diveRoot () {
|
||||||
|
const statusId = this.inlineDivePosition || this.statusId
|
||||||
|
const isTopLevel = !this.parentOf(statusId)
|
||||||
|
return isTopLevel ? null : statusId
|
||||||
|
},
|
||||||
|
diveDepth () {
|
||||||
|
return this.canDive && this.diveRoot ? this.depths[this.diveRoot] : 0
|
||||||
|
},
|
||||||
|
diveMode () {
|
||||||
|
return this.canDive && !!this.diveRoot
|
||||||
|
},
|
||||||
|
shouldShowAllConversationButton () {
|
||||||
|
// The "show all conversation" button tells the user that there exist
|
||||||
|
// other toplevel statuses, so do not show it if there is only a single root
|
||||||
|
return this.isTreeView && this.isExpanded && this.diveMode && this.topLevel.length > 1
|
||||||
|
},
|
||||||
|
shouldShowAncestors () {
|
||||||
|
return this.isTreeView && this.isExpanded && this.ancestorsOf(this.diveRoot).length
|
||||||
|
},
|
||||||
replies () {
|
replies () {
|
||||||
let i = 1
|
let i = 1
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
|
@ -109,15 +279,71 @@ const conversation = {
|
||||||
}, {})
|
}, {})
|
||||||
},
|
},
|
||||||
isExpanded () {
|
isExpanded () {
|
||||||
return this.expanded || this.isPage
|
return !!(this.expanded || this.isPage)
|
||||||
},
|
},
|
||||||
hiddenStyle () {
|
hiddenStyle () {
|
||||||
const height = (this.status && this.status.virtualHeight) || '120px'
|
const height = (this.status && this.status.virtualHeight) || '120px'
|
||||||
return this.virtualHidden ? { height } : {}
|
return this.virtualHidden ? { height } : {}
|
||||||
|
},
|
||||||
|
threadDisplayStatus () {
|
||||||
|
return this.conversation.reduce((a, k) => {
|
||||||
|
const id = k.id
|
||||||
|
const depth = this.depths[id]
|
||||||
|
const status = (() => {
|
||||||
|
if (this.threadDisplayStatusObject[id]) {
|
||||||
|
return this.threadDisplayStatusObject[id]
|
||||||
|
}
|
||||||
|
if ((depth - this.diveDepth) <= this.maxDepthToShowByDefault) {
|
||||||
|
return 'showing'
|
||||||
|
} else {
|
||||||
|
return 'hidden'
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
|
a[id] = status
|
||||||
|
return a
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
|
statusContentProperties () {
|
||||||
|
return this.conversation.reduce((a, k) => {
|
||||||
|
const id = k.id
|
||||||
|
const props = (() => {
|
||||||
|
const def = {
|
||||||
|
showingTall: false,
|
||||||
|
expandingSubject: false,
|
||||||
|
showingLongSubject: false,
|
||||||
|
isReplying: false,
|
||||||
|
mediaPlaying: []
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.statusContentPropertiesObject[id]) {
|
||||||
|
return {
|
||||||
|
...def,
|
||||||
|
...this.statusContentPropertiesObject[id]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return def
|
||||||
|
})()
|
||||||
|
|
||||||
|
a[id] = props
|
||||||
|
return a
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
|
canDive () {
|
||||||
|
return this.isTreeView && this.isExpanded
|
||||||
|
},
|
||||||
|
focused () {
|
||||||
|
return (id) => {
|
||||||
|
return (this.isExpanded) && id === this.highlight
|
||||||
|
}
|
||||||
|
},
|
||||||
|
maybeHighlight () {
|
||||||
|
return this.isExpanded ? this.highlight : null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Status
|
Status,
|
||||||
|
ThreadTree
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
statusId (newVal, oldVal) {
|
statusId (newVal, oldVal) {
|
||||||
|
@ -132,6 +358,8 @@ const conversation = {
|
||||||
expanded (value) {
|
expanded (value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
this.fetchConversation()
|
this.fetchConversation()
|
||||||
|
} else {
|
||||||
|
this.resetDisplayState()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
virtualHidden (value) {
|
virtualHidden (value) {
|
||||||
|
@ -161,8 +389,8 @@ const conversation = {
|
||||||
getReplies (id) {
|
getReplies (id) {
|
||||||
return this.replies[id] || []
|
return this.replies[id] || []
|
||||||
},
|
},
|
||||||
focused (id) {
|
getHighlight () {
|
||||||
return (this.isExpanded) && id === this.statusId
|
return this.isExpanded ? this.highlight : null
|
||||||
},
|
},
|
||||||
setHighlight (id) {
|
setHighlight (id) {
|
||||||
if (!id) return
|
if (!id) return
|
||||||
|
@ -170,15 +398,139 @@ const conversation = {
|
||||||
this.$store.dispatch('fetchFavsAndRepeats', id)
|
this.$store.dispatch('fetchFavsAndRepeats', id)
|
||||||
this.$store.dispatch('fetchEmojiReactionsBy', id)
|
this.$store.dispatch('fetchEmojiReactionsBy', id)
|
||||||
},
|
},
|
||||||
getHighlight () {
|
|
||||||
return this.isExpanded ? this.highlight : null
|
|
||||||
},
|
|
||||||
toggleExpanded () {
|
toggleExpanded () {
|
||||||
this.expanded = !this.expanded
|
this.expanded = !this.expanded
|
||||||
},
|
},
|
||||||
getConversationId (statusId) {
|
getConversationId (statusId) {
|
||||||
const status = this.$store.state.statuses.allStatusesObject[statusId]
|
const status = this.$store.state.statuses.allStatusesObject[statusId]
|
||||||
return get(status, 'retweeted_status.statusnet_conversation_id', get(status, 'statusnet_conversation_id'))
|
return get(status, 'retweeted_status.statusnet_conversation_id', get(status, 'statusnet_conversation_id'))
|
||||||
|
},
|
||||||
|
setThreadDisplay (id, nextStatus) {
|
||||||
|
this.threadDisplayStatusObject = {
|
||||||
|
...this.threadDisplayStatusObject,
|
||||||
|
[id]: nextStatus
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toggleThreadDisplay (id) {
|
||||||
|
const curStatus = this.threadDisplayStatus[id]
|
||||||
|
const nextStatus = curStatus === 'showing' ? 'hidden' : 'showing'
|
||||||
|
this.setThreadDisplay(id, nextStatus)
|
||||||
|
},
|
||||||
|
setThreadDisplayRecursively (id, nextStatus) {
|
||||||
|
this.setThreadDisplay(id, nextStatus)
|
||||||
|
this.getReplies(id).map(k => k.id).map(id => this.setThreadDisplayRecursively(id, nextStatus))
|
||||||
|
},
|
||||||
|
showThreadRecursively (id) {
|
||||||
|
this.setThreadDisplayRecursively(id, 'showing')
|
||||||
|
},
|
||||||
|
setStatusContentProperty (id, name, value) {
|
||||||
|
this.statusContentPropertiesObject = {
|
||||||
|
...this.statusContentPropertiesObject,
|
||||||
|
[id]: {
|
||||||
|
...this.statusContentPropertiesObject[id],
|
||||||
|
[name]: value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toggleStatusContentProperty (id, name) {
|
||||||
|
this.setStatusContentProperty(id, name, !this.statusContentProperties[id][name])
|
||||||
|
},
|
||||||
|
leastVisibleAncestor (id) {
|
||||||
|
let cur = id
|
||||||
|
let parent = this.parentOf(cur)
|
||||||
|
while (cur) {
|
||||||
|
// if the parent is showing it means cur is visible
|
||||||
|
if (this.threadDisplayStatus[parent] === 'showing') {
|
||||||
|
return cur
|
||||||
|
}
|
||||||
|
parent = this.parentOf(parent)
|
||||||
|
cur = this.parentOf(cur)
|
||||||
|
}
|
||||||
|
// nothing found, fall back to toplevel
|
||||||
|
return this.topLevel[0] ? this.topLevel[0].id : undefined
|
||||||
|
},
|
||||||
|
diveIntoStatus (id, preventScroll) {
|
||||||
|
this.tryScrollTo(id)
|
||||||
|
},
|
||||||
|
diveToTopLevel () {
|
||||||
|
this.tryScrollTo(this.topLevelAncestorOrSelfId(this.diveRoot) || this.topLevel[0].id)
|
||||||
|
},
|
||||||
|
// only used when we are not on a page
|
||||||
|
undive () {
|
||||||
|
this.inlineDivePosition = null
|
||||||
|
this.setHighlight(this.statusId)
|
||||||
|
},
|
||||||
|
tryScrollTo (id) {
|
||||||
|
if (!id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.isPage) {
|
||||||
|
// set statusId
|
||||||
|
this.$router.push({ name: 'conversation', params: { id } })
|
||||||
|
} else {
|
||||||
|
this.inlineDivePosition = id
|
||||||
|
}
|
||||||
|
// Because the conversation can be unmounted when out of sight
|
||||||
|
// and mounted again when it comes into sight,
|
||||||
|
// the `mounted` or `created` function in `status` should not
|
||||||
|
// contain scrolling calls, as we do not want the page to jump
|
||||||
|
// when we scroll with an expanded conversation.
|
||||||
|
//
|
||||||
|
// Now the method is to rely solely on the `highlight` watcher
|
||||||
|
// in `status` components.
|
||||||
|
// In linear views, all statuses are rendered at all times, but
|
||||||
|
// in tree views, it is possible that a change in active status
|
||||||
|
// removes and adds status components (e.g. an originally child
|
||||||
|
// status becomes an ancestor status, and thus they will be
|
||||||
|
// different).
|
||||||
|
// Here, let the components be rendered first, in order to trigger
|
||||||
|
// the `highlight` watcher.
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.setHighlight(id)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goToCurrent () {
|
||||||
|
this.tryScrollTo(this.diveRoot || this.topLevel[0].id)
|
||||||
|
},
|
||||||
|
statusById (id) {
|
||||||
|
return this.statusMap[id]
|
||||||
|
},
|
||||||
|
parentOf (id) {
|
||||||
|
const status = this.statusById(id)
|
||||||
|
if (!status) {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
const { in_reply_to_status_id: parentId } = status
|
||||||
|
if (!this.statusMap[parentId]) {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
return parentId
|
||||||
|
},
|
||||||
|
parentOrSelf (id) {
|
||||||
|
return this.parentOf(id) || id
|
||||||
|
},
|
||||||
|
// Ancestors of some status, from top to bottom
|
||||||
|
ancestorsOf (id) {
|
||||||
|
const ancestors = []
|
||||||
|
let cur = this.parentOf(id)
|
||||||
|
while (cur) {
|
||||||
|
ancestors.unshift(this.statusMap[cur])
|
||||||
|
cur = this.parentOf(cur)
|
||||||
|
}
|
||||||
|
return ancestors
|
||||||
|
},
|
||||||
|
topLevelAncestorOrSelfId (id) {
|
||||||
|
let cur = id
|
||||||
|
let parent = this.parentOf(id)
|
||||||
|
while (parent) {
|
||||||
|
cur = this.parentOf(cur)
|
||||||
|
parent = this.parentOf(parent)
|
||||||
|
}
|
||||||
|
return cur
|
||||||
|
},
|
||||||
|
resetDisplayState () {
|
||||||
|
this.undive()
|
||||||
|
this.threadDisplayStatusObject = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,24 +18,176 @@
|
||||||
{{ $t('timeline.collapse') }}
|
{{ $t('timeline.collapse') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<status
|
<div class="conversation-body panel-body">
|
||||||
v-for="status in conversation"
|
<div
|
||||||
:key="status.id"
|
v-if="isTreeView"
|
||||||
ref="statusComponent"
|
class="thread-body"
|
||||||
:inline-expanded="collapsable && isExpanded"
|
>
|
||||||
:statusoid="status"
|
<div
|
||||||
:expandable="!isExpanded"
|
v-if="shouldShowAllConversationButton"
|
||||||
:show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
|
class="conversation-dive-to-top-level-box"
|
||||||
:focused="focused(status.id)"
|
>
|
||||||
:in-conversation="isExpanded"
|
<i18n-t
|
||||||
:highlight="getHighlight()"
|
keypath="status.show_all_conversation_with_icon"
|
||||||
:replies="getReplies(status.id)"
|
tag="button"
|
||||||
:in-profile="inProfile"
|
class="button-unstyled -link"
|
||||||
:profile-user-id="profileUserId"
|
@click.prevent="diveToTopLevel"
|
||||||
class="conversation-status status-fadein panel-body"
|
scope="global"
|
||||||
@goto="setHighlight"
|
>
|
||||||
@toggleExpanded="toggleExpanded"
|
<template #icon>
|
||||||
/>
|
<FAIcon
|
||||||
|
icon="angle-double-left"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #text>
|
||||||
|
<span>
|
||||||
|
{{ $tc('status.show_all_conversation', otherTopLevelCount, { numStatus: otherTopLevelCount }) }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</i18n-t>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="shouldShowAncestors"
|
||||||
|
class="thread-ancestors"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-for="status in ancestorsOf(diveRoot)"
|
||||||
|
:key="status.id"
|
||||||
|
class="thread-ancestor"
|
||||||
|
:class="{'thread-ancestor-has-other-replies': getReplies(status.id).length > 1, '-faded': shouldFadeAncestors}"
|
||||||
|
>
|
||||||
|
<status
|
||||||
|
ref="statusComponent"
|
||||||
|
:inline-expanded="collapsable && isExpanded"
|
||||||
|
:statusoid="status"
|
||||||
|
:expandable="!isExpanded"
|
||||||
|
:show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
|
||||||
|
:focused="focused(status.id)"
|
||||||
|
:in-conversation="isExpanded"
|
||||||
|
:highlight="getHighlight()"
|
||||||
|
:replies="getReplies(status.id)"
|
||||||
|
:in-profile="inProfile"
|
||||||
|
:profile-user-id="profileUserId"
|
||||||
|
class="conversation-status status-fadein panel-body"
|
||||||
|
|
||||||
|
:simple-tree="treeViewIsSimple"
|
||||||
|
:toggle-thread-display="toggleThreadDisplay"
|
||||||
|
:thread-display-status="threadDisplayStatus"
|
||||||
|
:show-thread-recursively="showThreadRecursively"
|
||||||
|
:total-reply-count="totalReplyCount"
|
||||||
|
:total-reply-depth="totalReplyDepth"
|
||||||
|
:show-other-replies-as-button="showOtherRepliesButtonInsideStatus"
|
||||||
|
:dive="() => diveIntoStatus(status.id)"
|
||||||
|
|
||||||
|
:controlled-showing-tall="statusContentProperties[status.id].showingTall"
|
||||||
|
:controlled-expanding-subject="statusContentProperties[status.id].expandingSubject"
|
||||||
|
:controlled-showing-long-subject="statusContentProperties[status.id].showingLongSubject"
|
||||||
|
:controlled-replying="statusContentProperties[status.id].replying"
|
||||||
|
:controlled-media-playing="statusContentProperties[status.id].mediaPlaying"
|
||||||
|
:controlled-toggle-showing-tall="() => toggleStatusContentProperty(status.id, 'showingTall')"
|
||||||
|
:controlled-toggle-expanding-subject="() => toggleStatusContentProperty(status.id, 'expandingSubject')"
|
||||||
|
:controlled-toggle-showing-long-subject="() => toggleStatusContentProperty(status.id, 'showingLongSubject')"
|
||||||
|
:controlled-toggle-replying="() => toggleStatusContentProperty(status.id, 'replying')"
|
||||||
|
:controlled-set-media-playing="(newVal) => toggleStatusContentProperty(status.id, 'mediaPlaying', newVal)"
|
||||||
|
|
||||||
|
@goto="setHighlight"
|
||||||
|
@toggleExpanded="toggleExpanded"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
v-if="showOtherRepliesButtonBelowStatus && getReplies(status.id).length > 1"
|
||||||
|
class="thread-ancestor-dive-box"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="thread-ancestor-dive-box-inner"
|
||||||
|
>
|
||||||
|
<i18n-t
|
||||||
|
tag="button"
|
||||||
|
scope="global"
|
||||||
|
keypath="status.ancestor_follow_with_icon"
|
||||||
|
class="button-unstyled -link thread-tree-show-replies-button"
|
||||||
|
@click.prevent="diveIntoStatus(status.id)"
|
||||||
|
>
|
||||||
|
<template #icon>
|
||||||
|
<FAIcon
|
||||||
|
icon="angle-double-right"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #text>
|
||||||
|
<span>
|
||||||
|
{{ $tc('status.ancestor_follow', getReplies(status.id).length - 1, { numReplies: getReplies(status.id).length - 1 }) }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</i18n-t>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<thread-tree
|
||||||
|
v-for="status in showingTopLevel"
|
||||||
|
:key="status.id"
|
||||||
|
ref="statusComponent"
|
||||||
|
:depth="0"
|
||||||
|
|
||||||
|
:status="status"
|
||||||
|
:in-profile="inProfile"
|
||||||
|
:conversation="conversation"
|
||||||
|
:collapsable="collapsable"
|
||||||
|
:is-expanded="isExpanded"
|
||||||
|
:pinned-status-ids-object="pinnedStatusIdsObject"
|
||||||
|
:profile-user-id="profileUserId"
|
||||||
|
|
||||||
|
:focused="focused"
|
||||||
|
:get-replies="getReplies"
|
||||||
|
:highlight="maybeHighlight"
|
||||||
|
:set-highlight="setHighlight"
|
||||||
|
:toggle-expanded="toggleExpanded"
|
||||||
|
|
||||||
|
:simple="treeViewIsSimple"
|
||||||
|
:toggle-thread-display="toggleThreadDisplay"
|
||||||
|
:thread-display-status="threadDisplayStatus"
|
||||||
|
:show-thread-recursively="showThreadRecursively"
|
||||||
|
:total-reply-count="totalReplyCount"
|
||||||
|
:total-reply-depth="totalReplyDepth"
|
||||||
|
:status-content-properties="statusContentProperties"
|
||||||
|
:set-status-content-property="setStatusContentProperty"
|
||||||
|
:toggle-status-content-property="toggleStatusContentProperty"
|
||||||
|
:dive="canDive ? diveIntoStatus : undefined"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="isLinearView"
|
||||||
|
class="thread-body"
|
||||||
|
>
|
||||||
|
<status
|
||||||
|
v-for="status in conversation"
|
||||||
|
:key="status.id"
|
||||||
|
ref="statusComponent"
|
||||||
|
:inline-expanded="collapsable && isExpanded"
|
||||||
|
:statusoid="status"
|
||||||
|
:expandable="!isExpanded"
|
||||||
|
:show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
|
||||||
|
:focused="focused(status.id)"
|
||||||
|
:in-conversation="isExpanded"
|
||||||
|
:highlight="getHighlight()"
|
||||||
|
:replies="getReplies(status.id)"
|
||||||
|
:in-profile="inProfile"
|
||||||
|
:profile-user-id="profileUserId"
|
||||||
|
class="conversation-status status-fadein panel-body"
|
||||||
|
|
||||||
|
:toggle-thread-display="toggleThreadDisplay"
|
||||||
|
:thread-display-status="threadDisplayStatus"
|
||||||
|
:show-thread-recursively="showThreadRecursively"
|
||||||
|
:total-reply-count="totalReplyCount"
|
||||||
|
:total-reply-depth="totalReplyDepth"
|
||||||
|
:status-content-properties="statusContentProperties"
|
||||||
|
:set-status-content-property="setStatusContentProperty"
|
||||||
|
:toggle-status-content-property="toggleStatusContentProperty"
|
||||||
|
|
||||||
|
@goto="setHighlight"
|
||||||
|
@toggleExpanded="toggleExpanded"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
|
@ -49,6 +201,45 @@
|
||||||
@import '../../_variables.scss';
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
.Conversation {
|
.Conversation {
|
||||||
|
.conversation-dive-to-top-level-box {
|
||||||
|
padding: var(--status-margin, $status-margin);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
border-bottom-color: var(--border, $fallback--border);
|
||||||
|
border-radius: 0;
|
||||||
|
/* Make the button stretch along the whole row */
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thread-ancestors {
|
||||||
|
margin-left: var(--status-margin, $status-margin);
|
||||||
|
border-left: 2px solid var(--border, $fallback--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.thread-ancestor.-faded .StatusContent {
|
||||||
|
--link: var(--faintLink);
|
||||||
|
--text: var(--faint);
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
.thread-ancestor-dive-box {
|
||||||
|
padding-left: var(--status-margin, $status-margin);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
border-bottom-color: var(--border, $fallback--border);
|
||||||
|
border-radius: 0;
|
||||||
|
/* Make the button stretch along the whole row */
|
||||||
|
&, &-inner {
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.thread-ancestor-dive-box-inner {
|
||||||
|
padding: var(--status-margin, $status-margin);
|
||||||
|
}
|
||||||
|
|
||||||
.conversation-status {
|
.conversation-status {
|
||||||
border-bottom-width: 1px;
|
border-bottom-width: 1px;
|
||||||
border-bottom-style: solid;
|
border-bottom-style: solid;
|
||||||
|
@ -56,12 +247,28 @@
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.-expanded {
|
.thread-ancestor-has-other-replies .conversation-status,
|
||||||
.conversation-status:last-child {
|
.thread-ancestor:last-child .conversation-status,
|
||||||
border-bottom: none;
|
.thread-ancestor:last-child .thread-ancestor-dive-box,
|
||||||
border-radius: 0 0 $fallback--panelRadius $fallback--panelRadius;
|
&.-expanded .thread-tree .conversation-status {
|
||||||
border-radius: 0 0 var(--panelRadius, $fallback--panelRadius) var(--panelRadius, $fallback--panelRadius);
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.thread-ancestors + .thread-tree > .conversation-status {
|
||||||
|
border-top-width: 1px;
|
||||||
|
border-top-style: solid;
|
||||||
|
border-top-color: var(--border, $fallback--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* expanded conversation in timeline */
|
||||||
|
&.status-fadein.-expanded .thread-body {
|
||||||
|
border-left-width: 4px;
|
||||||
|
border-left-style: solid;
|
||||||
|
border-left-color: $fallback--cRed;
|
||||||
|
border-left-color: var(--cRed, $fallback--cRed);
|
||||||
|
border-radius: 0 0 $fallback--panelRadius $fallback--panelRadius;
|
||||||
|
border-radius: 0 0 var(--panelRadius, $fallback--panelRadius) var(--panelRadius, $fallback--panelRadius);
|
||||||
|
border-bottom: 1px solid var(--border, $fallback--border);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<search-bar
|
<search-bar
|
||||||
v-if="currentUser || !privateMode"
|
v-if="currentUser || !privateMode"
|
||||||
@toggled="onSearchBarToggled"
|
@toggled="onSearchBarToggled"
|
||||||
@click.stop.native
|
@click.stop
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class="button-unstyled nav-icon"
|
class="button-unstyled nav-icon"
|
||||||
|
@ -52,6 +52,7 @@
|
||||||
href="/pleroma/admin/#/login-pleroma"
|
href="/pleroma/admin/#/login-pleroma"
|
||||||
class="nav-icon"
|
class="nav-icon"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@click.stop
|
||||||
>
|
>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
fixed-width
|
fixed-width
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
class="btn button-default"
|
class="btn button-default"
|
||||||
>
|
>
|
||||||
{{ $t('domain_mute_card.unmute') }}
|
{{ $t('domain_mute_card.unmute') }}
|
||||||
<template slot="progress">
|
<template v-slot:progress>
|
||||||
{{ $t('domain_mute_card.unmute_progress') }}
|
{{ $t('domain_mute_card.unmute_progress') }}
|
||||||
</template>
|
</template>
|
||||||
</ProgressButton>
|
</ProgressButton>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
class="btn button-default"
|
class="btn button-default"
|
||||||
>
|
>
|
||||||
{{ $t('domain_mute_card.mute') }}
|
{{ $t('domain_mute_card.mute') }}
|
||||||
<template slot="progress">
|
<template v-slot:progress>
|
||||||
{{ $t('domain_mute_card.mute_progress') }}
|
{{ $t('domain_mute_card.mute_progress') }}
|
||||||
</template>
|
</template>
|
||||||
</ProgressButton>
|
</ProgressButton>
|
||||||
|
|
|
@ -31,6 +31,7 @@ library.add(
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const EmojiInput = {
|
const EmojiInput = {
|
||||||
|
emits: ['update:modelValue', 'shown'],
|
||||||
props: {
|
props: {
|
||||||
suggest: {
|
suggest: {
|
||||||
/**
|
/**
|
||||||
|
@ -57,7 +58,7 @@ const EmojiInput = {
|
||||||
required: true,
|
required: true,
|
||||||
type: Function
|
type: Function
|
||||||
},
|
},
|
||||||
value: {
|
modelValue: {
|
||||||
/**
|
/**
|
||||||
* Used for v-model
|
* Used for v-model
|
||||||
*/
|
*/
|
||||||
|
@ -136,39 +137,38 @@ const EmojiInput = {
|
||||||
return (this.wordAtCaret || {}).word || ''
|
return (this.wordAtCaret || {}).word || ''
|
||||||
},
|
},
|
||||||
wordAtCaret () {
|
wordAtCaret () {
|
||||||
if (this.value && this.caret) {
|
if (this.modelValue && this.caret) {
|
||||||
const word = Completion.wordAtPosition(this.value, this.caret - 1) || {}
|
const word = Completion.wordAtPosition(this.modelValue, this.caret - 1) || {}
|
||||||
return word
|
return word
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
const slots = this.$slots.default
|
const { root } = this.$refs
|
||||||
if (!slots || slots.length === 0) return
|
const input = root.querySelector('.emoji-input > input') || root.querySelector('.emoji-input > textarea')
|
||||||
const input = slots.find(slot => ['input', 'textarea'].includes(slot.tag))
|
|
||||||
if (!input) return
|
if (!input) return
|
||||||
this.input = input
|
this.input = input
|
||||||
this.resize()
|
this.resize()
|
||||||
input.elm.addEventListener('blur', this.onBlur)
|
input.addEventListener('blur', this.onBlur)
|
||||||
input.elm.addEventListener('focus', this.onFocus)
|
input.addEventListener('focus', this.onFocus)
|
||||||
input.elm.addEventListener('paste', this.onPaste)
|
input.addEventListener('paste', this.onPaste)
|
||||||
input.elm.addEventListener('keyup', this.onKeyUp)
|
input.addEventListener('keyup', this.onKeyUp)
|
||||||
input.elm.addEventListener('keydown', this.onKeyDown)
|
input.addEventListener('keydown', this.onKeyDown)
|
||||||
input.elm.addEventListener('click', this.onClickInput)
|
input.addEventListener('click', this.onClickInput)
|
||||||
input.elm.addEventListener('transitionend', this.onTransition)
|
input.addEventListener('transitionend', this.onTransition)
|
||||||
input.elm.addEventListener('input', this.onInput)
|
input.addEventListener('input', this.onInput)
|
||||||
},
|
},
|
||||||
unmounted () {
|
unmounted () {
|
||||||
const { input } = this
|
const { input } = this
|
||||||
if (input) {
|
if (input) {
|
||||||
input.elm.removeEventListener('blur', this.onBlur)
|
input.removeEventListener('blur', this.onBlur)
|
||||||
input.elm.removeEventListener('focus', this.onFocus)
|
input.removeEventListener('focus', this.onFocus)
|
||||||
input.elm.removeEventListener('paste', this.onPaste)
|
input.removeEventListener('paste', this.onPaste)
|
||||||
input.elm.removeEventListener('keyup', this.onKeyUp)
|
input.removeEventListener('keyup', this.onKeyUp)
|
||||||
input.elm.removeEventListener('keydown', this.onKeyDown)
|
input.removeEventListener('keydown', this.onKeyDown)
|
||||||
input.elm.removeEventListener('click', this.onClickInput)
|
input.removeEventListener('click', this.onClickInput)
|
||||||
input.elm.removeEventListener('transitionend', this.onTransition)
|
input.removeEventListener('transitionend', this.onTransition)
|
||||||
input.elm.removeEventListener('input', this.onInput)
|
input.removeEventListener('input', this.onInput)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -189,8 +189,11 @@ const EmojiInput = {
|
||||||
img: imageUrl || ''
|
img: imageUrl || ''
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
suggestions (newValue) {
|
suggestions: {
|
||||||
this.$nextTick(this.resize)
|
handler (newValue) {
|
||||||
|
this.$nextTick(this.resize)
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -216,7 +219,7 @@ const EmojiInput = {
|
||||||
}, 0)
|
}, 0)
|
||||||
},
|
},
|
||||||
togglePicker () {
|
togglePicker () {
|
||||||
this.input.elm.focus()
|
this.input.focus()
|
||||||
this.showPicker = !this.showPicker
|
this.showPicker = !this.showPicker
|
||||||
if (this.showPicker) {
|
if (this.showPicker) {
|
||||||
this.scrollIntoView()
|
this.scrollIntoView()
|
||||||
|
@ -225,13 +228,13 @@ const EmojiInput = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
replace (replacement) {
|
replace (replacement) {
|
||||||
const newValue = Completion.replaceWord(this.value, this.wordAtCaret, replacement)
|
const newValue = Completion.replaceWord(this.modelValue, this.wordAtCaret, replacement)
|
||||||
this.$emit('input', newValue)
|
this.$emit('update:modelValue', newValue)
|
||||||
this.caret = 0
|
this.caret = 0
|
||||||
},
|
},
|
||||||
insert ({ insertion, keepOpen, surroundingSpace = true }) {
|
insert ({ insertion, keepOpen, surroundingSpace = true }) {
|
||||||
const before = this.value.substring(0, this.caret) || ''
|
const before = this.modelValue.substring(0, this.caret) || ''
|
||||||
const after = this.value.substring(this.caret) || ''
|
const after = this.modelValue.substring(this.caret) || ''
|
||||||
|
|
||||||
/* Using a bit more smart approach to padding emojis with spaces:
|
/* Using a bit more smart approach to padding emojis with spaces:
|
||||||
* - put a space before cursor if there isn't one already, unless we
|
* - put a space before cursor if there isn't one already, unless we
|
||||||
|
@ -259,16 +262,16 @@ const EmojiInput = {
|
||||||
after
|
after
|
||||||
].join('')
|
].join('')
|
||||||
this.keepOpen = keepOpen
|
this.keepOpen = keepOpen
|
||||||
this.$emit('input', newValue)
|
this.$emit('update:modelValue', newValue)
|
||||||
const position = this.caret + (insertion + spaceAfter + spaceBefore).length
|
const position = this.caret + (insertion + spaceAfter + spaceBefore).length
|
||||||
if (!keepOpen) {
|
if (!keepOpen) {
|
||||||
this.input.elm.focus()
|
this.input.focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
// Re-focus inputbox after clicking suggestion
|
// Re-focus inputbox after clicking suggestion
|
||||||
// Set selection right after the replacement instead of the very end
|
// Set selection right after the replacement instead of the very end
|
||||||
this.input.elm.setSelectionRange(position, position)
|
this.input.setSelectionRange(position, position)
|
||||||
this.caret = position
|
this.caret = position
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -278,16 +281,16 @@ const EmojiInput = {
|
||||||
if (len > 0 || suggestion) {
|
if (len > 0 || suggestion) {
|
||||||
const chosenSuggestion = suggestion || this.suggestions[this.highlighted]
|
const chosenSuggestion = suggestion || this.suggestions[this.highlighted]
|
||||||
const replacement = chosenSuggestion.replacement
|
const replacement = chosenSuggestion.replacement
|
||||||
const newValue = Completion.replaceWord(this.value, this.wordAtCaret, replacement)
|
const newValue = Completion.replaceWord(this.modelValue, this.wordAtCaret, replacement)
|
||||||
this.$emit('input', newValue)
|
this.$emit('update:modelValue', newValue)
|
||||||
this.highlighted = 0
|
this.highlighted = 0
|
||||||
const position = this.wordAtCaret.start + replacement.length
|
const position = this.wordAtCaret.start + replacement.length
|
||||||
|
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
// Re-focus inputbox after clicking suggestion
|
// Re-focus inputbox after clicking suggestion
|
||||||
this.input.elm.focus()
|
this.input.focus()
|
||||||
// Set selection right after the replacement instead of the very end
|
// Set selection right after the replacement instead of the very end
|
||||||
this.input.elm.setSelectionRange(position, position)
|
this.input.setSelectionRange(position, position)
|
||||||
this.caret = position
|
this.caret = position
|
||||||
})
|
})
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
@ -349,7 +352,7 @@ const EmojiInput = {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const { offsetHeight } = this.input.elm
|
const { offsetHeight } = this.input
|
||||||
const { picker } = this.$refs
|
const { picker } = this.$refs
|
||||||
const pickerBottom = picker.$el.getBoundingClientRect().bottom
|
const pickerBottom = picker.$el.getBoundingClientRect().bottom
|
||||||
if (pickerBottom > window.innerHeight) {
|
if (pickerBottom > window.innerHeight) {
|
||||||
|
@ -414,8 +417,8 @@ const EmojiInput = {
|
||||||
|
|
||||||
// Scroll the input element to the position of the cursor
|
// Scroll the input element to the position of the cursor
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.input.elm.blur()
|
this.input.blur()
|
||||||
this.input.elm.focus()
|
this.input.focus()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// Disable suggestions hotkeys if suggestions are hidden
|
// Disable suggestions hotkeys if suggestions are hidden
|
||||||
|
@ -444,7 +447,7 @@ const EmojiInput = {
|
||||||
// de-focuses the element (i.e. default browser behavior)
|
// de-focuses the element (i.e. default browser behavior)
|
||||||
if (key === 'Escape') {
|
if (key === 'Escape') {
|
||||||
if (!this.temporarilyHideSuggestions) {
|
if (!this.temporarilyHideSuggestions) {
|
||||||
this.input.elm.focus()
|
this.input.focus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,7 +458,7 @@ const EmojiInput = {
|
||||||
this.showPicker = false
|
this.showPicker = false
|
||||||
this.setCaret(e)
|
this.setCaret(e)
|
||||||
this.resize()
|
this.resize()
|
||||||
this.$emit('input', e.target.value)
|
this.$emit('update:modelValue', e.target.value)
|
||||||
},
|
},
|
||||||
onClickInput (e) {
|
onClickInput (e) {
|
||||||
this.showPicker = false
|
this.showPicker = false
|
||||||
|
@ -480,7 +483,7 @@ const EmojiInput = {
|
||||||
if (!panel) return
|
if (!panel) return
|
||||||
const picker = this.$refs.picker.$el
|
const picker = this.$refs.picker.$el
|
||||||
const panelBody = this.$refs['panel-body']
|
const panelBody = this.$refs['panel-body']
|
||||||
const { offsetHeight, offsetTop } = this.input.elm
|
const { offsetHeight, offsetTop } = this.input
|
||||||
const offsetBottom = offsetTop + offsetHeight
|
const offsetBottom = offsetTop + offsetHeight
|
||||||
|
|
||||||
this.setPlacement(panelBody, panel, offsetBottom)
|
this.setPlacement(panelBody, panel, offsetBottom)
|
||||||
|
@ -494,7 +497,7 @@ const EmojiInput = {
|
||||||
|
|
||||||
if (this.placement === 'top' || (this.placement === 'auto' && this.overflowsBottom(container))) {
|
if (this.placement === 'top' || (this.placement === 'auto' && this.overflowsBottom(container))) {
|
||||||
target.style.top = 'auto'
|
target.style.top = 'auto'
|
||||||
target.style.bottom = this.input.elm.offsetHeight + 'px'
|
target.style.bottom = this.input.offsetHeight + 'px'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
overflowsBottom (el) {
|
overflowsBottom (el) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
|
ref="root"
|
||||||
v-click-outside="onClickOutside"
|
v-click-outside="onClickOutside"
|
||||||
class="emoji-input"
|
class="emoji-input"
|
||||||
:class="{ 'with-picker': !hideEmojiButton }"
|
:class="{ 'with-picker': !hideEmojiButton }"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { defineAsyncComponent } from 'vue'
|
||||||
import Checkbox from '../checkbox/checkbox.vue'
|
import Checkbox from '../checkbox/checkbox.vue'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
|
@ -57,7 +58,7 @@ const EmojiPicker = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
StickerPicker: () => import('../sticker_picker/sticker_picker.vue'),
|
StickerPicker: defineAsyncComponent(() => import('../sticker_picker/sticker_picker.vue')),
|
||||||
Checkbox
|
Checkbox
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -79,7 +80,7 @@ const EmojiPicker = {
|
||||||
},
|
},
|
||||||
highlight (key) {
|
highlight (key) {
|
||||||
const ref = this.$refs['group-' + key]
|
const ref = this.$refs['group-' + key]
|
||||||
const top = ref[0].offsetTop
|
const top = ref.offsetTop
|
||||||
this.setShowStickers(false)
|
this.setShowStickers(false)
|
||||||
this.activeGroup = key
|
this.activeGroup = key
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -96,7 +97,7 @@ const EmojiPicker = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
triggerLoadMore (target) {
|
triggerLoadMore (target) {
|
||||||
const ref = this.$refs['group-end-custom'][0]
|
const ref = this.$refs['group-end-custom']
|
||||||
if (!ref) return
|
if (!ref) return
|
||||||
const bottom = ref.offsetTop + ref.offsetHeight
|
const bottom = ref.offsetTop + ref.offsetHeight
|
||||||
|
|
||||||
|
@ -119,7 +120,7 @@ const EmojiPicker = {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.emojisView.forEach(group => {
|
this.emojisView.forEach(group => {
|
||||||
const ref = this.$refs['group-' + group.id]
|
const ref = this.$refs['group-' + group.id]
|
||||||
if (ref[0].offsetTop <= top) {
|
if (ref.offsetTop <= top) {
|
||||||
this.activeGroup = group.id
|
this.activeGroup = group.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,18 +15,8 @@ const Exporter = {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'export.csv'
|
default: 'export.csv'
|
||||||
},
|
},
|
||||||
exportButtonLabel: {
|
exportButtonLabel: { type: String },
|
||||||
type: String,
|
processingMessage: { type: String }
|
||||||
default () {
|
|
||||||
return this.$t('exporter.export')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
processingMessage: {
|
|
||||||
type: String,
|
|
||||||
default () {
|
|
||||||
return this.$t('exporter.processing')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
spin
|
spin
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<span>{{ processingMessage }}</span>
|
<span>{{ processingMessage || $t('exporter.processing') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
v-else
|
v-else
|
||||||
class="btn button-default"
|
class="btn button-default"
|
||||||
@click="process"
|
@click="process"
|
||||||
>
|
>
|
||||||
{{ exportButtonLabel }}
|
{{ exportButtonLabel || $t('exporter.export') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -7,10 +7,7 @@
|
||||||
:bound-to="{ x: 'container' }"
|
:bound-to="{ x: 'container' }"
|
||||||
remove-padding
|
remove-padding
|
||||||
>
|
>
|
||||||
<div
|
<template v-slot:content="{close}">
|
||||||
slot="content"
|
|
||||||
slot-scope="{close}"
|
|
||||||
>
|
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<button
|
<button
|
||||||
v-if="canMute && !status.thread_muted"
|
v-if="canMute && !status.thread_muted"
|
||||||
|
@ -120,16 +117,15 @@
|
||||||
/><span>{{ $t("user_card.report") }}</span>
|
/><span>{{ $t("user_card.report") }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
<span
|
<template v-slot:trigger>
|
||||||
slot="trigger"
|
<button class="button-unstyled popover-trigger">
|
||||||
class="popover-trigger"
|
<FAIcon
|
||||||
>
|
class="fa-scale-110 fa-old-padding"
|
||||||
<FAIcon
|
icon="ellipsis-h"
|
||||||
class="fa-scale-110 fa-old-padding"
|
/>
|
||||||
icon="ellipsis-h"
|
</button>
|
||||||
/>
|
</template>
|
||||||
</span>
|
|
||||||
</Popover>
|
</Popover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import fileSizeFormatService from '../../services/file_size_format/file_size_for
|
||||||
|
|
||||||
const FeaturesPanel = {
|
const FeaturesPanel = {
|
||||||
computed: {
|
computed: {
|
||||||
chat: function () { return this.$store.state.instance.chatAvailable },
|
shout: function () { return this.$store.state.instance.shoutAvailable },
|
||||||
pleromaChatMessages: function () { return this.$store.state.instance.pleromaChatMessagesAvailable },
|
pleromaChatMessages: function () { return this.$store.state.instance.pleromaChatMessagesAvailable },
|
||||||
gopher: function () { return this.$store.state.instance.gopherAvailable },
|
gopher: function () { return this.$store.state.instance.gopherAvailable },
|
||||||
whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled },
|
whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled },
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body features-panel">
|
<div class="panel-body features-panel">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-if="chat">
|
<li v-if="shout">
|
||||||
{{ $t('features_panel.chat') }}
|
{{ $t('features_panel.shout') }}
|
||||||
</li>
|
</li>
|
||||||
<li v-if="pleromaChatMessages">
|
<li v-if="pleromaChatMessages">
|
||||||
{{ $t('features_panel.pleroma_chat_messages') }}
|
{{ $t('features_panel.pleroma_chat_messages') }}
|
||||||
|
|
53
src/components/flash/flash.js
Normal file
53
src/components/flash/flash.js
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
import RuffleService from '../../services/ruffle_service/ruffle_service.js'
|
||||||
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import {
|
||||||
|
faStop,
|
||||||
|
faExclamationTriangle
|
||||||
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
|
library.add(
|
||||||
|
faStop,
|
||||||
|
faExclamationTriangle
|
||||||
|
)
|
||||||
|
|
||||||
|
const Flash = {
|
||||||
|
props: [ 'src' ],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
player: false, // can be true, "hidden", false. hidden = element exists
|
||||||
|
loaded: false,
|
||||||
|
ruffleInstance: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openPlayer () {
|
||||||
|
if (this.player) return // prevent double-loading, or re-loading on failure
|
||||||
|
this.player = 'hidden'
|
||||||
|
RuffleService.getRuffle().then((ruffle) => {
|
||||||
|
const player = ruffle.newest().createPlayer()
|
||||||
|
player.config = {
|
||||||
|
letterbox: 'on'
|
||||||
|
}
|
||||||
|
const container = this.$refs.container
|
||||||
|
container.appendChild(player)
|
||||||
|
player.style.width = '100%'
|
||||||
|
player.style.height = '100%'
|
||||||
|
player.load(this.src).then(() => {
|
||||||
|
this.player = true
|
||||||
|
}).catch((e) => {
|
||||||
|
console.error('Error loading ruffle', e)
|
||||||
|
this.player = 'error'
|
||||||
|
})
|
||||||
|
this.ruffleInstance = player
|
||||||
|
this.$emit('playerOpened')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
closePlayer () {
|
||||||
|
this.ruffleInstance && this.ruffleInstance.remove()
|
||||||
|
this.player = false
|
||||||
|
this.$emit('playerClosed')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Flash
|
84
src/components/flash/flash.vue
Normal file
84
src/components/flash/flash.vue
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
<template>
|
||||||
|
<div class="Flash">
|
||||||
|
<div
|
||||||
|
v-if="player === true || player === 'hidden'"
|
||||||
|
ref="container"
|
||||||
|
class="player"
|
||||||
|
:class="{ hidden: player === 'hidden' }"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
v-if="player !== true"
|
||||||
|
class="button-unstyled placeholder"
|
||||||
|
@click="openPlayer"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
v-if="player === 'hidden'"
|
||||||
|
class="label"
|
||||||
|
>
|
||||||
|
{{ $t('general.loading') }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="player === 'error'"
|
||||||
|
class="label"
|
||||||
|
>
|
||||||
|
{{ $t('general.flash_fail') }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
class="label"
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
{{ $t('general.flash_content') }}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<FAIcon icon="exclamation-triangle" />
|
||||||
|
{{ $t('general.flash_security') }}
|
||||||
|
</p>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./flash.js"></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import '../../_variables.scss';
|
||||||
|
.Flash {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.player {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.placeholder {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--link);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hider {
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
text-align: center;
|
||||||
|
flex: 1 1 0;
|
||||||
|
line-height: 1.2;
|
||||||
|
white-space: normal;
|
||||||
|
word-wrap: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
visibility: 'hidden';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,6 +1,6 @@
|
||||||
import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
|
import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
|
||||||
export default {
|
export default {
|
||||||
props: ['relationship', 'labelFollowing', 'buttonClass'],
|
props: ['relationship', 'user', 'labelFollowing', 'buttonClass'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
inProgress: false
|
inProgress: false
|
||||||
|
@ -14,7 +14,7 @@ export default {
|
||||||
if (this.inProgress || this.relationship.following) {
|
if (this.inProgress || this.relationship.following) {
|
||||||
return this.$t('user_card.follow_unfollow')
|
return this.$t('user_card.follow_unfollow')
|
||||||
} else if (this.relationship.requested) {
|
} else if (this.relationship.requested) {
|
||||||
return this.$t('user_card.follow_again')
|
return this.$t('user_card.follow_cancel')
|
||||||
} else {
|
} else {
|
||||||
return this.$t('user_card.follow')
|
return this.$t('user_card.follow')
|
||||||
}
|
}
|
||||||
|
@ -29,11 +29,14 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
return this.$t('user_card.follow')
|
return this.$t('user_card.follow')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
disabled () {
|
||||||
|
return this.inProgress || this.user.deactivated
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onClick () {
|
onClick () {
|
||||||
this.relationship.following ? this.unfollow() : this.follow()
|
this.relationship.following || this.relationship.requested ? this.unfollow() : this.follow()
|
||||||
},
|
},
|
||||||
follow () {
|
follow () {
|
||||||
this.inProgress = true
|
this.inProgress = true
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<button
|
<button
|
||||||
class="btn button-default follow-button"
|
class="btn button-default follow-button"
|
||||||
:class="{ toggled: isPressed }"
|
:class="{ toggled: isPressed }"
|
||||||
:disabled="inProgress"
|
:disabled="disabled"
|
||||||
:title="title"
|
:title="title"
|
||||||
@click="onClick"
|
@click="onClick"
|
||||||
>
|
>
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
:relationship="relationship"
|
:relationship="relationship"
|
||||||
:label-following="$t('user_card.follow_unfollow')"
|
:label-following="$t('user_card.follow_unfollow')"
|
||||||
class="follow-card-follow-button"
|
class="follow-card-follow-button"
|
||||||
|
:user="user"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,20 +1,17 @@
|
||||||
import { set } from 'vue'
|
import { set } from 'lodash'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import Select from '../select/select.vue'
|
||||||
import {
|
|
||||||
faChevronDown
|
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
library.add(
|
|
||||||
faChevronDown
|
|
||||||
)
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
Select
|
||||||
|
},
|
||||||
props: [
|
props: [
|
||||||
'name', 'label', 'value', 'fallback', 'options', 'no-inherit'
|
'name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit'
|
||||||
],
|
],
|
||||||
|
emits: ['update:modelValue'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
lValue: this.value,
|
lValue: this.modelValue,
|
||||||
availableOptions: [
|
availableOptions: [
|
||||||
this.noInherit ? '' : 'inherit',
|
this.noInherit ? '' : 'inherit',
|
||||||
'custom',
|
'custom',
|
||||||
|
@ -26,7 +23,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeUpdate () {
|
beforeUpdate () {
|
||||||
this.lValue = this.value
|
this.lValue = this.modelValue
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
present () {
|
present () {
|
||||||
|
@ -41,7 +38,7 @@ export default {
|
||||||
},
|
},
|
||||||
set (v) {
|
set (v) {
|
||||||
set(this.lValue, 'family', v)
|
set(this.lValue, 'family', v)
|
||||||
this.$emit('input', this.lValue)
|
this.$emit('update:modelValue', this.lValue)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isCustom () {
|
isCustom () {
|
||||||
|
|
|
@ -15,37 +15,28 @@
|
||||||
class="opt exlcude-disabled"
|
class="opt exlcude-disabled"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
:checked="present"
|
:checked="present"
|
||||||
@input="$emit('input', typeof value === 'undefined' ? fallback : undefined)"
|
@change="$emit('update:modelValue', typeof modelValue === 'undefined' ? fallback : undefined)"
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
v-if="typeof fallback !== 'undefined'"
|
v-if="typeof fallback !== 'undefined'"
|
||||||
class="opt-l"
|
class="opt-l"
|
||||||
:for="name + '-o'"
|
:for="name + '-o'"
|
||||||
/>
|
/>
|
||||||
<label
|
{{ ' ' }}
|
||||||
:for="name + '-font-switcher'"
|
<Select
|
||||||
class="select"
|
:id="name + '-font-switcher'"
|
||||||
|
v-model="preset"
|
||||||
:disabled="!present"
|
:disabled="!present"
|
||||||
|
class="font-switcher"
|
||||||
>
|
>
|
||||||
<select
|
<option
|
||||||
:id="name + '-font-switcher'"
|
v-for="option in availableOptions"
|
||||||
v-model="preset"
|
:key="option"
|
||||||
:disabled="!present"
|
:value="option"
|
||||||
class="font-switcher"
|
|
||||||
>
|
>
|
||||||
<option
|
{{ option === 'custom' ? $t('settings.style.fonts.custom') : option }}
|
||||||
v-for="option in availableOptions"
|
</option>
|
||||||
:key="option"
|
</Select>
|
||||||
:value="option"
|
|
||||||
>
|
|
||||||
{{ option === 'custom' ? $t('settings.style.fonts.custom') : option }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<FAIcon
|
|
||||||
class="select-down-icon"
|
|
||||||
icon="chevron-down"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<input
|
<input
|
||||||
v-if="isCustom"
|
v-if="isCustom"
|
||||||
:id="name"
|
:id="name"
|
||||||
|
@ -65,7 +56,8 @@
|
||||||
min-width: 10em;
|
min-width: 10em;
|
||||||
}
|
}
|
||||||
&.custom {
|
&.custom {
|
||||||
.select {
|
/* TODO Should make proper joiners... */
|
||||||
|
.font-switcher {
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,26 @@
|
||||||
import Attachment from '../attachment/attachment.vue'
|
import Attachment from '../attachment/attachment.vue'
|
||||||
import { chunk, last, dropRight, sumBy } from 'lodash'
|
import { sumBy, set } from 'lodash'
|
||||||
|
|
||||||
const Gallery = {
|
const Gallery = {
|
||||||
props: [
|
props: [
|
||||||
'attachments',
|
'attachments',
|
||||||
|
'limitRows',
|
||||||
|
'descriptions',
|
||||||
|
'limit',
|
||||||
'nsfw',
|
'nsfw',
|
||||||
'setMedia'
|
'setMedia',
|
||||||
|
'size',
|
||||||
|
'editable',
|
||||||
|
'removeAttachment',
|
||||||
|
'shiftUpAttachment',
|
||||||
|
'shiftDnAttachment',
|
||||||
|
'editAttachment',
|
||||||
|
'grid'
|
||||||
],
|
],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
sizes: {}
|
sizes: {},
|
||||||
|
hidingLong: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: { Attachment },
|
components: { Attachment },
|
||||||
|
@ -18,26 +29,70 @@ const Gallery = {
|
||||||
if (!this.attachments) {
|
if (!this.attachments) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
const rows = chunk(this.attachments, 3)
|
const attachments = this.limit > 0
|
||||||
if (last(rows).length === 1 && rows.length > 1) {
|
? this.attachments.slice(0, this.limit)
|
||||||
// if 1 attachment on last row -> add it to the previous row instead
|
: this.attachments
|
||||||
const lastAttachment = last(rows)[0]
|
if (this.size === 'hide') {
|
||||||
const allButLastRow = dropRight(rows)
|
return attachments.map(item => ({ minimal: true, items: [item] }))
|
||||||
last(allButLastRow).push(lastAttachment)
|
|
||||||
return allButLastRow
|
|
||||||
}
|
}
|
||||||
|
const rows = this.grid
|
||||||
|
? [{ grid: true, items: attachments }]
|
||||||
|
: attachments.reduce((acc, attachment, i) => {
|
||||||
|
if (attachment.mimetype.includes('audio')) {
|
||||||
|
return [...acc, { audio: true, items: [attachment] }, { items: [] }]
|
||||||
|
}
|
||||||
|
if (!(
|
||||||
|
attachment.mimetype.includes('image') ||
|
||||||
|
attachment.mimetype.includes('video') ||
|
||||||
|
attachment.mimetype.includes('flash')
|
||||||
|
)) {
|
||||||
|
return [...acc, { minimal: true, items: [attachment] }, { items: [] }]
|
||||||
|
}
|
||||||
|
const maxPerRow = 3
|
||||||
|
const attachmentsRemaining = this.attachments.length - i + 1
|
||||||
|
const currentRow = acc[acc.length - 1].items
|
||||||
|
currentRow.push(attachment)
|
||||||
|
if (currentRow.length >= maxPerRow && attachmentsRemaining > maxPerRow) {
|
||||||
|
return [...acc, { items: [] }]
|
||||||
|
} else {
|
||||||
|
return acc
|
||||||
|
}
|
||||||
|
}, [{ items: [] }]).filter(_ => _.items.length > 0)
|
||||||
return rows
|
return rows
|
||||||
},
|
},
|
||||||
useContainFit () {
|
attachmentsDimensionalScore () {
|
||||||
return this.$store.getters.mergedConfig.useContainFit
|
return this.rows.reduce((acc, row) => {
|
||||||
|
let size = 0
|
||||||
|
if (row.minimal) {
|
||||||
|
size += 1 / 8
|
||||||
|
} else if (row.audio) {
|
||||||
|
size += 1 / 4
|
||||||
|
} else {
|
||||||
|
size += 1 / (row.items.length + 0.6)
|
||||||
|
}
|
||||||
|
return acc + size
|
||||||
|
}, 0)
|
||||||
|
},
|
||||||
|
tooManyAttachments () {
|
||||||
|
if (this.editable || this.size === 'small') {
|
||||||
|
return false
|
||||||
|
} else if (this.size === 'hide') {
|
||||||
|
return this.attachments.length > 8
|
||||||
|
} else {
|
||||||
|
return this.attachmentsDimensionalScore > 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onNaturalSizeLoad (id, size) {
|
onNaturalSizeLoad ({ id, width, height }) {
|
||||||
this.$set(this.sizes, id, size)
|
set(this.sizes, id, { width, height })
|
||||||
},
|
},
|
||||||
rowStyle (itemsPerRow) {
|
rowStyle (row) {
|
||||||
return { 'padding-bottom': `${(100 / (itemsPerRow + 0.6))}%` }
|
if (row.audio) {
|
||||||
|
return { 'padding-bottom': '25%' } // fixed reduced height for audio
|
||||||
|
} else if (!row.minimal && !row.grid) {
|
||||||
|
return { 'padding-bottom': `${(100 / (row.items.length + 0.6))}%` }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
itemStyle (id, row) {
|
itemStyle (id, row) {
|
||||||
const total = sumBy(row, item => this.getAspectRatio(item.id))
|
const total = sumBy(row, item => this.getAspectRatio(item.id))
|
||||||
|
@ -46,6 +101,16 @@ const Gallery = {
|
||||||
getAspectRatio (id) {
|
getAspectRatio (id) {
|
||||||
const size = this.sizes[id]
|
const size = this.sizes[id]
|
||||||
return size ? size.width / size.height : 1
|
return size ? size.width / size.height : 1
|
||||||
|
},
|
||||||
|
toggleHidingLong (event) {
|
||||||
|
this.hidingLong = event
|
||||||
|
},
|
||||||
|
openGallery () {
|
||||||
|
this.$store.dispatch('setMedia', this.attachments)
|
||||||
|
this.$store.dispatch('setCurrentMedia', this.attachments[0])
|
||||||
|
},
|
||||||
|
onMedia () {
|
||||||
|
this.$store.dispatch('setMedia', this.attachments)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,83 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
ref="galleryContainer"
|
ref="galleryContainer"
|
||||||
style="width: 100%;"
|
class="Gallery"
|
||||||
|
:class="{ '-long': tooManyAttachments && hidingLong }"
|
||||||
>
|
>
|
||||||
|
<div class="gallery-rows">
|
||||||
|
<div
|
||||||
|
v-for="(row, rowIndex) in rows"
|
||||||
|
:key="rowIndex"
|
||||||
|
class="gallery-row"
|
||||||
|
:style="rowStyle(row)"
|
||||||
|
:class="{ '-audio': row.audio, '-minimal': row.minimal, '-grid': grid }"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="gallery-row-inner"
|
||||||
|
:class="{ '-grid': grid }"
|
||||||
|
>
|
||||||
|
<Attachment
|
||||||
|
v-for="(attachment, attachmentIndex) in row.items"
|
||||||
|
:key="attachment.id"
|
||||||
|
class="gallery-item"
|
||||||
|
:nsfw="nsfw"
|
||||||
|
:attachment="attachment"
|
||||||
|
:size="size"
|
||||||
|
:editable="editable"
|
||||||
|
:remove="removeAttachment"
|
||||||
|
:shift-up="!(attachmentIndex === 0 && rowIndex === 0) && shiftUpAttachment"
|
||||||
|
:shift-dn="!(attachmentIndex === row.items.length - 1 && rowIndex === rows.length - 1) && shiftDnAttachment"
|
||||||
|
:edit="editAttachment"
|
||||||
|
:description="descriptions && descriptions[attachment.id]"
|
||||||
|
:hide-description="size === 'small' || tooManyAttachments && hidingLong"
|
||||||
|
:style="itemStyle(attachment.id, row.items)"
|
||||||
|
@setMedia="onMedia"
|
||||||
|
@naturalSizeLoad="onNaturalSizeLoad"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
v-for="(row, index) in rows"
|
v-if="tooManyAttachments"
|
||||||
:key="index"
|
class="many-attachments"
|
||||||
class="gallery-row"
|
|
||||||
:style="rowStyle(row.length)"
|
|
||||||
:class="{ 'contain-fit': useContainFit, 'cover-fit': !useContainFit }"
|
|
||||||
>
|
>
|
||||||
<div class="gallery-row-inner">
|
<div class="many-attachments-text">
|
||||||
<attachment
|
{{ $t("status.many_attachments", { number: attachments.length }) }}
|
||||||
v-for="attachment in row"
|
</div>
|
||||||
:key="attachment.id"
|
<div class="many-attachments-buttons">
|
||||||
:set-media="setMedia"
|
<span
|
||||||
:nsfw="nsfw"
|
v-if="!hidingLong"
|
||||||
:attachment="attachment"
|
class="many-attachments-button"
|
||||||
:allow-play="false"
|
>
|
||||||
:natural-size-load="onNaturalSizeLoad.bind(null, attachment.id)"
|
<button
|
||||||
:style="itemStyle(attachment.id, row)"
|
class="button-unstyled -link"
|
||||||
/>
|
@click="toggleHidingLong(true)"
|
||||||
|
>
|
||||||
|
{{ $t("status.collapse_attachments") }}
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="hidingLong"
|
||||||
|
class="many-attachments-button"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class="button-unstyled -link"
|
||||||
|
@click="toggleHidingLong(false)"
|
||||||
|
>
|
||||||
|
{{ $t("status.show_all_attachments") }}
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="hidingLong"
|
||||||
|
class="many-attachments-button"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class="button-unstyled -link"
|
||||||
|
@click="openGallery"
|
||||||
|
>
|
||||||
|
{{ $t("status.open_gallery") }}
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -31,12 +88,66 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import '../../_variables.scss';
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
.gallery-row {
|
.Gallery {
|
||||||
position: relative;
|
.gallery-rows {
|
||||||
height: 0;
|
display: flex;
|
||||||
width: 100%;
|
flex-direction: column;
|
||||||
flex-grow: 1;
|
}
|
||||||
margin-top: 0.5em;
|
|
||||||
|
.gallery-row {
|
||||||
|
position: relative;
|
||||||
|
height: 0;
|
||||||
|
width: 100%;
|
||||||
|
flex-grow: 1;
|
||||||
|
|
||||||
|
&:not(:first-child) {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-long {
|
||||||
|
.gallery-rows {
|
||||||
|
max-height: 25em;
|
||||||
|
overflow: hidden;
|
||||||
|
mask:
|
||||||
|
linear-gradient(to top, white, transparent) bottom/100% 70px no-repeat,
|
||||||
|
linear-gradient(to top, white, white);
|
||||||
|
|
||||||
|
/* Autoprefixed seem to ignore this one, and also syntax is different */
|
||||||
|
-webkit-mask-composite: xor;
|
||||||
|
mask-composite: exclude;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.many-attachments-text {
|
||||||
|
text-align: center;
|
||||||
|
line-height: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.many-attachments-buttons {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.many-attachments-button {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
justify-content: center;
|
||||||
|
line-height: 2;
|
||||||
|
|
||||||
|
button {
|
||||||
|
padding: 0 2em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-row {
|
||||||
|
&.-grid,
|
||||||
|
&.-minimal {
|
||||||
|
height: auto;
|
||||||
|
.gallery-row-inner {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.gallery-row-inner {
|
.gallery-row-inner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -48,9 +159,24 @@
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
align-content: stretch;
|
align-content: stretch;
|
||||||
|
|
||||||
|
&.-grid {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
position: relative;
|
||||||
|
display: grid;
|
||||||
|
grid-column-gap: 0.5em;
|
||||||
|
grid-row-gap: 0.5em;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
|
||||||
|
|
||||||
|
.gallery-item {
|
||||||
|
margin: 0;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery-row-inner .attachment {
|
.gallery-item {
|
||||||
margin: 0 0.5em 0 0;
|
margin: 0 0.5em 0 0;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -61,32 +187,5 @@
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-attachment {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-container {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.contain-fit {
|
|
||||||
img,
|
|
||||||
video,
|
|
||||||
canvas {
|
|
||||||
object-fit: contain;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.cover-fit {
|
|
||||||
img,
|
|
||||||
video,
|
|
||||||
canvas {
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
36
src/components/hashtag_link/hashtag_link.js
Normal file
36
src/components/hashtag_link/hashtag_link.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import { extractTagFromUrl } from 'src/services/matcher/matcher.service.js'
|
||||||
|
|
||||||
|
const HashtagLink = {
|
||||||
|
name: 'HashtagLink',
|
||||||
|
props: {
|
||||||
|
url: {
|
||||||
|
required: true,
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
required: true,
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
tag: {
|
||||||
|
required: false,
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onClick () {
|
||||||
|
const tag = this.tag || extractTagFromUrl(this.url)
|
||||||
|
if (tag) {
|
||||||
|
const link = this.generateTagLink(tag)
|
||||||
|
this.$router.push(link)
|
||||||
|
} else {
|
||||||
|
window.open(this.url, '_blank')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
generateTagLink (tag) {
|
||||||
|
return `/tag/${tag}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HashtagLink
|
6
src/components/hashtag_link/hashtag_link.scss
Normal file
6
src/components/hashtag_link/hashtag_link.scss
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.HashtagLink {
|
||||||
|
position: relative;
|
||||||
|
white-space: normal;
|
||||||
|
display: inline-block;
|
||||||
|
color: var(--link);
|
||||||
|
}
|
19
src/components/hashtag_link/hashtag_link.vue
Normal file
19
src/components/hashtag_link/hashtag_link.vue
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<template>
|
||||||
|
<span
|
||||||
|
class="HashtagLink"
|
||||||
|
>
|
||||||
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
|
<a
|
||||||
|
:href="url"
|
||||||
|
class="original"
|
||||||
|
target="_blank"
|
||||||
|
@click.prevent="onClick"
|
||||||
|
v-html="content"
|
||||||
|
/>
|
||||||
|
<!-- eslint-enable vue/no-v-html -->
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./hashtag_link.js"/>
|
||||||
|
|
||||||
|
<style lang="scss" src="./hashtag_link.scss"/>
|
|
@ -117,7 +117,7 @@ const ImageCropper = {
|
||||||
const fileInput = this.$refs.input
|
const fileInput = this.$refs.input
|
||||||
fileInput.addEventListener('change', this.readFile)
|
fileInput.addEventListener('change', this.readFile)
|
||||||
},
|
},
|
||||||
beforeDestroy: function () {
|
beforeUnmount: function () {
|
||||||
// remove the event listeners
|
// remove the event listeners
|
||||||
const trigger = this.getTriggerDOM()
|
const trigger = this.getTriggerDOM()
|
||||||
if (trigger) {
|
if (trigger) {
|
||||||
|
|
|
@ -15,24 +15,9 @@ const Importer = {
|
||||||
type: Function,
|
type: Function,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
submitButtonLabel: {
|
submitButtonLabel: { type: String },
|
||||||
type: String,
|
successMessage: { type: String },
|
||||||
default () {
|
errorMessage: { type: String }
|
||||||
return this.$t('importer.submit')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
successMessage: {
|
|
||||||
type: String,
|
|
||||||
default () {
|
|
||||||
return this.$t('importer.success')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
errorMessage: {
|
|
||||||
type: String,
|
|
||||||
default () {
|
|
||||||
return this.$t('importer.error')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -18,21 +18,31 @@
|
||||||
class="btn button-default"
|
class="btn button-default"
|
||||||
@click="submit"
|
@click="submit"
|
||||||
>
|
>
|
||||||
{{ submitButtonLabel }}
|
{{ submitButtonLabel || $t('importer.submit') }}
|
||||||
</button>
|
</button>
|
||||||
<div v-if="success">
|
<div v-if="success">
|
||||||
<FAIcon
|
<button
|
||||||
icon="times"
|
class="button-unstyled"
|
||||||
@click="dismiss"
|
@click="dismiss"
|
||||||
/>
|
>
|
||||||
<p>{{ successMessage }}</p>
|
<FAIcon
|
||||||
|
icon="times"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
{{ ' ' }}
|
||||||
|
<span>{{ successMessage || $t('importer.success') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="error">
|
<div v-else-if="error">
|
||||||
<FAIcon
|
<button
|
||||||
icon="times"
|
class="button-unstyled"
|
||||||
@click="dismiss"
|
@click="dismiss"
|
||||||
/>
|
>
|
||||||
<p>{{ errorMessage }}</p>
|
<FAIcon
|
||||||
|
icon="times"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
{{ ' ' }}
|
||||||
|
<span>{{ errorMessage || $t('importer.error') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import Notifications from '../notifications/notifications.vue'
|
import Notifications from '../notifications/notifications.vue'
|
||||||
|
import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
|
||||||
|
|
||||||
const tabModeDict = {
|
const tabModeDict = {
|
||||||
mentions: ['mention'],
|
mentions: ['mention'],
|
||||||
|
@ -20,7 +21,8 @@ const Interactions = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Notifications
|
Notifications,
|
||||||
|
TabSwitcher
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,27 +3,19 @@
|
||||||
<label for="interface-language-switcher">
|
<label for="interface-language-switcher">
|
||||||
{{ $t('settings.interfaceLanguage') }}
|
{{ $t('settings.interfaceLanguage') }}
|
||||||
</label>
|
</label>
|
||||||
<label
|
{{ ' ' }}
|
||||||
for="interface-language-switcher"
|
<Select
|
||||||
class="select"
|
id="interface-language-switcher"
|
||||||
|
v-model="language"
|
||||||
>
|
>
|
||||||
<select
|
<option
|
||||||
id="interface-language-switcher"
|
v-for="lang in languages"
|
||||||
v-model="language"
|
:key="lang.code"
|
||||||
|
:value="lang.code"
|
||||||
>
|
>
|
||||||
<option
|
{{ lang.name }}
|
||||||
v-for="lang in languages"
|
</option>
|
||||||
:key="lang.code"
|
</Select>
|
||||||
:value="lang.code"
|
|
||||||
>
|
|
||||||
{{ lang.name }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<FAIcon
|
|
||||||
class="select-down-icon"
|
|
||||||
icon="chevron-down"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -32,16 +24,12 @@ import languagesObject from '../../i18n/messages'
|
||||||
import localeService from '../../services/locale/locale.service.js'
|
import localeService from '../../services/locale/locale.service.js'
|
||||||
import ISO6391 from 'iso-639-1'
|
import ISO6391 from 'iso-639-1'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import Select from '../select/select.vue'
|
||||||
import {
|
|
||||||
faChevronDown
|
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
library.add(
|
|
||||||
faChevronDown
|
|
||||||
)
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
Select
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
languages () {
|
languages () {
|
||||||
return _.map(languagesObject.languages, (code) => ({ code: code, name: this.getLanguageName(code) })).sort((a, b) => a.name.localeCompare(b.name))
|
return _.map(languagesObject.languages, (code) => ({ code: code, name: this.getLanguageName(code) })).sort((a, b) => a.name.localeCompare(b.name))
|
||||||
|
|
|
@ -76,11 +76,15 @@
|
||||||
>
|
>
|
||||||
<div class="alert error">
|
<div class="alert error">
|
||||||
{{ error }}
|
{{ error }}
|
||||||
<FAIcon
|
<button
|
||||||
class="fa-scale-110 fa-old-padding"
|
class="button-unstyled"
|
||||||
icon="times"
|
|
||||||
@click="clearError"
|
@click="clearError"
|
||||||
/>
|
>
|
||||||
|
<FAIcon
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="times"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,24 +1,46 @@
|
||||||
import StillImage from '../still-image/still-image.vue'
|
import StillImage from '../still-image/still-image.vue'
|
||||||
import VideoAttachment from '../video_attachment/video_attachment.vue'
|
import VideoAttachment from '../video_attachment/video_attachment.vue'
|
||||||
import Modal from '../modal/modal.vue'
|
import Modal from '../modal/modal.vue'
|
||||||
import fileTypeService from '../../services/file_type/file_type.service.js'
|
import PinchZoom from '../pinch_zoom/pinch_zoom.vue'
|
||||||
|
import SwipeClick from '../swipe_click/swipe_click.vue'
|
||||||
import GestureService from '../../services/gesture_service/gesture_service'
|
import GestureService from '../../services/gesture_service/gesture_service'
|
||||||
|
import Flash from 'src/components/flash/flash.vue'
|
||||||
|
import fileTypeService from '../../services/file_type/file_type.service.js'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
faChevronLeft,
|
faChevronLeft,
|
||||||
faChevronRight
|
faChevronRight,
|
||||||
|
faCircleNotch,
|
||||||
|
faTimes
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
library.add(
|
library.add(
|
||||||
faChevronLeft,
|
faChevronLeft,
|
||||||
faChevronRight
|
faChevronRight,
|
||||||
|
faCircleNotch,
|
||||||
|
faTimes
|
||||||
)
|
)
|
||||||
|
|
||||||
const MediaModal = {
|
const MediaModal = {
|
||||||
components: {
|
components: {
|
||||||
StillImage,
|
StillImage,
|
||||||
VideoAttachment,
|
VideoAttachment,
|
||||||
Modal
|
PinchZoom,
|
||||||
|
SwipeClick,
|
||||||
|
Modal,
|
||||||
|
Flash
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
swipeDirection: GestureService.DIRECTION_LEFT,
|
||||||
|
swipeThreshold: () => {
|
||||||
|
const considerableMoveRatio = 1 / 4
|
||||||
|
return window.innerWidth * considerableMoveRatio
|
||||||
|
},
|
||||||
|
pinchZoomMinScale: 1,
|
||||||
|
pinchZoomScaleResetLimit: 1.2
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
showing () {
|
showing () {
|
||||||
|
@ -27,6 +49,9 @@ const MediaModal = {
|
||||||
media () {
|
media () {
|
||||||
return this.$store.state.mediaViewer.media
|
return this.$store.state.mediaViewer.media
|
||||||
},
|
},
|
||||||
|
description () {
|
||||||
|
return this.currentMedia.description
|
||||||
|
},
|
||||||
currentIndex () {
|
currentIndex () {
|
||||||
return this.$store.state.mediaViewer.currentIndex
|
return this.$store.state.mediaViewer.currentIndex
|
||||||
},
|
},
|
||||||
|
@ -37,43 +62,62 @@ const MediaModal = {
|
||||||
return this.media.length > 1
|
return this.media.length > 1
|
||||||
},
|
},
|
||||||
type () {
|
type () {
|
||||||
return this.currentMedia ? fileTypeService.fileType(this.currentMedia.mimetype) : null
|
return this.currentMedia ? this.getType(this.currentMedia) : null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
|
||||||
this.mediaSwipeGestureRight = GestureService.swipeGesture(
|
|
||||||
GestureService.DIRECTION_RIGHT,
|
|
||||||
this.goPrev,
|
|
||||||
50
|
|
||||||
)
|
|
||||||
this.mediaSwipeGestureLeft = GestureService.swipeGesture(
|
|
||||||
GestureService.DIRECTION_LEFT,
|
|
||||||
this.goNext,
|
|
||||||
50
|
|
||||||
)
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
mediaTouchStart (e) {
|
getType (media) {
|
||||||
GestureService.beginSwipe(e, this.mediaSwipeGestureRight)
|
return fileTypeService.fileType(media.mimetype)
|
||||||
GestureService.beginSwipe(e, this.mediaSwipeGestureLeft)
|
|
||||||
},
|
|
||||||
mediaTouchMove (e) {
|
|
||||||
GestureService.updateSwipe(e, this.mediaSwipeGestureRight)
|
|
||||||
GestureService.updateSwipe(e, this.mediaSwipeGestureLeft)
|
|
||||||
},
|
},
|
||||||
hide () {
|
hide () {
|
||||||
this.$store.dispatch('closeMediaViewer')
|
// HACK: Closing immediately via a touch will cause the click
|
||||||
|
// to be processed on the content below the overlay
|
||||||
|
const transitionTime = 100 // ms
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$store.dispatch('closeMediaViewer')
|
||||||
|
}, transitionTime)
|
||||||
|
},
|
||||||
|
hideIfNotSwiped (event) {
|
||||||
|
// If we have swiped over SwipeClick, do not trigger hide
|
||||||
|
const comp = this.$refs.swipeClick
|
||||||
|
if (!comp) {
|
||||||
|
this.hide()
|
||||||
|
} else {
|
||||||
|
comp.$gesture.click(event)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
goPrev () {
|
goPrev () {
|
||||||
if (this.canNavigate) {
|
if (this.canNavigate) {
|
||||||
const prevIndex = this.currentIndex === 0 ? this.media.length - 1 : (this.currentIndex - 1)
|
const prevIndex = this.currentIndex === 0 ? this.media.length - 1 : (this.currentIndex - 1)
|
||||||
this.$store.dispatch('setCurrent', this.media[prevIndex])
|
const newMedia = this.media[prevIndex]
|
||||||
|
if (this.getType(newMedia) === 'image') {
|
||||||
|
this.loading = true
|
||||||
|
}
|
||||||
|
this.$store.dispatch('setCurrentMedia', newMedia)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
goNext () {
|
goNext () {
|
||||||
if (this.canNavigate) {
|
if (this.canNavigate) {
|
||||||
const nextIndex = this.currentIndex === this.media.length - 1 ? 0 : (this.currentIndex + 1)
|
const nextIndex = this.currentIndex === this.media.length - 1 ? 0 : (this.currentIndex + 1)
|
||||||
this.$store.dispatch('setCurrent', this.media[nextIndex])
|
const newMedia = this.media[nextIndex]
|
||||||
|
if (this.getType(newMedia) === 'image') {
|
||||||
|
this.loading = true
|
||||||
|
}
|
||||||
|
this.$store.dispatch('setCurrentMedia', newMedia)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onImageLoaded () {
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
handleSwipePreview (offsets) {
|
||||||
|
this.$refs.pinchZoom.setTransform({ scale: 1, x: offsets[0], y: 0 })
|
||||||
|
},
|
||||||
|
handleSwipeEnd (sign) {
|
||||||
|
this.$refs.pinchZoom.setTransform({ scale: 1, x: 0, y: 0 })
|
||||||
|
if (sign > 0) {
|
||||||
|
this.goNext()
|
||||||
|
} else if (sign < 0) {
|
||||||
|
this.goPrev()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleKeyupEvent (e) {
|
handleKeyupEvent (e) {
|
||||||
|
@ -98,7 +142,7 @@ const MediaModal = {
|
||||||
document.addEventListener('keyup', this.handleKeyupEvent)
|
document.addEventListener('keyup', this.handleKeyupEvent)
|
||||||
document.addEventListener('keydown', this.handleKeydownEvent)
|
document.addEventListener('keydown', this.handleKeydownEvent)
|
||||||
},
|
},
|
||||||
destroyed () {
|
unmounted () {
|
||||||
window.removeEventListener('popstate', this.hide)
|
window.removeEventListener('popstate', this.hide)
|
||||||
document.removeEventListener('keyup', this.handleKeyupEvent)
|
document.removeEventListener('keyup', this.handleKeyupEvent)
|
||||||
document.removeEventListener('keydown', this.handleKeydownEvent)
|
document.removeEventListener('keydown', this.handleKeydownEvent)
|
||||||
|
|
|
@ -2,18 +2,38 @@
|
||||||
<Modal
|
<Modal
|
||||||
v-if="showing"
|
v-if="showing"
|
||||||
class="media-modal-view"
|
class="media-modal-view"
|
||||||
@backdropClicked="hide"
|
@backdropClicked="hideIfNotSwiped"
|
||||||
>
|
>
|
||||||
<img
|
<SwipeClick
|
||||||
v-if="type === 'image'"
|
v-if="type === 'image'"
|
||||||
class="modal-image"
|
ref="swipeClick"
|
||||||
:src="currentMedia.url"
|
class="modal-image-container"
|
||||||
:alt="currentMedia.description"
|
:direction="swipeDirection"
|
||||||
:title="currentMedia.description"
|
:threshold="swipeThreshold"
|
||||||
@touchstart.stop="mediaTouchStart"
|
@preview-requested="handleSwipePreview"
|
||||||
@touchmove.stop="mediaTouchMove"
|
@swipe-finished="handleSwipeEnd"
|
||||||
@click="hide"
|
@swipeless-clicked="hide"
|
||||||
>
|
>
|
||||||
|
<PinchZoom
|
||||||
|
ref="pinchZoom"
|
||||||
|
class="modal-image-container-inner"
|
||||||
|
selector=".modal-image"
|
||||||
|
reach-min-scale-strategy="reset"
|
||||||
|
stop-propagate-handled="stop-propgate-handled"
|
||||||
|
:allow-pan-min-scale="pinchZoomMinScale"
|
||||||
|
:min-scale="pinchZoomMinScale"
|
||||||
|
:reset-to-min-scale-limit="pinchZoomScaleResetLimit"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
:class="{ loading }"
|
||||||
|
class="modal-image"
|
||||||
|
:src="currentMedia.url"
|
||||||
|
:alt="currentMedia.description"
|
||||||
|
:title="currentMedia.description"
|
||||||
|
@load="onImageLoaded"
|
||||||
|
>
|
||||||
|
</PinchZoom>
|
||||||
|
</SwipeClick>
|
||||||
<VideoAttachment
|
<VideoAttachment
|
||||||
v-if="type === 'video'"
|
v-if="type === 'video'"
|
||||||
class="modal-image"
|
class="modal-image"
|
||||||
|
@ -28,38 +48,84 @@
|
||||||
:title="currentMedia.description"
|
:title="currentMedia.description"
|
||||||
controls
|
controls
|
||||||
/>
|
/>
|
||||||
|
<Flash
|
||||||
|
v-if="type === 'flash'"
|
||||||
|
class="modal-image"
|
||||||
|
:src="currentMedia.url"
|
||||||
|
:alt="currentMedia.description"
|
||||||
|
:title="currentMedia.description"
|
||||||
|
/>
|
||||||
<button
|
<button
|
||||||
v-if="canNavigate"
|
v-if="canNavigate"
|
||||||
:title="$t('media_modal.previous')"
|
:title="$t('media_modal.previous')"
|
||||||
class="modal-view-button-arrow modal-view-button-arrow--prev"
|
class="modal-view-button modal-view-button-arrow modal-view-button-arrow--prev"
|
||||||
@click.stop.prevent="goPrev"
|
@click.stop.prevent="goPrev"
|
||||||
>
|
>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
class="arrow-icon"
|
class="button-icon arrow-icon"
|
||||||
icon="chevron-left"
|
icon="chevron-left"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="canNavigate"
|
v-if="canNavigate"
|
||||||
:title="$t('media_modal.next')"
|
:title="$t('media_modal.next')"
|
||||||
class="modal-view-button-arrow modal-view-button-arrow--next"
|
class="modal-view-button modal-view-button-arrow modal-view-button-arrow--next"
|
||||||
@click.stop.prevent="goNext"
|
@click.stop.prevent="goNext"
|
||||||
>
|
>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
class="arrow-icon"
|
class="button-icon arrow-icon"
|
||||||
icon="chevron-right"
|
icon="chevron-right"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
class="modal-view-button modal-view-button-hide"
|
||||||
|
:title="$t('media_modal.hide')"
|
||||||
|
@click.stop.prevent="hide"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
class="button-icon"
|
||||||
|
icon="times"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<span
|
||||||
|
v-if="description"
|
||||||
|
class="description"
|
||||||
|
>
|
||||||
|
{{ description }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="counter"
|
||||||
|
>
|
||||||
|
{{ $tc('media_modal.counter', currentIndex + 1, { current: currentIndex + 1, total: media.length }) }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="loading"
|
||||||
|
class="loading-spinner"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
spin
|
||||||
|
icon="circle-notch"
|
||||||
|
size="5x"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./media_modal.js"></script>
|
<script src="./media_modal.js"></script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
$modal-view-button-icon-height: 3em;
|
||||||
|
$modal-view-button-icon-half-height: calc(#{$modal-view-button-icon-height} / 2);
|
||||||
|
$modal-view-button-icon-width: 3em;
|
||||||
|
$modal-view-button-icon-margin: 0.5em;
|
||||||
|
|
||||||
.modal-view.media-modal-view {
|
.modal-view.media-modal-view {
|
||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
.modal-view-button-arrow {
|
.modal-view-button-arrow,
|
||||||
|
.modal-view-button-hide {
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
|
|
||||||
&:focus,
|
&:focus,
|
||||||
|
@ -67,69 +133,154 @@
|
||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes media-fadein {
|
.media-modal-view {
|
||||||
from {
|
@keyframes media-fadein {
|
||||||
opacity: 0;
|
from {
|
||||||
}
|
opacity: 0;
|
||||||
to {
|
}
|
||||||
opacity: 1;
|
to {
|
||||||
}
|
opacity: 1;
|
||||||
}
|
|
||||||
|
|
||||||
.modal-image {
|
|
||||||
max-width: 90%;
|
|
||||||
max-height: 90%;
|
|
||||||
box-shadow: 0px 5px 15px 0 rgba(0, 0, 0, 0.5);
|
|
||||||
image-orientation: from-image; // NOTE: only FF supports this
|
|
||||||
animation: 0.1s cubic-bezier(0.7, 0, 1, 0.6) media-fadein;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-view-button-arrow {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
top: 50%;
|
|
||||||
margin-top: -50px;
|
|
||||||
width: 70px;
|
|
||||||
height: 100px;
|
|
||||||
border: 0;
|
|
||||||
padding: 0;
|
|
||||||
opacity: 0;
|
|
||||||
box-shadow: none;
|
|
||||||
background: none;
|
|
||||||
appearance: none;
|
|
||||||
overflow: visible;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: opacity 333ms cubic-bezier(.4,0,.22,1);
|
|
||||||
|
|
||||||
.arrow-icon {
|
|
||||||
position: absolute;
|
|
||||||
top: 35px;
|
|
||||||
height: 30px;
|
|
||||||
width: 32px;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 30px;
|
|
||||||
color: #FFF;
|
|
||||||
text-align: center;
|
|
||||||
background-color: rgba(0,0,0,.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
&--prev {
|
|
||||||
left: 0;
|
|
||||||
.arrow-icon {
|
|
||||||
left: 6px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&--next {
|
.modal-image-container {
|
||||||
right: 0;
|
display: flex;
|
||||||
|
overflow: hidden;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
flex-grow: 1;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
&-inner {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.description,
|
||||||
|
.counter {
|
||||||
|
/* Hardcoded since background is also hardcoded */
|
||||||
|
color: white;
|
||||||
|
margin-top: 1em;
|
||||||
|
text-shadow: 0 0 10px black, 0 0 10px black;
|
||||||
|
padding: 0.2em 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
overflow-y: auto;
|
||||||
|
min-height: 1em;
|
||||||
|
max-width: 500px;
|
||||||
|
max-height: 9.5em;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-image {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
image-orientation: from-image; // NOTE: only FF supports this
|
||||||
|
animation: 0.1s cubic-bezier(0.7, 0, 1, 0.6) media-fadein;
|
||||||
|
|
||||||
|
&.loading {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-spinner {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-view-button {
|
||||||
|
border: 0;
|
||||||
|
padding: 0;
|
||||||
|
opacity: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
background: none;
|
||||||
|
appearance: none;
|
||||||
|
overflow: visible;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: opacity 333ms cubic-bezier(.4,0,.22,1);
|
||||||
|
height: $modal-view-button-icon-height;
|
||||||
|
width: $modal-view-button-icon-width;
|
||||||
|
|
||||||
|
.button-icon {
|
||||||
|
position: absolute;
|
||||||
|
height: $modal-view-button-icon-height;
|
||||||
|
width: $modal-view-button-icon-width;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: $modal-view-button-icon-height;
|
||||||
|
color: #FFF;
|
||||||
|
text-align: center;
|
||||||
|
background-color: rgba(0,0,0,.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-view-button-arrow {
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: $modal-view-button-icon-half-height;
|
||||||
|
width: $modal-view-button-icon-width;
|
||||||
|
height: $modal-view-button-icon-height;
|
||||||
|
|
||||||
.arrow-icon {
|
.arrow-icon {
|
||||||
right: 6px;
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
line-height: $modal-view-button-icon-height;
|
||||||
|
color: #FFF;
|
||||||
|
text-align: center;
|
||||||
|
background-color: rgba(0,0,0,.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
&--prev {
|
||||||
|
left: 0;
|
||||||
|
.arrow-icon {
|
||||||
|
left: $modal-view-button-icon-margin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--next {
|
||||||
|
right: 0;
|
||||||
|
.arrow-icon {
|
||||||
|
right: $modal-view-button-icon-margin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-view-button-hide {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
.button-icon {
|
||||||
|
top: $modal-view-button-icon-margin;
|
||||||
|
right: $modal-view-button-icon-margin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
134
src/components/mention_link/mention_link.js
Normal file
134
src/components/mention_link/mention_link.js
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||||
|
import { mapGetters, mapState } from 'vuex'
|
||||||
|
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
|
||||||
|
import UserAvatar from '../user_avatar/user_avatar.vue'
|
||||||
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import {
|
||||||
|
faAt
|
||||||
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
|
library.add(
|
||||||
|
faAt
|
||||||
|
)
|
||||||
|
|
||||||
|
const MentionLink = {
|
||||||
|
name: 'MentionLink',
|
||||||
|
components: {
|
||||||
|
UserAvatar
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
url: {
|
||||||
|
required: true,
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
required: true,
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
userId: {
|
||||||
|
required: false,
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
userScreenName: {
|
||||||
|
required: false,
|
||||||
|
type: String
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onClick () {
|
||||||
|
const link = generateProfileLink(
|
||||||
|
this.userId || this.user.id,
|
||||||
|
this.userScreenName || this.user.screen_name
|
||||||
|
)
|
||||||
|
this.$router.push(link)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
user () {
|
||||||
|
return this.url && this.$store && this.$store.getters.findUserByUrl(this.url)
|
||||||
|
},
|
||||||
|
isYou () {
|
||||||
|
// FIXME why user !== currentUser???
|
||||||
|
return this.user && this.user.id === this.currentUser.id
|
||||||
|
},
|
||||||
|
userName () {
|
||||||
|
return this.user && this.userNameFullUi.split('@')[0]
|
||||||
|
},
|
||||||
|
serverName () {
|
||||||
|
// XXX assumed that domain does not contain @
|
||||||
|
return this.user && (this.userNameFullUi.split('@')[1] || this.$store.getters.instanceDomain)
|
||||||
|
},
|
||||||
|
userNameFull () {
|
||||||
|
return this.user && this.user.screen_name
|
||||||
|
},
|
||||||
|
userNameFullUi () {
|
||||||
|
return this.user && this.user.screen_name_ui
|
||||||
|
},
|
||||||
|
highlight () {
|
||||||
|
return this.user && this.mergedConfig.highlight[this.user.screen_name]
|
||||||
|
},
|
||||||
|
highlightType () {
|
||||||
|
return this.highlight && ('-' + this.highlight.type)
|
||||||
|
},
|
||||||
|
highlightClass () {
|
||||||
|
if (this.highlight) return highlightClass(this.user)
|
||||||
|
},
|
||||||
|
style () {
|
||||||
|
if (this.highlight) {
|
||||||
|
const {
|
||||||
|
backgroundColor,
|
||||||
|
backgroundPosition,
|
||||||
|
backgroundImage,
|
||||||
|
...rest
|
||||||
|
} = highlightStyle(this.highlight)
|
||||||
|
return rest
|
||||||
|
}
|
||||||
|
},
|
||||||
|
classnames () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
'-you': this.isYou && this.shouldBoldenYou,
|
||||||
|
'-highlighted': this.highlight
|
||||||
|
},
|
||||||
|
this.highlightType
|
||||||
|
]
|
||||||
|
},
|
||||||
|
useAtIcon () {
|
||||||
|
return this.mergedConfig.useAtIcon
|
||||||
|
},
|
||||||
|
isRemote () {
|
||||||
|
return this.userName !== this.userNameFull
|
||||||
|
},
|
||||||
|
shouldShowFullUserName () {
|
||||||
|
const conf = this.mergedConfig.mentionLinkDisplay
|
||||||
|
if (conf === 'short') {
|
||||||
|
return false
|
||||||
|
} else if (conf === 'full') {
|
||||||
|
return true
|
||||||
|
} else { // full_for_remote
|
||||||
|
return this.isRemote
|
||||||
|
}
|
||||||
|
},
|
||||||
|
shouldShowTooltip () {
|
||||||
|
return this.mergedConfig.mentionLinkShowTooltip && this.mergedConfig.mentionLinkDisplay === 'short' && this.isRemote
|
||||||
|
},
|
||||||
|
shouldShowAvatar () {
|
||||||
|
return this.mergedConfig.mentionLinkShowAvatar
|
||||||
|
},
|
||||||
|
shouldShowYous () {
|
||||||
|
return this.mergedConfig.mentionLinkShowYous
|
||||||
|
},
|
||||||
|
shouldBoldenYou () {
|
||||||
|
return this.mergedConfig.mentionLinkBoldenYou
|
||||||
|
},
|
||||||
|
shouldFadeDomain () {
|
||||||
|
return this.mergedConfig.mentionLinkFadeDomain
|
||||||
|
},
|
||||||
|
...mapGetters(['mergedConfig']),
|
||||||
|
...mapState({
|
||||||
|
currentUser: state => state.users.currentUser
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MentionLink
|
115
src/components/mention_link/mention_link.scss
Normal file
115
src/components/mention_link/mention_link.scss
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
|
.MentionLink {
|
||||||
|
position: relative;
|
||||||
|
white-space: normal;
|
||||||
|
display: inline;
|
||||||
|
color: var(--link);
|
||||||
|
word-break: normal;
|
||||||
|
|
||||||
|
& .new,
|
||||||
|
& .original {
|
||||||
|
display: inline;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mention-avatar {
|
||||||
|
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
|
||||||
|
width: 1.5em;
|
||||||
|
height: 1.5em;
|
||||||
|
vertical-align: middle;
|
||||||
|
user-select: none;
|
||||||
|
margin-right: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full {
|
||||||
|
position: absolute;
|
||||||
|
display: inline-block;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
word-wrap: normal;
|
||||||
|
white-space: nowrap;
|
||||||
|
transition: opacity 0.2s ease;
|
||||||
|
z-index: 1;
|
||||||
|
margin-top: 0.25em;
|
||||||
|
padding: 0.5em;
|
||||||
|
user-select: all;
|
||||||
|
}
|
||||||
|
|
||||||
|
& .short.-with-tooltip,
|
||||||
|
& .you {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
& .short,
|
||||||
|
& .full {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shortName {
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.new {
|
||||||
|
&.-you {
|
||||||
|
& .shortName,
|
||||||
|
& .full {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.at {
|
||||||
|
color: var(--link);
|
||||||
|
opacity: 0.8;
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 0 0.1em;
|
||||||
|
vertical-align: -25%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-striped {
|
||||||
|
& .shortName,
|
||||||
|
& .full {
|
||||||
|
background-image:
|
||||||
|
repeating-linear-gradient(
|
||||||
|
135deg,
|
||||||
|
var(--____highlight-tintColor),
|
||||||
|
var(--____highlight-tintColor) 5px,
|
||||||
|
var(--____highlight-tintColor2) 5px,
|
||||||
|
var(--____highlight-tintColor2) 10px
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-solid {
|
||||||
|
& .shortName,
|
||||||
|
& .full {
|
||||||
|
background-image: linear-gradient(var(--____highlight-tintColor2), var(--____highlight-tintColor2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-side {
|
||||||
|
& .shortName,
|
||||||
|
& .userNameFull {
|
||||||
|
box-shadow: 0 -5px 3px -4px inset var(--____highlight-solidColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover .new .full {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
.serverName.-faded {
|
||||||
|
color: var(--faintLink, $fallback--link);
|
||||||
|
}
|
||||||
|
|
||||||
|
.full .-faded {
|
||||||
|
color: var(--faint, $fallback--faint);
|
||||||
|
}
|
||||||
|
}
|
77
src/components/mention_link/mention_link.vue
Normal file
77
src/components/mention_link/mention_link.vue
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
<template>
|
||||||
|
<span
|
||||||
|
class="MentionLink"
|
||||||
|
>
|
||||||
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
|
<a
|
||||||
|
v-if="!user"
|
||||||
|
:href="url"
|
||||||
|
class="original"
|
||||||
|
target="_blank"
|
||||||
|
v-html="content"
|
||||||
|
/><!-- eslint-enable vue/no-v-html --><span
|
||||||
|
v-if="user"
|
||||||
|
class="new"
|
||||||
|
:style="style"
|
||||||
|
:class="classnames"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
class="short button-unstyled"
|
||||||
|
:class="{ '-with-tooltip': shouldShowTooltip }"
|
||||||
|
:href="url"
|
||||||
|
@click.prevent="onClick"
|
||||||
|
>
|
||||||
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
|
<UserAvatar
|
||||||
|
v-if="shouldShowAvatar"
|
||||||
|
class="mention-avatar"
|
||||||
|
:user="user"
|
||||||
|
/><span
|
||||||
|
class="shortName"
|
||||||
|
><FAIcon
|
||||||
|
v-if="useAtIcon"
|
||||||
|
size="sm"
|
||||||
|
icon="at"
|
||||||
|
class="at"
|
||||||
|
/>{{ !useAtIcon ? '@' : '' }}<span
|
||||||
|
class="userName"
|
||||||
|
v-html="userName"
|
||||||
|
/><span
|
||||||
|
v-if="shouldShowFullUserName"
|
||||||
|
class="serverName"
|
||||||
|
:class="{ '-faded': shouldFadeDomain }"
|
||||||
|
v-html="'@' + serverName"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="isYou && shouldShowYous"
|
||||||
|
:class="{ '-you': shouldBoldenYou }"
|
||||||
|
> {{ ' ' + $t('status.you') }}</span>
|
||||||
|
<!-- eslint-enable vue/no-v-html -->
|
||||||
|
</a><span
|
||||||
|
v-if="shouldShowTooltip"
|
||||||
|
class="full popover-default"
|
||||||
|
:class="[highlightType]"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="userNameFull"
|
||||||
|
>
|
||||||
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
|
@<span
|
||||||
|
class="userName"
|
||||||
|
v-html="userName"
|
||||||
|
/><span
|
||||||
|
class="serverName"
|
||||||
|
:class="{ '-faded': shouldFadeDomain }"
|
||||||
|
v-html="'@' + serverName"
|
||||||
|
/>
|
||||||
|
<!-- eslint-enable vue/no-v-html -->
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./mention_link.js"/>
|
||||||
|
|
||||||
|
<style lang="scss" src="./mention_link.scss"/>
|
37
src/components/mentions_line/mentions_line.js
Normal file
37
src/components/mentions_line/mentions_line.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
import MentionLink from 'src/components/mention_link/mention_link.vue'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
|
export const MENTIONS_LIMIT = 5
|
||||||
|
|
||||||
|
const MentionsLine = {
|
||||||
|
name: 'MentionsLine',
|
||||||
|
props: {
|
||||||
|
mentions: {
|
||||||
|
required: true,
|
||||||
|
type: Array
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: () => ({ expanded: false }),
|
||||||
|
components: {
|
||||||
|
MentionLink
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
mentionsComputed () {
|
||||||
|
return this.mentions.slice(0, MENTIONS_LIMIT)
|
||||||
|
},
|
||||||
|
extraMentions () {
|
||||||
|
return this.mentions.slice(MENTIONS_LIMIT)
|
||||||
|
},
|
||||||
|
manyMentions () {
|
||||||
|
return this.extraMentions.length > 0
|
||||||
|
},
|
||||||
|
...mapGetters(['mergedConfig'])
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toggleShowMore () {
|
||||||
|
this.expanded = !this.expanded
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MentionsLine
|
13
src/components/mentions_line/mentions_line.scss
Normal file
13
src/components/mentions_line/mentions_line.scss
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
.MentionsLine {
|
||||||
|
word-break: break-all;
|
||||||
|
|
||||||
|
.mention-link:not(:first-child)::before {
|
||||||
|
content: ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
.showMoreLess {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
white-space: normal;
|
||||||
|
color: var(--link);
|
||||||
|
}
|
||||||
|
}
|
41
src/components/mentions_line/mentions_line.vue
Normal file
41
src/components/mentions_line/mentions_line.vue
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<template>
|
||||||
|
<span class="MentionsLine">
|
||||||
|
<MentionLink
|
||||||
|
v-for="mention in mentionsComputed"
|
||||||
|
:key="mention.index"
|
||||||
|
class="mention-link"
|
||||||
|
:content="mention.content"
|
||||||
|
:url="mention.url"
|
||||||
|
/><span
|
||||||
|
v-if="manyMentions"
|
||||||
|
class="extraMentions"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
v-if="expanded"
|
||||||
|
class="fullExtraMentions"
|
||||||
|
>
|
||||||
|
<MentionLink
|
||||||
|
v-for="mention in extraMentions"
|
||||||
|
:key="mention.index"
|
||||||
|
class="mention-link"
|
||||||
|
:content="mention.content"
|
||||||
|
:url="mention.url"
|
||||||
|
/>
|
||||||
|
</span><button
|
||||||
|
v-if="!expanded"
|
||||||
|
class="button-unstyled showMoreLess"
|
||||||
|
@click="toggleShowMore"
|
||||||
|
>
|
||||||
|
{{ $t('status.plus_more', { number: extraMentions.length }) }}
|
||||||
|
</button><button
|
||||||
|
v-if="expanded"
|
||||||
|
class="button-unstyled showMoreLess"
|
||||||
|
@click="toggleShowMore"
|
||||||
|
>
|
||||||
|
{{ $t('general.show_less') }}
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<script src="./mentions_line.js" ></script>
|
||||||
|
<style lang="scss" src="./mentions_line.scss" />
|
|
@ -56,11 +56,15 @@
|
||||||
>
|
>
|
||||||
<div class="alert error">
|
<div class="alert error">
|
||||||
{{ error }}
|
{{ error }}
|
||||||
<FAIcon
|
<button
|
||||||
class="fa-scale-110 fa-old-padding"
|
class="button-unstyled"
|
||||||
icon="times"
|
|
||||||
@click="clearError"
|
@click="clearError"
|
||||||
/>
|
>
|
||||||
|
<FAIcon
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="times"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -58,12 +58,16 @@
|
||||||
>
|
>
|
||||||
<div class="alert error">
|
<div class="alert error">
|
||||||
{{ error }}
|
{{ error }}
|
||||||
<FAIcon
|
<button
|
||||||
size="lg"
|
class="button-unstyled"
|
||||||
class="fa-scale-110 fa-old-padding"
|
|
||||||
icon="times"
|
|
||||||
@click="clearError"
|
@click="clearError"
|
||||||
/>
|
>
|
||||||
|
<FAIcon
|
||||||
|
size="lg"
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="times"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -99,6 +99,9 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
a {
|
||||||
|
color: var(--topBarLink, $fallback--link);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-inner-nav {
|
.mobile-inner-nav {
|
||||||
|
|
|
@ -29,7 +29,7 @@ const MobilePostStatusButton = {
|
||||||
}
|
}
|
||||||
window.addEventListener('resize', this.handleOSK)
|
window.addEventListener('resize', this.handleOSK)
|
||||||
},
|
},
|
||||||
destroyed () {
|
unmounted () {
|
||||||
if (this.autohideFloatingPostButton) {
|
if (this.autohideFloatingPostButton) {
|
||||||
this.deactivateFloatingPostButtonAutohide()
|
this.deactivateFloatingPostButtonAutohide()
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,9 @@ const MobilePostStatusButton = {
|
||||||
|
|
||||||
return this.autohideFloatingPostButton && (this.hidden || this.inputActive)
|
return this.autohideFloatingPostButton && (this.hidden || this.inputActive)
|
||||||
},
|
},
|
||||||
|
isPersistent () {
|
||||||
|
return !!this.$store.getters.mergedConfig.showNewPostButton
|
||||||
|
},
|
||||||
autohideFloatingPostButton () {
|
autohideFloatingPostButton () {
|
||||||
return !!this.$store.getters.mergedConfig.autohideFloatingPostButton
|
return !!this.$store.getters.mergedConfig.autohideFloatingPostButton
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="isLoggedIn">
|
<button
|
||||||
<button
|
v-if="isLoggedIn"
|
||||||
class="button-default new-status-button"
|
class="MobilePostButton button-default new-status-button"
|
||||||
:class="{ 'hidden': isHidden }"
|
:class="{ 'hidden': isHidden, 'always-show': isPersistent }"
|
||||||
@click="openPostForm"
|
@click="openPostForm"
|
||||||
>
|
>
|
||||||
<FAIcon icon="pen" />
|
<FAIcon icon="pen" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./mobile_post_status_button.js"></script>
|
<script src="./mobile_post_status_button.js"></script>
|
||||||
|
@ -15,25 +14,27 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import '../../_variables.scss';
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
.new-status-button {
|
.MobilePostButton {
|
||||||
width: 5em;
|
&.button-default {
|
||||||
height: 5em;
|
width: 5em;
|
||||||
border-radius: 100%;
|
height: 5em;
|
||||||
position: fixed;
|
border-radius: 100%;
|
||||||
bottom: 1.5em;
|
position: fixed;
|
||||||
right: 1.5em;
|
bottom: 1.5em;
|
||||||
// TODO: this needs its own color, it has to stand out enough and link color
|
right: 1.5em;
|
||||||
// is not very optimal for this particular use.
|
// TODO: this needs its own color, it has to stand out enough and link color
|
||||||
background-color: $fallback--fg;
|
// is not very optimal for this particular use.
|
||||||
background-color: var(--btn, $fallback--fg);
|
background-color: $fallback--fg;
|
||||||
display: flex;
|
background-color: var(--btn, $fallback--fg);
|
||||||
justify-content: center;
|
display: flex;
|
||||||
align-items: center;
|
justify-content: center;
|
||||||
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3), 0px 4px 6px rgba(0, 0, 0, 0.3);
|
align-items: center;
|
||||||
z-index: 10;
|
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3), 0px 4px 6px rgba(0, 0, 0, 0.3);
|
||||||
|
z-index: 10;
|
||||||
|
|
||||||
transition: 0.35s transform;
|
transition: 0.35s transform;
|
||||||
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
|
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
|
||||||
|
}
|
||||||
|
|
||||||
&.hidden {
|
&.hidden {
|
||||||
transform: translateY(150%);
|
transform: translateY(150%);
|
||||||
|
@ -47,7 +48,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 801px) {
|
@media all and (min-width: 801px) {
|
||||||
.new-status-button {
|
.new-status-button:not(.always-show) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
@show="setToggled(true)"
|
@show="setToggled(true)"
|
||||||
@close="setToggled(false)"
|
@close="setToggled(false)"
|
||||||
>
|
>
|
||||||
<div slot="content">
|
<template v-slot:content>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<span v-if="user.is_local">
|
<span v-if="user.is_local">
|
||||||
<button
|
<button
|
||||||
|
@ -121,26 +121,27 @@
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
<button
|
<template v-slot:trigger>
|
||||||
slot="trigger"
|
<button
|
||||||
class="btn button-default btn-block moderation-tools-button"
|
class="btn button-default btn-block moderation-tools-button"
|
||||||
:class="{ toggled }"
|
:class="{ toggled }"
|
||||||
>
|
>
|
||||||
{{ $t('user_card.admin_menu.moderation') }}
|
{{ $t('user_card.admin_menu.moderation') }}
|
||||||
<FAIcon icon="chevron-down" />
|
<FAIcon icon="chevron-down" />
|
||||||
</button>
|
</button>
|
||||||
|
</template>
|
||||||
</Popover>
|
</Popover>
|
||||||
<portal to="modal">
|
<teleport to="#modal">
|
||||||
<DialogModal
|
<DialogModal
|
||||||
v-if="showDeleteUserDialog"
|
v-if="showDeleteUserDialog"
|
||||||
:on-cancel="deleteUserDialog.bind(this, false)"
|
:on-cancel="deleteUserDialog.bind(this, false)"
|
||||||
>
|
>
|
||||||
<template slot="header">
|
<template v-slot:header>
|
||||||
{{ $t('user_card.admin_menu.delete_user') }}
|
{{ $t('user_card.admin_menu.delete_user') }}
|
||||||
</template>
|
</template>
|
||||||
<p>{{ $t('user_card.admin_menu.delete_user_confirmation') }}</p>
|
<p>{{ $t('user_card.admin_menu.delete_user_confirmation') }}</p>
|
||||||
<template slot="footer">
|
<template v-slot:footer>
|
||||||
<button
|
<button
|
||||||
class="btn button-default"
|
class="btn button-default"
|
||||||
@click="deleteUserDialog(false)"
|
@click="deleteUserDialog(false)"
|
||||||
|
@ -155,7 +156,7 @@
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</DialogModal>
|
</DialogModal>
|
||||||
</portal>
|
</teleport>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,56 @@
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import { get } from 'lodash'
|
import { get } from 'lodash'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is for backwards compatibility. We originally didn't recieve
|
||||||
|
* extra info like a reason why an instance was rejected/quarantined/etc.
|
||||||
|
* Because we didn't want to break backwards compatibility it was decided
|
||||||
|
* to add an extra "info" key.
|
||||||
|
*/
|
||||||
|
const toInstanceReasonObject = (instances, info, key) => {
|
||||||
|
return instances.map(instance => {
|
||||||
|
if (info[key] && info[key][instance] && info[key][instance]['reason']) {
|
||||||
|
return { instance: instance, reason: info[key][instance]['reason'] }
|
||||||
|
}
|
||||||
|
return { instance: instance, reason: '' }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const MRFTransparencyPanel = {
|
const MRFTransparencyPanel = {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
federationPolicy: state => get(state, 'instance.federationPolicy'),
|
federationPolicy: state => get(state, 'instance.federationPolicy'),
|
||||||
mrfPolicies: state => get(state, 'instance.federationPolicy.mrf_policies', []),
|
mrfPolicies: state => get(state, 'instance.federationPolicy.mrf_policies', []),
|
||||||
quarantineInstances: state => get(state, 'instance.federationPolicy.quarantined_instances', []),
|
quarantineInstances: state => toInstanceReasonObject(
|
||||||
acceptInstances: state => get(state, 'instance.federationPolicy.mrf_simple.accept', []),
|
get(state, 'instance.federationPolicy.quarantined_instances', []),
|
||||||
rejectInstances: state => get(state, 'instance.federationPolicy.mrf_simple.reject', []),
|
get(state, 'instance.federationPolicy.quarantined_instances_info', []),
|
||||||
ftlRemovalInstances: state => get(state, 'instance.federationPolicy.mrf_simple.federated_timeline_removal', []),
|
'quarantined_instances'
|
||||||
mediaNsfwInstances: state => get(state, 'instance.federationPolicy.mrf_simple.media_nsfw', []),
|
),
|
||||||
mediaRemovalInstances: state => get(state, 'instance.federationPolicy.mrf_simple.media_removal', []),
|
acceptInstances: state => toInstanceReasonObject(
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple.accept', []),
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple_info', []),
|
||||||
|
'accept'
|
||||||
|
),
|
||||||
|
rejectInstances: state => toInstanceReasonObject(
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple.reject', []),
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple_info', []),
|
||||||
|
'reject'
|
||||||
|
),
|
||||||
|
ftlRemovalInstances: state => toInstanceReasonObject(
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple.federated_timeline_removal', []),
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple_info', []),
|
||||||
|
'federated_timeline_removal'
|
||||||
|
),
|
||||||
|
mediaNsfwInstances: state => toInstanceReasonObject(
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple.media_nsfw', []),
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple_info', []),
|
||||||
|
'media_nsfw'
|
||||||
|
),
|
||||||
|
mediaRemovalInstances: state => toInstanceReasonObject(
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple.media_removal', []),
|
||||||
|
get(state, 'instance.federationPolicy.mrf_simple_info', []),
|
||||||
|
'media_removal'
|
||||||
|
),
|
||||||
keywordsFtlRemoval: state => get(state, 'instance.federationPolicy.mrf_keyword.federated_timeline_removal', []),
|
keywordsFtlRemoval: state => get(state, 'instance.federationPolicy.mrf_keyword.federated_timeline_removal', []),
|
||||||
keywordsReject: state => get(state, 'instance.federationPolicy.mrf_keyword.reject', []),
|
keywordsReject: state => get(state, 'instance.federationPolicy.mrf_keyword.reject', []),
|
||||||
keywordsReplace: state => get(state, 'instance.federationPolicy.mrf_keyword.replace', [])
|
keywordsReplace: state => get(state, 'instance.federationPolicy.mrf_keyword.replace', [])
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
.mrf-section {
|
||||||
|
margin: 1em;
|
||||||
|
|
||||||
|
table {
|
||||||
|
width:100%;
|
||||||
|
text-align: left;
|
||||||
|
padding-left:10px;
|
||||||
|
padding-bottom:20px;
|
||||||
|
|
||||||
|
th, td {
|
||||||
|
width: 180px;
|
||||||
|
max-width: 360px;
|
||||||
|
overflow: hidden;
|
||||||
|
vertical-align: text-top;
|
||||||
|
}
|
||||||
|
|
||||||
|
th+th, td+td {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -31,13 +31,24 @@
|
||||||
|
|
||||||
<p>{{ $t("about.mrf.simple.accept_desc") }}</p>
|
<p>{{ $t("about.mrf.simple.accept_desc") }}</p>
|
||||||
|
|
||||||
<ul>
|
<table>
|
||||||
<li
|
<tr>
|
||||||
v-for="instance in acceptInstances"
|
<th>{{ $t("about.mrf.simple.instance") }}</th>
|
||||||
:key="instance"
|
<th>{{ $t("about.mrf.simple.reason") }}</th>
|
||||||
v-text="instance"
|
</tr>
|
||||||
/>
|
<tr
|
||||||
</ul>
|
v-for="entry in acceptInstances"
|
||||||
|
:key="entry.instance + '_accept'"
|
||||||
|
>
|
||||||
|
<td>{{ entry.instance }}</td>
|
||||||
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.not_applicable") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="rejectInstances.length">
|
<div v-if="rejectInstances.length">
|
||||||
|
@ -45,13 +56,24 @@
|
||||||
|
|
||||||
<p>{{ $t("about.mrf.simple.reject_desc") }}</p>
|
<p>{{ $t("about.mrf.simple.reject_desc") }}</p>
|
||||||
|
|
||||||
<ul>
|
<table>
|
||||||
<li
|
<tr>
|
||||||
v-for="instance in rejectInstances"
|
<th>{{ $t("about.mrf.simple.instance") }}</th>
|
||||||
:key="instance"
|
<th>{{ $t("about.mrf.simple.reason") }}</th>
|
||||||
v-text="instance"
|
</tr>
|
||||||
/>
|
<tr
|
||||||
</ul>
|
v-for="entry in rejectInstances"
|
||||||
|
:key="entry.instance + '_reject'"
|
||||||
|
>
|
||||||
|
<td>{{ entry.instance }}</td>
|
||||||
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.not_applicable") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="quarantineInstances.length">
|
<div v-if="quarantineInstances.length">
|
||||||
|
@ -59,13 +81,24 @@
|
||||||
|
|
||||||
<p>{{ $t("about.mrf.simple.quarantine_desc") }}</p>
|
<p>{{ $t("about.mrf.simple.quarantine_desc") }}</p>
|
||||||
|
|
||||||
<ul>
|
<table>
|
||||||
<li
|
<tr>
|
||||||
v-for="instance in quarantineInstances"
|
<th>{{ $t("about.mrf.simple.instance") }}</th>
|
||||||
:key="instance"
|
<th>{{ $t("about.mrf.simple.reason") }}</th>
|
||||||
v-text="instance"
|
</tr>
|
||||||
/>
|
<tr
|
||||||
</ul>
|
v-for="entry in quarantineInstances"
|
||||||
|
:key="entry.instance + '_quarantine'"
|
||||||
|
>
|
||||||
|
<td>{{ entry.instance }}</td>
|
||||||
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.not_applicable") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="ftlRemovalInstances.length">
|
<div v-if="ftlRemovalInstances.length">
|
||||||
|
@ -73,13 +106,24 @@
|
||||||
|
|
||||||
<p>{{ $t("about.mrf.simple.ftl_removal_desc") }}</p>
|
<p>{{ $t("about.mrf.simple.ftl_removal_desc") }}</p>
|
||||||
|
|
||||||
<ul>
|
<table>
|
||||||
<li
|
<tr>
|
||||||
v-for="instance in ftlRemovalInstances"
|
<th>{{ $t("about.mrf.simple.instance") }}</th>
|
||||||
:key="instance"
|
<th>{{ $t("about.mrf.simple.reason") }}</th>
|
||||||
v-text="instance"
|
</tr>
|
||||||
/>
|
<tr
|
||||||
</ul>
|
v-for="entry in ftlRemovalInstances"
|
||||||
|
:key="entry.instance + '_ftl_removal'"
|
||||||
|
>
|
||||||
|
<td>{{ entry.instance }}</td>
|
||||||
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.not_applicable") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="mediaNsfwInstances.length">
|
<div v-if="mediaNsfwInstances.length">
|
||||||
|
@ -87,13 +131,24 @@
|
||||||
|
|
||||||
<p>{{ $t("about.mrf.simple.media_nsfw_desc") }}</p>
|
<p>{{ $t("about.mrf.simple.media_nsfw_desc") }}</p>
|
||||||
|
|
||||||
<ul>
|
<table>
|
||||||
<li
|
<tr>
|
||||||
v-for="instance in mediaNsfwInstances"
|
<th>{{ $t("about.mrf.simple.instance") }}</th>
|
||||||
:key="instance"
|
<th>{{ $t("about.mrf.simple.reason") }}</th>
|
||||||
v-text="instance"
|
</tr>
|
||||||
/>
|
<tr
|
||||||
</ul>
|
v-for="entry in mediaNsfwInstances"
|
||||||
|
:key="entry.instance + '_media_nsfw'"
|
||||||
|
>
|
||||||
|
<td>{{ entry.instance }}</td>
|
||||||
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.not_applicable") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="mediaRemovalInstances.length">
|
<div v-if="mediaRemovalInstances.length">
|
||||||
|
@ -101,13 +156,24 @@
|
||||||
|
|
||||||
<p>{{ $t("about.mrf.simple.media_removal_desc") }}</p>
|
<p>{{ $t("about.mrf.simple.media_removal_desc") }}</p>
|
||||||
|
|
||||||
<ul>
|
<table>
|
||||||
<li
|
<tr>
|
||||||
v-for="instance in mediaRemovalInstances"
|
<th>{{ $t("about.mrf.simple.instance") }}</th>
|
||||||
:key="instance"
|
<th>{{ $t("about.mrf.simple.reason") }}</th>
|
||||||
v-text="instance"
|
</tr>
|
||||||
/>
|
<tr
|
||||||
</ul>
|
v-for="entry in mediaRemovalInstances"
|
||||||
|
:key="entry.instance + '_media_removal'"
|
||||||
|
>
|
||||||
|
<td>{{ entry.instance }}</td>
|
||||||
|
<td v-if="entry.reason === ''">
|
||||||
|
{{ $t("about.mrf.simple.not_applicable") }}
|
||||||
|
</td>
|
||||||
|
<td v-else>
|
||||||
|
{{ entry.reason }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 v-if="hasKeywordPolicies">
|
<h2 v-if="hasKeywordPolicies">
|
||||||
|
@ -161,7 +227,6 @@
|
||||||
<script src="./mrf_transparency_panel.js"></script>
|
<script src="./mrf_transparency_panel.js"></script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.mrf-section {
|
@import '../../_variables.scss';
|
||||||
margin: 1em;
|
@import './mrf_transparency_panel.scss';
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import Status from '../status/status.vue'
|
||||||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
import UserAvatar from '../user_avatar/user_avatar.vue'
|
||||||
import UserCard from '../user_card/user_card.vue'
|
import UserCard from '../user_card/user_card.vue'
|
||||||
import Timeago from '../timeago/timeago.vue'
|
import Timeago from '../timeago/timeago.vue'
|
||||||
|
import RichContent from 'src/components/rich_content/rich_content.jsx'
|
||||||
import { isStatusNotification } from '../../services/notification_utils/notification_utils.js'
|
import { isStatusNotification } from '../../services/notification_utils/notification_utils.js'
|
||||||
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
|
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||||
|
@ -44,7 +45,8 @@ const Notification = {
|
||||||
UserAvatar,
|
UserAvatar,
|
||||||
UserCard,
|
UserCard,
|
||||||
Timeago,
|
Timeago,
|
||||||
Status
|
Status,
|
||||||
|
RichContent
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleUserExpanded () {
|
toggleUserExpanded () {
|
||||||
|
|
|
@ -2,6 +2,19 @@
|
||||||
|
|
||||||
// TODO Copypaste from Status, should unify it somehow
|
// TODO Copypaste from Status, should unify it somehow
|
||||||
.Notification {
|
.Notification {
|
||||||
|
border-bottom: 1px solid;
|
||||||
|
border-color: $fallback--border;
|
||||||
|
border-color: var(--border, $fallback--border);
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-word;
|
||||||
|
--emoji-size: 14px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
--_still-image-img-visibility: visible;
|
||||||
|
--_still-image-canvas-visibility: hidden;
|
||||||
|
--_still-image-label-visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
&.-muted {
|
&.-muted {
|
||||||
padding: 0.25em 0.6em;
|
padding: 0.25em 0.6em;
|
||||||
height: 1.2em;
|
height: 1.2em;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<Status
|
<Status
|
||||||
v-if="notification.type === 'mention'"
|
v-if="notification.type === 'mention'"
|
||||||
|
class="Notification"
|
||||||
:compact="true"
|
:compact="true"
|
||||||
:statusoid="notification.status"
|
:statusoid="notification.status"
|
||||||
/>
|
/>
|
||||||
|
@ -32,7 +33,7 @@
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="avatar-container"
|
class="avatar-container"
|
||||||
:href="notification.from_profile.statusnet_profile_url"
|
:href="$router.resolve(userProfileLink).href"
|
||||||
@click.stop.prevent.capture="toggleUserExpanded"
|
@click.stop.prevent.capture="toggleUserExpanded"
|
||||||
>
|
>
|
||||||
<UserAvatar
|
<UserAvatar
|
||||||
|
@ -51,23 +52,29 @@
|
||||||
<span class="notification-details">
|
<span class="notification-details">
|
||||||
<div class="name-and-action">
|
<div class="name-and-action">
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
<bdi
|
<bdi v-if="!!notification.from_profile.name_html">
|
||||||
v-if="!!notification.from_profile.name_html"
|
<RichContent
|
||||||
class="username"
|
class="username"
|
||||||
:title="'@'+notification.from_profile.screen_name_ui"
|
:title="'@'+notification.from_profile.screen_name_ui"
|
||||||
v-html="notification.from_profile.name_html"
|
:html="notification.from_profile.name_html"
|
||||||
/>
|
:emoji="notification.from_profile.emoji"
|
||||||
|
/>
|
||||||
|
</bdi>
|
||||||
<!-- eslint-enable vue/no-v-html -->
|
<!-- eslint-enable vue/no-v-html -->
|
||||||
<span
|
<span
|
||||||
v-else
|
v-else
|
||||||
class="username"
|
class="username"
|
||||||
:title="'@'+notification.from_profile.screen_name_ui"
|
:title="'@'+notification.from_profile.screen_name_ui"
|
||||||
>{{ notification.from_profile.name }}</span>
|
>
|
||||||
|
{{ notification.from_profile.name }}
|
||||||
|
</span>
|
||||||
|
{{ ' ' }}
|
||||||
<span v-if="notification.type === 'like'">
|
<span v-if="notification.type === 'like'">
|
||||||
<FAIcon
|
<FAIcon
|
||||||
class="type-icon"
|
class="type-icon"
|
||||||
icon="star"
|
icon="star"
|
||||||
/>
|
/>
|
||||||
|
{{ ' ' }}
|
||||||
<small>{{ $t('notifications.favorited_you') }}</small>
|
<small>{{ $t('notifications.favorited_you') }}</small>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="notification.type === 'repeat'">
|
<span v-if="notification.type === 'repeat'">
|
||||||
|
@ -76,6 +83,7 @@
|
||||||
icon="retweet"
|
icon="retweet"
|
||||||
:title="$t('tool_tip.repeat')"
|
:title="$t('tool_tip.repeat')"
|
||||||
/>
|
/>
|
||||||
|
{{ ' ' }}
|
||||||
<small>{{ $t('notifications.repeated_you') }}</small>
|
<small>{{ $t('notifications.repeated_you') }}</small>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="notification.type === 'follow'">
|
<span v-if="notification.type === 'follow'">
|
||||||
|
@ -83,6 +91,7 @@
|
||||||
class="type-icon"
|
class="type-icon"
|
||||||
icon="user-plus"
|
icon="user-plus"
|
||||||
/>
|
/>
|
||||||
|
{{ ' ' }}
|
||||||
<small>{{ $t('notifications.followed_you') }}</small>
|
<small>{{ $t('notifications.followed_you') }}</small>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="notification.type === 'follow_request'">
|
<span v-if="notification.type === 'follow_request'">
|
||||||
|
@ -90,6 +99,7 @@
|
||||||
class="type-icon"
|
class="type-icon"
|
||||||
icon="user"
|
icon="user"
|
||||||
/>
|
/>
|
||||||
|
{{ ' ' }}
|
||||||
<small>{{ $t('notifications.follow_request') }}</small>
|
<small>{{ $t('notifications.follow_request') }}</small>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="notification.type === 'move'">
|
<span v-if="notification.type === 'move'">
|
||||||
|
@ -97,13 +107,17 @@
|
||||||
class="type-icon"
|
class="type-icon"
|
||||||
icon="suitcase-rolling"
|
icon="suitcase-rolling"
|
||||||
/>
|
/>
|
||||||
|
{{ ' ' }}
|
||||||
<small>{{ $t('notifications.migrated_to') }}</small>
|
<small>{{ $t('notifications.migrated_to') }}</small>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="notification.type === 'pleroma:emoji_reaction'">
|
<span v-if="notification.type === 'pleroma:emoji_reaction'">
|
||||||
<small>
|
<small>
|
||||||
<i18n path="notifications.reacted_with">
|
<i18n-t
|
||||||
|
scope="global"
|
||||||
|
keypath="notifications.reacted_with"
|
||||||
|
>
|
||||||
<span class="emoji-reaction-emoji">{{ notification.emoji }}</span>
|
<span class="emoji-reaction-emoji">{{ notification.emoji }}</span>
|
||||||
</i18n>
|
</i18n-t>
|
||||||
</small>
|
</small>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -158,18 +172,26 @@
|
||||||
v-if="notification.type === 'follow_request'"
|
v-if="notification.type === 'follow_request'"
|
||||||
style="white-space: nowrap;"
|
style="white-space: nowrap;"
|
||||||
>
|
>
|
||||||
<FAIcon
|
<button
|
||||||
icon="check"
|
class="button-unstyled"
|
||||||
class="fa-scale-110 fa-old-padding follow-request-accept"
|
|
||||||
:title="$t('tool_tip.accept_follow_request')"
|
:title="$t('tool_tip.accept_follow_request')"
|
||||||
@click="approveUser()"
|
@click="approveUser()"
|
||||||
/>
|
>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
icon="times"
|
icon="check"
|
||||||
class="fa-scale-110 fa-old-padding follow-request-reject"
|
class="fa-scale-110 fa-old-padding follow-request-accept"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="button-unstyled"
|
||||||
:title="$t('tool_tip.reject_follow_request')"
|
:title="$t('tool_tip.reject_follow_request')"
|
||||||
@click="denyUser()"
|
@click="denyUser()"
|
||||||
/>
|
>
|
||||||
|
<FAIcon
|
||||||
|
icon="times"
|
||||||
|
class="fa-scale-110 fa-old-padding follow-request-reject"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -181,8 +203,9 @@
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<status-content
|
<StatusContent
|
||||||
class="faint"
|
class="faint"
|
||||||
|
:compact="true"
|
||||||
:status="notification.action"
|
:status="notification.action"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -5,9 +5,7 @@
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
:bound-to="{ x: 'container' }"
|
:bound-to="{ x: 'container' }"
|
||||||
>
|
>
|
||||||
<template
|
<template v-slot:content>
|
||||||
v-slot:content
|
|
||||||
>
|
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<button
|
<button
|
||||||
class="button-default dropdown-item"
|
class="button-default dropdown-item"
|
||||||
|
@ -66,7 +64,9 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:trigger>
|
<template v-slot:trigger>
|
||||||
<FAIcon icon="filter" />
|
<button class="button-unstyled">
|
||||||
|
<FAIcon icon="filter" />
|
||||||
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</Popover>
|
</Popover>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -37,11 +37,6 @@
|
||||||
|
|
||||||
.notification {
|
.notification {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-bottom: 1px solid;
|
|
||||||
border-color: $fallback--border;
|
|
||||||
border-color: var(--border, $fallback--border);
|
|
||||||
word-wrap: break-word;
|
|
||||||
word-break: break-word;
|
|
||||||
|
|
||||||
&:hover .animated.Avatar {
|
&:hover .animated.Avatar {
|
||||||
canvas {
|
canvas {
|
||||||
|
@ -69,8 +64,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.follow-request-accept {
|
.follow-request-accept {
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: $fallback--text;
|
color: $fallback--text;
|
||||||
color: var(--text, $fallback--text);
|
color: var(--text, $fallback--text);
|
||||||
|
@ -78,8 +71,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.follow-request-reject {
|
.follow-request-reject {
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: $fallback--cRed;
|
color: $fallback--cRed;
|
||||||
color: var(--cRed, $fallback--cRed);
|
color: var(--cRed, $fallback--cRed);
|
||||||
|
@ -148,13 +139,6 @@
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
img {
|
|
||||||
width: 14px;
|
|
||||||
height: 14px;
|
|
||||||
vertical-align: middle;
|
|
||||||
object-fit: contain
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeago {
|
.timeago {
|
||||||
|
|
|
@ -11,21 +11,21 @@
|
||||||
</label>
|
</label>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
v-if="typeof fallback !== 'undefined'"
|
v-if="typeof fallback !== 'undefined'"
|
||||||
:checked="present"
|
:model-value="present"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
class="opt"
|
class="opt"
|
||||||
@change="$emit('input', !present ? fallback : undefined)"
|
@update:modelValue="$emit('update:modelValue', !present ? fallback : undefined)"
|
||||||
/>
|
/>
|
||||||
<input
|
<input
|
||||||
:id="name"
|
:id="name"
|
||||||
class="input-number"
|
class="input-number"
|
||||||
type="number"
|
type="number"
|
||||||
:value="value || fallback"
|
:value="modelValue || fallback"
|
||||||
:disabled="!present || disabled"
|
:disabled="!present || disabled"
|
||||||
max="1"
|
max="1"
|
||||||
min="0"
|
min="0"
|
||||||
step=".05"
|
step=".05"
|
||||||
@input="$emit('input', $event.target.value)"
|
@input="$emit('update:modelValue', $event.target.value)"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -37,11 +37,12 @@ export default {
|
||||||
Checkbox
|
Checkbox
|
||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
'name', 'value', 'fallback', 'disabled'
|
'name', 'modelValue', 'fallback', 'disabled'
|
||||||
],
|
],
|
||||||
|
emits: ['update:modelValue'],
|
||||||
computed: {
|
computed: {
|
||||||
present () {
|
present () {
|
||||||
return typeof this.value !== 'undefined'
|
return typeof this.modelValue !== 'undefined'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
13
src/components/pinch_zoom/pinch_zoom.js
Normal file
13
src/components/pinch_zoom/pinch_zoom.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import PinchZoom from '@kazvmoe-infra/pinch-zoom-element'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
setTransform ({ scale, x, y }) {
|
||||||
|
this.$el.setTransform({ scale, x, y })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
// Make lint happy
|
||||||
|
(() => PinchZoom)()
|
||||||
|
}
|
||||||
|
}
|
11
src/components/pinch_zoom/pinch_zoom.vue
Normal file
11
src/components/pinch_zoom/pinch_zoom.vue
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<template>
|
||||||
|
<pinch-zoom
|
||||||
|
class="pinch-zoom-parent"
|
||||||
|
v-bind="$attrs"
|
||||||
|
v-on="$listeners"
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
</pinch-zoom>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./pinch_zoom.js"></script>
|
|
@ -1,10 +1,14 @@
|
||||||
import Timeago from '../timeago/timeago.vue'
|
import Timeago from 'components/timeago/timeago.vue'
|
||||||
|
import RichContent from 'components/rich_content/rich_content.jsx'
|
||||||
import { forEach, map } from 'lodash'
|
import { forEach, map } from 'lodash'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Poll',
|
name: 'Poll',
|
||||||
props: ['basePoll'],
|
props: ['basePoll', 'emoji'],
|
||||||
components: { Timeago },
|
components: {
|
||||||
|
Timeago,
|
||||||
|
RichContent
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
|
@ -17,7 +21,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.$store.dispatch('trackPoll', this.pollId)
|
this.$store.dispatch('trackPoll', this.pollId)
|
||||||
},
|
},
|
||||||
destroyed () {
|
unmounted () {
|
||||||
this.$store.dispatch('untrackPoll', this.pollId)
|
this.$store.dispatch('untrackPoll', this.pollId)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
@ -17,8 +17,11 @@
|
||||||
<span class="result-percentage">
|
<span class="result-percentage">
|
||||||
{{ percentageForOption(option.votes_count) }}%
|
{{ percentageForOption(option.votes_count) }}%
|
||||||
</span>
|
</span>
|
||||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
<RichContent
|
||||||
<span v-html="option.title_html" />
|
:html="option.title_html"
|
||||||
|
:handle-links="false"
|
||||||
|
:emoji="emoji"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="result-fill"
|
class="result-fill"
|
||||||
|
@ -42,8 +45,11 @@
|
||||||
:value="index"
|
:value="index"
|
||||||
>
|
>
|
||||||
<label class="option-vote">
|
<label class="option-vote">
|
||||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
<RichContent
|
||||||
<div v-html="option.title_html" />
|
:html="option.title_html"
|
||||||
|
:handle-links="false"
|
||||||
|
:emoji="emoji"
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -65,13 +71,18 @@
|
||||||
{{ $tc("polls.votes_count", poll.votes_count, { count: poll.votes_count }) }} ·
|
{{ $tc("polls.votes_count", poll.votes_count, { count: poll.votes_count }) }} ·
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<i18n :path="expired ? 'polls.expired' : 'polls.expires_in'">
|
<span>
|
||||||
<Timeago
|
<i18n-t
|
||||||
:time="expiresAt"
|
scope="global"
|
||||||
:auto-update="60"
|
:keypath="expired ? 'polls.expired' : 'polls.expires_in'"
|
||||||
:now-threshold="0"
|
>
|
||||||
/>
|
<Timeago
|
||||||
</i18n>
|
:time="expiresAt"
|
||||||
|
:auto-update="60"
|
||||||
|
:now-threshold="0"
|
||||||
|
/>
|
||||||
|
</i18n-t>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,19 +1,21 @@
|
||||||
import * as DateUtils from 'src/services/date_utils/date_utils.js'
|
import * as DateUtils from 'src/services/date_utils/date_utils.js'
|
||||||
import { uniq } from 'lodash'
|
import { uniq } from 'lodash'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import Select from '../select/select.vue'
|
||||||
import {
|
import {
|
||||||
faTimes,
|
faTimes,
|
||||||
faChevronDown,
|
|
||||||
faPlus
|
faPlus
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
library.add(
|
library.add(
|
||||||
faTimes,
|
faTimes,
|
||||||
faChevronDown,
|
|
||||||
faPlus
|
faPlus
|
||||||
)
|
)
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
Select
|
||||||
|
},
|
||||||
name: 'PollForm',
|
name: 'PollForm',
|
||||||
props: ['visible'],
|
props: ['visible'],
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
|
|
@ -46,23 +46,19 @@
|
||||||
class="poll-type"
|
class="poll-type"
|
||||||
:title="$t('polls.type')"
|
:title="$t('polls.type')"
|
||||||
>
|
>
|
||||||
<label
|
<Select
|
||||||
for="poll-type-selector"
|
v-model="pollType"
|
||||||
class="select"
|
class="poll-type-select"
|
||||||
|
unstyled="true"
|
||||||
|
@change="updatePollToParent"
|
||||||
>
|
>
|
||||||
<select
|
<option value="single">
|
||||||
v-model="pollType"
|
{{ $t('polls.single_choice') }}
|
||||||
class="select"
|
</option>
|
||||||
@change="updatePollToParent"
|
<option value="multiple">
|
||||||
>
|
{{ $t('polls.multiple_choices') }}
|
||||||
<option value="single">{{ $t('polls.single_choice') }}</option>
|
</option>
|
||||||
<option value="multiple">{{ $t('polls.multiple_choices') }}</option>
|
</Select>
|
||||||
</select>
|
|
||||||
<FAIcon
|
|
||||||
class="select-down-icon"
|
|
||||||
icon="chevron-down"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="poll-expiry"
|
class="poll-expiry"
|
||||||
|
@ -76,24 +72,21 @@
|
||||||
:max="maxExpirationInCurrentUnit"
|
:max="maxExpirationInCurrentUnit"
|
||||||
@change="expiryAmountChange"
|
@change="expiryAmountChange"
|
||||||
>
|
>
|
||||||
<label class="expiry-unit select">
|
{{ ' ' }}
|
||||||
<select
|
<Select
|
||||||
v-model="expiryUnit"
|
v-model="expiryUnit"
|
||||||
@change="expiryAmountChange"
|
unstyled="true"
|
||||||
|
class="expiry-unit"
|
||||||
|
@change="expiryAmountChange"
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
v-for="unit in expiryUnits"
|
||||||
|
:key="unit"
|
||||||
|
:value="unit"
|
||||||
>
|
>
|
||||||
<option
|
{{ $t(`time.${unit}_short`, ['']) }}
|
||||||
v-for="unit in expiryUnits"
|
</option>
|
||||||
:key="unit"
|
</Select>
|
||||||
:value="unit"
|
|
||||||
>
|
|
||||||
{{ $t(`time.${unit}_short`, ['']) }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<FAIcon
|
|
||||||
class="select-down-icon"
|
|
||||||
icon="chevron-down"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -147,10 +140,8 @@
|
||||||
.poll-type {
|
.poll-type {
|
||||||
margin-right: 0.75em;
|
margin-right: 0.75em;
|
||||||
flex: 1 1 60%;
|
flex: 1 1 60%;
|
||||||
.select {
|
|
||||||
border: none;
|
.poll-type-select {
|
||||||
box-shadow: none;
|
|
||||||
background-color: transparent;
|
|
||||||
padding-right: 0.75em;
|
padding-right: 0.75em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,12 +153,6 @@
|
||||||
width: 3em;
|
width: 3em;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.expiry-unit {
|
|
||||||
border: none;
|
|
||||||
box-shadow: none;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -54,7 +54,7 @@ const Popover = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Popover will be anchored around this element, trigger ref is the container, so
|
// Popover will be anchored around this element, trigger ref is the container, so
|
||||||
// its children are what are inside the slot. Expect only one slot="trigger".
|
// its children are what are inside the slot. Expect only one v-slot:trigger.
|
||||||
const anchorEl = (this.$refs.trigger && this.$refs.trigger.children[0]) || this.$el
|
const anchorEl = (this.$refs.trigger && this.$refs.trigger.children[0]) || this.$el
|
||||||
// SVGs don't have offsetWidth/Height, use fallback
|
// SVGs don't have offsetWidth/Height, use fallback
|
||||||
const anchorWidth = anchorEl.offsetWidth || anchorEl.clientWidth
|
const anchorWidth = anchorEl.offsetWidth || anchorEl.clientWidth
|
||||||
|
@ -178,7 +178,7 @@ const Popover = {
|
||||||
created () {
|
created () {
|
||||||
document.addEventListener('click', this.onClickOutside)
|
document.addEventListener('click', this.onClickOutside)
|
||||||
},
|
},
|
||||||
destroyed () {
|
unmounted () {
|
||||||
document.removeEventListener('click', this.onClickOutside)
|
document.removeEventListener('click', this.onClickOutside)
|
||||||
this.hidePopover()
|
this.hidePopover()
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
@import '../../_variables.scss';
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
.popover-trigger-button {
|
.popover-trigger-button {
|
||||||
display: block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popover {
|
.popover {
|
||||||
|
@ -149,5 +149,30 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button-default.dropdown-item {
|
||||||
|
&,
|
||||||
|
i[class*=icon-] {
|
||||||
|
color: $fallback--text;
|
||||||
|
color: var(--btnText, $fallback--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: $fallback--lightBg;
|
||||||
|
background-color: var(--selectedMenuPopover, $fallback--lightBg);
|
||||||
|
color: $fallback--link;
|
||||||
|
color: var(--selectedMenuPopoverText, $fallback--link);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
color: $fallback--text;
|
||||||
|
color: var(--btnDisabledText, $fallback--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.toggled {
|
||||||
|
color: $fallback--text;
|
||||||
|
color: var(--btnToggledText, $fallback--text);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue