forked from AkkomaGang/akkoma-fe
Compare commits
650 commits
build-on-m
...
develop
Author | SHA1 | Date | |
---|---|---|---|
4a50b1273d | |||
c76dc6d79e | |||
cb4c581cde | |||
|
8231c8f0b6 | ||
35cf3327c8 | |||
1ae09458c6 | |||
f391cf70a4 | |||
fa8fde2ab1 | |||
1f2c96a485 | |||
6c178aa257 | |||
|
3349fe6ff2 | ||
e274adf47d | |||
8765491399 | |||
4211e05a75 | |||
a3251a1ba6 | |||
e5608f4009 | |||
1092d43802 | |||
|
98a3622172 | ||
24b9e350e2 | |||
|
7ab4d22a4c | ||
8489f6d5ae | |||
b2cab6d088 | |||
3ebaba6fa7 | |||
f1058567b9 | |||
49a850a1e9 | |||
|
b2de68239f | ||
c68595345f | |||
a5d4b0a68c | |||
bd263587b2 | |||
|
c19fb198ca | ||
97966045cb | |||
aad023c8a0 | |||
c952b2335c | |||
0baf31f498 | |||
8fa24d0c40 | |||
5848c18ec8 | |||
|
54dbead22c | ||
3e86db24d3 | |||
|
d8f3f5002f | ||
7789c5def6 | |||
a45f482c79 | |||
|
ed22c480f9 | ||
f3934afbd8 | |||
|
3797495e53 | ||
0b437ab6fd | |||
a7dea2f70f | |||
|
2c9da4a58c | ||
8964dce609 | |||
|
156b036caa | ||
1a49a1b3ac | |||
|
61d82a2a07 | ||
1adef56603 | |||
|
b9bf0f0002 | ||
5aaa605df0 | |||
|
7136ea80b9 | ||
71e287d56c | |||
|
a64cdda725 | ||
70275684bf | |||
|
7e7f03aece | ||
29ff2ef455 | |||
8c49474dea | |||
62e0dd858c | |||
cc709394c5 | |||
57beea6a0d | |||
|
45524552a0 | ||
|
ee66b69ab5 | ||
|
d42e374704 | ||
|
ce8a9d2b4a | ||
|
d2b7ac6d8c | ||
|
754c72cb24 | ||
|
f5bd195422 | ||
|
d49fd46554 | ||
|
9982373853 | ||
|
5206b5cf9c | ||
|
a65a06ca04 | ||
|
c10b38afbc | ||
|
009941ea2c | ||
042e8c78dc | |||
0e07d88afa | |||
1f5f8665c8 | |||
428ed70b0d | |||
ed0b403c33 | |||
0f842b300b | |||
865cb6f96a | |||
050c7df2e6 | |||
a77a9e04d9 | |||
a57334991e | |||
8dce31d0ad | |||
ea9ad4d600 | |||
34e2800f59 | |||
3d65eccf04 | |||
d304be654f | |||
aee97fa948 | |||
7da1687f31 | |||
a8f193d4bd | |||
81c82e11bc | |||
00cadce5b4 | |||
40a08f279b | |||
c524a47e6f | |||
235c734d37 | |||
deaef1d0b9 | |||
1b28ec3b72 | |||
c9dc8f00f9 | |||
beee99e733 | |||
ccb0ffdc8a | |||
ab250c2f3a | |||
1de62fffcd | |||
306cea04a1 | |||
d9e1bc4d99 | |||
52b0b6f008 | |||
8afbe5e3bc | |||
58be48d164 | |||
1056b89fd1 | |||
3e64d78d05 | |||
3947aafeba | |||
345934c2f3 | |||
42a13b0f1b | |||
e13c4b6b85 | |||
6a1409e09b | |||
174f98b1cb | |||
ab146b67ec | |||
3b4208ea41 | |||
856324fa26 | |||
5a9322d2c7 | |||
|
b52bfbcba0 | ||
2b05a738c9 | |||
|
fa5d31b793 | ||
|
29cfdcbbcd | ||
|
5174b95918 | ||
|
56528206b8 | ||
|
590380c084 | ||
|
dfcbb3c1ec | ||
|
9b01c31283 | ||
|
6be003b2f8 | ||
|
cc302fb0e2 | ||
|
c4e768f977 | ||
|
d8a7217335 | ||
35d10ab9ff | |||
|
43d0a24547 | ||
|
51ebe643d5 | ||
7c14e1a5bd | |||
|
0da0e2c814 | ||
af97dd7484 | |||
28bf597443 | |||
a249baea8c | |||
a4e82f7886 | |||
|
32dc55b07c | ||
|
91eab22d77 | ||
|
e2125c57d6 | ||
|
e0a6418e91 | ||
|
14ed359c33 | ||
2d387e2eb4 | |||
57f70371a9 | |||
8feffbcdf6 | |||
42ffce97d6 | |||
2f479c670f | |||
|
ee6e7026ab | ||
17c05a5ca2 | |||
|
42896c2abf | ||
ecb6be2152 | |||
|
6c92983af6 | ||
9e4985e225 | |||
|
60ff715aff | ||
|
04bcf7d804 | ||
|
5fa305c58c | ||
|
a2ceb89d5e | ||
6b3b55455d | |||
8c6ccc321d | |||
596ae7e377 | |||
0d22a22a10 | |||
2a76be56e7 | |||
661a98d38d | |||
94d640f9f1 | |||
|
1f943ce8a5 | ||
c540764408 | |||
|
a4dfdc0853 | ||
ddea499a36 | |||
|
db33fe8ee2 | ||
|
f1bf22436d | ||
|
459c73ec02 | ||
|
2acf1e5c59 | ||
|
33c4459744 | ||
|
b00487e51f | ||
|
1e1cab643c | ||
|
8d3219a6d2 | ||
|
ec9753758f | ||
|
97ff4a7241 | ||
14cedc5ed1 | |||
5911777aa2 | |||
47fc082fb9 | |||
7e1b1e79f4 | |||
b92b2f74a4 | |||
7361f4e77e | |||
9f7f9e2798 | |||
42ab3eada4 | |||
6fdef479d0 | |||
fe08691f05 | |||
6a9764951f | |||
0f33b1cd79 | |||
999c38594e | |||
626c880038 | |||
6d7761c7e5 | |||
996ce3dde3 | |||
|
2c007f06e3 | ||
|
00704bd88c | ||
6a9d169e24 | |||
581c53a15e | |||
9e04e4fd80 | |||
88d5149db5 | |||
b4b13d777f | |||
7f4dd9ff03 | |||
a9a95e9120 | |||
56fd2e773b | |||
42dc1a027a | |||
236bc2c762 | |||
|
e9f47509ae | ||
f288d0c219 | |||
d973396c96 | |||
62287fffae | |||
e9f16af82d | |||
dfba8be134 | |||
313ddcebcb | |||
236b19e854 | |||
ea941d7cfa | |||
2e5001e5de | |||
014f8b0dd2 | |||
dd403b295f | |||
|
9cd62fe08d | ||
f668455dff | |||
5a4315384e | |||
401dfa8fa6 | |||
bb243168b3 | |||
da491f3278 | |||
d00e28d5e9 | |||
7ff17ab722 | |||
b009428814 | |||
7bec96a1bf | |||
0b5793c1e0 | |||
72ef2e7454 | |||
c39332c1bf | |||
8c6cf86de3 | |||
909271c764 | |||
413acbc7dd | |||
|
6e1ba218df | ||
|
830e8fdb45 | ||
9bf310d509 | |||
e3e8b19df3 | |||
|
e86c7abb39 | ||
8a0da8861d | |||
|
6c7e691aea | ||
|
b33d15a739 | ||
40e86998e6 | |||
|
177f344033 | ||
9079ac4afa | |||
|
dfc4e0a026 | ||
|
3d732d1d28 | ||
|
e8ee31afed | ||
|
d9d6b1e80b | ||
|
1dd7a89544 | ||
d3280c4ab3 | |||
abc75c360b | |||
a8e119b0f1 | |||
17e574b173 | |||
71d2e0b0ce | |||
b68e968bf9 | |||
eb49295422 | |||
337a30fe01 | |||
105ecd3836 | |||
a3e490edcd | |||
f8f5e1c89b | |||
e132814478 | |||
6af1df8bef | |||
b86f12cede | |||
|
c669701762 | ||
0900a9d87b | |||
0a01a2bdf0 | |||
7860c885c4 | |||
1c3bd60af2 | |||
|
b8faee5d6d | ||
c01c62f149 | |||
105b934f90 | |||
b1f41add0e | |||
e4e8ed812b | |||
684894aee3 | |||
f8a796b234 | |||
70ea9e772c | |||
efe0f53736 | |||
fcbbbad8d4 | |||
39b6b0b49f | |||
867a86d887 | |||
7538369fa1 | |||
|
2d4b2f2e20 | ||
862c93706c | |||
|
e06348ee33 | ||
169282ea42 | |||
db46879a8f | |||
0770981a20 | |||
c2a5a8c91f | |||
|
a1c0642bb5 | ||
|
1157396ed5 | ||
|
5a76dd5f90 | ||
c7200b2234 | |||
98074ed90d | |||
d51308a56b | |||
4b5536ae68 | |||
e44462b1d5 | |||
af32f901ac | |||
0810c57c8b | |||
e77931d68c | |||
f3962e3be7 | |||
1e8fc5bcc4 | |||
|
642fe3dc10 | ||
8713f1870f | |||
837c61569a | |||
a83c3a1fa1 | |||
|
4d8f288bd9 | ||
3286641f3c | |||
|
677f5ae071 | ||
|
15bac1e401 | ||
|
22b4aed8f6 | ||
23b0b01829 | |||
|
53c487535e | ||
278b2c25ad | |||
|
6a045dbc58 | ||
|
cd9dc9d2b2 | ||
|
3f2d54f057 | ||
251e440dad | |||
ffac376b5a | |||
|
8bd18643e4 | ||
|
5c28865018 | ||
721e3b016d | |||
469063ff52 | |||
d8643b5b4a | |||
04c744e764 | |||
bda433b006 | |||
2e00c19074 | |||
7df49720de | |||
|
ddc40f5bb3 | ||
|
90793281d5 | ||
|
d1dd043cfa | ||
|
8745317c38 | ||
|
80f58baa86 | ||
|
2453a338be | ||
4f837f75ea | |||
eaf2bd05a0 | |||
|
ca646822f6 | ||
468eb12573 | |||
2ab223e791 | |||
87683052e8 | |||
42e48348ae | |||
38d50acaeb | |||
e72548ae51 | |||
bf1debdeb6 | |||
aedd0794a4 | |||
92927bb7e6 | |||
7328795331 | |||
0a6c1f7d0a | |||
|
b936506f47 | ||
f628483499 | |||
61c70545f0 | |||
ad8be6b199 | |||
dd89735008 | |||
|
3c780adeb2 | ||
|
d813a8528a | ||
|
58f6dfebe9 | ||
da4b315d69 | |||
b980d5b2ef | |||
|
9447b7eaea | ||
2da92fcd13 | |||
|
6aadbcecfa | ||
6084cbbb00 | |||
bd868e47de | |||
1cce6969cc | |||
|
ebdcb31c12 | ||
|
d42b207b64 | ||
|
4f1d85b054 | ||
|
cffc073aa7 | ||
|
d6bbbea5dc | ||
|
b5f90a96cc | ||
|
9220c3859a | ||
|
aecb9f6e2a | ||
ae1b6ad887 | |||
c301daa276 | |||
8e2a4a9f7b | |||
|
948436ad3e | ||
301a32991b | |||
|
91357aad88 | ||
c97cd56439 | |||
|
49875ef601 | ||
|
a234cd3f00 | ||
6f2058a8fc | |||
064b8ba7f7 | |||
48826ede36 | |||
7dc0464094 | |||
6440e51b7e | |||
ef50c63dc7 | |||
59eb434840 | |||
bd4e8271df | |||
08d4b3b885 | |||
e7c21ffbd7 | |||
9b4cddd2e9 | |||
cd20e45157 | |||
48a11cb9d1 | |||
e67d94f73d | |||
|
b39143413c | ||
|
b1460a9909 | ||
776bee889e | |||
f925fa6265 | |||
c1c40d72da | |||
df70b1e4be | |||
|
58614fed35 | ||
05d052212a | |||
d4e91ef61e | |||
|
bf501e36a1 | ||
|
9a37c42f06 | ||
|
f67868b9ad | ||
|
e678327526 | ||
|
e1e3b9beff | ||
1f2b059320 | |||
2d85ee6a08 | |||
e61228b031 | |||
64fdde52f6 | |||
ca0b730605 | |||
4dcca7cf53 | |||
cbf883ab1e | |||
|
edf36d28ca | ||
|
c554ced3a4 | ||
75a3ab343b | |||
|
617773d287 | ||
9ede66fcc0 | |||
|
f969dd6ad2 | ||
|
468fe27565 | ||
|
251a1b13a3 | ||
94af72fd62 | |||
e5ca36a68c | |||
4d27064db3 | |||
d4f8934e8a | |||
b354ad382c | |||
863d586664 | |||
92e0d885f0 | |||
327195dc55 | |||
|
e47d3a6d13 | ||
df82757376 | |||
59d2800051 | |||
|
eab93c1ff6 | ||
|
f89be95e65 | ||
|
d69df0e906 | ||
5a99c54ebe | |||
aa88e4cb0a | |||
6ba8fcb604 | |||
|
0e1286c454 | ||
3eab17330b | |||
2e92aaaaa3 | |||
dfcc91c8c6 | |||
2712e47bc1 | |||
9421aa1d39 | |||
|
d8708f020e | ||
5873ee4e6c | |||
aff6caa4c0 | |||
2fe5699b8f | |||
e43799e3b5 | |||
|
3a16e7401e | ||
|
6441ff45a9 | ||
ef41494bad | |||
6380e6c4c2 | |||
ff3421c7cb | |||
|
7f61beff7a | ||
3cc0b44cb6 | |||
d8dd408de0 | |||
6f1bb99990 | |||
|
b69801d33f | ||
2d36b2403b | |||
5bef62398a | |||
5f09326879 | |||
|
8d53d4f0a9 | ||
45d8747fdd | |||
|
974663c42d | ||
f474763151 | |||
|
7c675f1ded | ||
751fd5917b | |||
bdbd0b644e | |||
|
53acda2cc7 | ||
50f13701be | |||
1f047b3ce3 | |||
c6a4485a20 | |||
7e9273aa91 | |||
|
bccbdd4706 | ||
bd38f8e263 | |||
a023ee9893 | |||
38c9720c65 | |||
1189607f2e | |||
a142a016d9 | |||
6ed6395c07 | |||
|
eef99fd86b | ||
86bdbfe0c0 | |||
2258174a00 | |||
7cec2616b4 | |||
|
1bd60115ce | ||
|
f7e2b48c72 | ||
93feda84dc | |||
|
5577fc9a32 | ||
|
9af2ebe485 | ||
|
7e0f13320a | ||
|
70e431f460 | ||
|
24487f9d77 | ||
|
584d3f4c4b | ||
|
61b90473ac | ||
|
e7d2921828 | ||
|
68813cf4e3 | ||
|
6576042814 | ||
|
0421d07ca5 | ||
|
7e10674eb9 | ||
|
0df62261f5 | ||
|
28e59decab | ||
|
073f62e2ed | ||
|
86f6bfa04f | ||
|
bd57be4b12 | ||
|
7bced9da57 | ||
|
206de567d4 | ||
|
f3a6c04f41 | ||
|
e0eb8d0342 | ||
|
74db389f6a | ||
|
40bd0b2262 | ||
|
4e2d63b15a | ||
|
b37265f185 | ||
|
c283924a20 | ||
|
554e3de73b | ||
|
176828a374 | ||
|
1be46da339 | ||
|
a072226d92 | ||
|
d0f07d47ce | ||
27ab013704 | |||
|
603d82dbe8 | ||
|
3b1464e29a | ||
|
bd63808767 | ||
|
2d25fbf6a4 | ||
|
b301b48571 | ||
|
16aacf55cb | ||
|
c14dbe146c | ||
|
8361ea76d0 | ||
|
80cefc20fd | ||
|
2b99c62957 | ||
|
ae16d37242 | ||
|
2fc2bc5590 | ||
|
62c5709cc5 | ||
|
22f21e7a83 | ||
|
155a734a52 | ||
|
b996677c7e | ||
|
bf42249200 | ||
|
c161e54e6b | ||
|
2ae7a4712d | ||
|
e90c23fde2 | ||
|
47fd319fed | ||
|
390231246f | ||
|
0c7f1475cb | ||
|
868dce8e3a | ||
|
66f45846a6 | ||
|
df158da14a | ||
|
25e7b90926 | ||
|
b686dec2b1 | ||
|
015f21a1c9 | ||
|
6f07fc7326 | ||
|
13df926362 | ||
|
78c3bb168f | ||
|
f0ee4414f3 | ||
|
b8f6b79682 | ||
|
7666a13445 | ||
|
858df3737d | ||
|
a9e46b7c7f | ||
|
05ba991414 | ||
|
8ba5d3e739 | ||
|
a4c7cf3b8a | ||
|
f06ddec06b | ||
|
37ece31b94 | ||
|
650898fdc4 | ||
|
3572d5edba | ||
017197cd28 | |||
|
0c9de801f7 | ||
d85d9c26b1 | |||
0746682763 | |||
|
1201418bec | ||
07adab74ec | |||
|
55a840ba9d | ||
|
0fdaca8cb2 | ||
|
86fc043e54 | ||
a2541bb4e0 | |||
04bb4112c0 | |||
c8b2bf96be | |||
4d2cf83452 | |||
12d7e4ea24 | |||
3d921c81bd | |||
e48506844d | |||
18fc3a0ad5 | |||
75024d8501 | |||
7a0b83cdc9 | |||
3302ef08ae | |||
a8c4aec721 | |||
9a82e8b097 | |||
4714d683d3 | |||
137bf5557c | |||
606e850aad | |||
eb47bb8973 | |||
a32cd0a98c | |||
cfb55594a5 | |||
|
15b612bad6 | ||
fab72940c4 | |||
2977edc04d | |||
a256931596 | |||
29f3c8a40e | |||
e2d064131b | |||
ea6f6ec82c | |||
35146e3615 | |||
bcd32de461 | |||
985a70c084 | |||
0dfde3e92c | |||
361662b6cf | |||
494d7f49c9 | |||
3ff141a122 | |||
dba047ce34 | |||
|
931ed3d3c7 | ||
d29bccb7d6 | |||
|
d480429896 | ||
28d5a55352 | |||
|
a8f9734400 | ||
4d84fd4cf7 | |||
|
8861835580 | ||
|
8c9821e444 | ||
|
f15465f0d3 | ||
|
5e18f1ceeb | ||
|
5385797ff1 | ||
7d377b8e88 | |||
67bc9e5ba3 | |||
|
83a3b37f1f | ||
|
5f9e3709b3 | ||
3dac486688 | |||
88d04f0af7 | |||
617cd7d1f8 | |||
|
677e5325fa | ||
101f15a078 | |||
370f3b14fa | |||
6e641a99a2 | |||
|
716320de35 | ||
06343addef | |||
|
eb69fc33f6 | ||
9e13e5d164 | |||
|
794906f01e | ||
|
263ef17816 | ||
7025cb8bb0 | |||
821460075a | |||
b87637c611 |
397 changed files with 41645 additions and 33034 deletions
|
@ -1,2 +0,0 @@
|
||||||
build/*.js
|
|
||||||
config/*.js
|
|
28
.eslintrc.js
28
.eslintrc.js
|
@ -1,28 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
parserOptions: {
|
|
||||||
parser: 'babel-eslint',
|
|
||||||
sourceType: 'module'
|
|
||||||
},
|
|
||||||
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
|
|
||||||
extends: [
|
|
||||||
'standard',
|
|
||||||
'plugin:vue/recommended'
|
|
||||||
],
|
|
||||||
// required to lint *.vue files
|
|
||||||
plugins: [
|
|
||||||
'vue'
|
|
||||||
],
|
|
||||||
// add your custom rules here
|
|
||||||
rules: {
|
|
||||||
// allow paren-less arrow functions
|
|
||||||
'arrow-parens': 0,
|
|
||||||
// allow async-await
|
|
||||||
'generator-star-spacing': 0,
|
|
||||||
// allow debugger during development
|
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
|
||||||
'vue/require-prop-types': 0,
|
|
||||||
'vue/no-unused-vars': 0,
|
|
||||||
'no-tabs': 0
|
|
||||||
}
|
|
||||||
}
|
|
49
.gitea/issue_template/bug.yml
Normal file
49
.gitea/issue_template/bug.yml
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
name: "Bug report"
|
||||||
|
about: "Something isn't working as expected"
|
||||||
|
title: "[bug] "
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: "Thanks for taking the time to file this bug report! Please try to be as specific and detailed as you can, so we can track down the issue and fix it as soon as possible."
|
||||||
|
- type: input
|
||||||
|
id: version
|
||||||
|
attributes:
|
||||||
|
label: "Version"
|
||||||
|
description: "Which version of pleroma-fe are you running? If running develop, specify the commit hash."
|
||||||
|
placeholder: "e.g. 2022.11, 40e86998e6"
|
||||||
|
- type: textarea
|
||||||
|
id: attempt
|
||||||
|
attributes:
|
||||||
|
label: "What were you trying to do?"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: expectation
|
||||||
|
attributes:
|
||||||
|
label: "What did you expect to happen?"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: reality
|
||||||
|
attributes:
|
||||||
|
label: "What actually happened?"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
id: severity
|
||||||
|
attributes:
|
||||||
|
label: "Severity"
|
||||||
|
description: "Does this issue prevent you from using the software as normal?"
|
||||||
|
options:
|
||||||
|
- "I cannot use the software"
|
||||||
|
- "I cannot use it as easily as I'd like"
|
||||||
|
- "I can manage"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: searched
|
||||||
|
attributes:
|
||||||
|
label: "Have you searched for this issue?"
|
||||||
|
description: "Please double-check that your issue is not already being tracked on [the forums](https://meta.akkoma.dev) or [the issue tracker](https://akkoma.dev/AkkomaGang/pleroma-fe/issues)."
|
||||||
|
options:
|
||||||
|
- label: "I have double-checked and have not found this issue mentioned anywhere."
|
29
.gitea/issue_template/feat.yml
Normal file
29
.gitea/issue_template/feat.yml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
name: "Feature request"
|
||||||
|
about: "I'd like something to be added to pleroma-fe"
|
||||||
|
title: "[feat] "
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: "Thanks for taking the time to request a new feature! Please be as concise and clear as you can in your proposal, so we could understand what you're going for."
|
||||||
|
- type: textarea
|
||||||
|
id: idea
|
||||||
|
attributes:
|
||||||
|
label: "The idea"
|
||||||
|
description: "What do you think you should be able to do in pleroma-fe?"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: reason
|
||||||
|
attributes:
|
||||||
|
label: "The reasoning"
|
||||||
|
description: "Why would this be a worthwhile feature? Does it solve any problems? Have people talked about wanting it?"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: searched
|
||||||
|
attributes:
|
||||||
|
label: "Have you searched for this feature request?"
|
||||||
|
description: "Please double-check that your issue is not already being tracked on [the forums](https://meta.akkoma.dev), [the issue tracker](https://akkoma.dev/AkkomaGang/pleroma-fe/issues), or the one for [the backend](https://akkoma.dev/AkkomaGang/akkoma/issues)."
|
||||||
|
options:
|
||||||
|
- label: "I have double-checked and have not found this feature request mentioned anywhere."
|
||||||
|
- label: "This feature is related to the pleroma-fe Akkoma frontend specifically, and not the backend."
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -8,3 +8,5 @@ selenium-debug.log
|
||||||
.idea/
|
.idea/
|
||||||
config/local.json
|
config/local.json
|
||||||
config/local.*.json
|
config/local.*.json
|
||||||
|
docs/site/
|
||||||
|
.vscode/
|
|
@ -1,47 +0,0 @@
|
||||||
# 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:
|
|
||||||
# https://hub.docker.com/r/library/node/tags/
|
|
||||||
image: node:12
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- lint
|
|
||||||
- build
|
|
||||||
- test
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
lint:
|
|
||||||
stage: lint
|
|
||||||
script:
|
|
||||||
- yarn
|
|
||||||
- npm run lint
|
|
||||||
- npm run stylelint
|
|
||||||
|
|
||||||
test:
|
|
||||||
stage: test
|
|
||||||
variables:
|
|
||||||
APT_CACHE_DIR: apt-cache
|
|
||||||
script:
|
|
||||||
- mkdir -pv $APT_CACHE_DIR && apt-get -qq update
|
|
||||||
- apt install firefox-esr -y --no-install-recommends
|
|
||||||
- firefox --version
|
|
||||||
- yarn
|
|
||||||
- yarn unit
|
|
||||||
|
|
||||||
build:
|
|
||||||
stage: build
|
|
||||||
script:
|
|
||||||
- yarn
|
|
||||||
- npm run build
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- dist/
|
|
||||||
|
|
||||||
docs-deploy:
|
|
||||||
stage: deploy
|
|
||||||
image: alpine:latest
|
|
||||||
only:
|
|
||||||
- develop@pleroma/pleroma-fe
|
|
||||||
before_script:
|
|
||||||
- apk add curl
|
|
||||||
script:
|
|
||||||
- curl -X POST -F"token=$DOCS_PIPELINE_TRIGGER" -F'ref=master' https://git.pleroma.social/api/v4/projects/673/trigger/pipeline
|
|
|
@ -1 +0,0 @@
|
||||||
7.2.1
|
|
|
@ -1,19 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": [
|
"extends": [
|
||||||
"stylelint-rscss/config",
|
"stylelint-config-recommended-vue/scss",
|
||||||
"stylelint-config-recommended",
|
"stylelint-config-recommended",
|
||||||
"stylelint-config-standard"
|
"stylelint-config-standard"
|
||||||
],
|
],
|
||||||
|
"customSyntax": "postcss-scss",
|
||||||
"rules": {
|
"rules": {
|
||||||
"declaration-no-important": true,
|
"declaration-no-important": true,
|
||||||
"rscss/no-descendant-combinator": false,
|
"selector-class-pattern": null,
|
||||||
"rscss/class-format": [
|
"custom-property-pattern": null
|
||||||
true,
|
|
||||||
{
|
|
||||||
"component": "pascal-case",
|
|
||||||
"variant": "^-[a-z]\\w+",
|
|
||||||
"element": "^[a-z]\\w+"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
.tool-versions
Normal file
1
.tool-versions
Normal file
|
@ -0,0 +1 @@
|
||||||
|
nodejs 20.12.2
|
|
@ -1,21 +1,21 @@
|
||||||
pipeline:
|
labels:
|
||||||
|
platform: linux/amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
lint:
|
lint:
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
|
||||||
- pull_request
|
- pull_request
|
||||||
image: node:16
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- yarn
|
- yarn
|
||||||
- yarn lint
|
- yarn lint
|
||||||
- yarn stylelint
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
|
||||||
- pull_request
|
- pull_request
|
||||||
image: node:16
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- apt update
|
- apt update
|
||||||
- apt install firefox-esr -y --no-install-recommends
|
- apt install firefox-esr -y --no-install-recommends
|
||||||
|
@ -25,8 +25,11 @@ pipeline:
|
||||||
build:
|
build:
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- tag
|
- push
|
||||||
image: node:16
|
branch:
|
||||||
|
- develop
|
||||||
|
- stable
|
||||||
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- yarn
|
- yarn
|
||||||
- yarn build
|
- yarn build
|
||||||
|
@ -37,16 +40,44 @@ pipeline:
|
||||||
- push
|
- push
|
||||||
branch:
|
branch:
|
||||||
- develop
|
- develop
|
||||||
image: node:16
|
- stable
|
||||||
|
image: node:20
|
||||||
secrets:
|
secrets:
|
||||||
- SCW_ACCESS_KEY
|
- SCW_ACCESS_KEY
|
||||||
- SCW_SECRET_KEY
|
- SCW_SECRET_KEY
|
||||||
- SCW_DEFAULT_ORGANIZATION_ID
|
- SCW_DEFAULT_ORGANIZATION_ID
|
||||||
commands:
|
commands:
|
||||||
- apt-get update && apt-get install -y rclone wget zip
|
- apt-get update && apt-get install -y rclone wget zip
|
||||||
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64
|
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.30.0/scaleway-cli_2.30.0_linux_amd64
|
||||||
- mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli
|
- mv scaleway-cli_2.30.0_linux_amd64 scaleway-cli
|
||||||
- chmod +x scaleway-cli
|
- chmod +x scaleway-cli
|
||||||
- ./scaleway-cli object config install type=rclone
|
- ./scaleway-cli object config install type=rclone
|
||||||
- zip akkoma-fe.zip -r dist
|
- zip akkoma-fe.zip -r dist
|
||||||
- rclone copyto akkoma-fe.zip scaleway:akkoma-updates/frontend/akkoma-fe.zip
|
- rclone copyto akkoma-fe.zip scaleway:akkoma-updates/frontend/$CI_COMMIT_BRANCH/akkoma-fe.zip
|
||||||
|
|
||||||
|
docs:
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
branch:
|
||||||
|
- develop
|
||||||
|
- stable
|
||||||
|
environment:
|
||||||
|
CI: "true"
|
||||||
|
image: python:3.10-slim
|
||||||
|
secrets:
|
||||||
|
- SCW_ACCESS_KEY
|
||||||
|
- SCW_SECRET_KEY
|
||||||
|
- SCW_DEFAULT_ORGANIZATION_ID
|
||||||
|
commands:
|
||||||
|
- apt-get update && apt-get install -y rclone wget git zip
|
||||||
|
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.30.0/scaleway-cli_2.30.0_linux_amd64
|
||||||
|
- mv scaleway-cli_2.30.0_linux_amd64 scaleway-cli
|
||||||
|
- chmod +x scaleway-cli
|
||||||
|
- ./scaleway-cli object config install type=rclone
|
||||||
|
- cd docs
|
||||||
|
- pip install -r requirements.txt
|
||||||
|
- mkdocs build
|
||||||
|
- zip -r docs.zip site/*
|
||||||
|
- cd site
|
||||||
|
- rclone copy . scaleway:akkoma-docs/frontend/$CI_COMMIT_BRANCH/
|
||||||
|
|
30
CHANGELOG.md
30
CHANGELOG.md
|
@ -4,6 +4,33 @@ 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
|
||||||
|
### Added
|
||||||
|
- Implemented remote interaction with statuses
|
||||||
|
|
||||||
|
|
||||||
|
## 2022.09 - 2022-09-10
|
||||||
|
### Added
|
||||||
|
- Automatic post translations. Must be configured on the backend in order to work.
|
||||||
|
- Post editing, including a log of previous edits.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Top bar now has navigation shortcuts. Can be enabled or disabled by admins or users.
|
||||||
|
- Optional replacement of timeline drop-down with navigation buttons. Also configurable.
|
||||||
|
- Posts and posts with replies are now separated on user profiles.
|
||||||
|
- Custom emoji from remote instances on a post can now also be used.
|
||||||
|
|
||||||
|
## 2022.08 - 2022-08-12
|
||||||
|
### Added
|
||||||
|
- Ability to quote public and unlisted posts
|
||||||
|
- Bubble timeline
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Emoji in emoji picker is separated by packs
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Chats, they were half-baked. Just use PMs.
|
||||||
|
|
||||||
|
## 2022.07 - 2022-07-16
|
||||||
### Fixed
|
### Fixed
|
||||||
- AdminFE button no longer scrolls page to top when clicked
|
- 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)
|
- Pinned statuses no longer appear at bottom of user timeline (still appear as part of the timeline when fetched deep enough)
|
||||||
|
@ -16,6 +43,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
- Attachments are ALWAYS in same order as user uploaded, no more "videos first"
|
- Attachments are ALWAYS in same order as user uploaded, no more "videos first"
|
||||||
- Attachment description is prefilled with backend-provided default when uploading
|
- Attachment description is prefilled with backend-provided default when uploading
|
||||||
- Proper visual feedback that next image is loading when browsing
|
- Proper visual feedback that next image is loading when browsing
|
||||||
|
- Misskey-Flavoured Markdown support
|
||||||
|
- Custom emoji reactions
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- (You)s are optional (opt-in) now, bolding your nickname is also optional (opt-out)
|
- (You)s are optional (opt-in) now, bolding your nickname is also optional (opt-out)
|
||||||
|
@ -37,6 +66,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
- Media modal now also displays description and counter position in gallery (i.e. 1/5)
|
- Media modal now also displays description and counter position in gallery (i.e. 1/5)
|
||||||
- Ability to rearrange order of attachments when uploading
|
- Ability to rearrange order of attachments when uploading
|
||||||
- Enabled users to zoom and pan images in media viewer with mouse and touch
|
- Enabled users to zoom and pan images in media viewer with mouse and touch
|
||||||
|
- Added frontend ui for account migration
|
||||||
|
|
||||||
|
|
||||||
## [2.4.2] - 2022-01-09
|
## [2.4.2] - 2022-01-09
|
||||||
|
|
24
CODE_OF_CONDUCT.md
Normal file
24
CODE_OF_CONDUCT.md
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# Akkoma Code of Conduct
|
||||||
|
|
||||||
|
The Akkoma project aims to be **enjoyable** for anyone to participate in, regardless of their identity or level of expertise. To achieve this, the community must create an environment which is **safe** and **equitable**; the following guidelines have been created with these goals in mind.
|
||||||
|
|
||||||
|
1. **Treat individuals with respect.** Differing experiences and viewpoints deserve to be respected, and bigotry and harassment are not tolerated under any circumstances.
|
||||||
|
- Individuals should at all times be treated as equals, regardless of their age, gender, sexuality, race, ethnicity, _or any other characteristic_, intrinsic or otherwise.
|
||||||
|
- Behaviour that is harmful in nature should be addressed and corrected *regardless of intent*.
|
||||||
|
- Respect personal boundaries and ask for clarification whenever they are unclear.
|
||||||
|
- (Obviously, hate does not count as merely a "differing viewpoint", because it is harmful in nature.)
|
||||||
|
|
||||||
|
2. **Be understanding of differences in communication.** Not everyone is aware of unspoken social cues, and speech that is not intended to be offensive should not be treated as such simply due to an atypical manner of communication.
|
||||||
|
- Somebody who speaks bluntly is not necessarily rude, and somebody who swears a lot is not necessarily volatile.
|
||||||
|
- Try to confirm your interpretation of their intent rather than assuming bad faith.
|
||||||
|
- Someone may not communicate as, or come across as a picture of "professionalism", but this should not be seen as a reason to dismiss them. This is a **casual** space, and communication styles can reflect that.
|
||||||
|
|
||||||
|
3. **"Uncomfortable" does not mean "unsafe".** In an ideal world, the community would be safe, equitable, enjoyable, *and* comfortable for all members at all times. Unfortunately, this is not always possible in reality.
|
||||||
|
- Safety and equity will be prioritized over comfort whenever it is necessary to do so.
|
||||||
|
- Weaponizing one's own discomfort to deflect accountability or censor an individual (e.g. "white fragility") is a form of discriminatory conduct.
|
||||||
|
|
||||||
|
4. **Let people grow from their mistakes.** Nobody is perfect; even the most well-meaning individual can do something hurtful. Everyone should be given a fair opportunity to explain themselves and correct their behaviour. Portraying someone as inherently malicious prevents improvement and shifts focus away from the *action* that was problematic.
|
||||||
|
- Avoid bringing up past events that do not accurately reflect an individual's current actions or beliefs. (This is, of course, different from providing evidence of a recurring pattern of behaviour.)
|
||||||
|
|
||||||
|
---
|
||||||
|
This document was adapted from one created by ~keith as part of punks default repository template, and is licensed under CC-BY-SA 4.0. The original template is here: <https://bytes.keithhacks.cyou/keith/default-template>
|
|
@ -1,49 +0,0 @@
|
||||||
```
|
|
||||||
o$$$$$$oo
|
|
||||||
o$" "$oo
|
|
||||||
$ o""""$o "$o
|
|
||||||
"$ o "o "o $
|
|
||||||
"$ $o $ $ o$
|
|
||||||
"$ o$"$ o$
|
|
||||||
"$ooooo$$ $ o$
|
|
||||||
o$ """ $ " $$$ " $
|
|
||||||
o$ $o $$" " "
|
|
||||||
$$ $ " $ $$$o"$ o o$"
|
|
||||||
$" o "" $ $" " o" $$
|
|
||||||
$o " " $ o$" o" o$"
|
|
||||||
"$o $$ $ o" o$$"
|
|
||||||
""o$o"$" $oo" o$"
|
|
||||||
o$$ $ $$$ o$$
|
|
||||||
o" o oo"" "" "$o
|
|
||||||
o$o" "" $
|
|
||||||
$" " o" " " " "o
|
|
||||||
$$ " " o$ o$o " $
|
|
||||||
o$ $ $ o$$ " " ""
|
|
||||||
o $ $" " "o o$
|
|
||||||
$ o $o$oo$""
|
|
||||||
$o $ o o o"$$
|
|
||||||
$o o $ $ "$o
|
|
||||||
$o $ o $ $ "o
|
|
||||||
$ $ "o $ "o"$o
|
|
||||||
$ " o $ o $$
|
|
||||||
$o$o$o$o$$o$$$o$$o$o$$o$$o$$$o$o$o$o$o$o$o$o$o$ooo
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " $$$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$"
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ooooo$$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"""""
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
|
|
||||||
"$o$o$o$o$o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
|
|
||||||
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
|
|
||||||
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"""
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
```
|
|
|
@ -10,3 +10,5 @@ Contributors of this project.
|
||||||
- shpuld (shpuld@shitposter.club): CSS and styling
|
- shpuld (shpuld@shitposter.club): CSS and styling
|
||||||
- Vincent Guth (https://unsplash.com/photos/XrwVIFy6rTw): Background images.
|
- Vincent Guth (https://unsplash.com/photos/XrwVIFy6rTw): Background images.
|
||||||
- hj (hj@shigusegubu.club): Code
|
- hj (hj@shigusegubu.club): Code
|
||||||
|
- Sean King (seanking@freespeechextremist.com): Code
|
||||||
|
- Tusooa Zhu (tusooa@kazv.moe): Code
|
||||||
|
|
22
README.md
22
README.md
|
@ -1,22 +1,30 @@
|
||||||
# Pleroma-FE
|
# Akkoma-FE
|
||||||
|
|
||||||
> A single column frontend designed for Pleroma.
|
![English OK](https://img.shields.io/badge/English-OK-blueviolet) ![日本語OK](https://img.shields.io/badge/%E6%97%A5%E6%9C%AC%E8%AA%9E-OK-blueviolet)
|
||||||
|
|
||||||
![screenshot](/uploads/796c5ecf985ed1e2b0943ee0df131ed0/DJVqSJ0.png)
|
This is a fork of Akkoma-FE from the Pleroma project, with support for new Akkoma features such as:
|
||||||
|
- MFM support via [marked-mfm](https://akkoma.dev/sfr/marked-mfm)
|
||||||
|
- Custom emoji reactions
|
||||||
|
|
||||||
# For Translators
|
# For Translators
|
||||||
|
|
||||||
To translate Pleroma-FE, add your language to [src/i18n/messages.js](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/i18n/messages.js). Pleroma-FE will set your language by your browser locale, but you can temporarily force it in the code by changing the locale in main.js.
|
The [Weblate UI](https://translate.akkoma.dev/projects/akkoma/pleroma-fe/) is recommended for adding or modifying translations for Akkoma-FE.
|
||||||
|
|
||||||
|
Alternatively, edit/create `src/i18n/$LANGUAGE_CODE.json` (where `$LANGUAGE_CODE` is the [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for your language), then add your language to [src/i18n/messages.js](https://akkoma.dev/AkkomaGang/pleroma-fe/src/branch/develop/src/i18n/messages.js) if it doesn't already exist there.
|
||||||
|
|
||||||
|
Akkoma-FE will set your language by your browser locale, but you can temporarily force it in the code by changing the locale in main.js.
|
||||||
|
|
||||||
# FOR ADMINS
|
# FOR ADMINS
|
||||||
|
|
||||||
You don't need to build Pleroma-FE yourself. Those using the Pleroma backend will be able to use it out of the box.
|
To use Akkoma-FE in Akkoma, use the [frontend](https://docs.akkoma.dev/stable/administration/CLI_tasks/frontend/) CLI task to install Akkoma-FE, then modify your configuration as described in the [Frontend Management](https://docs.akkoma.dev/stable/configuration/frontend_management/) doc.
|
||||||
|
|
||||||
## Build Setup
|
## Build Setup
|
||||||
|
|
||||||
|
Make sure you have [Node.js](https://nodejs.org/) installed. You can check `/.woodpecker.yml` for which node version the Akkoma CI currently uses.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
# install dependencies
|
# install dependencies
|
||||||
npm install -g yarn
|
corepack enable
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
# serve with hot reload at localhost:8080
|
# serve with hot reload at localhost:8080
|
||||||
|
@ -31,7 +39,7 @@ npm run unit
|
||||||
|
|
||||||
# For Contributors:
|
# For Contributors:
|
||||||
|
|
||||||
You can create file `/config/local.json` (see [example](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/config/local.example.json)) to enable some convenience dev options:
|
You can create file `/config/local.json` (see [example](https://akkoma.dev/AkkomaGang/akkoma-fe/src/branch/develop/config/local.example.json)) to enable some convenience dev options:
|
||||||
|
|
||||||
* `target`: makes local dev server redirect to some existing instance's BE instead of local BE, useful for testing things in near-production environment and searching for real-life use-cases.
|
* `target`: makes local dev server redirect to some existing instance's BE instead of local BE, useful for testing things in near-production environment and searching for real-life use-cases.
|
||||||
* `staticConfigPreference`: makes FE's `/static/config.json` take preference of BE-served `/api/statusnet/config.json`. Only works in dev mode.
|
* `staticConfigPreference`: makes FE's `/static/config.json` take preference of BE-served `/api/statusnet/config.json`. Only works in dev mode.
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
// https://github.com/shelljs/shelljs
|
// https://github.com/shelljs/shelljs
|
||||||
require('./check-versions')()
|
require("./check-versions")();
|
||||||
require('shelljs/global')
|
require("shelljs/global");
|
||||||
env.NODE_ENV = 'production'
|
env.NODE_ENV = "production";
|
||||||
|
|
||||||
var path = require('path')
|
var path = require("path");
|
||||||
var config = require('../config')
|
var config = require("../config");
|
||||||
var ora = require('ora')
|
var webpack = require("webpack");
|
||||||
var webpack = require('webpack')
|
var webpackConfig = require("./webpack.prod.conf");
|
||||||
var webpackConfig = require('./webpack.prod.conf')
|
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
' Tip:\n' +
|
" Tip:\n" +
|
||||||
' Built files are meant to be served over an HTTP server.\n' +
|
" Built files are meant to be served over an HTTP server.\n" +
|
||||||
' Opening index.html over file:// won\'t work.\n'
|
" Opening index.html over file:// won't work.\n",
|
||||||
)
|
);
|
||||||
|
|
||||||
var spinner = ora('building for production...')
|
var assetsPath = path.join(
|
||||||
spinner.start()
|
config.build.assetsRoot,
|
||||||
|
config.build.assetsSubDirectory,
|
||||||
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
|
);
|
||||||
rm('-rf', assetsPath)
|
rm("-rf", assetsPath);
|
||||||
mkdir('-p', assetsPath)
|
mkdir("-p", assetsPath);
|
||||||
cp('-R', 'static/*', assetsPath)
|
cp("-R", "static/*", assetsPath);
|
||||||
|
|
||||||
webpack(webpackConfig, function (err, stats) {
|
webpack(webpackConfig, function (err, stats) {
|
||||||
spinner.stop()
|
if (err) throw err;
|
||||||
if (err) throw err
|
process.stdout.write(
|
||||||
process.stdout.write(stats.toString({
|
stats.toString({
|
||||||
colors: true,
|
colors: true,
|
||||||
modules: false,
|
modules: false,
|
||||||
children: false,
|
children: false,
|
||||||
chunks: false,
|
chunks: false,
|
||||||
chunkModules: false
|
chunkModules: false,
|
||||||
}) + '\n')
|
}) + "\n",
|
||||||
})
|
);
|
||||||
|
});
|
||||||
|
|
|
@ -5,7 +5,7 @@ var path = require('path')
|
||||||
var express = require('express')
|
var express = require('express')
|
||||||
var webpack = require('webpack')
|
var webpack = require('webpack')
|
||||||
var opn = require('opn')
|
var opn = require('opn')
|
||||||
var proxyMiddleware = require('http-proxy-middleware')
|
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||||||
var webpackConfig = process.env.NODE_ENV === 'testing'
|
var webpackConfig = process.env.NODE_ENV === 'testing'
|
||||||
? require('./webpack.prod.conf')
|
? require('./webpack.prod.conf')
|
||||||
: require('./webpack.dev.conf')
|
: require('./webpack.dev.conf')
|
||||||
|
@ -29,18 +29,6 @@ var devMiddleware = require('webpack-dev-middleware')(compiler, {
|
||||||
})
|
})
|
||||||
|
|
||||||
var hotMiddleware = require('webpack-hot-middleware')(compiler)
|
var hotMiddleware = require('webpack-hot-middleware')(compiler)
|
||||||
// force page reload when html-webpack-plugin template changes
|
|
||||||
compiler.plugin('compilation', function (compilation) {
|
|
||||||
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
|
|
||||||
// FIXME: This supposed to reload whole page when index.html is changed,
|
|
||||||
// however now it reloads entire page on every breath, i suppose the order
|
|
||||||
// of plugins changed or something. It's a minor thing and douesn't hurt
|
|
||||||
// disabling it, constant reloads hurt much more
|
|
||||||
|
|
||||||
// hotMiddleware.publish({ action: 'reload' })
|
|
||||||
// cb()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// proxy api requests
|
// proxy api requests
|
||||||
Object.keys(proxyTable).forEach(function (context) {
|
Object.keys(proxyTable).forEach(function (context) {
|
||||||
|
@ -48,7 +36,13 @@ Object.keys(proxyTable).forEach(function (context) {
|
||||||
if (typeof options === 'string') {
|
if (typeof options === 'string') {
|
||||||
options = { target: options }
|
options = { target: options }
|
||||||
}
|
}
|
||||||
app.use(proxyMiddleware(context, options))
|
const targetUrl = new URL(options.target);
|
||||||
|
// add path
|
||||||
|
targetUrl.pathname = context;
|
||||||
|
options.target = targetUrl.toString();
|
||||||
|
|
||||||
|
console.log("Proxying", context, "to", options.target);
|
||||||
|
app.use(context, createProxyMiddleware(options))
|
||||||
})
|
})
|
||||||
|
|
||||||
// handle fallback for HTML5 history API
|
// handle fallback for HTML5 history API
|
||||||
|
|
|
@ -2,9 +2,8 @@ var path = require('path')
|
||||||
var config = require('../config')
|
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 CopyPlugin = require('copy-webpack-plugin');
|
|
||||||
var { VueLoaderPlugin } = require('vue-loader')
|
var { VueLoaderPlugin } = require('vue-loader')
|
||||||
|
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||||
|
|
||||||
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
|
||||||
|
@ -20,6 +19,7 @@ module.exports = {
|
||||||
app: './src/main.js'
|
app: './src/main.js'
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
|
hashFunction: "sha256", // Workaround for builds with OpenSSL 3.
|
||||||
path: config.build.assetsRoot,
|
path: config.build.assetsRoot,
|
||||||
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
|
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
|
||||||
filename: '[name].js'
|
filename: '[name].js'
|
||||||
|
@ -30,10 +30,14 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.js', '.jsx', '.vue'],
|
extensions: ['.js', '.jsx', '.vue', '.mjs'],
|
||||||
modules: [
|
modules: [
|
||||||
path.join(__dirname, '../node_modules')
|
path.join(__dirname, '../node_modules')
|
||||||
],
|
],
|
||||||
|
fallback: {
|
||||||
|
"url": require.resolve("url/"),
|
||||||
|
querystring: require.resolve("querystring-es3")
|
||||||
|
},
|
||||||
alias: {
|
alias: {
|
||||||
'static': path.resolve(__dirname, '../static'),
|
'static': path.resolve(__dirname, '../static'),
|
||||||
'src': path.resolve(__dirname, '../src'),
|
'src': path.resolve(__dirname, '../src'),
|
||||||
|
@ -45,20 +49,6 @@ module.exports = {
|
||||||
module: {
|
module: {
|
||||||
noParse: /node_modules\/localforage\/dist\/localforage.js/,
|
noParse: /node_modules\/localforage\/dist\/localforage.js/,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
|
||||||
enforce: 'pre',
|
|
||||||
test: /\.(js|vue)$/,
|
|
||||||
include: projectRoot,
|
|
||||||
exclude: /node_modules/,
|
|
||||||
use: {
|
|
||||||
loader: 'eslint-loader',
|
|
||||||
options: {
|
|
||||||
formatter: require('eslint-friendly-formatter'),
|
|
||||||
sourceMap: config.build.productionSourceMap,
|
|
||||||
extract: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
enforce: 'post',
|
enforce: 'post',
|
||||||
test: /\.(json5?|ya?ml)$/, // target json, json5, yaml and yml files
|
test: /\.(json5?|ya?ml)$/, // target json, json5, yaml and yml files
|
||||||
|
@ -68,6 +58,11 @@ module.exports = {
|
||||||
path.resolve(__dirname, '../src/i18n')
|
path.resolve(__dirname, '../src/i18n')
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
test: /\.mjs$/,
|
||||||
|
include: /node_modules/,
|
||||||
|
type: "javascript/auto"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.vue$/,
|
test: /\.vue$/,
|
||||||
loader: 'vue-loader',
|
loader: 'vue-loader',
|
||||||
|
@ -111,23 +106,9 @@ module.exports = {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new ServiceWorkerWebpackPlugin({
|
|
||||||
entry: path.join(__dirname, '..', 'src/sw.js'),
|
|
||||||
filename: 'sw-pleroma.js'
|
|
||||||
}),
|
|
||||||
new VueLoaderPlugin(),
|
new VueLoaderPlugin(),
|
||||||
// This copies Ruffle's WASM to a directory so that JS side can access it
|
new ESLintPlugin({
|
||||||
new CopyPlugin({
|
configType: 'flat'
|
||||||
patterns: [
|
|
||||||
{
|
|
||||||
from: "node_modules/ruffle-mirror/*",
|
|
||||||
to: "static/ruffle",
|
|
||||||
flatten: true
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: {
|
|
||||||
concurrency: 100,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
var config = require('../config')
|
var config = require('../config')
|
||||||
var webpack = require('webpack')
|
var webpack = require('webpack')
|
||||||
var merge = require('webpack-merge')
|
var { merge } = require('webpack-merge')
|
||||||
var utils = require('./utils')
|
var utils = require('./utils')
|
||||||
var baseWebpackConfig = require('./webpack.base.conf')
|
var baseWebpackConfig = require('./webpack.base.conf')
|
||||||
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
|
@ -16,7 +16,7 @@ module.exports = merge(baseWebpackConfig, {
|
||||||
},
|
},
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
// eval-source-map is faster for development
|
// eval-source-map is faster for development
|
||||||
devtool: '#eval-source-map',
|
devtool: 'eval-source-map',
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': config.dev.env,
|
'process.env': config.dev.env,
|
||||||
|
|
|
@ -2,7 +2,8 @@ var path = require('path')
|
||||||
var config = require('../config')
|
var config = require('../config')
|
||||||
var utils = require('./utils')
|
var utils = require('./utils')
|
||||||
var webpack = require('webpack')
|
var webpack = require('webpack')
|
||||||
var merge = require('webpack-merge')
|
const WorkboxPlugin = require('workbox-webpack-plugin');
|
||||||
|
var { merge } = require('webpack-merge')
|
||||||
var baseWebpackConfig = require('./webpack.base.conf')
|
var baseWebpackConfig = require('./webpack.base.conf')
|
||||||
var MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
var MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||||
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
|
@ -19,7 +20,7 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||||
module: {
|
module: {
|
||||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, extract: true })
|
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, extract: true })
|
||||||
},
|
},
|
||||||
devtool: config.build.productionSourceMap ? '#source-map' : false,
|
devtool: 'source-map',
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
|
@ -32,6 +33,11 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||||
chunkFilename: utils.assetsPath('js/[name].[chunkhash].js')
|
chunkFilename: utils.assetsPath('js/[name].[chunkhash].js')
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
new WorkboxPlugin.InjectManifest({
|
||||||
|
swSrc: path.join(__dirname, '..', 'src/sw.js'),
|
||||||
|
swDest: 'sw-pleroma.js',
|
||||||
|
maximumFileSizeToCacheInBytes: 15 * 1024 * 1024,
|
||||||
|
}),
|
||||||
// http://vuejs.github.io/vue-loader/workflow/production.html
|
// http://vuejs.github.io/vue-loader/workflow/production.html
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': env,
|
'process.env': env,
|
||||||
|
@ -62,7 +68,7 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||||
},
|
},
|
||||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||||
chunksSortMode: 'dependency'
|
chunksSortMode: 'auto'
|
||||||
}),
|
}),
|
||||||
// split vendor js into its own file
|
// split vendor js into its own file
|
||||||
// extract webpack runtime and module manifest to its own file in order to
|
// extract webpack runtime and module manifest to its own file in order to
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var merge = require('webpack-merge')
|
var { merge } = require('webpack-merge')
|
||||||
var prodEnv = require('./prod.env')
|
var prodEnv = require('./prod.env')
|
||||||
|
|
||||||
module.exports = merge(prodEnv, {
|
module.exports = merge(prodEnv, {
|
||||||
|
|
4
config/ihba.json
Normal file
4
config/ihba.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"target": "https://ihatebeinga.live",
|
||||||
|
"staticConfigPreference": false
|
||||||
|
}
|
|
@ -38,6 +38,11 @@ module.exports = {
|
||||||
assetsSubDirectory: 'static',
|
assetsSubDirectory: 'static',
|
||||||
assetsPublicPath: '/',
|
assetsPublicPath: '/',
|
||||||
proxyTable: {
|
proxyTable: {
|
||||||
|
'/manifest.json': {
|
||||||
|
target,
|
||||||
|
changeOrigin: true,
|
||||||
|
cookieDomainRewrite: 'localhost'
|
||||||
|
},
|
||||||
'/api': {
|
'/api': {
|
||||||
target,
|
target,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
@ -61,7 +66,17 @@ module.exports = {
|
||||||
target,
|
target,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
cookieDomainRewrite: 'localhost'
|
cookieDomainRewrite: 'localhost'
|
||||||
}
|
},
|
||||||
|
'/static/stickers.json': {
|
||||||
|
target,
|
||||||
|
changeOrigin: true,
|
||||||
|
cookieDomainRewrite: 'localhost'
|
||||||
|
},
|
||||||
|
'/static/stickers': {
|
||||||
|
target,
|
||||||
|
changeOrigin: true,
|
||||||
|
cookieDomainRewrite: 'localhost'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// CSS Sourcemaps off by default because relative paths are "buggy"
|
// CSS Sourcemaps off by default because relative paths are "buggy"
|
||||||
// with this option, according to the CSS-Loader README
|
// with this option, according to the CSS-Loader README
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"target": "https://pleroma.soykaf.com/",
|
"target": "https://otp.akkoma.dev/",
|
||||||
"staticConfigPreference": false
|
"staticConfigPreference": false
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
var merge = require('webpack-merge')
|
var { merge } = require('webpack-merge')
|
||||||
var devEnv = require('./dev.env')
|
var devEnv = require('./dev.env')
|
||||||
|
|
||||||
module.exports = merge(devEnv, {
|
module.exports = merge(devEnv, {
|
||||||
NODE_ENV: '"testing"'
|
|
||||||
})
|
})
|
||||||
|
|
7
docs/Makefile
Normal file
7
docs/Makefile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
all: install
|
||||||
|
pipenv run mkdocs build
|
||||||
|
|
||||||
|
install:
|
||||||
|
pipenv install
|
||||||
|
clean:
|
||||||
|
rm -rf site
|
10
docs/Pipfile
Normal file
10
docs/Pipfile
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[[source]]
|
||||||
|
name = "pypi"
|
||||||
|
url = "https://pypi.org/simple"
|
||||||
|
verify_ssl = true
|
||||||
|
|
||||||
|
[dev-packages]
|
||||||
|
|
||||||
|
[packages]
|
||||||
|
mkdocs-material = "*"
|
||||||
|
markdown-include = "*"
|
277
docs/Pipfile.lock
generated
Normal file
277
docs/Pipfile.lock
generated
Normal file
|
@ -0,0 +1,277 @@
|
||||||
|
{
|
||||||
|
"_meta": {
|
||||||
|
"hash": {
|
||||||
|
"sha256": "926d34630c729228bb015cb958c04f8269c57f5ca1ffc2ceab1dfd1798884772"
|
||||||
|
},
|
||||||
|
"pipfile-spec": 6,
|
||||||
|
"requires": {},
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"name": "pypi",
|
||||||
|
"url": "https://pypi.org/simple",
|
||||||
|
"verify_ssl": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"click": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e",
|
||||||
|
"sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.7'",
|
||||||
|
"version": "==8.1.3"
|
||||||
|
},
|
||||||
|
"ghp-import": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:8337dd7b50877f163d4c0289bc1f1c7f127550241988d568c1db512c4324a619",
|
||||||
|
"sha256:9c535c4c61193c2df8871222567d7fd7e5014d835f97dc7b7439069e2413d343"
|
||||||
|
],
|
||||||
|
"version": "==2.1.0"
|
||||||
|
},
|
||||||
|
"importlib-metadata": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670",
|
||||||
|
"sha256:7401a975809ea1fdc658c3aa4f78cc2195a0e019c5cbc4c06122884e9ae80c23"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.7'",
|
||||||
|
"version": "==4.12.0"
|
||||||
|
},
|
||||||
|
"jinja2": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852",
|
||||||
|
"sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.7'",
|
||||||
|
"version": "==3.1.2"
|
||||||
|
},
|
||||||
|
"markdown": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:cbb516f16218e643d8e0a95b309f77eb118cb138d39a4f27851e6a63581db874",
|
||||||
|
"sha256:f5da449a6e1c989a4cea2631aa8ee67caa5a2ef855d551c88f9e309f4634c621"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==3.3.7"
|
||||||
|
},
|
||||||
|
"markdown-include": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:6f5d680e36f7780c7f0f61dca53ca581bd50d1b56137ddcd6353efafa0c3e4a2"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==0.6.0"
|
||||||
|
},
|
||||||
|
"markupsafe": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003",
|
||||||
|
"sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88",
|
||||||
|
"sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5",
|
||||||
|
"sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7",
|
||||||
|
"sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a",
|
||||||
|
"sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603",
|
||||||
|
"sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1",
|
||||||
|
"sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135",
|
||||||
|
"sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247",
|
||||||
|
"sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6",
|
||||||
|
"sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601",
|
||||||
|
"sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77",
|
||||||
|
"sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02",
|
||||||
|
"sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e",
|
||||||
|
"sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63",
|
||||||
|
"sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f",
|
||||||
|
"sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980",
|
||||||
|
"sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b",
|
||||||
|
"sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812",
|
||||||
|
"sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff",
|
||||||
|
"sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96",
|
||||||
|
"sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1",
|
||||||
|
"sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925",
|
||||||
|
"sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a",
|
||||||
|
"sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6",
|
||||||
|
"sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e",
|
||||||
|
"sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f",
|
||||||
|
"sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4",
|
||||||
|
"sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f",
|
||||||
|
"sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3",
|
||||||
|
"sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c",
|
||||||
|
"sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a",
|
||||||
|
"sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417",
|
||||||
|
"sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a",
|
||||||
|
"sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a",
|
||||||
|
"sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37",
|
||||||
|
"sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452",
|
||||||
|
"sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933",
|
||||||
|
"sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a",
|
||||||
|
"sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.7'",
|
||||||
|
"version": "==2.1.1"
|
||||||
|
},
|
||||||
|
"mergedeep": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8",
|
||||||
|
"sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==1.3.4"
|
||||||
|
},
|
||||||
|
"mkdocs": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:26bd2b03d739ac57a3e6eed0b7bcc86168703b719c27b99ad6ca91dc439aacde",
|
||||||
|
"sha256:b504405b04da38795fec9b2e5e28f6aa3a73bb0960cb6d5d27ead28952bd35ea"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==1.3.0"
|
||||||
|
},
|
||||||
|
"mkdocs-material": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:263f2721f3abe533b61f7c8bed435a0462620912742c919821ac2d698b4bfe67",
|
||||||
|
"sha256:dc82b667d2a83f0de581b46a6d0949732ab77e7638b87ea35b770b33bc02e75a"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==8.3.9"
|
||||||
|
},
|
||||||
|
"mkdocs-material-extensions": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:a82b70e533ce060b2a5d9eb2bc2e1be201cf61f901f93704b4acf6e3d5983a44",
|
||||||
|
"sha256:bfd24dfdef7b41c312ede42648f9eb83476ea168ec163b613f9abd12bbfddba2"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==1.0.3"
|
||||||
|
},
|
||||||
|
"packaging": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb",
|
||||||
|
"sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==21.3"
|
||||||
|
},
|
||||||
|
"pygments": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb",
|
||||||
|
"sha256:dc9c10fb40944260f6ed4c688ece0cd2048414940f1cea51b8b226318411c519"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==2.12.0"
|
||||||
|
},
|
||||||
|
"pymdown-extensions": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:3ef2d998c0d5fa7eb09291926d90d69391283561cf6306f85cd588a5eb5befa0",
|
||||||
|
"sha256:ec141c0f4983755349f0c8710416348d1a13753976c028186ed14f190c8061c4"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.7'",
|
||||||
|
"version": "==9.5"
|
||||||
|
},
|
||||||
|
"pyparsing": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb",
|
||||||
|
"sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"
|
||||||
|
],
|
||||||
|
"markers": "python_full_version >= '3.6.8'",
|
||||||
|
"version": "==3.0.9"
|
||||||
|
},
|
||||||
|
"python-dateutil": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86",
|
||||||
|
"sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||||
|
"version": "==2.8.2"
|
||||||
|
},
|
||||||
|
"pyyaml": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293",
|
||||||
|
"sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b",
|
||||||
|
"sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57",
|
||||||
|
"sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b",
|
||||||
|
"sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4",
|
||||||
|
"sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07",
|
||||||
|
"sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba",
|
||||||
|
"sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9",
|
||||||
|
"sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287",
|
||||||
|
"sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513",
|
||||||
|
"sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0",
|
||||||
|
"sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0",
|
||||||
|
"sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92",
|
||||||
|
"sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f",
|
||||||
|
"sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2",
|
||||||
|
"sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc",
|
||||||
|
"sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c",
|
||||||
|
"sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86",
|
||||||
|
"sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4",
|
||||||
|
"sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c",
|
||||||
|
"sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34",
|
||||||
|
"sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b",
|
||||||
|
"sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c",
|
||||||
|
"sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb",
|
||||||
|
"sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737",
|
||||||
|
"sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3",
|
||||||
|
"sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d",
|
||||||
|
"sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53",
|
||||||
|
"sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78",
|
||||||
|
"sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803",
|
||||||
|
"sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a",
|
||||||
|
"sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174",
|
||||||
|
"sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==6.0"
|
||||||
|
},
|
||||||
|
"pyyaml-env-tag": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:70092675bda14fdec33b31ba77e7543de9ddc88f2e5b99160396572d11525bdb",
|
||||||
|
"sha256:af31106dec8a4d68c60207c1886031cbf839b68aa7abccdb19868200532c2069"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==0.1"
|
||||||
|
},
|
||||||
|
"six": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
|
||||||
|
"sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||||
|
"version": "==1.16.0"
|
||||||
|
},
|
||||||
|
"watchdog": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:083171652584e1b8829581f965b9b7723ca5f9a2cd7e20271edf264cfd7c1412",
|
||||||
|
"sha256:117ffc6ec261639a0209a3252546b12800670d4bf5f84fbd355957a0595fe654",
|
||||||
|
"sha256:186f6c55abc5e03872ae14c2f294a153ec7292f807af99f57611acc8caa75306",
|
||||||
|
"sha256:195fc70c6e41237362ba720e9aaf394f8178bfc7fa68207f112d108edef1af33",
|
||||||
|
"sha256:226b3c6c468ce72051a4c15a4cc2ef317c32590d82ba0b330403cafd98a62cfd",
|
||||||
|
"sha256:247dcf1df956daa24828bfea5a138d0e7a7c98b1a47cf1fa5b0c3c16241fcbb7",
|
||||||
|
"sha256:255bb5758f7e89b1a13c05a5bceccec2219f8995a3a4c4d6968fe1de6a3b2892",
|
||||||
|
"sha256:43ce20ebb36a51f21fa376f76d1d4692452b2527ccd601950d69ed36b9e21609",
|
||||||
|
"sha256:4f4e1c4aa54fb86316a62a87b3378c025e228178d55481d30d857c6c438897d6",
|
||||||
|
"sha256:5952135968519e2447a01875a6f5fc8c03190b24d14ee52b0f4b1682259520b1",
|
||||||
|
"sha256:64a27aed691408a6abd83394b38503e8176f69031ca25d64131d8d640a307591",
|
||||||
|
"sha256:6b17d302850c8d412784d9246cfe8d7e3af6bcd45f958abb2d08a6f8bedf695d",
|
||||||
|
"sha256:70af927aa1613ded6a68089a9262a009fbdf819f46d09c1a908d4b36e1ba2b2d",
|
||||||
|
"sha256:7a833211f49143c3d336729b0020ffd1274078e94b0ae42e22f596999f50279c",
|
||||||
|
"sha256:8250546a98388cbc00c3ee3cc5cf96799b5a595270dfcfa855491a64b86ef8c3",
|
||||||
|
"sha256:97f9752208f5154e9e7b76acc8c4f5a58801b338de2af14e7e181ee3b28a5d39",
|
||||||
|
"sha256:9f05a5f7c12452f6a27203f76779ae3f46fa30f1dd833037ea8cbc2887c60213",
|
||||||
|
"sha256:a735a990a1095f75ca4f36ea2ef2752c99e6ee997c46b0de507ba40a09bf7330",
|
||||||
|
"sha256:ad576a565260d8f99d97f2e64b0f97a48228317095908568a9d5c786c829d428",
|
||||||
|
"sha256:b530ae007a5f5d50b7fbba96634c7ee21abec70dc3e7f0233339c81943848dc1",
|
||||||
|
"sha256:bfc4d351e6348d6ec51df007432e6fe80adb53fd41183716017026af03427846",
|
||||||
|
"sha256:d3dda00aca282b26194bdd0adec21e4c21e916956d972369359ba63ade616153",
|
||||||
|
"sha256:d9820fe47c20c13e3c9dd544d3706a2a26c02b2b43c993b62fcd8011bcc0adb3",
|
||||||
|
"sha256:ed80a1628cee19f5cfc6bb74e173f1b4189eb532e705e2a13e3250312a62e0c9",
|
||||||
|
"sha256:ee3e38a6cc050a8830089f79cbec8a3878ec2fe5160cdb2dc8ccb6def8552658"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==2.1.9"
|
||||||
|
},
|
||||||
|
"zipp": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad",
|
||||||
|
"sha256:c4f6e5bbf48e74f7a38e7cc5b0480ff42b0ae5178957d564d18932525d5cf099"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.7'",
|
||||||
|
"version": "==3.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"develop": {}
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 491 B |
|
@ -1,15 +1,15 @@
|
||||||
# Pleroma-FE configuration and customization for instance administrators
|
# Akkoma-FE configuration and customization for instance administrators
|
||||||
|
|
||||||
* *For user configuration, see [Pleroma-FE user guide](../user_guide)*
|
* *For user configuration, see [Akkoma-FE user guide](../user_guide)*
|
||||||
* *For local development server configuration, see [Hacking, tweaking, contributing](HACKING.md)*
|
* *For local development server configuration, see [Hacking, tweaking, contributing](HACKING.md)*
|
||||||
|
|
||||||
## Where configuration is stored
|
## Where configuration is stored
|
||||||
|
|
||||||
PleromaFE gets its configuration from several sources, in order of preference (the one above overrides ones below it)
|
Akkoma-FE gets its configuration from several sources, in order of preference (the one above overrides ones below it)
|
||||||
|
|
||||||
1. `/api/statusnet/config.json` - this is generated on Backend and contains multiple things including instance name, char limit etc. It also contains FE/Client-specific data, PleromaFE uses `pleromafe` field of it. For more info on changing config on BE, look [here](../backend/configuration/cheatsheet.md#frontend_configurations)
|
1. `/api/statusnet/config.json` - this is generated on Backend and contains multiple things including instance name, char limit etc. It also contains FE/Client-specific data, Akkoma-FE uses `pleromafe` field of it. For more info on changing config on BE, look [here](https://docs.akkoma.dev/stable/configuration/cheatsheet.md#frontend_configurations)
|
||||||
2. `/static/config.json` - this is a static FE-provided file, containing only FE specific configuration. This file is completely optional and could be removed but is useful as a fallback if some configuration JSON property isn't present in BE-provided config. It's also a reference point to check what default configuration are and what JSON properties even exist. In local dev mode it could be used to override BE configuration, more about that in HACKING.md. File is located [here](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/static/config.json).
|
2. `/static/config.json` - this is a static FE-provided file, containing only FE specific configuration. This file is completely optional and could be removed but is useful as a fallback if some configuration JSON property isn't present in BE-provided config. It's also a reference point to check what default configuration are and what JSON properties even exist. In local dev mode it could be used to override BE configuration, more about that in HACKING.md. File is located [here](https://akkoma.dev/AkkomaGang/akkoma-fe/src/branch/develop/static/config.json).
|
||||||
3. Built-in defaults. Those are hard-coded defaults that are used when `/static/config.json` is not available and BE-provided configuration JSON is missing some JSON properties. ( [Code](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/modules/instance.js) )
|
3. Built-in defaults. Those are hard-coded defaults that are used when `/static/config.json` is not available and BE-provided configuration JSON is missing some JSON properties. ( [Code](https://akkoma.dev/AkkomaGang/akkoma-fe/src/branch/develop/src/modules/instance.js) )
|
||||||
|
|
||||||
## Instance-defaults
|
## Instance-defaults
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ Instance `logo`, could be any image, including svg. By default it assumes logo u
|
||||||
`logoMargin` allows you to adjust vertical margins between logo boundary and navbar borders. The idea is that to have logo's image without any extra margins and instead adjust them to your need in layout.
|
`logoMargin` allows you to adjust vertical margins between logo boundary and navbar borders. The idea is that to have logo's image without any extra margins and instead adjust them to your need in layout.
|
||||||
|
|
||||||
### `minimalScopesMode`
|
### `minimalScopesMode`
|
||||||
Limit scope selection to *Direct*, *User default* and *Scope of post replying to*. This also makes it impossible to reply to a DM with a non-DM post from PleromaFE.
|
Limit scope selection to *Direct*, *User default* and *Scope of post replying to*. This also makes it impossible to reply to a DM with a non-DM post from Akkoma-FE.
|
||||||
|
|
||||||
### `nsfwCensorImage`
|
### `nsfwCensorImage`
|
||||||
Use custom image for NSFW'd images
|
Use custom image for NSFW'd images
|
||||||
|
@ -70,9 +70,6 @@ Default post formatting option (markdown/bbcode/plaintext/etc...)
|
||||||
### `redirectRootNoLogin`, `redirectRootLogin`
|
### `redirectRootNoLogin`, `redirectRootLogin`
|
||||||
These two settings should point to where FE should redirect visitor when they login/open up website root
|
These two settings should point to where FE should redirect visitor when they login/open up website root
|
||||||
|
|
||||||
### `scopeCopy`
|
|
||||||
Copy post scope (visibility) when replying to a post. Instance-default.
|
|
||||||
|
|
||||||
### `sidebarRight`
|
### `sidebarRight`
|
||||||
Change alignment of sidebar and panels to the right. Defaults to `false`.
|
Change alignment of sidebar and panels to the right. Defaults to `false`.
|
||||||
|
|
||||||
|
@ -80,7 +77,7 @@ Change alignment of sidebar and panels to the right. Defaults to `false`.
|
||||||
Show panel showcasing instance features/settings to logged-out visitors
|
Show panel showcasing instance features/settings to logged-out visitors
|
||||||
|
|
||||||
### `showInstanceSpecificPanel`
|
### `showInstanceSpecificPanel`
|
||||||
This allows you to include arbitrary HTML content in a panel below navigation menu. PleromaFE looks for an html page `instance/panel.html`, by default it's not provided in FE, but BE bundles some [default one](https://git.pleroma.social/pleroma/pleroma/blob/develop/priv/static/instance/panel.html). De-facto instance-defaults, since user can hide instance-specific panel.
|
This allows you to include arbitrary HTML content in a panel below navigation menu. Akkoma-FE looks for an html page `instance/panel.html`, by default it's not provided in FE, but BE bundles some [default one](https://git.pleroma.social/pleroma/pleroma/blob/develop/priv/static/instance/panel.html). De-facto instance-defaults, since user can hide instance-specific panel.
|
||||||
|
|
||||||
### `subjectLineBehavior`
|
### `subjectLineBehavior`
|
||||||
How to handle subject line (CW) when replying to a post.
|
How to handle subject line (CW) when replying to a post.
|
|
@ -1,8 +1,8 @@
|
||||||
# Hacking, tweaking, contributing
|
# Hacking, tweaking, contributing
|
||||||
|
|
||||||
## What PleromaFE even is, how it works
|
## What Akkoma-FE even is, how it works
|
||||||
|
|
||||||
PleromaFE is an SPA (Single-Page Application) backed by [Vue](https://vuejs.org/) framework. It means that it's just a nearly-empty HTML page with bunch of JavaScript that actually generates and controls DOM (i.e. html elements) in Runtime. Currently, there's no way around it - you have to have Javascript enabled in the browser to make it work, there is a theoretical possibility to generate some HTML server-side but it's not implemented yet.
|
Akkoma-FE is an SPA (Single-Page Application) backed by [Vue](https://vuejs.org/) framework. It means that it's just a nearly-empty HTML page with bunch of JavaScript that actually generates and controls DOM (i.e. html elements) in Runtime. Currently, there's no way around it - you have to have Javascript enabled in the browser to make it work, there is a theoretical possibility to generate some HTML server-side but it's not implemented yet.
|
||||||
|
|
||||||
You can serve static html page and everything from any HTTP(S) server but currently it will try to access /api/ path at same domain it's running on, meaning that as of right now you cannot put it on one domain and access the other without proxying requests.
|
You can serve static html page and everything from any HTTP(S) server but currently it will try to access /api/ path at same domain it's running on, meaning that as of right now you cannot put it on one domain and access the other without proxying requests.
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ This could be a bit trickier, you basically need steps 1-4 from *develop build*
|
||||||
|
|
||||||
### Replacing your instance's frontend with custom FE build
|
### Replacing your instance's frontend with custom FE build
|
||||||
|
|
||||||
This is the most easiest way to use and test FE build: you just need to copy or symlink contents of `dist` folder into backend's [static directory](../backend/configuration/static_dir.md), by default it is located in `instance/static`, or in `/var/lib/pleroma/static` for OTP release installations, create it if it doesn't exist already. Be aware that running `yarn build` wipes the contents of `dist` folder.
|
This is the most easiest way to use and test FE build: you just need to copy or symlink contents of `dist` folder into backend's [static directory](https://docs.akkoma.dev/stable/configuration/static_dir/), by default it is located in `instance/static`, or in `/var/lib/pleroma/static` for OTP release installations, create it if it doesn't exist already. Be aware that running `yarn build` wipes the contents of `dist` folder.
|
||||||
|
|
||||||
### Running production build locally or on a separate server
|
### Running production build locally or on a separate server
|
||||||
|
|
||||||
|
@ -67,19 +67,19 @@ server {
|
||||||
|
|
||||||
### API, Data, Operations
|
### API, Data, Operations
|
||||||
|
|
||||||
In 99% cases PleromaFE uses [MastoAPI](https://docs.joinmastodon.org/api/) with [Pleroma Extensions](../backend/API/differences_in_mastoapi_responses.md) to fetch the data. The rest is either QvitterAPI leftovers or pleroma-exclusive APIs. QvitterAPI doesn't exactly have documentation and uses different JSON structure and sometimes different parameters and workflows, [this](https://twitter-api.readthedocs.io/en/latest/index.html) could be a good reference though. Some pleroma-exclusive API may still be using QvitterAPI JSON structure.
|
In 99% cases Akkoma-FE uses [MastoAPI](https://docs.joinmastodon.org/api/) with [Pleroma Extensions](https://docs.akkoma.dev/stable/differences_in_mastoapi_responses.md) to fetch the data. The rest is either QvitterAPI leftovers or pleroma-exclusive APIs. QvitterAPI doesn't exactly have documentation and uses different JSON structure and sometimes different parameters and workflows, [this](https://twitter-api.readthedocs.io/en/latest/index.html) could be a good reference though. Some pleroma-exclusive API may still be using QvitterAPI JSON structure.
|
||||||
|
|
||||||
PleromaFE supports both formats by transforming them into internal format which is basically QvitterAPI one with some additions and renaming. All data is passed trough [Entity Normalizer](https://git.pleroma.social/pleroma/pleroma-fe/-/blob/develop/src/services/entity_normalizer/entity_normalizer.service.js) which can serve as a reference of API and what's actually used, it's also a host for all the hacks and data transformation.
|
Akkoma-FE supports both formats by transforming them into internal format which is basically QvitterAPI one with some additions and renaming. All data is passed trough [Entity Normalizer](https://akkoma.dev/AkkomaGang/akkoma-fe/src/branch/develop/src/services/entity_normalizer/entity_normalizer.service.js) which can serve as a reference of API and what's actually used, it's also a host for all the hacks and data transformation.
|
||||||
|
|
||||||
For most part, PleromaFE tries to store all the info it can get in global vuex store - every user and post are passed trough updating mechanism where data is either added or merged with existing data, reactively updating the information throughout UI, so if in newest request user's post counter increased, it will be instantly updated in open user profile cards. This is also used to find users, posts and sometimes to build timelines and/or request parameters.
|
For most part, Akkoma-FE tries to store all the info it can get in global vuex store - every user and post are passed trough updating mechanism where data is either added or merged with existing data, reactively updating the information throughout UI, so if in newest request user's post counter increased, it will be instantly updated in open user profile cards. This is also used to find users, posts and sometimes to build timelines and/or request parameters.
|
||||||
|
|
||||||
PleromaFE also tries to persist this store, however only stable data is stored, such as user authentication and preferences, user highlights. Persistence is performed by saving and loading chunk of vuex store in browser's LocalStorage/IndexedDB.
|
Akkoma-FE also tries to persist this store, however only stable data is stored, such as user authentication and preferences, user highlights. Persistence is performed by saving and loading chunk of vuex store in browser's LocalStorage/IndexedDB.
|
||||||
|
|
||||||
TODO: Refactor API code and document it here
|
TODO: Refactor API code and document it here
|
||||||
|
|
||||||
### Themes
|
### Themes
|
||||||
|
|
||||||
PleromaFE uses custom theme "framework" which is pretty much just a style tag rendered by vue which only contains CSS3 variables. Every color used in UI should be derived from theme. Theme is stored in a JSON object containing color, opacity, shadow and font information, with most of it being optional.
|
Akkoma-FE uses custom theme "framework" which is pretty much just a style tag rendered by vue which only contains CSS3 variables. Every color used in UI should be derived from theme. Theme is stored in a JSON object containing color, opacity, shadow and font information, with most of it being optional.
|
||||||
|
|
||||||
The most basic theme can consist of 4 to 8 "basic colors", which is also what previous version of themes allowed, with all other colors being derived from those basic colors, i.e. "light background" will be "background" color lightened/darkened, "panel header" will be same as "foreground". The idea is that you can specify just basic color palette and everything else will be generated automatically, but if you really need to tweak some specific color - you can.
|
The most basic theme can consist of 4 to 8 "basic colors", which is also what previous version of themes allowed, with all other colors being derived from those basic colors, i.e. "light background" will be "background" color lightened/darkened, "panel header" will be same as "foreground". The idea is that you can specify just basic color palette and everything else will be generated automatically, but if you really need to tweak some specific color - you can.
|
||||||
|
|
BIN
docs/docs/assets/example_emoji.png
Normal file
BIN
docs/docs/assets/example_emoji.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
28
docs/docs/css/extra.css
Normal file
28
docs/docs/css/extra.css
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
p, a, li, pre {
|
||||||
|
font-family: "Tiresias PCFont", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
code,
|
||||||
|
.codehilite pre {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
:root > * {
|
||||||
|
--md-primary-fg-color: #593196;
|
||||||
|
--md-accent-fg-color: #455a63;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Tiresias PCFont';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Tiresias PCFont'), local('Tiresias PCFont'),
|
||||||
|
url('./fonts/Tiresias_PCfont.ttf') format('truetype')
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Tiresias Infofont';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Tiresias Infofont'), local('Tiresias Infofont'),
|
||||||
|
url('./fonts/Tiresias_Infofont.ttf') format('truetype')
|
||||||
|
}
|
BIN
docs/docs/fonts/Tiresias_Infofont.ttf
Executable file
BIN
docs/docs/fonts/Tiresias_Infofont.ttf
Executable file
Binary file not shown.
BIN
docs/docs/fonts/Tiresias_PCfont.ttf
Executable file
BIN
docs/docs/fonts/Tiresias_PCfont.ttf
Executable file
Binary file not shown.
BIN
docs/docs/images/akkoma_logo_vector_bg_32.png
Normal file
BIN
docs/docs/images/akkoma_logo_vector_bg_32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
24
docs/docs/images/akkoma_logo_vector_nobg.svg
Normal file
24
docs/docs/images/akkoma_logo_vector_nobg.svg
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 362.83 362.83">
|
||||||
|
<defs>
|
||||||
|
<style>
|
||||||
|
.cls-1, .cls-2 {
|
||||||
|
fill: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cls-2 {
|
||||||
|
stroke: #fff;
|
||||||
|
stroke-miterlimit: 10;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</defs>
|
||||||
|
<g id="Layer_6" data-name="Layer 6">
|
||||||
|
<path class="cls-1" d="M115.2,131.89c6.26-6.54,20.19-20.63,42.39-26.14,15.79-3.92,28.51-1.28,33.51,0,83.72,21.41,116.03,201.78,77.79,226.32-10.28,6.6-26.86,2.7-36.77-3.3-32.63-19.78-29.3-72.87-44.44-73.73-5.11-.29-7.15,5.8-20.91,24.94-19.63,27.3-31.49,43.44-49.21,50.87-2.53,1.06-26.91,12.07-41.84,1.23-38.55-28-2.96-155.84,39.49-200.18Zm56.31,10.45c-27.39-.52-46.38,38.21-37.98,54.55,10.09,19.62,65.5,18.26,74.77-3.3,7.21-16.78-11.38-50.77-36.79-51.24Z"/>
|
||||||
|
</g>
|
||||||
|
<g id="Layer_4" data-name="Layer 4">
|
||||||
|
<path class="cls-1" d="M68.93,86.51c-6.55,27.74,252.45,113.97,267.56,89.66,9.24-14.87-64.9-83.62-163.53-97.57-39.06-5.52-100.95-5.14-104.03,7.91Z"/>
|
||||||
|
</g>
|
||||||
|
<g id="Layer_5" data-name="Layer 5">
|
||||||
|
<path class="cls-2" d="M138.96,93.76c.41-5.25,6.51-5.74,28.85-19.42,26.97-16.51,28.85-22.38,56.86-40.83,30.07-19.81,48.46-31.94,54.82-26.61,9.72,8.15-25.18,43.33-21.31,99.35,.87,12.61,3.12,17.79-.86,23.01-18.25,23.95-120.07-13.68-118.35-35.5Z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
8
docs/docs/index.md
Normal file
8
docs/docs/index.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Introduction to Akkoma-FE
|
||||||
|
## What is Akkoma-FE?
|
||||||
|
|
||||||
|
Akkoma-FE is the default user-facing frontend for Pleroma. It's user interface is modeled after Qvitter which is modeled after an older Twitter design. It provides a simple 2-column interface for microblogging. While being simple by default it also provides many powerful customization options.
|
||||||
|
|
||||||
|
## How can I use it?
|
||||||
|
|
||||||
|
If your instance uses Akkoma-FE, you can acces it by going to your instance (e.g. <https://pleroma.soykaf.com>). You can read more about it's basic functionality in the [Akkoma-FE User Guide](./user_guide/). We also have [a guide for administrators](./CONFIGURATION.md) and for [hackers/contributors](./HACKING.md).
|
53
docs/docs/stickers.md
Normal file
53
docs/docs/stickers.md
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
# Adding stickers
|
||||||
|
|
||||||
|
Akkoma-FE supports stickers, which are essentially little images stored server-side
|
||||||
|
which can be selected by a user to automatically attach them to a post.
|
||||||
|
|
||||||
|
There's no explicit setting for these, they just rely on the existence of certain files.
|
||||||
|
|
||||||
|
## Initialising the sticker config file
|
||||||
|
|
||||||
|
You're probably serving Akkoma-FE from your instance's `instance/static/` directory -
|
||||||
|
this directy can also override files served at a given path.
|
||||||
|
|
||||||
|
The first thing we need to do is set up our `stickers.json` file. At `instance/static/static/stickers.json`,
|
||||||
|
put a file that looks like this
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"myPack": "/static/stickers/myPack"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This file is a mapping from name to pack directory location. It says "we have a pack called myPack, look for
|
||||||
|
it at `/static/stickers/myPack`". You can add as many packs as you like in this manner.
|
||||||
|
|
||||||
|
## Creating the pack
|
||||||
|
|
||||||
|
First, create your pack directory
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p instance/static/static/stickers/myPack
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you need to give it some config.
|
||||||
|
|
||||||
|
At `instance/static/static/stickers/myPack/pack.json`, put a file that looks like:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"title": "myPack",
|
||||||
|
"author": "me for i am very cool",
|
||||||
|
"tabIcon": "tab.png",
|
||||||
|
"stickers": [
|
||||||
|
"mySticker.png"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This should be relatively self-explanatory, it declares a pack with a title `myPack` which has only one sticker in it.
|
||||||
|
The `tabIcon` will appear on the sticker picker itself as a representative of the pack.
|
||||||
|
|
||||||
|
You can add as many stickers as you like. They should all be in the same directory as your `pack.json`.
|
||||||
|
|
||||||
|
Now you should find that there's a sticky note icon on the emoji picker on Akkoma-FE that allows you to attach stickers.
|
|
@ -8,13 +8,13 @@
|
||||||
>
|
>
|
||||||
> --Catbag
|
> --Catbag
|
||||||
|
|
||||||
Pleroma-FE is the default user-facing frontend for Pleroma. If your instance uses Pleroma-FE, you can access it by going to your instance (e.g. <https://pleroma.soykaf.com>). After logging in you will have two columns in front of you. Here we're going to keep it to the default behaviour, but some instances swap the left and right columns. If you're on such an instance what we refer to as the left column will be on your right and vice versa.
|
Akkoma-FE is the default user-facing frontend for Pleroma. If your instance uses Akkoma-FE, you can access it by going to your instance (e.g. <https://pleroma.soykaf.com>). After logging in you will have two columns in front of you. Here we're going to keep it to the default behaviour, but some instances swap the left and right columns. If you're on such an instance what we refer to as the left column will be on your right and vice versa.
|
||||||
|
|
||||||
### Left column
|
### Left column
|
||||||
|
|
||||||
- first block: This section is dedicated to [posting](posting_reading_basic_functions.md)
|
- first block: This section is dedicated to [posting](posting_reading_basic_functions.md)
|
||||||
- second block: Here you can switch between the different views for the right column.
|
- second block: Here you can switch between the different views for the right column.
|
||||||
- Optional third block: This is the Instance panel that can be activated, but is deactivated by default. It's fully customisable by instance admins and by default has links to the Pleroma-FE and Mastodon-FE.
|
- Optional third block: This is the Instance panel that can be activated, but is deactivated by default. It's fully customisable by instance admins and by default has links to the Akkoma-FE and Mastodon-FE.
|
||||||
- fourth block: This is the Notifications block, here you will get notified whenever somebody mentions you, follows you, repeats or favorites one of your statuses
|
- fourth block: This is the Notifications block, here you will get notified whenever somebody mentions you, follows you, repeats or favorites one of your statuses
|
||||||
|
|
||||||
### Right column
|
### Right column
|
|
@ -15,11 +15,11 @@ Posts will contain the text you are posting, but some content will be modified:
|
||||||
Let's clear up some basic stuff. When you post something it's called a **post** or it could be called a **status** or even a **toot** or a **prööt** depending on whom you ask. Post has body/content but it also has some other stuff in it - from attachments, visibility scope, subject line...
|
Let's clear up some basic stuff. When you post something it's called a **post** or it could be called a **status** or even a **toot** or a **prööt** depending on whom you ask. Post has body/content but it also has some other stuff in it - from attachments, visibility scope, subject line...
|
||||||
|
|
||||||
**Emoji** are small images embedded in text, there are two major types of emoji: [unicode emoji](https://en.wikipedia.org/wiki/Emoji) and custom emoji. While unicode emoji are universal and standardized, they can appear differently depending on where you are using them or may not appear at all on older systems. Custom emoji are a more *fun* kind - instance administrator can define many images as *custom emoji* for their users. This works very simple - custom emoji is defined by its *shortcode* and an image, so that any shortcode enclosed in colons get replaced with image if such shortcode exist.
|
**Emoji** are small images embedded in text, there are two major types of emoji: [unicode emoji](https://en.wikipedia.org/wiki/Emoji) and custom emoji. While unicode emoji are universal and standardized, they can appear differently depending on where you are using them or may not appear at all on older systems. Custom emoji are a more *fun* kind - instance administrator can define many images as *custom emoji* for their users. This works very simple - custom emoji is defined by its *shortcode* and an image, so that any shortcode enclosed in colons get replaced with image if such shortcode exist.
|
||||||
Let's say there's a `:pleroma:` emoji defined on an instance. That means
|
Let's say there's a `:akkoma:` emoji defined on an instance. That means
|
||||||
> First time using :pleroma: pleroma!
|
> First time using :akkoma: akkoma!
|
||||||
|
|
||||||
will become
|
will become
|
||||||
> First time using ![pleroma](../assets/example_emoji.png) pleroma!
|
> First time using ![akkoma](../assets/example_emoji.png) akkoma!
|
||||||
|
|
||||||
Note that you can only use emoji defined on your instance, you cannot "copy" someone else's emoji, and will have to ask your administrator to copy emoji from other instance to yours.
|
Note that you can only use emoji defined on your instance, you cannot "copy" someone else's emoji, and will have to ask your administrator to copy emoji from other instance to yours.
|
||||||
Lastly, there's two convenience options for emoji: an emoji picker (smiley face to the right of "submit" button) and autocomplete suggestions - when you start typing :shortcode: it will automatically try to suggest you emoji and complete the shortcode for you if you select one. If emoji doesn't show up in suggestions nor in emoji picker it means there's no such emoji on your instance, if shortcode doesn't match any defined emoji it will appear as text.
|
Lastly, there's two convenience options for emoji: an emoji picker (smiley face to the right of "submit" button) and autocomplete suggestions - when you start typing :shortcode: it will automatically try to suggest you emoji and complete the shortcode for you if you select one. If emoji doesn't show up in suggestions nor in emoji picker it means there's no such emoji on your instance, if shortcode doesn't match any defined emoji it will appear as text.
|
||||||
|
@ -42,7 +42,7 @@ A few things to consider about the security and usage of these scopes:
|
||||||
- Changing scopes during a thread or adding people to a direct message will not retroactively make them see the whole conversation. If you add someone to a direct message conversation, they will not see the post that happened before they were mentioned.
|
- Changing scopes during a thread or adding people to a direct message will not retroactively make them see the whole conversation. If you add someone to a direct message conversation, they will not see the post that happened before they were mentioned.
|
||||||
* **Reply-to** if you are replying to someone, your post will also contain a note that your post is referring to the post you're replying to. Person you're replying to will receive a notification *even* if you remove them from mentioned people. You won't receive notifications when replying to your own posts, but it's useful to reply to your own posts to provide people some context if it's a follow-up to a previous post. There's a small "Reply to ..." label under post author's name which you can hover on to see what post it's referring to.
|
* **Reply-to** if you are replying to someone, your post will also contain a note that your post is referring to the post you're replying to. Person you're replying to will receive a notification *even* if you remove them from mentioned people. You won't receive notifications when replying to your own posts, but it's useful to reply to your own posts to provide people some context if it's a follow-up to a previous post. There's a small "Reply to ..." label under post author's name which you can hover on to see what post it's referring to.
|
||||||
|
|
||||||
Sometimes you may encounter posts that seem different than what they are supposed to. For example, you might see a direct message without any mentions in the text. This can happen because internally, the Fediverse has a different addressing mechanism similar to email, with `to` and `cc` fields. While these are not directly accessible in PleromaFE, other software in the Fediverse might generate those posts. Do not worry in these cases, these are normal and not a bug.
|
Sometimes you may encounter posts that seem different than what they are supposed to. For example, you might see a direct message without any mentions in the text. This can happen because internally, the Fediverse has a different addressing mechanism similar to email, with `to` and `cc` fields. While these are not directly accessible in Akkoma-FE, other software in the Fediverse might generate those posts. Do not worry in these cases, these are normal and not a bug.
|
||||||
|
|
||||||
## Rich text
|
## Rich text
|
||||||
|
|
||||||
|
@ -65,6 +65,16 @@ If you set the input-method to Markdown, and post this, it will look something l
|
||||||
|
|
||||||
![example_markdown](../assets/example_markdown.png)
|
![example_markdown](../assets/example_markdown.png)
|
||||||
|
|
||||||
|
## Misskey markdown
|
||||||
|
|
||||||
|
Akkoma-FE includes support for writing and rendering
|
||||||
|
misskey markdown (MFM). To write this you will need to select "MFM" from
|
||||||
|
the content type dropdown (if supported), and then you can format text
|
||||||
|
[in MFM](https://akkoma.dev/sfr/marked-mfm/src/branch/master/docs/syntax.md).
|
||||||
|
|
||||||
|
To render MFM, you will need to turn on "Render Misskey Markdown" in
|
||||||
|
the settings modal.
|
||||||
|
|
||||||
## Other actions
|
## Other actions
|
||||||
|
|
||||||
In addition to posting you can also *favorite* posts also known as *liking* them and *repeat* posts (also known as *retweeting*, *boosting* and even *reprööting*). Favoriting a post increments a counter on it, notifies the post author of your affection towards that post and also adds that post to your "favorited" posts list (in your own profile, "Favorites" tab). Reprööting a post does all that and also repeats this post to your followers and your profile page with a note "*user* repeated post".
|
In addition to posting you can also *favorite* posts also known as *liking* them and *repeat* posts (also known as *retweeting*, *boosting* and even *reprööting*). Favoriting a post increments a counter on it, notifies the post author of your affection towards that post and also adds that post to your "favorited" posts list (in your own profile, "Favorites" tab). Reprööting a post does all that and also repeats this post to your followers and your profile page with a note "*user* repeated post".
|
|
@ -83,7 +83,7 @@ Here you can change your password, revoke access tokens, configure 2-factor auth
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
Here you can change the look and feel of Pleroma-FE. You can choose from several instance-provided presets and you can load one from file and save current theme to file. Before you apply new theme you can see what it will look like approximately in preview section.
|
Here you can change the look and feel of Akkoma-FE. You can choose from several instance-provided presets and you can load one from file and save current theme to file. Before you apply new theme you can see what it will look like approximately in preview section.
|
||||||
|
|
||||||
The themes engine was made to be easy to use while giving an option for powerful in-depth customization - you can just tweak colors on "Common" tab and leave everything else as is.
|
The themes engine was made to be easy to use while giving an option for powerful in-depth customization - you can just tweak colors on "Common" tab and leave everything else as is.
|
||||||
|
|
|
@ -6,6 +6,7 @@ You have several timelines to browse trough
|
||||||
- **Bookmarks** all the posts you've bookmarked. You can bookmark a post by clicking the three dots on the bottom right of the post and choose Bookmark.
|
- **Bookmarks** all the posts you've bookmarked. You can bookmark a post by clicking the three dots on the bottom right of the post and choose Bookmark.
|
||||||
- **Direct Messages** all posts with `direct` scope addressed to you or mentioning you.
|
- **Direct Messages** all posts with `direct` scope addressed to you or mentioning you.
|
||||||
- **Public Timelines** all public posts made by users on the instance you're on
|
- **Public Timelines** all public posts made by users on the instance you're on
|
||||||
|
- **Bubble Timeline** all public posts from instances recommended by your admin(s) in the instance settings. This won't appear if they haven't set anything up for it.
|
||||||
- **The Whole Known Network** also known as **TWKN** or **Federated Timeline** - all public posts known by your instance. Due to nature of the network your instance may not know *all* the posts on the network, so only posts known by your instance are shown there.
|
- **The Whole Known Network** also known as **TWKN** or **Federated Timeline** - all public posts known by your instance. Due to nature of the network your instance may not know *all* the posts on the network, so only posts known by your instance are shown there.
|
||||||
|
|
||||||
Note that by default you will see all posts made by other users on your Home Timeline, this contrast behavior of Twitter and Mastodon, which shows you only non-reply posts and replies to people you follow. You can change said behavior in the [settings](settings.md#filtering).
|
Note that by default you will see all posts made by other users on your Home Timeline, this contrast behavior of Twitter and Mastodon, which shows you only non-reply posts and replies to people you follow. You can change said behavior in the [settings](settings.md#filtering).
|
|
@ -4,7 +4,7 @@ When you see someone, you can click on their user picture to view their profile,
|
||||||
|
|
||||||
**Following** is self-explanatory, it adds them to your Home Timeline, lists you as a follower and gives you access to follower-only posts if they have any.
|
**Following** is self-explanatory, it adds them to your Home Timeline, lists you as a follower and gives you access to follower-only posts if they have any.
|
||||||
|
|
||||||
**Muting** collapses posts and notifications made by them, giving you an option to see the post if you're curious. Clients other than PleromaFE may completely remove their posts.
|
**Muting** collapses posts and notifications made by them, giving you an option to see the post if you're curious. Clients other than Akkoma-FE may completely remove their posts.
|
||||||
|
|
||||||
**Blocking** a user removes them from your timeline and notifications and prevents them from following you (automatically unfollows them from you).
|
**Blocking** a user removes them from your timeline and notifications and prevents them from following you (automatically unfollows them from you).
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
# Introduction to Pleroma-FE
|
|
||||||
## What is Pleroma-FE?
|
|
||||||
|
|
||||||
Pleroma-FE is the default user-facing frontend for Pleroma. It's user interface is modeled after Qvitter which is modeled after an older Twitter design. It provides a simple 2-column interface for microblogging. While being simple by default it also provides many powerful customization options.
|
|
||||||
|
|
||||||
## How can I use it?
|
|
||||||
|
|
||||||
If your instance uses Pleroma-FE, you can acces it by going to your instance (e.g. <https://pleroma.soykaf.com>). You can read more about it's basic functionality in the [Pleroma-FE User Guide](./user_guide/). We also have [a guide for administrators](./CONFIGURATION.md) and for [hackers/contributors](./HACKING.md).
|
|
37
docs/mkdocs.yml
Normal file
37
docs/mkdocs.yml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
site_name: Akkoma-FE Documentation
|
||||||
|
theme:
|
||||||
|
favicon: 'images/akkoma_logo_vector_bg_32.png'
|
||||||
|
name: 'material'
|
||||||
|
custom_dir: 'theme'
|
||||||
|
# Disable google fonts
|
||||||
|
font: false
|
||||||
|
logo: 'images/akkoma_logo_vector_nobg.svg'
|
||||||
|
features:
|
||||||
|
- tabs
|
||||||
|
palette:
|
||||||
|
primary: 'deep purple'
|
||||||
|
accent: 'blue grey'
|
||||||
|
|
||||||
|
extra_css:
|
||||||
|
- css/extra.css
|
||||||
|
repo_name: 'AkkomaGang/akkoma-fe'
|
||||||
|
repo_url: 'https://akkoma.dev/AkkomaGang/akkoma-fe'
|
||||||
|
|
||||||
|
extra:
|
||||||
|
repo_icon: gitea
|
||||||
|
|
||||||
|
markdown_extensions:
|
||||||
|
# Note/warning blocks https://squidfunk.github.io/mkdocs-material/extensions/admonition/
|
||||||
|
- admonition
|
||||||
|
- codehilite:
|
||||||
|
guess_lang: false
|
||||||
|
# Make it possible to link to every header https://squidfunk.github.io/mkdocs-material/extensions/permalinks/
|
||||||
|
- toc:
|
||||||
|
permalink: true
|
||||||
|
- pymdownx.tasklist:
|
||||||
|
custom_checkbox: true
|
||||||
|
- pymdownx.superfences
|
||||||
|
- pymdownx.tabbed
|
||||||
|
- pymdownx.details
|
||||||
|
- markdown_include.include:
|
||||||
|
base_path: docs
|
22
docs/requirements.txt
Normal file
22
docs/requirements.txt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
click==8.1.3
|
||||||
|
ghp-import==2.1.0
|
||||||
|
importlib-metadata==4.12.0
|
||||||
|
Jinja2==3.1.2
|
||||||
|
Markdown==3.3.7
|
||||||
|
markdown-include==0.6.0
|
||||||
|
MarkupSafe==2.1.1
|
||||||
|
mergedeep==1.3.4
|
||||||
|
mkdocs==1.3.0
|
||||||
|
mkdocs-bootswatch==1.1
|
||||||
|
mkdocs-material==8.1.8
|
||||||
|
mkdocs-material-extensions==1.0.3
|
||||||
|
packaging==21.3
|
||||||
|
Pygments==2.11.2
|
||||||
|
pymdown-extensions==9.1
|
||||||
|
pyparsing==3.0.9
|
||||||
|
python-dateutil==2.8.2
|
||||||
|
PyYAML==6.0
|
||||||
|
pyyaml_env_tag==0.1
|
||||||
|
six==1.16.0
|
||||||
|
watchdog==2.1.9
|
||||||
|
zipp==3.8.0
|
64
docs/theme/partials/source.html
vendored
Normal file
64
docs/theme/partials/source.html
vendored
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
<!--
|
||||||
|
Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to
|
||||||
|
deal in the Software without restriction, including without limitation the
|
||||||
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
IN THE SOFTWARE.
|
||||||
|
-->
|
||||||
|
|
||||||
|
{% import "partials/language.html" as lang with context %}
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Check whether the repository is hosted on one of the supported code hosting
|
||||||
|
platforms (GitHub, GitLab or Bitbucket) to show icon.
|
||||||
|
-->
|
||||||
|
{% set platform = config.extra.repo_icon or config.repo_url %}
|
||||||
|
{% if "github" in platform %}
|
||||||
|
{% set repo_type = "github" %}
|
||||||
|
{% elif "gitlab" in platform %}
|
||||||
|
{% set repo_type = "gitlab" %}
|
||||||
|
{% elif "bitbucket" in platform %}
|
||||||
|
{% set repo_type = "bitbucket" %}
|
||||||
|
{% else %}
|
||||||
|
{% set repo_type = "" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if page and page.url.startswith('backend') %}
|
||||||
|
{% set repo_url = "https://akkoma.dev/AkkomaGang/akkoma" %}
|
||||||
|
{% set repo_name = "AkkomaGang/akkoma" %}
|
||||||
|
{% elif page and page.url.startswith('frontend') %}
|
||||||
|
{% set repo_url = "https://akkoma.dev/AkkomaGang/akkoma-fe" %}
|
||||||
|
{% set repo_name = "AkkomaGang/akkoma-fe" %}
|
||||||
|
{% else %}
|
||||||
|
{% set repo_url = config.repo_url %}
|
||||||
|
{% set repo_name = config.repo_name %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Repository containing source -->
|
||||||
|
<a href="{{ repo_url }}" title="{{ lang.t('source.link.title') }}"
|
||||||
|
class="md-source" data-md-source="{{ repo_type }}">
|
||||||
|
{% if repo_type %}
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__{{ repo_type }}" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="md-source__repository">
|
||||||
|
{{ repo_name }}
|
||||||
|
</div>
|
||||||
|
</a>
|
31
eslint.config.js
Normal file
31
eslint.config.js
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
const pluginVue = require('eslint-plugin-vue')
|
||||||
|
const pluginImport = require('eslint-plugin-import')
|
||||||
|
|
||||||
|
module.exports = [
|
||||||
|
...pluginVue.configs['flat/recommended'],
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
parser: '@babel/eslint-parser',
|
||||||
|
sourceType: 'module'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
// allow paren-less arrow functions
|
||||||
|
'arrow-parens': 0,
|
||||||
|
// allow async-await
|
||||||
|
'generator-star-spacing': 0,
|
||||||
|
// allow debugger during development
|
||||||
|
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
||||||
|
'vue/require-prop-types': 0,
|
||||||
|
'vue/no-unused-vars': 0,
|
||||||
|
'no-tabs': 0,
|
||||||
|
'vue/multi-word-component-names': 0,
|
||||||
|
'vue/no-reserved-component-names': 0
|
||||||
|
},
|
||||||
|
ignores: [
|
||||||
|
'build/*.js',
|
||||||
|
'config/*.js'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
10
index.html
10
index.html
|
@ -3,18 +3,20 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
|
||||||
<title>Pleroma</title>
|
<title>Akkoma</title>
|
||||||
<link rel="stylesheet" href="/static/font/css/fontello.css">
|
|
||||||
<link rel="stylesheet" href="/static/font/css/animation.css">
|
|
||||||
<link rel="stylesheet" href="/static/font/tiresias.css">
|
<link rel="stylesheet" href="/static/font/tiresias.css">
|
||||||
<link rel="stylesheet" href="/static/font/css/lato.css">
|
<link rel="stylesheet" href="/static/font/css/lato.css">
|
||||||
<link rel="stylesheet" href="/static/mfm.css">
|
<link rel="stylesheet" href="/static/mfm.css">
|
||||||
|
<link rel="stylesheet" href="/static/custom.css">
|
||||||
|
<link rel="stylesheet" href="/static/theme-holder.css" id="theme-holder">
|
||||||
<!--server-generated-meta-->
|
<!--server-generated-meta-->
|
||||||
<link rel="icon" type="image/png" href="/favicon.png">
|
<link rel="icon" type="image/png" href="/favicon.png">
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
</head>
|
</head>
|
||||||
<body class="hidden">
|
<body class="hidden">
|
||||||
<noscript>To use Pleroma, please enable JavaScript.</noscript>
|
<noscript>To use Akkoma, please enable JavaScript.</noscript>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
<div id="modal"></div>
|
||||||
<!-- built files will be auto injected -->
|
<!-- built files will be auto injected -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
215
package.json
215
package.json
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "pleroma_fe",
|
"name": "pleroma_fe",
|
||||||
"version": "1.0.0",
|
"version": "3.10.0",
|
||||||
"description": "A Qvitter-style frontend for certain GS servers.",
|
"description": "A frontend for Akkoma instances",
|
||||||
"author": "Roger Braun <roger@rogerbraun.net>",
|
"author": "Roger Braun <roger@rogerbraun.net>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -11,121 +11,122 @@
|
||||||
"unit:watch": "karma start test/unit/karma.conf.js --single-run=false",
|
"unit:watch": "karma start test/unit/karma.conf.js --single-run=false",
|
||||||
"e2e": "node test/e2e/runner.js",
|
"e2e": "node test/e2e/runner.js",
|
||||||
"test": "npm run unit && npm run e2e",
|
"test": "npm run unit && npm run e2e",
|
||||||
"stylelint": "npx stylelint src/components/status/status.scss",
|
"stylelint": "stylelint src/**/*.scss",
|
||||||
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
|
"lint": "eslint src test/unit/specs test/e2e/specs",
|
||||||
"lint-fix": "eslint --fix --ext .js,.vue src test/unit/specs test/e2e/specs"
|
"lint-fix": "eslint --fix src test/unit/specs test/e2e/specs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "7.17.8",
|
"@babel/runtime": "7.17.8",
|
||||||
"@chenfengyuan/vue-qrcode": "2.0.0",
|
"@chenfengyuan/vue-qrcode": "^2.0.0",
|
||||||
"@fortawesome/fontawesome-svg-core": "1.3.0",
|
"@floatingghost/pinch-zoom-element": "^1.3.1",
|
||||||
"@fortawesome/free-regular-svg-icons": "5.15.4",
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "5.15.4",
|
"@fortawesome/free-regular-svg-icons": "^6.5.2",
|
||||||
"@fortawesome/vue-fontawesome": "3.0.0-5",
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
||||||
"@kazvmoe-infra/pinch-zoom-element": "1.2.0",
|
"@fortawesome/vue-fontawesome": "^3.0.8",
|
||||||
"@vuelidate/core": "2.0.0-alpha.41",
|
"@vuelidate/core": "^2.0.3",
|
||||||
"@vuelidate/validators": "2.0.0-alpha.27",
|
"@vuelidate/validators": "^2.0.4",
|
||||||
"body-scroll-lock": "2.7.1",
|
"blurhash": "^2.0.5",
|
||||||
"chromatism": "3.0.0",
|
"body-scroll-lock": "^3.1.5",
|
||||||
"click-outside-vue3": "4.0.1",
|
"chromatism": "^3.0.0",
|
||||||
"cropperjs": "1.5.12",
|
"click-outside-vue3": "^4.0.1",
|
||||||
"diff": "3.5.0",
|
"cropperjs": "^1.6.2",
|
||||||
"escape-html": "1.0.3",
|
"diff": "^5.2.0",
|
||||||
|
"escape-html": "^1.0.3",
|
||||||
|
"iso-639-1": "^2.1.15",
|
||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"localforage": "1.10.0",
|
"localforage": "^1.10.0",
|
||||||
"mfm-js": "^0.22.1",
|
"parse-link-header": "^2.0.0",
|
||||||
"parse-link-header": "1.0.1",
|
"phoenix": "^1.7.12",
|
||||||
"phoenix": "1.6.2",
|
"punycode.js": "^2.3.1",
|
||||||
"punycode.js": "2.1.0",
|
"qrcode": "^1.5.3",
|
||||||
"qrcode": "1",
|
"querystring-es3": "^0.2.1",
|
||||||
"ruffle-mirror": "2021.12.31",
|
"url": "^0.11.3",
|
||||||
"vue": "^3.2.31",
|
"vue": "^3.4.38",
|
||||||
"vue-i18n": "^9.2.0-beta.34",
|
"vue-i18n": "^9.14.0",
|
||||||
"vue-router": "4.0.14",
|
"vue-router": "^4.4.3",
|
||||||
"vue-template-compiler": "2.6.11",
|
"vue-template-compiler": "^2.7.16",
|
||||||
"vuex": "4.0.2"
|
"vuex": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.17.8",
|
"@babel/core": "^7.24.6",
|
||||||
"@babel/plugin-transform-runtime": "7.17.0",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/preset-env": "7.16.11",
|
"@babel/plugin-transform-runtime": "^7.24.6",
|
||||||
"@babel/register": "7.17.7",
|
"@babel/preset-env": "^7.24.6",
|
||||||
|
"@babel/register": "^7.24.6",
|
||||||
"@intlify/vue-i18n-loader": "^5.0.0",
|
"@intlify/vue-i18n-loader": "^5.0.0",
|
||||||
"@ungap/event-target": "0.2.3",
|
"@ungap/event-target": "^0.2.4",
|
||||||
"@vue/babel-helper-vue-jsx-merge-props": "1.2.1",
|
"@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
|
||||||
"@vue/babel-plugin-jsx": "1.1.1",
|
"@vue/babel-plugin-jsx": "^1.2.2",
|
||||||
"@vue/compiler-sfc": "^3.1.0",
|
"@vue/compiler-sfc": "^3.1.0",
|
||||||
"@vue/test-utils": "2.0.0-rc.17",
|
"@vue/test-utils": "^2.0.2",
|
||||||
"autoprefixer": "6.7.7",
|
"autoprefixer": "^10.4.19",
|
||||||
"babel-eslint": "7.2.3",
|
"babel-loader": "^9.1.0",
|
||||||
"babel-loader": "8.2.4",
|
"babel-plugin-lodash": "^3.3.4",
|
||||||
"babel-plugin-lodash": "3.3.4",
|
"chai": "^4.3.7",
|
||||||
"chai": "3.5.0",
|
"chalk": "^1.1.3",
|
||||||
"chalk": "1.1.3",
|
"chromedriver": "^119.0.1",
|
||||||
"chromedriver": "87.0.7",
|
"connect-history-api-fallback": "^2.0.0",
|
||||||
"connect-history-api-fallback": "1.6.0",
|
"cross-spawn": "^7.0.3",
|
||||||
"copy-webpack-plugin": "6.4.1",
|
"css-loader": "^7.1.2",
|
||||||
"cross-spawn": "4.0.2",
|
"custom-event-polyfill": "^1.0.7",
|
||||||
"css-loader": "0.28.11",
|
"eslint": "^9.3.0",
|
||||||
"custom-event-polyfill": "1.0.7",
|
"eslint-config-standard": "^17.1.0",
|
||||||
"eslint": "5.16.0",
|
"eslint-friendly-formatter": "^4.0.1",
|
||||||
"eslint-config-standard": "12.0.0",
|
"eslint-plugin-import": "^2.29.1",
|
||||||
"eslint-friendly-formatter": "2.0.7",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-loader": "2.2.1",
|
"eslint-plugin-promise": "^6.2.0",
|
||||||
"eslint-plugin-import": "2.25.4",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
"eslint-plugin-node": "7.0.1",
|
"eslint-plugin-vue": "^9.26.0",
|
||||||
"eslint-plugin-promise": "4.3.1",
|
"eslint-webpack-plugin": "^4.2.0",
|
||||||
"eslint-plugin-standard": "4.1.0",
|
"eventsource-polyfill": "^0.9.6",
|
||||||
"eslint-plugin-vue": "5.2.3",
|
"express": "^4.19.2",
|
||||||
"eventsource-polyfill": "0.9.6",
|
"file-loader": "^6.2.0",
|
||||||
"express": "4.17.3",
|
"function-bind": "^1.1.2",
|
||||||
"file-loader": "3.0.1",
|
"html-webpack-plugin": "^5.5.0",
|
||||||
"function-bind": "1.1.1",
|
"http-proxy-middleware": "^3.0.0",
|
||||||
"html-webpack-plugin": "3.2.0",
|
"json-loader": "^0.5.7",
|
||||||
"http-proxy-middleware": "0.21.0",
|
"karma": "^6.4.3",
|
||||||
"inject-loader": "2.0.1",
|
"karma-coverage": "^2.2.1",
|
||||||
"iso-639-1": "2.1.13",
|
"karma-firefox-launcher": "^2.1.3",
|
||||||
"isparta-loader": "2.0.0",
|
"karma-mocha": "^2.0.1",
|
||||||
"json-loader": "0.5.7",
|
"karma-mocha-reporter": "^2.2.5",
|
||||||
"karma": "6.3.17",
|
"karma-sinon-chai": "^2.0.2",
|
||||||
"karma-coverage": "1.1.2",
|
"karma-sourcemap-loader": "^0.4.0",
|
||||||
"karma-firefox-launcher": "1.3.0",
|
"karma-spec-reporter": "^0.0.36",
|
||||||
"karma-mocha": "2.0.1",
|
"karma-webpack": "^5.0.0",
|
||||||
"karma-mocha-reporter": "2.2.5",
|
"lodash": "^4.17.21",
|
||||||
"karma-sinon-chai": "2.0.2",
|
"lolex": "^6.0.0",
|
||||||
"karma-sourcemap-loader": "0.3.8",
|
"mini-css-extract-plugin": "^2.9.0",
|
||||||
"karma-spec-reporter": "0.0.33",
|
"mocha": "^10.4.0",
|
||||||
"karma-webpack": "4.0.2",
|
"nightwatch": "^3.6.3",
|
||||||
"lodash": "4.17.21",
|
"opn": "^6.0.0",
|
||||||
"lolex": "1.6.0",
|
"postcss-html": "^1.5.0",
|
||||||
"mini-css-extract-plugin": "0.12.0",
|
"postcss-loader": "^8.1.1",
|
||||||
"mocha": "3.5.3",
|
"postcss-sass": "^0.5.0",
|
||||||
"nightwatch": "0.9.21",
|
"raw-loader": "^4.0.2",
|
||||||
"opn": "4.0.2",
|
"sass": "^1.77.2",
|
||||||
"ora": "0.4.1",
|
"sass-loader": "^14.2.1",
|
||||||
"postcss-loader": "3.0.0",
|
"selenium-server": "^3.141.59",
|
||||||
"raw-loader": "0.5.1",
|
"semver": "^7.6.2",
|
||||||
"sass": "1.20.1",
|
"shelljs": "^0.8.5",
|
||||||
"sass-loader": "7.2.0",
|
"sinon": "^18.0.0",
|
||||||
"selenium-server": "2.53.1",
|
"sinon-chai": "^3.7.0",
|
||||||
"semver": "5.7.1",
|
"stylelint": "^14.15.0",
|
||||||
"serviceworker-webpack-plugin": "1.0.1",
|
"stylelint-config-recommended-vue": "^1.4.0",
|
||||||
"shelljs": "0.8.5",
|
"stylelint-config-standard": "^29.0.0",
|
||||||
"sinon": "2.4.1",
|
"stylelint-config-standard-scss": "^6.1.0",
|
||||||
"sinon-chai": "2.14.0",
|
"stylelint-rscss": "^0.4.0",
|
||||||
"stylelint": "13.6.1",
|
"url-loader": "^4.1.1",
|
||||||
"stylelint-config-standard": "20.0.0",
|
"vue-loader": "^17.4.2",
|
||||||
"stylelint-rscss": "0.4.0",
|
"vue-style-loader": "^4.1.3",
|
||||||
"url-loader": "1.1.2",
|
"webpack": "^5.91.0",
|
||||||
"vue-loader": "^16.0.0",
|
"webpack-dev-middleware": "^7.2.1",
|
||||||
"vue-style-loader": "4.1.2",
|
"webpack-hot-middleware": "^2.26.1",
|
||||||
"webpack": "4.46.0",
|
"webpack-merge": "^5.10.0",
|
||||||
"webpack-dev-middleware": "3.7.3",
|
"workbox-webpack-plugin": "^7.1.0"
|
||||||
"webpack-hot-middleware": "2.24.3",
|
|
||||||
"webpack-merge": "0.20.0"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 4.0.0",
|
"node": ">= 16.0.0",
|
||||||
"npm": ">= 3.0.0"
|
"npm": ">= 3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
27
src/App.js
27
src/App.js
|
@ -3,15 +3,17 @@ import NavPanel from './components/nav_panel/nav_panel.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 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 ModModal from './components/mod_modal/mod_modal.vue'
|
||||||
import SideDrawer from './components/side_drawer/side_drawer.vue'
|
import SideDrawer from './components/side_drawer/side_drawer.vue'
|
||||||
import MobilePostStatusButton from './components/mobile_post_status_button/mobile_post_status_button.vue'
|
import MobilePostStatusButton from './components/mobile_post_status_button/mobile_post_status_button.vue'
|
||||||
import MobileNav from './components/mobile_nav/mobile_nav.vue'
|
import MobileNav from './components/mobile_nav/mobile_nav.vue'
|
||||||
import DesktopNav from './components/desktop_nav/desktop_nav.vue'
|
import DesktopNav from './components/desktop_nav/desktop_nav.vue'
|
||||||
import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue'
|
import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue'
|
||||||
|
import EditStatusModal from './components/edit_status_modal/edit_status_modal.vue'
|
||||||
import PostStatusModal from './components/post_status_modal/post_status_modal.vue'
|
import PostStatusModal from './components/post_status_modal/post_status_modal.vue'
|
||||||
|
import StatusHistoryModal from './components/status_history_modal/status_history_modal.vue'
|
||||||
import GlobalNoticeList from './components/global_notice_list/global_notice_list.vue'
|
import GlobalNoticeList from './components/global_notice_list/global_notice_list.vue'
|
||||||
import { windowWidth, windowHeight } from './services/window_utils/window_utils'
|
import { windowWidth, windowHeight } from './services/window_utils/window_utils'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
@ -26,15 +28,17 @@ export default {
|
||||||
InstanceSpecificPanel,
|
InstanceSpecificPanel,
|
||||||
FeaturesPanel,
|
FeaturesPanel,
|
||||||
WhoToFollowPanel,
|
WhoToFollowPanel,
|
||||||
ShoutPanel,
|
|
||||||
MediaModal,
|
MediaModal,
|
||||||
SideDrawer,
|
SideDrawer,
|
||||||
MobilePostStatusButton,
|
MobilePostStatusButton,
|
||||||
MobileNav,
|
MobileNav,
|
||||||
DesktopNav,
|
DesktopNav,
|
||||||
SettingsModal,
|
SettingsModal,
|
||||||
|
ModModal,
|
||||||
UserReportingModal,
|
UserReportingModal,
|
||||||
PostStatusModal,
|
PostStatusModal,
|
||||||
|
EditStatusModal,
|
||||||
|
StatusHistoryModal,
|
||||||
GlobalNoticeList
|
GlobalNoticeList
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
@ -60,6 +64,11 @@ export default {
|
||||||
'-' + this.layoutType
|
'-' + this.layoutType
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
pageBackground () {
|
||||||
|
return this.mergedConfig.displayPageBackgrounds
|
||||||
|
? this.$store.state.users.displayBackground
|
||||||
|
: null
|
||||||
|
},
|
||||||
currentUser () { return this.$store.state.users.currentUser },
|
currentUser () { return this.$store.state.users.currentUser },
|
||||||
userBackground () { return this.currentUser.background_image },
|
userBackground () { return this.currentUser.background_image },
|
||||||
instanceBackground () {
|
instanceBackground () {
|
||||||
|
@ -67,7 +76,7 @@ export default {
|
||||||
? null
|
? null
|
||||||
: this.$store.state.instance.background
|
: this.$store.state.instance.background
|
||||||
},
|
},
|
||||||
background () { return this.userBackground || this.instanceBackground },
|
background () { return this.pageBackground || this.userBackground || this.instanceBackground },
|
||||||
bgStyle () {
|
bgStyle () {
|
||||||
if (this.background) {
|
if (this.background) {
|
||||||
return {
|
return {
|
||||||
|
@ -75,27 +84,17 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
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 &&
|
||||||
!this.$store.getters.mergedConfig.hideISP &&
|
!this.$store.getters.mergedConfig.hideISP &&
|
||||||
this.$store.state.instance.instanceSpecificPanelContent
|
this.$store.state.instance.instanceSpecificPanelContent
|
||||||
},
|
},
|
||||||
isChats () {
|
|
||||||
return this.$route.name === 'chat' || this.$route.name === 'chats'
|
|
||||||
},
|
|
||||||
newPostButtonShown () {
|
newPostButtonShown () {
|
||||||
if (this.isChats) return false
|
|
||||||
return this.$store.getters.mergedConfig.alwaysShowNewPostButton || this.layoutType === 'mobile'
|
return this.$store.getters.mergedConfig.alwaysShowNewPostButton || this.layoutType === 'mobile'
|
||||||
},
|
},
|
||||||
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
|
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
|
||||||
shoutboxPosition () {
|
editingAvailable () { return this.$store.state.instance.editingAvailable },
|
||||||
return this.$store.getters.mergedConfig.alwaysShowNewPostButton || false
|
|
||||||
},
|
|
||||||
hideShoutbox () {
|
|
||||||
return this.$store.getters.mergedConfig.hideShoutbox
|
|
||||||
},
|
|
||||||
layoutType () { return this.$store.state.interface.layoutType },
|
layoutType () { return this.$store.state.interface.layoutType },
|
||||||
privateMode () { return this.$store.state.instance.private },
|
privateMode () { return this.$store.state.instance.private },
|
||||||
reverseLayout () {
|
reverseLayout () {
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
// stylelint-disable rscss/class-format
|
// stylelint-disable rscss/class-format
|
||||||
@import './_variables.scss';
|
@import './_variables.scss';
|
||||||
|
@import '@fortawesome/fontawesome-svg-core/styles.css';
|
||||||
|
@import '@floatingghost/pinch-zoom-element/dist/pinch-zoom.css';
|
||||||
:root {
|
:root {
|
||||||
--navbar-height: 3.5rem;
|
--navbar-height: 3.5rem;
|
||||||
--post-line-height: 1.4;
|
--post-line-height: 1.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
font-size: 14px;
|
font-size: 0.875rem;
|
||||||
// overflow-x: clip causes my browser's tab to crash with SIGILL lul
|
// overflow-x: clip causes my browser's tab to crash with SIGILL lul
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +311,6 @@ nav {
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.underlay,
|
|
||||||
#sidebar,
|
#sidebar,
|
||||||
#notifs-column {
|
#notifs-column {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -469,7 +469,7 @@ textarea,
|
||||||
color: $fallback--lightText;
|
color: $fallback--lightText;
|
||||||
color: var(--inputText, $fallback--lightText);
|
color: var(--inputText, $fallback--lightText);
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
font-family: var(--inputFont, sans-serif);
|
font-family: var(--interfaceFont, sans-serif);
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
12
src/App.vue
12
src/App.vue
|
@ -33,7 +33,7 @@
|
||||||
<div
|
<div
|
||||||
id="main-scroller"
|
id="main-scroller"
|
||||||
class="column main"
|
class="column main"
|
||||||
:class="{ '-full-height': isChats }"
|
:class="{ '-full-height': false }"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="!currentUser"
|
v-if="!currentUser"
|
||||||
|
@ -55,17 +55,13 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<media-modal />
|
<media-modal />
|
||||||
<shout-panel
|
|
||||||
v-if="currentUser && shout && !hideShoutbox"
|
|
||||||
:floating="true"
|
|
||||||
class="floating-shout mobile-hidden"
|
|
||||||
:class="{ '-left': shoutboxPosition }"
|
|
||||||
/>
|
|
||||||
<MobilePostStatusButton />
|
<MobilePostStatusButton />
|
||||||
<UserReportingModal />
|
<UserReportingModal />
|
||||||
<PostStatusModal />
|
<PostStatusModal />
|
||||||
|
<EditStatusModal v-if="editingAvailable" />
|
||||||
|
<StatusHistoryModal v-if="editingAvailable" />
|
||||||
<SettingsModal />
|
<SettingsModal />
|
||||||
<div id="modal" />
|
<ModModal />
|
||||||
<GlobalNoticeList />
|
<GlobalNoticeList />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -27,7 +27,6 @@ $fallback--tooltipRadius: 5px;
|
||||||
$fallback--avatarRadius: 4px;
|
$fallback--avatarRadius: 4px;
|
||||||
$fallback--avatarAltRadius: 10px;
|
$fallback--avatarAltRadius: 10px;
|
||||||
$fallback--attachmentRadius: 10px;
|
$fallback--attachmentRadius: 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;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
|
import Cookies from 'js-cookie'
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
import vClickOutside from 'click-outside-vue3'
|
import vClickOutside from 'click-outside-vue3'
|
||||||
|
|
||||||
import { FontAwesomeIcon, FontAwesomeLayers } from '@fortawesome/vue-fontawesome'
|
import { FontAwesomeIcon, FontAwesomeLayers } from '@fortawesome/vue-fontawesome'
|
||||||
|
import { config } from '@fortawesome/fontawesome-svg-core';
|
||||||
|
config.autoAddCss = false
|
||||||
|
|
||||||
import App from '../App.vue'
|
import App from '../App.vue'
|
||||||
import routes from './routes'
|
import routes from './routes'
|
||||||
|
@ -48,6 +51,20 @@ const preloadFetch = async (request) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resolveLanguage = (instanceLanguages) => {
|
||||||
|
// First language in navigator.languages that is listed as an instance language
|
||||||
|
// falls back to first instance language
|
||||||
|
const navigatorLanguages = navigator.languages.map((x) => x.split('-')[0])
|
||||||
|
|
||||||
|
for (const navLanguage of navigatorLanguages) {
|
||||||
|
if (instanceLanguages.includes(navLanguage)) {
|
||||||
|
return navLanguage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return instanceLanguages[0]
|
||||||
|
}
|
||||||
|
|
||||||
const getInstanceConfig = async ({ store }) => {
|
const getInstanceConfig = async ({ store }) => {
|
||||||
try {
|
try {
|
||||||
const res = await preloadFetch('/api/v1/instance')
|
const res = await preloadFetch('/api/v1/instance')
|
||||||
|
@ -58,6 +75,10 @@ const getInstanceConfig = async ({ store }) => {
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', { name: 'textlimit', value: textlimit })
|
store.dispatch('setInstanceOption', { name: 'textlimit', value: textlimit })
|
||||||
store.dispatch('setInstanceOption', { name: 'accountApprovalRequired', value: data.approval_required })
|
store.dispatch('setInstanceOption', { name: 'accountApprovalRequired', value: data.approval_required })
|
||||||
|
// don't override cookie if set
|
||||||
|
if (!Cookies.get('userLanguage')) {
|
||||||
|
store.dispatch('setOption', { name: 'interfaceLanguage', value: resolveLanguage(data.languages) })
|
||||||
|
}
|
||||||
|
|
||||||
if (vapidPublicKey) {
|
if (vapidPublicKey) {
|
||||||
store.dispatch('setInstanceOption', { name: 'vapidPublicKey', value: vapidPublicKey })
|
store.dispatch('setInstanceOption', { name: 'vapidPublicKey', value: vapidPublicKey })
|
||||||
|
@ -124,7 +145,14 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
copyInstanceOption('hideBotIndication')
|
copyInstanceOption('hideBotIndication')
|
||||||
copyInstanceOption('hideUserStats')
|
copyInstanceOption('hideUserStats')
|
||||||
copyInstanceOption('hideFilteredStatuses')
|
copyInstanceOption('hideFilteredStatuses')
|
||||||
|
copyInstanceOption('hideSiteName')
|
||||||
|
copyInstanceOption('hideSiteFavicon')
|
||||||
|
copyInstanceOption('showWiderShortcuts')
|
||||||
|
copyInstanceOption('showNavShortcuts')
|
||||||
|
copyInstanceOption('showPanelNavShortcuts')
|
||||||
|
copyInstanceOption('stopGifs')
|
||||||
copyInstanceOption('logo')
|
copyInstanceOption('logo')
|
||||||
|
copyInstanceOption('conversationDisplay')
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', {
|
store.dispatch('setInstanceOption', {
|
||||||
name: 'logoMask',
|
name: 'logoMask',
|
||||||
|
@ -145,15 +173,14 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
copyInstanceOption('redirectRootNoLogin')
|
copyInstanceOption('redirectRootNoLogin')
|
||||||
copyInstanceOption('redirectRootLogin')
|
copyInstanceOption('redirectRootLogin')
|
||||||
copyInstanceOption('showInstanceSpecificPanel')
|
copyInstanceOption('showInstanceSpecificPanel')
|
||||||
copyInstanceOption('minimalScopesMode')
|
|
||||||
copyInstanceOption('hideMutedPosts')
|
copyInstanceOption('hideMutedPosts')
|
||||||
copyInstanceOption('collapseMessageWithSubject')
|
copyInstanceOption('collapseMessageWithSubject')
|
||||||
copyInstanceOption('scopeCopy')
|
|
||||||
copyInstanceOption('subjectLineBehavior')
|
copyInstanceOption('subjectLineBehavior')
|
||||||
copyInstanceOption('postContentType')
|
copyInstanceOption('postContentType')
|
||||||
copyInstanceOption('alwaysShowSubjectInput')
|
copyInstanceOption('alwaysShowSubjectInput')
|
||||||
copyInstanceOption('showFeaturesPanel')
|
copyInstanceOption('showFeaturesPanel')
|
||||||
copyInstanceOption('hideSitename')
|
copyInstanceOption('hideSitename')
|
||||||
|
copyInstanceOption('renderMisskeyMarkdown')
|
||||||
copyInstanceOption('sidebarRight')
|
copyInstanceOption('sidebarRight')
|
||||||
|
|
||||||
return store.dispatch('setTheme', config['theme'])
|
return store.dispatch('setTheme', config['theme'])
|
||||||
|
@ -247,12 +274,11 @@ 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: 'shoutAvailable', value: features.includes('chat') })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') })
|
|
||||||
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') })
|
||||||
|
store.dispatch('setInstanceOption', { name: 'editingAvailable', value: features.includes('editing') })
|
||||||
store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits })
|
store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits })
|
||||||
store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled })
|
store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled })
|
||||||
|
store.dispatch('setInstanceOption', { name: 'translationEnabled', value: features.includes('akkoma:machine_translation') })
|
||||||
|
|
||||||
const uploadLimits = metadata.uploadLimits
|
const uploadLimits = metadata.uploadLimits
|
||||||
store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) })
|
store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) })
|
||||||
|
@ -288,6 +314,7 @@ const getNodeInfo = async ({ store }) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', { name: 'federationPolicy', value: federation })
|
store.dispatch('setInstanceOption', { name: 'federationPolicy', value: federation })
|
||||||
|
store.dispatch('setInstanceOption', { name: 'localBubbleInstances', value: metadata.localBubbleInstances })
|
||||||
store.dispatch('setInstanceOption', {
|
store.dispatch('setInstanceOption', {
|
||||||
name: 'federating',
|
name: 'federating',
|
||||||
value: typeof federation.enabled === 'undefined'
|
value: typeof federation.enabled === 'undefined'
|
||||||
|
@ -295,6 +322,9 @@ const getNodeInfo = async ({ store }) => {
|
||||||
: federation.enabled
|
: federation.enabled
|
||||||
})
|
})
|
||||||
|
|
||||||
|
store.dispatch('setInstanceOption', { name: 'publicTimelineVisibility', value: metadata.publicTimelineVisibility })
|
||||||
|
store.dispatch('setInstanceOption', { name: 'federatedTimelineAvailable', value: metadata.federatedTimelineAvailable })
|
||||||
|
|
||||||
const accountActivationRequired = metadata.accountActivationRequired
|
const accountActivationRequired = metadata.accountActivationRequired
|
||||||
store.dispatch('setInstanceOption', { name: 'accountActivationRequired', value: accountActivationRequired })
|
store.dispatch('setInstanceOption', { name: 'accountActivationRequired', value: accountActivationRequired })
|
||||||
|
|
||||||
|
@ -369,7 +399,6 @@ const afterStoreSetup = async ({ store, i18n }) => {
|
||||||
])
|
])
|
||||||
|
|
||||||
// Start fetching things that don't need to block the UI
|
// Start fetching things that don't need to block the UI
|
||||||
store.dispatch('fetchMutes')
|
|
||||||
getTOS({ store })
|
getTOS({ store })
|
||||||
getStickers({ store })
|
getStickers({ store })
|
||||||
|
|
||||||
|
@ -378,8 +407,9 @@ const afterStoreSetup = async ({ store, i18n }) => {
|
||||||
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 {}
|
||||||
}
|
}
|
||||||
|
|
||||||
return savedPosition || { left: 0, top: 0 }
|
return savedPosition || { left: 0, top: 0 }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,12 +2,11 @@ import PublicTimeline from 'components/public_timeline/public_timeline.vue'
|
||||||
import PublicAndExternalTimeline from 'components/public_and_external_timeline/public_and_external_timeline.vue'
|
import PublicAndExternalTimeline from 'components/public_and_external_timeline/public_and_external_timeline.vue'
|
||||||
import FriendsTimeline from 'components/friends_timeline/friends_timeline.vue'
|
import FriendsTimeline from 'components/friends_timeline/friends_timeline.vue'
|
||||||
import TagTimeline from 'components/tag_timeline/tag_timeline.vue'
|
import TagTimeline from 'components/tag_timeline/tag_timeline.vue'
|
||||||
|
import BubbleTimeline from 'components/bubble_timeline/bubble_timeline.vue'
|
||||||
import BookmarkTimeline from 'components/bookmark_timeline/bookmark_timeline.vue'
|
import BookmarkTimeline from 'components/bookmark_timeline/bookmark_timeline.vue'
|
||||||
import ConversationPage from 'components/conversation-page/conversation-page.vue'
|
import ConversationPage from 'components/conversation-page/conversation-page.vue'
|
||||||
import Interactions from 'components/interactions/interactions.vue'
|
import Interactions from 'components/interactions/interactions.vue'
|
||||||
import DMs from 'components/dm_timeline/dm_timeline.vue'
|
import DMs from 'components/dm_timeline/dm_timeline.vue'
|
||||||
import ChatList from 'components/chat_list/chat_list.vue'
|
|
||||||
import Chat from 'components/chat/chat.vue'
|
|
||||||
import UserProfile from 'components/user_profile/user_profile.vue'
|
import UserProfile from 'components/user_profile/user_profile.vue'
|
||||||
import Search from 'components/search/search.vue'
|
import Search from 'components/search/search.vue'
|
||||||
import Registration from 'components/registration/registration.vue'
|
import Registration from 'components/registration/registration.vue'
|
||||||
|
@ -16,13 +15,15 @@ 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 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'
|
||||||
import Lists from 'components/lists/lists.vue'
|
import Lists from 'components/lists/lists.vue'
|
||||||
import ListTimeline from 'components/list_timeline/list_timeline.vue'
|
import ListTimeline from 'components/list_timeline/list_timeline.vue'
|
||||||
import ListEdit from 'components/list_edit/list_edit.vue'
|
import ListEdit from 'components/list_edit/list_edit.vue'
|
||||||
|
import AnnouncementsPage from 'components/announcements_page/announcements_page.vue'
|
||||||
|
import RegistrationRequestSent from 'components/registration_request_sent/registration_request_sent.vue'
|
||||||
|
import AwaitingEmailConfirmation from 'components/awaiting_email_confirmation/awaiting_email_confirmation.vue'
|
||||||
|
|
||||||
export default (store) => {
|
export default (store) => {
|
||||||
const validateAuthenticatedRoute = (to, from, next) => {
|
const validateAuthenticatedRoute = (to, from, next) => {
|
||||||
|
@ -44,6 +45,7 @@ export default (store) => {
|
||||||
},
|
},
|
||||||
{ name: 'public-external-timeline', path: '/main/all', component: PublicAndExternalTimeline },
|
{ name: 'public-external-timeline', path: '/main/all', component: PublicAndExternalTimeline },
|
||||||
{ name: 'public-timeline', path: '/main/public', component: PublicTimeline },
|
{ name: 'public-timeline', path: '/main/public', component: PublicTimeline },
|
||||||
|
{ name: 'bubble-timeline', path: '/main/bubble', component: BubbleTimeline },
|
||||||
{ name: 'friends', path: '/main/friends', component: FriendsTimeline, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'friends', path: '/main/friends', component: FriendsTimeline, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'tag-timeline', path: '/tag/:tag', component: TagTimeline },
|
{ name: 'tag-timeline', path: '/tag/:tag', component: TagTimeline },
|
||||||
{ name: 'bookmarks', path: '/bookmarks', component: BookmarkTimeline },
|
{ name: 'bookmarks', path: '/bookmarks', component: BookmarkTimeline },
|
||||||
|
@ -58,32 +60,27 @@ export default (store) => {
|
||||||
component: RemoteUserResolver,
|
component: RemoteUserResolver,
|
||||||
beforeEnter: validateAuthenticatedRoute
|
beforeEnter: validateAuthenticatedRoute
|
||||||
},
|
},
|
||||||
{ name: 'external-user-profile', path: '/users/:id', component: UserProfile },
|
{ name: 'external-user-profile', path: '/users/:id', component: UserProfile, meta: { dontScroll: true } },
|
||||||
{ name: 'interactions', path: '/users/:username/interactions', component: Interactions, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'interactions', path: '/users/:username/interactions', component: Interactions, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'dms', path: '/users/:username/dms', component: DMs, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'dms', path: '/users/:username/dms', component: DMs, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'registration', path: '/registration', component: Registration },
|
{ name: 'registration', path: '/registration', component: Registration },
|
||||||
|
{ name: 'registration-request-sent', path: '/registration-request-sent', component: RegistrationRequestSent },
|
||||||
|
{ name: 'awaiting-email-confirmation', path: '/awaiting-email-confirmation', component: AwaitingEmailConfirmation },
|
||||||
{ name: 'password-reset', path: '/password-reset', component: PasswordReset, props: true },
|
{ name: 'password-reset', path: '/password-reset', component: PasswordReset, props: true },
|
||||||
{ name: 'registration-token', path: '/registration/:token', component: Registration },
|
{ name: 'registration-token', path: '/registration/:token', component: Registration },
|
||||||
{ 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, props: () => ({ disableTeleport: true }), beforeEnter: validateAuthenticatedRoute },
|
{ name: 'notifications', path: '/:username/notifications', component: Notifications, props: () => ({ disableTeleport: true }), beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'login', path: '/login', component: AuthForm },
|
{ name: 'login', path: '/login', component: AuthForm },
|
||||||
{ 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: 'lists', path: '/lists', component: Lists },
|
{ name: 'lists', path: '/lists', component: Lists },
|
||||||
{ name: 'list-timeline', path: '/lists/:id', component: ListTimeline },
|
{ name: 'list-timeline', path: '/lists/:id', component: ListTimeline },
|
||||||
{ name: 'list-edit', path: '/lists/:id/edit', component: ListEdit }
|
{ name: 'list-edit', path: '/lists/:id/edit', component: ListEdit },
|
||||||
|
{ name: 'announcements', path: '/announcements', component: AnnouncementsPage },
|
||||||
|
{ name: 'user-profile', path: '/:_(users)?/:name', component: UserProfile, meta: { dontScroll: true } }
|
||||||
]
|
]
|
||||||
|
|
||||||
if (store.state.instance.pleromaChatMessagesAvailable) {
|
|
||||||
routes = routes.concat([
|
|
||||||
{ name: 'chat', path: '/users/:username/chats/:recipient_id', component: Chat, meta: { dontScroll: false }, beforeEnter: validateAuthenticatedRoute },
|
|
||||||
{ name: 'chats', path: '/users/:username/chats', component: ChatList, meta: { dontScroll: false }, beforeEnter: validateAuthenticatedRoute }
|
|
||||||
])
|
|
||||||
}
|
|
||||||
|
|
||||||
return routes
|
return routes
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import FeaturesPanel from '../features_panel/features_panel.vue'
|
||||||
import TermsOfServicePanel from '../terms_of_service_panel/terms_of_service_panel.vue'
|
import TermsOfServicePanel from '../terms_of_service_panel/terms_of_service_panel.vue'
|
||||||
import StaffPanel from '../staff_panel/staff_panel.vue'
|
import StaffPanel from '../staff_panel/staff_panel.vue'
|
||||||
import MRFTransparencyPanel from '../mrf_transparency_panel/mrf_transparency_panel.vue'
|
import MRFTransparencyPanel from '../mrf_transparency_panel/mrf_transparency_panel.vue'
|
||||||
|
import LocalBubblePanel from '../local_bubble_panel/local_bubble_panel.vue'
|
||||||
|
|
||||||
const About = {
|
const About = {
|
||||||
components: {
|
components: {
|
||||||
|
@ -10,7 +11,8 @@ const About = {
|
||||||
FeaturesPanel,
|
FeaturesPanel,
|
||||||
TermsOfServicePanel,
|
TermsOfServicePanel,
|
||||||
StaffPanel,
|
StaffPanel,
|
||||||
MRFTransparencyPanel
|
MRFTransparencyPanel,
|
||||||
|
LocalBubblePanel
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
|
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
|
||||||
|
@ -18,6 +20,9 @@ const About = {
|
||||||
return this.$store.state.instance.showInstanceSpecificPanel &&
|
return this.$store.state.instance.showInstanceSpecificPanel &&
|
||||||
!this.$store.getters.mergedConfig.hideISP &&
|
!this.$store.getters.mergedConfig.hideISP &&
|
||||||
this.$store.state.instance.instanceSpecificPanelContent
|
this.$store.state.instance.instanceSpecificPanelContent
|
||||||
|
},
|
||||||
|
showLocalBubblePanel () {
|
||||||
|
return this.$store.state.instance.localBubbleInstances.length > 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<instance-specific-panel v-if="showInstanceSpecificPanel" />
|
<instance-specific-panel v-if="showInstanceSpecificPanel" />
|
||||||
<staff-panel />
|
<staff-panel />
|
||||||
<terms-of-service-panel />
|
<terms-of-service-panel />
|
||||||
|
<LocalBubblePanel v-if="showLocalBubblePanel" />
|
||||||
<MRFTransparencyPanel />
|
<MRFTransparencyPanel />
|
||||||
<features-panel v-if="showFeaturesPanel" />
|
<features-panel v-if="showFeaturesPanel" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { mapState } from 'vuex'
|
|
||||||
import ProgressButton from '../progress_button/progress_button.vue'
|
import ProgressButton from '../progress_button/progress_button.vue'
|
||||||
import Popover from '../popover/popover.vue'
|
import Popover from '../popover/popover.vue'
|
||||||
|
import ConfirmModal from '../confirm_modal/confirm_modal.vue'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import { mapState } from 'vuex'
|
||||||
import {
|
import {
|
||||||
faEllipsisV
|
faEllipsisV
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
@ -15,13 +16,25 @@ const AccountActions = {
|
||||||
'user', 'relationship'
|
'user', 'relationship'
|
||||||
],
|
],
|
||||||
data () {
|
data () {
|
||||||
return { }
|
return {
|
||||||
|
showingConfirmBlock: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
ProgressButton,
|
ProgressButton,
|
||||||
Popover
|
Popover,
|
||||||
|
ConfirmModal
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
refetchRelationship () {
|
||||||
|
return this.$store.dispatch('fetchUserRelationship', this.user.id)
|
||||||
|
},
|
||||||
|
showConfirmBlock () {
|
||||||
|
this.showingConfirmBlock = true
|
||||||
|
},
|
||||||
|
hideConfirmBlock () {
|
||||||
|
this.showingConfirmBlock = false
|
||||||
|
},
|
||||||
showRepeats () {
|
showRepeats () {
|
||||||
this.$store.dispatch('showReblogs', this.user.id)
|
this.$store.dispatch('showReblogs', this.user.id)
|
||||||
},
|
},
|
||||||
|
@ -29,22 +42,38 @@ const AccountActions = {
|
||||||
this.$store.dispatch('hideReblogs', this.user.id)
|
this.$store.dispatch('hideReblogs', this.user.id)
|
||||||
},
|
},
|
||||||
blockUser () {
|
blockUser () {
|
||||||
|
if (!this.shouldConfirmBlock) {
|
||||||
|
this.doBlockUser()
|
||||||
|
} else {
|
||||||
|
this.showConfirmBlock()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doBlockUser () {
|
||||||
this.$store.dispatch('blockUser', this.user.id)
|
this.$store.dispatch('blockUser', this.user.id)
|
||||||
|
this.hideConfirmBlock()
|
||||||
},
|
},
|
||||||
unblockUser () {
|
unblockUser () {
|
||||||
this.$store.dispatch('unblockUser', this.user.id)
|
this.$store.dispatch('unblockUser', this.user.id)
|
||||||
},
|
},
|
||||||
|
removeUserFromFollowers () {
|
||||||
|
this.$store.dispatch('removeUserFromFollowers', this.user.id)
|
||||||
|
},
|
||||||
reportUser () {
|
reportUser () {
|
||||||
this.$store.dispatch('openUserReportingModal', { userId: this.user.id })
|
this.$store.dispatch('openUserReportingModal', { userId: this.user.id })
|
||||||
},
|
},
|
||||||
openChat () {
|
muteDomain () {
|
||||||
this.$router.push({
|
this.$store.dispatch('muteDomain', this.user.screen_name.split('@')[1])
|
||||||
name: 'chat',
|
.then(() => this.refetchRelationship())
|
||||||
params: { username: this.$store.state.users.currentUser.screen_name, recipient_id: this.user.id }
|
},
|
||||||
})
|
unmuteDomain () {
|
||||||
|
this.$store.dispatch('unmuteDomain', this.user.screen_name.split('@')[1])
|
||||||
|
.then(() => this.refetchRelationship())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
shouldConfirmBlock () {
|
||||||
|
return this.$store.getters.mergedConfig.modalOnBlock
|
||||||
|
},
|
||||||
...mapState({
|
...mapState({
|
||||||
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable
|
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
:bound-to="{ x: 'container' }"
|
:bound-to="{ x: 'container' }"
|
||||||
remove-padding
|
remove-padding
|
||||||
>
|
>
|
||||||
<template v-slot:content>
|
<template #content>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<template v-if="relationship.following">
|
<template v-if="relationship.following">
|
||||||
<button
|
<button
|
||||||
|
@ -28,6 +28,13 @@
|
||||||
class="dropdown-divider"
|
class="dropdown-divider"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<button
|
||||||
|
v-if="relationship.followed_by"
|
||||||
|
class="btn button-default btn-block dropdown-item"
|
||||||
|
@click="removeUserFromFollowers"
|
||||||
|
>
|
||||||
|
{{ $t('user_card.remove_follower') }}
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="relationship.blocking"
|
v-if="relationship.blocking"
|
||||||
class="btn button-default btn-block dropdown-item"
|
class="btn button-default btn-block dropdown-item"
|
||||||
|
@ -49,15 +56,22 @@
|
||||||
{{ $t('user_card.report') }}
|
{{ $t('user_card.report') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="pleromaChatMessagesAvailable"
|
v-if="relationship.domain_blocking"
|
||||||
class="btn button-default btn-block dropdown-item"
|
class="btn button-default btn-block dropdown-item"
|
||||||
@click="openChat"
|
@click="unmuteDomain"
|
||||||
>
|
>
|
||||||
{{ $t('user_card.message') }}
|
{{ $t('user_card.domain_muted') }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-else-if="!user.is_local"
|
||||||
|
class="btn button-default btn-block dropdown-item"
|
||||||
|
@click="muteDomain"
|
||||||
|
>
|
||||||
|
{{ $t('user_card.mute_domain') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:trigger>
|
<template #trigger>
|
||||||
<button class="button-unstyled ellipsis-button">
|
<button class="button-unstyled ellipsis-button">
|
||||||
<FAIcon
|
<FAIcon
|
||||||
class="icon"
|
class="icon"
|
||||||
|
@ -66,6 +80,27 @@
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
<teleport to="#modal">
|
||||||
|
<confirm-modal
|
||||||
|
v-if="showingConfirmBlock"
|
||||||
|
:title="$t('user_card.block_confirm_title')"
|
||||||
|
:confirm-text="$t('user_card.block_confirm_accept_button')"
|
||||||
|
:cancel-text="$t('user_card.block_confirm_cancel_button')"
|
||||||
|
@accepted="doBlockUser"
|
||||||
|
@cancelled="hideConfirmBlock"
|
||||||
|
>
|
||||||
|
<i18n-t
|
||||||
|
keypath="user_card.block_confirm"
|
||||||
|
tag="span"
|
||||||
|
>
|
||||||
|
<template #user>
|
||||||
|
<span
|
||||||
|
v-text="user.screen_name_ui"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</i18n-t>
|
||||||
|
</confirm-modal>
|
||||||
|
</teleport>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
105
src/components/announcement/announcement.js
Normal file
105
src/components/announcement/announcement.js
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
import AnnouncementEditor from '../announcement_editor/announcement_editor.vue'
|
||||||
|
import RichContent from '../rich_content/rich_content.jsx'
|
||||||
|
import localeService from '../../services/locale/locale.service.js'
|
||||||
|
|
||||||
|
const Announcement = {
|
||||||
|
components: {
|
||||||
|
AnnouncementEditor,
|
||||||
|
RichContent
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
editing: false,
|
||||||
|
editedAnnouncement: {
|
||||||
|
content: '',
|
||||||
|
startsAt: undefined,
|
||||||
|
endsAt: undefined,
|
||||||
|
allDay: undefined
|
||||||
|
},
|
||||||
|
editError: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
announcement: Object
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
currentUser: state => state.users.currentUser
|
||||||
|
}),
|
||||||
|
content () {
|
||||||
|
return this.announcement.content
|
||||||
|
},
|
||||||
|
isRead () {
|
||||||
|
return this.announcement.read
|
||||||
|
},
|
||||||
|
publishedAt () {
|
||||||
|
const time = this.announcement['published_at']
|
||||||
|
if (!time) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
||||||
|
},
|
||||||
|
startsAt () {
|
||||||
|
const time = this.announcement['starts_at']
|
||||||
|
if (!time) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
||||||
|
},
|
||||||
|
endsAt () {
|
||||||
|
const time = this.announcement['ends_at']
|
||||||
|
if (!time) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
||||||
|
},
|
||||||
|
inactive () {
|
||||||
|
return this.announcement.inactive
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
markAsRead () {
|
||||||
|
if (!this.isRead) {
|
||||||
|
return this.$store.dispatch('markAnnouncementAsRead', this.announcement.id)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deleteAnnouncement () {
|
||||||
|
return this.$store.dispatch('deleteAnnouncement', this.announcement.id)
|
||||||
|
},
|
||||||
|
formatTimeOrDate (time, locale) {
|
||||||
|
const d = new Date(time)
|
||||||
|
return this.announcement['all_day'] ? d.toLocaleDateString(locale) : d.toLocaleString(locale)
|
||||||
|
},
|
||||||
|
enterEditMode () {
|
||||||
|
this.editedAnnouncement.content = this.announcement.pleroma['raw_content']
|
||||||
|
this.editedAnnouncement.startsAt = this.announcement['starts_at']
|
||||||
|
this.editedAnnouncement.endsAt = this.announcement['ends_at']
|
||||||
|
this.editedAnnouncement.allDay = this.announcement['all_day']
|
||||||
|
this.editing = true
|
||||||
|
},
|
||||||
|
submitEdit () {
|
||||||
|
this.$store.dispatch('editAnnouncement', {
|
||||||
|
id: this.announcement.id,
|
||||||
|
...this.editedAnnouncement
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.editing = false
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.editError = error.error
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cancelEdit () {
|
||||||
|
this.editing = false
|
||||||
|
},
|
||||||
|
clearError () {
|
||||||
|
this.editError = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Announcement
|
136
src/components/announcement/announcement.vue
Normal file
136
src/components/announcement/announcement.vue
Normal file
|
@ -0,0 +1,136 @@
|
||||||
|
<template>
|
||||||
|
<div class="announcement">
|
||||||
|
<div class="heading">
|
||||||
|
<h4>{{ $t('announcements.title') }}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="body">
|
||||||
|
<rich-content
|
||||||
|
v-if="!editing"
|
||||||
|
:html="content"
|
||||||
|
:emoji="announcement.emojis"
|
||||||
|
:handle-links="true"
|
||||||
|
/>
|
||||||
|
<announcement-editor
|
||||||
|
v-else
|
||||||
|
:announcement="editedAnnouncement"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="footer">
|
||||||
|
<div
|
||||||
|
v-if="!editing"
|
||||||
|
class="times"
|
||||||
|
>
|
||||||
|
<span v-if="publishedAt">
|
||||||
|
{{ $t('announcements.published_time_display', { time: publishedAt }) }}
|
||||||
|
</span>
|
||||||
|
<span v-if="startsAt">
|
||||||
|
{{ $t('announcements.start_time_display', { time: startsAt }) }}
|
||||||
|
</span>
|
||||||
|
<span v-if="endsAt">
|
||||||
|
{{ $t('announcements.end_time_display', { time: endsAt }) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="!editing"
|
||||||
|
class="actions"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
v-if="currentUser"
|
||||||
|
class="btn button-default"
|
||||||
|
:class="{ toggled: isRead }"
|
||||||
|
:disabled="inactive"
|
||||||
|
:title="inactive ? $t('announcements.inactive_message') : ''"
|
||||||
|
@click="markAsRead"
|
||||||
|
>
|
||||||
|
{{ $t('announcements.mark_as_read_action') }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="currentUser && currentUser.role === 'admin'"
|
||||||
|
class="btn button-default"
|
||||||
|
@click="enterEditMode"
|
||||||
|
>
|
||||||
|
{{ $t('announcements.edit_action') }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="currentUser && currentUser.role === 'admin'"
|
||||||
|
class="btn button-default"
|
||||||
|
@click="deleteAnnouncement"
|
||||||
|
>
|
||||||
|
{{ $t('announcements.delete_action') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-else
|
||||||
|
class="actions"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class="btn button-default"
|
||||||
|
@click="submitEdit"
|
||||||
|
>
|
||||||
|
{{ $t('announcements.submit_edit_action') }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn button-default"
|
||||||
|
@click="cancelEdit"
|
||||||
|
>
|
||||||
|
{{ $t('announcements.cancel_edit_action') }}
|
||||||
|
</button>
|
||||||
|
<div
|
||||||
|
v-if="editing && editError"
|
||||||
|
class="alert error"
|
||||||
|
>
|
||||||
|
{{ $t('announcements.edit_error', { error }) }}
|
||||||
|
<button
|
||||||
|
class="button-unstyled"
|
||||||
|
@click="clearError"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="times"
|
||||||
|
:title="$t('announcements.close_error')"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./announcement.js"></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import "../../variables";
|
||||||
|
|
||||||
|
.announcement {
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
border-bottom-color: var(--border, $fallback--border);
|
||||||
|
border-radius: 0;
|
||||||
|
padding: var(--status-margin, $status-margin);
|
||||||
|
|
||||||
|
.heading, .body {
|
||||||
|
margin-bottom: var(--status-margin, $status-margin);
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.times {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer .actions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
flex: 1;
|
||||||
|
margin: 1em;
|
||||||
|
max-width: 10em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
13
src/components/announcement_editor/announcement_editor.js
Normal file
13
src/components/announcement_editor/announcement_editor.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import Checkbox from '../checkbox/checkbox.vue'
|
||||||
|
|
||||||
|
const AnnouncementEditor = {
|
||||||
|
components: {
|
||||||
|
Checkbox
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
announcement: Object,
|
||||||
|
disabled: Boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AnnouncementEditor
|
60
src/components/announcement_editor/announcement_editor.vue
Normal file
60
src/components/announcement_editor/announcement_editor.vue
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<template>
|
||||||
|
<div class="announcement-editor">
|
||||||
|
<textarea
|
||||||
|
ref="textarea"
|
||||||
|
v-model="announcement.content"
|
||||||
|
class="post-textarea"
|
||||||
|
rows="1"
|
||||||
|
cols="1"
|
||||||
|
:placeholder="$t('announcements.post_placeholder')"
|
||||||
|
:disabled="disabled"
|
||||||
|
/>
|
||||||
|
<span class="announcement-metadata">
|
||||||
|
<label for="announcement-start-time">{{ $t('announcements.start_time_prompt') }}</label>
|
||||||
|
<input
|
||||||
|
id="announcement-start-time"
|
||||||
|
v-model="announcement.startsAt"
|
||||||
|
:type="announcement.allDay ? 'date' : 'datetime-local'"
|
||||||
|
:disabled="disabled"
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
<span class="announcement-metadata">
|
||||||
|
<label for="announcement-end-time">{{ $t('announcements.end_time_prompt') }}</label>
|
||||||
|
<input
|
||||||
|
id="announcement-end-time"
|
||||||
|
v-model="announcement.endsAt"
|
||||||
|
:type="announcement.allDay ? 'date' : 'datetime-local'"
|
||||||
|
:disabled="disabled"
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
<span class="announcement-metadata">
|
||||||
|
<Checkbox
|
||||||
|
id="announcement-all-day"
|
||||||
|
v-model="announcement.allDay"
|
||||||
|
:disabled="disabled"
|
||||||
|
/>
|
||||||
|
<label for="announcement-all-day">{{ $t('announcements.all_day_prompt') }}</label>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./announcement_editor.js"></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.announcement-editor {
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.announcement-metadata {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-textarea {
|
||||||
|
resize: vertical;
|
||||||
|
height: 10em;
|
||||||
|
overflow: none;
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
55
src/components/announcements_page/announcements_page.js
Normal file
55
src/components/announcements_page/announcements_page.js
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
import Announcement from '../announcement/announcement.vue'
|
||||||
|
import AnnouncementEditor from '../announcement_editor/announcement_editor.vue'
|
||||||
|
|
||||||
|
const AnnouncementsPage = {
|
||||||
|
components: {
|
||||||
|
Announcement,
|
||||||
|
AnnouncementEditor
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
newAnnouncement: {
|
||||||
|
content: '',
|
||||||
|
startsAt: undefined,
|
||||||
|
endsAt: undefined,
|
||||||
|
allDay: false
|
||||||
|
},
|
||||||
|
posting: false,
|
||||||
|
error: undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.$store.dispatch('fetchAnnouncements')
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
currentUser: state => state.users.currentUser
|
||||||
|
}),
|
||||||
|
announcements () {
|
||||||
|
return this.$store.state.announcements.announcements
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
postAnnouncement () {
|
||||||
|
this.posting = true
|
||||||
|
this.$store.dispatch('postAnnouncement', this.newAnnouncement)
|
||||||
|
.then(() => {
|
||||||
|
this.newAnnouncement.content = ''
|
||||||
|
this.startsAt = undefined
|
||||||
|
this.endsAt = undefined
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.error = error.error
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.posting = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
clearError () {
|
||||||
|
this.error = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AnnouncementsPage
|
79
src/components/announcements_page/announcements_page.vue
Normal file
79
src/components/announcements_page/announcements_page.vue
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
<template>
|
||||||
|
<div class="panel panel-default announcements-page">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<div class="title">
|
||||||
|
{{ $t('announcements.page_header') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<section
|
||||||
|
v-if="currentUser && currentUser.role === 'admin'"
|
||||||
|
>
|
||||||
|
<div class="post-form">
|
||||||
|
<div class="heading">
|
||||||
|
<h4>{{ $t('announcements.post_form_header') }}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="body">
|
||||||
|
<announcement-editor
|
||||||
|
:announcement="newAnnouncement"
|
||||||
|
:disabled="posting"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="footer">
|
||||||
|
<button
|
||||||
|
class="btn button-default post-button"
|
||||||
|
:disabled="posting"
|
||||||
|
@click.prevent="postAnnouncement"
|
||||||
|
>
|
||||||
|
{{ $t('announcements.post_action') }}
|
||||||
|
</button>
|
||||||
|
<div
|
||||||
|
v-if="error"
|
||||||
|
class="alert error"
|
||||||
|
>
|
||||||
|
{{ $t('announcements.post_error', { error }) }}
|
||||||
|
<button
|
||||||
|
class="button-unstyled"
|
||||||
|
@click="clearError"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="times"
|
||||||
|
:title="$t('announcements.close_error')"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section
|
||||||
|
v-for="announcement in announcements"
|
||||||
|
:key="announcement.id"
|
||||||
|
>
|
||||||
|
<announcement
|
||||||
|
:announcement="announcement"
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./announcements_page.js"></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import "../../variables";
|
||||||
|
|
||||||
|
.announcements-page {
|
||||||
|
.post-form {
|
||||||
|
padding: var(--status-margin, $status-margin);
|
||||||
|
|
||||||
|
.heading, .body {
|
||||||
|
margin-bottom: var(--status-margin, $status-margin);
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-button {
|
||||||
|
min-width: 10em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -18,6 +18,7 @@ import {
|
||||||
faPencilAlt,
|
faPencilAlt,
|
||||||
faAlignRight
|
faAlignRight
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
import Blurhash from '../blurhash/Blurhash.vue'
|
||||||
|
|
||||||
library.add(
|
library.add(
|
||||||
faFile,
|
faFile,
|
||||||
|
@ -63,7 +64,8 @@ const Attachment = {
|
||||||
components: {
|
components: {
|
||||||
Flash,
|
Flash,
|
||||||
StillImage,
|
StillImage,
|
||||||
VideoAttachment
|
VideoAttachment,
|
||||||
|
Blurhash
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
classNames () {
|
classNames () {
|
||||||
|
@ -84,6 +86,9 @@ const Attachment = {
|
||||||
useContainFit () {
|
useContainFit () {
|
||||||
return this.$store.getters.mergedConfig.useContainFit
|
return this.$store.getters.mergedConfig.useContainFit
|
||||||
},
|
},
|
||||||
|
useBlurhash () {
|
||||||
|
return this.$store.getters.mergedConfig.useBlurhash
|
||||||
|
},
|
||||||
placeholderName () {
|
placeholderName () {
|
||||||
if (this.attachment.description === '' || !this.attachment.description) {
|
if (this.attachment.description === '' || !this.attachment.description) {
|
||||||
return this.type.toUpperCase()
|
return this.type.toUpperCase()
|
||||||
|
@ -126,9 +131,15 @@ const Attachment = {
|
||||||
videoTag () {
|
videoTag () {
|
||||||
return this.useModal ? 'button' : 'span'
|
return this.useModal ? 'button' : 'span'
|
||||||
},
|
},
|
||||||
|
statusForm () {
|
||||||
|
return this.$parent.$parent
|
||||||
|
},
|
||||||
...mapGetters(['mergedConfig'])
|
...mapGetters(['mergedConfig'])
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
'attachment.description' (newVal) {
|
||||||
|
this.localDescription = newVal
|
||||||
|
},
|
||||||
localDescription (newVal) {
|
localDescription (newVal) {
|
||||||
this.onEdit(newVal)
|
this.onEdit(newVal)
|
||||||
}
|
}
|
||||||
|
@ -199,6 +210,29 @@ const Attachment = {
|
||||||
const width = image.naturalWidth
|
const width = image.naturalWidth
|
||||||
const height = image.naturalHeight
|
const height = image.naturalHeight
|
||||||
this.$emit('naturalSizeLoad', { id: this.attachment.id, width, height })
|
this.$emit('naturalSizeLoad', { id: this.attachment.id, width, height })
|
||||||
|
},
|
||||||
|
resize (e) {
|
||||||
|
const target = e.target || e
|
||||||
|
if (!(target instanceof window.Element)) { return }
|
||||||
|
|
||||||
|
// Reset to default height for empty form, nothing else to do here.
|
||||||
|
if (target.value === '') {
|
||||||
|
target.style.height = null
|
||||||
|
this.$emit('resize')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const paddingString = getComputedStyle(target)['padding']
|
||||||
|
// remove -px suffix
|
||||||
|
const padding = Number(paddingString.substring(0, paddingString.length - 2))
|
||||||
|
|
||||||
|
target.style.height = 'auto'
|
||||||
|
const newHeight = Math.floor(target.scrollHeight - padding * 2)
|
||||||
|
target.style.height = `${newHeight}px`
|
||||||
|
this.$emit('resize', newHeight)
|
||||||
|
},
|
||||||
|
postStatus (event) {
|
||||||
|
this.statusForm.postStatus(event, this.statusForm.newStatus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
.attachment-wrapper {
|
.attachment-wrapper {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
height: 100%;
|
height: 200px;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-top: 0.5em;
|
padding-top: 0.5em;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
max-height: 50%;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
@ -33,9 +34,10 @@
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
white-space: nowrap;
|
white-space: pre-line;
|
||||||
|
word-break: break-word;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.-static {
|
&.-static {
|
||||||
|
@ -52,6 +54,19 @@
|
||||||
.description-field {
|
.description-field {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
||||||
|
box-sizing: content-box;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: min-height 200ms 100ms;
|
||||||
|
|
||||||
|
padding-bottom: var(--_padding);
|
||||||
|
height: calc(var(--post-line-height) * 1em);
|
||||||
|
min-height: calc(var(--post-line-height) * 1em);
|
||||||
|
resize: none;
|
||||||
|
|
||||||
|
&.scrollable-form {
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& .placeholder-container,
|
& .placeholder-container,
|
||||||
|
|
|
@ -64,7 +64,15 @@
|
||||||
:title="attachment.description"
|
:title="attachment.description"
|
||||||
@click.prevent.stop="toggleHidden"
|
@click.prevent.stop="toggleHidden"
|
||||||
>
|
>
|
||||||
|
<Blurhash
|
||||||
|
v-if="useBlurhash && attachment.blurhash"
|
||||||
|
:height="512"
|
||||||
|
:width="1024"
|
||||||
|
:hash="attachment.blurhash"
|
||||||
|
:punch="1"
|
||||||
|
/>
|
||||||
<img
|
<img
|
||||||
|
v-else
|
||||||
:key="nsfwImage"
|
:key="nsfwImage"
|
||||||
class="nsfw"
|
class="nsfw"
|
||||||
:src="nsfwImage"
|
:src="nsfwImage"
|
||||||
|
@ -238,8 +246,8 @@
|
||||||
ref="flash"
|
ref="flash"
|
||||||
class="flash"
|
class="flash"
|
||||||
:src="attachment.large_thumb_url || attachment.url"
|
:src="attachment.large_thumb_url || attachment.url"
|
||||||
@playerOpened="setFlashLoaded(true)"
|
@player-opened="setFlashLoaded(true)"
|
||||||
@playerClosed="setFlashLoaded(false)"
|
@player-closed="setFlashLoaded(false)"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -248,14 +256,16 @@
|
||||||
class="description-container"
|
class="description-container"
|
||||||
:class="{ '-static': !edit }"
|
:class="{ '-static': !edit }"
|
||||||
>
|
>
|
||||||
<input
|
<textarea
|
||||||
v-if="edit"
|
v-if="edit"
|
||||||
v-model="localDescription"
|
v-model="localDescription"
|
||||||
type="text"
|
|
||||||
class="description-field"
|
class="description-field"
|
||||||
:placeholder="$t('post_status.media_description')"
|
:placeholder="$t('post_status.media_description')"
|
||||||
@keydown.enter.prevent=""
|
rows="1"
|
||||||
>
|
cols="1"
|
||||||
|
@keydown.ctrl.enter="postStatus()"
|
||||||
|
@input="resize"
|
||||||
|
/>
|
||||||
<p v-else>
|
<p v-else>
|
||||||
{{ localDescription }}
|
{{ localDescription }}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
<template>
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<h4>{{ $t('registration.awaiting_email_confirmation_title') }}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<p>{{ $t('registration.awaiting_email_confirmation') }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./awaiting_email_confirmation.js"></script>
|
66
src/components/blurhash/Blurhash.vue
Normal file
66
src/components/blurhash/Blurhash.vue
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
<template>
|
||||||
|
<canvas
|
||||||
|
ref="canvas"
|
||||||
|
class="blurhash"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { decode } from "blurhash";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Blurhash',
|
||||||
|
props: {
|
||||||
|
hash: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
width: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
punch: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
canvas: null,
|
||||||
|
ctx: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.canvas = this.$refs.canvas;
|
||||||
|
this.ctx = this.canvas.getContext('2d');
|
||||||
|
this.canvas.width = 1024;
|
||||||
|
this.canvas.height = 512;
|
||||||
|
this.draw();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
draw() {
|
||||||
|
const pixels = decode(this.hash, this.width, this.height, this.punch);
|
||||||
|
const imageData = this.ctx.createImageData(this.width, this.height);
|
||||||
|
imageData.data.set(pixels);
|
||||||
|
this.ctx.putImageData(imageData, 0, 0);
|
||||||
|
fetch("/static/blurhash-overlay.png")
|
||||||
|
.then((response) => response.blob())
|
||||||
|
.then((blob) => {
|
||||||
|
const img = new Image();
|
||||||
|
img.src = URL.createObjectURL(blob);
|
||||||
|
img.onload = () => {
|
||||||
|
this.ctx.drawImage(img, 0, 0, this.width, this.height);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
18
src/components/bubble_timeline/bubble_timeline.js
Normal file
18
src/components/bubble_timeline/bubble_timeline.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import Timeline from '../timeline/timeline.vue'
|
||||||
|
const PublicTimeline = {
|
||||||
|
components: {
|
||||||
|
Timeline
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
timeline () { return this.$store.state.statuses.timelines.bubble }
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.$store.dispatch('startFetchingTimeline', { timeline: 'bubble' })
|
||||||
|
},
|
||||||
|
unmounted () {
|
||||||
|
this.$store.dispatch('stopFetchingTimeline', 'bubble')
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PublicTimeline
|
9
src/components/bubble_timeline/bubble_timeline.vue
Normal file
9
src/components/bubble_timeline/bubble_timeline.vue
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<template>
|
||||||
|
<Timeline
|
||||||
|
:title="$t('nav.bubble_timeline')"
|
||||||
|
:timeline="timeline"
|
||||||
|
:timeline-name="'bubble'"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./bubble_timeline.js"></script>
|
|
@ -1,346 +0,0 @@
|
||||||
import _ from 'lodash'
|
|
||||||
import { WSConnectionStatus } from '../../services/api/api.service.js'
|
|
||||||
import { mapGetters, mapState } from 'vuex'
|
|
||||||
import ChatMessage from '../chat_message/chat_message.vue'
|
|
||||||
import PostStatusForm from '../post_status_form/post_status_form.vue'
|
|
||||||
import ChatTitle from '../chat_title/chat_title.vue'
|
|
||||||
import chatService from '../../services/chat_service/chat_service.js'
|
|
||||||
import { promiseInterval } from '../../services/promise_interval/promise_interval.js'
|
|
||||||
import { getScrollPosition, getNewTopPosition, isBottomedOut, isScrollable } from './chat_layout_utils.js'
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
||||||
import {
|
|
||||||
faChevronDown,
|
|
||||||
faChevronLeft
|
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import { buildFakeMessage } from '../../services/chat_utils/chat_utils.js'
|
|
||||||
|
|
||||||
library.add(
|
|
||||||
faChevronDown,
|
|
||||||
faChevronLeft
|
|
||||||
)
|
|
||||||
|
|
||||||
const BOTTOMED_OUT_OFFSET = 10
|
|
||||||
const JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET = 10
|
|
||||||
const SAFE_RESIZE_TIME_OFFSET = 100
|
|
||||||
const MARK_AS_READ_DELAY = 1500
|
|
||||||
const MAX_RETRIES = 10
|
|
||||||
|
|
||||||
const Chat = {
|
|
||||||
components: {
|
|
||||||
ChatMessage,
|
|
||||||
ChatTitle,
|
|
||||||
PostStatusForm
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
jumpToBottomButtonVisible: false,
|
|
||||||
hoveredMessageChainId: undefined,
|
|
||||||
lastScrollPosition: {},
|
|
||||||
scrollableContainerHeight: '100%',
|
|
||||||
errorLoadingChat: false,
|
|
||||||
messageRetriers: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created () {
|
|
||||||
this.startFetching()
|
|
||||||
window.addEventListener('resize', this.handleResize)
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
window.addEventListener('scroll', this.handleScroll)
|
|
||||||
if (typeof document.hidden !== 'undefined') {
|
|
||||||
document.addEventListener('visibilitychange', this.handleVisibilityChange, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.handleResize()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
unmounted () {
|
|
||||||
window.removeEventListener('scroll', this.handleScroll)
|
|
||||||
if (typeof document.hidden !== 'undefined') document.removeEventListener('visibilitychange', this.handleVisibilityChange, false)
|
|
||||||
this.$store.dispatch('clearCurrentChat')
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
recipient () {
|
|
||||||
return this.currentChat && this.currentChat.account
|
|
||||||
},
|
|
||||||
recipientId () {
|
|
||||||
return this.$route.params.recipient_id
|
|
||||||
},
|
|
||||||
formPlaceholder () {
|
|
||||||
if (this.recipient) {
|
|
||||||
return this.$t('chats.message_user', { nickname: this.recipient.screen_name_ui })
|
|
||||||
} else {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
chatViewItems () {
|
|
||||||
return chatService.getView(this.currentChatMessageService)
|
|
||||||
},
|
|
||||||
newMessageCount () {
|
|
||||||
return this.currentChatMessageService && this.currentChatMessageService.newMessageCount
|
|
||||||
},
|
|
||||||
streamingEnabled () {
|
|
||||||
return this.mergedConfig.useStreamingApi && this.mastoUserSocketStatus === WSConnectionStatus.JOINED
|
|
||||||
},
|
|
||||||
...mapGetters([
|
|
||||||
'currentChat',
|
|
||||||
'currentChatMessageService',
|
|
||||||
'findOpenedChatByRecipientId',
|
|
||||||
'mergedConfig'
|
|
||||||
]),
|
|
||||||
...mapState({
|
|
||||||
backendInteractor: state => state.api.backendInteractor,
|
|
||||||
mastoUserSocketStatus: state => state.api.mastoUserSocketStatus,
|
|
||||||
mobileLayout: state => state.interface.layoutType === 'mobile',
|
|
||||||
currentUser: state => state.users.currentUser
|
|
||||||
})
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
chatViewItems () {
|
|
||||||
// We don't want to scroll to the bottom on a new message when the user is viewing older messages.
|
|
||||||
// Therefore we need to know whether the scroll position was at the bottom before the DOM update.
|
|
||||||
const bottomedOutBeforeUpdate = this.bottomedOut(BOTTOMED_OUT_OFFSET)
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (bottomedOutBeforeUpdate) {
|
|
||||||
this.scrollDown()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
'$route': function () {
|
|
||||||
this.startFetching()
|
|
||||||
},
|
|
||||||
mastoUserSocketStatus (newValue) {
|
|
||||||
if (newValue === WSConnectionStatus.JOINED) {
|
|
||||||
this.fetchChat({ isFirstFetch: true })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// Used to animate the avatar near the first message of the message chain when any message belonging to the chain is hovered
|
|
||||||
onMessageHover ({ isHovered, messageChainId }) {
|
|
||||||
this.hoveredMessageChainId = isHovered ? messageChainId : undefined
|
|
||||||
},
|
|
||||||
onFilesDropped () {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.handleResize()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleVisibilityChange () {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (!document.hidden && this.bottomedOut(BOTTOMED_OUT_OFFSET)) {
|
|
||||||
this.scrollDown({ forceRead: true })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// "Sticks" scroll to bottom instead of top, helps with OSK resizing the viewport
|
|
||||||
handleResize (opts = {}) {
|
|
||||||
const { expand = false, delayed = false } = opts
|
|
||||||
|
|
||||||
if (delayed) {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.handleResize({ ...opts, delayed: false })
|
|
||||||
}, SAFE_RESIZE_TIME_OFFSET)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
const { offsetHeight = undefined } = getScrollPosition()
|
|
||||||
const diff = this.lastScrollPosition.offsetHeight - offsetHeight
|
|
||||||
if (diff !== 0 || (!this.bottomedOut() && expand)) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
window.scrollTo({ top: window.scrollY + diff })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.lastScrollPosition = getScrollPosition()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
scrollDown (options = {}) {
|
|
||||||
const { behavior = 'auto', forceRead = false } = options
|
|
||||||
this.$nextTick(() => {
|
|
||||||
window.scrollTo({ top: document.documentElement.scrollHeight, behavior })
|
|
||||||
})
|
|
||||||
if (forceRead) {
|
|
||||||
this.readChat()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
readChat () {
|
|
||||||
if (!(this.currentChatMessageService && this.currentChatMessageService.maxId)) { return }
|
|
||||||
if (document.hidden) { return }
|
|
||||||
const lastReadId = this.currentChatMessageService.maxId
|
|
||||||
this.$store.dispatch('readChat', {
|
|
||||||
id: this.currentChat.id,
|
|
||||||
lastReadId
|
|
||||||
})
|
|
||||||
},
|
|
||||||
bottomedOut (offset) {
|
|
||||||
return isBottomedOut(offset)
|
|
||||||
},
|
|
||||||
reachedTop () {
|
|
||||||
return window.scrollY <= 0
|
|
||||||
},
|
|
||||||
cullOlderCheck () {
|
|
||||||
window.setTimeout(() => {
|
|
||||||
if (this.bottomedOut(JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET)) {
|
|
||||||
this.$store.dispatch('cullOlderMessages', this.currentChatMessageService.chatId)
|
|
||||||
}
|
|
||||||
}, 5000)
|
|
||||||
},
|
|
||||||
handleScroll: _.throttle(function () {
|
|
||||||
if (!this.currentChat) { return }
|
|
||||||
|
|
||||||
if (this.reachedTop()) {
|
|
||||||
this.fetchChat({ maxId: this.currentChatMessageService.minId })
|
|
||||||
} else if (this.bottomedOut(JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET)) {
|
|
||||||
this.jumpToBottomButtonVisible = false
|
|
||||||
this.cullOlderCheck()
|
|
||||||
if (this.newMessageCount > 0) {
|
|
||||||
// Use a delay before marking as read to prevent situation where new messages
|
|
||||||
// arrive just as you're leaving the view and messages that you didn't actually
|
|
||||||
// get to see get marked as read.
|
|
||||||
window.setTimeout(() => {
|
|
||||||
// Don't mark as read if the element doesn't exist, user has left chat view
|
|
||||||
if (this.$el) this.readChat()
|
|
||||||
}, MARK_AS_READ_DELAY)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.jumpToBottomButtonVisible = true
|
|
||||||
}
|
|
||||||
}, 200),
|
|
||||||
handleScrollUp (positionBeforeLoading) {
|
|
||||||
const positionAfterLoading = getScrollPosition()
|
|
||||||
window.scrollTo({
|
|
||||||
top: getNewTopPosition(positionBeforeLoading, positionAfterLoading)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fetchChat ({ isFirstFetch = false, fetchLatest = false, maxId }) {
|
|
||||||
const chatMessageService = this.currentChatMessageService
|
|
||||||
if (!chatMessageService) { return }
|
|
||||||
if (fetchLatest && this.streamingEnabled) { return }
|
|
||||||
|
|
||||||
const chatId = chatMessageService.chatId
|
|
||||||
const fetchOlderMessages = !!maxId
|
|
||||||
const sinceId = fetchLatest && chatMessageService.maxId
|
|
||||||
|
|
||||||
return this.backendInteractor.chatMessages({ id: chatId, maxId, sinceId })
|
|
||||||
.then((messages) => {
|
|
||||||
// Clear the current chat in case we're recovering from a ws connection loss.
|
|
||||||
if (isFirstFetch) {
|
|
||||||
chatService.clear(chatMessageService)
|
|
||||||
}
|
|
||||||
|
|
||||||
const positionBeforeUpdate = getScrollPosition()
|
|
||||||
this.$store.dispatch('addChatMessages', { chatId, messages }).then(() => {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (fetchOlderMessages) {
|
|
||||||
this.handleScrollUp(positionBeforeUpdate)
|
|
||||||
}
|
|
||||||
|
|
||||||
// In vertical screens, the first batch of fetched messages may not always take the
|
|
||||||
// full height of the scrollable container.
|
|
||||||
// If this is the case, we want to fetch the messages until the scrollable container
|
|
||||||
// is fully populated so that the user has the ability to scroll up and load the history.
|
|
||||||
if (!isScrollable() && messages.length > 0) {
|
|
||||||
this.fetchChat({ maxId: this.currentChatMessageService.minId })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async startFetching () {
|
|
||||||
let chat = this.findOpenedChatByRecipientId(this.recipientId)
|
|
||||||
if (!chat) {
|
|
||||||
try {
|
|
||||||
chat = await this.backendInteractor.getOrCreateChat({ accountId: this.recipientId })
|
|
||||||
} catch (e) {
|
|
||||||
console.error('Error creating or getting a chat', e)
|
|
||||||
this.errorLoadingChat = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (chat) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.scrollDown({ forceRead: true })
|
|
||||||
})
|
|
||||||
this.$store.dispatch('addOpenedChat', { chat })
|
|
||||||
this.doStartFetching()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
doStartFetching () {
|
|
||||||
this.$store.dispatch('startFetchingCurrentChat', {
|
|
||||||
fetcher: () => promiseInterval(() => this.fetchChat({ fetchLatest: true }), 5000)
|
|
||||||
})
|
|
||||||
this.fetchChat({ isFirstFetch: true })
|
|
||||||
},
|
|
||||||
handleAttachmentPosting () {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.handleResize()
|
|
||||||
// When the posting form size changes because of a media attachment, we need an extra resize
|
|
||||||
// to account for the potential delay in the DOM update.
|
|
||||||
this.scrollDown({ forceRead: true })
|
|
||||||
})
|
|
||||||
},
|
|
||||||
sendMessage ({ status, media, idempotencyKey }) {
|
|
||||||
const params = {
|
|
||||||
id: this.currentChat.id,
|
|
||||||
content: status,
|
|
||||||
idempotencyKey
|
|
||||||
}
|
|
||||||
|
|
||||||
if (media[0]) {
|
|
||||||
params.mediaId = media[0].id
|
|
||||||
}
|
|
||||||
|
|
||||||
const fakeMessage = buildFakeMessage({
|
|
||||||
attachments: media,
|
|
||||||
chatId: this.currentChat.id,
|
|
||||||
content: status,
|
|
||||||
userId: this.currentUser.id,
|
|
||||||
idempotencyKey
|
|
||||||
})
|
|
||||||
|
|
||||||
this.$store.dispatch('addChatMessages', {
|
|
||||||
chatId: this.currentChat.id,
|
|
||||||
messages: [fakeMessage]
|
|
||||||
}).then(() => {
|
|
||||||
this.handleAttachmentPosting()
|
|
||||||
})
|
|
||||||
|
|
||||||
return this.doSendMessage({ params, fakeMessage, retriesLeft: MAX_RETRIES })
|
|
||||||
},
|
|
||||||
doSendMessage ({ params, fakeMessage, retriesLeft = MAX_RETRIES }) {
|
|
||||||
if (retriesLeft <= 0) return
|
|
||||||
|
|
||||||
this.backendInteractor.sendChatMessage(params)
|
|
||||||
.then(data => {
|
|
||||||
this.$store.dispatch('addChatMessages', {
|
|
||||||
chatId: this.currentChat.id,
|
|
||||||
updateMaxId: false,
|
|
||||||
messages: [{ ...data, fakeId: fakeMessage.id }]
|
|
||||||
})
|
|
||||||
|
|
||||||
return data
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error('Error sending message', error)
|
|
||||||
this.$store.dispatch('handleMessageError', {
|
|
||||||
chatId: this.currentChat.id,
|
|
||||||
fakeId: fakeMessage.id,
|
|
||||||
isRetry: retriesLeft !== MAX_RETRIES
|
|
||||||
})
|
|
||||||
if ((error.statusCode >= 500 && error.statusCode < 600) || error.message === 'Failed to fetch') {
|
|
||||||
this.messageRetriers[fakeMessage.id] = setTimeout(() => {
|
|
||||||
this.doSendMessage({ params, fakeMessage, retriesLeft: retriesLeft - 1 })
|
|
||||||
}, 1000 * (2 ** (MAX_RETRIES - retriesLeft)))
|
|
||||||
}
|
|
||||||
return {}
|
|
||||||
})
|
|
||||||
|
|
||||||
return Promise.resolve(fakeMessage)
|
|
||||||
},
|
|
||||||
goBack () {
|
|
||||||
this.$router.push({ name: 'chats', params: { username: this.currentUser.screen_name } })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Chat
|
|
|
@ -1,108 +0,0 @@
|
||||||
.chat-view {
|
|
||||||
display: flex;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.chat-view-inner {
|
|
||||||
height: auto;
|
|
||||||
width: 100%;
|
|
||||||
overflow: visible;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-view-body {
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-color: var(--chatBg, $fallback--bg);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
width: 100%;
|
|
||||||
overflow: visible;
|
|
||||||
min-height: calc(100vh - var(--navbar-height));
|
|
||||||
margin: 0 0 0 0;
|
|
||||||
border-radius: 10px 10px 0 0;
|
|
||||||
border-radius: var(--panelRadius, 10px) var(--panelRadius, 10px) 0 0;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.message-list {
|
|
||||||
padding: 0 0.8em;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: end;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
position: sticky;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: $fallback--bg;
|
|
||||||
background-color: var(--bg, $fallback--bg);
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-view-heading {
|
|
||||||
grid-template-columns: auto minmax(50%, 1fr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.go-back-button {
|
|
||||||
text-align: center;
|
|
||||||
line-height: 1;
|
|
||||||
height: 100%;
|
|
||||||
align-self: start;
|
|
||||||
width: var(--__panel-heading-height-inner);
|
|
||||||
}
|
|
||||||
|
|
||||||
.jump-to-bottom-button {
|
|
||||||
width: 2.5em;
|
|
||||||
height: 2.5em;
|
|
||||||
border-radius: 100%;
|
|
||||||
position: absolute;
|
|
||||||
right: 1.3em;
|
|
||||||
top: -3.2em;
|
|
||||||
background-color: $fallback--fg;
|
|
||||||
background-color: var(--btn, $fallback--fg);
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
||||||
z-index: 10;
|
|
||||||
transition: 0.35s all;
|
|
||||||
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
|
|
||||||
opacity: 0;
|
|
||||||
visibility: hidden;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&.visible {
|
|
||||||
opacity: 1;
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
i {
|
|
||||||
font-size: 1em;
|
|
||||||
color: $fallback--text;
|
|
||||||
color: var(--text, $fallback--text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.unread-message-count {
|
|
||||||
font-size: 0.8em;
|
|
||||||
left: 50%;
|
|
||||||
margin-top: -1rem;
|
|
||||||
padding: 0.1em;
|
|
||||||
border-radius: 50px;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-loading-error {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.error {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,100 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="chat-view">
|
|
||||||
<div class="chat-view-inner">
|
|
||||||
<div
|
|
||||||
ref="inner"
|
|
||||||
class="panel-default panel chat-view-body"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
ref="header"
|
|
||||||
class="panel-heading -sticky chat-view-heading"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
class="button-unstyled go-back-button"
|
|
||||||
@click="goBack"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
size="lg"
|
|
||||||
icon="chevron-left"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
<div class="title text-center">
|
|
||||||
<ChatTitle
|
|
||||||
:user="recipient"
|
|
||||||
:with-avatar="true"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="message-list"
|
|
||||||
:style="{ height: scrollableContainerHeight }"
|
|
||||||
>
|
|
||||||
<template v-if="!errorLoadingChat">
|
|
||||||
<ChatMessage
|
|
||||||
v-for="chatViewItem in chatViewItems"
|
|
||||||
:key="chatViewItem.id"
|
|
||||||
:author="recipient"
|
|
||||||
:chat-view-item="chatViewItem"
|
|
||||||
:hovered-message-chain="chatViewItem.messageChainId === hoveredMessageChainId"
|
|
||||||
@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"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script src="./chat.js"></script>
|
|
||||||
<style lang="scss">
|
|
||||||
@import '../../_variables.scss';
|
|
||||||
@import './chat.scss';
|
|
||||||
</style>
|
|
|
@ -1,24 +0,0 @@
|
||||||
// Captures a scroll position
|
|
||||||
export const getScrollPosition = () => {
|
|
||||||
return {
|
|
||||||
scrollTop: window.scrollY,
|
|
||||||
scrollHeight: document.documentElement.scrollHeight,
|
|
||||||
offsetHeight: window.innerHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A helper function that is used to keep the scroll position fixed as the new elements are added to the top
|
|
||||||
// Takes two scroll positions, before and after the update.
|
|
||||||
export const getNewTopPosition = (previousPosition, newPosition) => {
|
|
||||||
return previousPosition.scrollTop + (newPosition.scrollHeight - previousPosition.scrollHeight)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const isBottomedOut = (offset = 0) => {
|
|
||||||
const scrollHeight = window.scrollY + offset
|
|
||||||
const totalHeight = document.documentElement.scrollHeight - window.innerHeight
|
|
||||||
return totalHeight <= scrollHeight
|
|
||||||
}
|
|
||||||
// Returns whether or not the scrollbar is visible.
|
|
||||||
export const isScrollable = () => {
|
|
||||||
return document.documentElement.scrollHeight > window.innerHeight
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
import { mapState, mapGetters } from 'vuex'
|
|
||||||
import ChatListItem from '../chat_list_item/chat_list_item.vue'
|
|
||||||
import ChatNew from '../chat_new/chat_new.vue'
|
|
||||||
import List from '../list/list.vue'
|
|
||||||
|
|
||||||
const ChatList = {
|
|
||||||
components: {
|
|
||||||
ChatListItem,
|
|
||||||
List,
|
|
||||||
ChatNew
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState({
|
|
||||||
currentUser: state => state.users.currentUser
|
|
||||||
}),
|
|
||||||
...mapGetters(['sortedChatList'])
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
isNew: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created () {
|
|
||||||
this.$store.dispatch('fetchChats', { latest: true })
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cancelNewChat () {
|
|
||||||
this.isNew = false
|
|
||||||
this.$store.dispatch('fetchChats', { latest: true })
|
|
||||||
},
|
|
||||||
newChat () {
|
|
||||||
this.isNew = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ChatList
|
|
|
@ -1,64 +0,0 @@
|
||||||
<template>
|
|
||||||
<div v-if="isNew">
|
|
||||||
<ChatNew @cancel="cancelNewChat" />
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="chat-list panel panel-default"
|
|
||||||
>
|
|
||||||
<div class="panel-heading -sticky">
|
|
||||||
<span class="title">
|
|
||||||
{{ $t("chats.chats") }}
|
|
||||||
</span>
|
|
||||||
<button
|
|
||||||
class="button-default"
|
|
||||||
@click="newChat"
|
|
||||||
>
|
|
||||||
{{ $t("chats.new") }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<div
|
|
||||||
v-if="sortedChatList.length > 0"
|
|
||||||
class="timeline"
|
|
||||||
>
|
|
||||||
<List :items="sortedChatList">
|
|
||||||
<template v-slot:item="{item}">
|
|
||||||
<ChatListItem
|
|
||||||
:key="item.id"
|
|
||||||
:compact="false"
|
|
||||||
:chat="item"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</List>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="emtpy-chat-list-alert"
|
|
||||||
>
|
|
||||||
<span>{{ $t('chats.empty_chat_list_placeholder') }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script src="./chat_list.js"></script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
@import '../../_variables.scss';
|
|
||||||
|
|
||||||
.chat-list {
|
|
||||||
min-height: 25em;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.emtpy-chat-list-alert {
|
|
||||||
padding: 3em;
|
|
||||||
font-size: 1.2em;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
color: $fallback--text;
|
|
||||||
color: var(--faint, $fallback--text);
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -1,69 +0,0 @@
|
||||||
import { mapState } from 'vuex'
|
|
||||||
import StatusBody from '../status_content/status_content.vue'
|
|
||||||
import fileType from 'src/services/file_type/file_type.service'
|
|
||||||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
|
||||||
import AvatarList from '../avatar_list/avatar_list.vue'
|
|
||||||
import Timeago from '../timeago/timeago.vue'
|
|
||||||
import ChatTitle from '../chat_title/chat_title.vue'
|
|
||||||
|
|
||||||
const ChatListItem = {
|
|
||||||
name: 'ChatListItem',
|
|
||||||
props: [
|
|
||||||
'chat'
|
|
||||||
],
|
|
||||||
components: {
|
|
||||||
UserAvatar,
|
|
||||||
AvatarList,
|
|
||||||
Timeago,
|
|
||||||
ChatTitle,
|
|
||||||
StatusBody
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState({
|
|
||||||
currentUser: state => state.users.currentUser
|
|
||||||
}),
|
|
||||||
attachmentInfo () {
|
|
||||||
if (this.chat.lastMessage.attachments.length === 0) { return }
|
|
||||||
|
|
||||||
const types = this.chat.lastMessage.attachments.map(file => fileType.fileType(file.mimetype))
|
|
||||||
if (types.includes('video')) {
|
|
||||||
return this.$t('file_type.video')
|
|
||||||
} else if (types.includes('audio')) {
|
|
||||||
return this.$t('file_type.audio')
|
|
||||||
} else if (types.includes('image')) {
|
|
||||||
return this.$t('file_type.image')
|
|
||||||
} else {
|
|
||||||
return this.$t('file_type.file')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
messageForStatusContent () {
|
|
||||||
const message = this.chat.lastMessage
|
|
||||||
const messageEmojis = message ? message.emojis : []
|
|
||||||
const isYou = message && message.account_id === this.currentUser.id
|
|
||||||
const content = message ? (this.attachmentInfo || message.content) : ''
|
|
||||||
const messagePreview = isYou ? `<i>${this.$t('chats.you')}</i> ${content}` : content
|
|
||||||
return {
|
|
||||||
summary: '',
|
|
||||||
emojis: messageEmojis,
|
|
||||||
raw_html: messagePreview,
|
|
||||||
text: messagePreview,
|
|
||||||
attachments: []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
openChat (_e) {
|
|
||||||
if (this.chat.id) {
|
|
||||||
this.$router.push({
|
|
||||||
name: 'chat',
|
|
||||||
params: {
|
|
||||||
username: this.currentUser.screen_name,
|
|
||||||
recipient_id: this.chat.account.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ChatListItem
|
|
|
@ -1,91 +0,0 @@
|
||||||
.chat-list-item {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
padding: 0.75em;
|
|
||||||
height: 5em;
|
|
||||||
overflow: hidden;
|
|
||||||
box-sizing: border-box;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--selectedPost, $fallback--lightBg);
|
|
||||||
box-shadow: 0 0 3px 1px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-list-item-left {
|
|
||||||
margin-right: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-list-item-center {
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
overflow: hidden;
|
|
||||||
word-wrap: break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
.heading {
|
|
||||||
width: 100%;
|
|
||||||
display: inline-flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
line-height: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.heading-right {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name-and-account-name {
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
flex-shrink: 1;
|
|
||||||
line-height: var(--post-line-height);
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-preview {
|
|
||||||
display: inline-flex;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
margin: 0.35em 0;
|
|
||||||
color: $fallback--text;
|
|
||||||
color: var(--faint, $fallback--text);
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: var(--faintLink, $fallback--link);
|
|
||||||
text-decoration: none;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover .animated.avatar {
|
|
||||||
canvas {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.Avatar {
|
|
||||||
border-radius: $fallback--avatarAltRadius;
|
|
||||||
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-preview-body {
|
|
||||||
--emoji-size: 1.4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-wrapper {
|
|
||||||
line-height: var(--post-line-height);
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-preview-body {
|
|
||||||
padding-right: 1em;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
<template>
|
|
||||||
<div
|
|
||||||
class="chat-list-item"
|
|
||||||
@click.capture.prevent="openChat"
|
|
||||||
>
|
|
||||||
<div class="chat-list-item-left">
|
|
||||||
<UserAvatar
|
|
||||||
:user="chat.account"
|
|
||||||
height="48px"
|
|
||||||
width="48px"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="chat-list-item-center">
|
|
||||||
<div class="heading">
|
|
||||||
<span
|
|
||||||
v-if="chat.account"
|
|
||||||
class="name-and-account-name"
|
|
||||||
>
|
|
||||||
<ChatTitle
|
|
||||||
:user="chat.account"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<span class="heading-right" />
|
|
||||||
<div class="time-wrapper">
|
|
||||||
<Timeago
|
|
||||||
:time="chat.updated_at"
|
|
||||||
:auto-update="60"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="chat-preview">
|
|
||||||
<StatusBody
|
|
||||||
class="chat-preview-body"
|
|
||||||
:status="messageForStatusContent"
|
|
||||||
:single-line="true"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
v-if="chat.unread > 0"
|
|
||||||
class="badge badge-notification unread-chat-count"
|
|
||||||
>
|
|
||||||
{{ chat.unread }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script src="./chat_list_item.js"></script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
@import '../../_variables.scss';
|
|
||||||
@import './chat_list_item.scss';
|
|
||||||
</style>
|
|
|
@ -1,108 +0,0 @@
|
||||||
import { mapState, mapGetters } from 'vuex'
|
|
||||||
import Popover from '../popover/popover.vue'
|
|
||||||
import Attachment from '../attachment/attachment.vue'
|
|
||||||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
|
||||||
import Gallery from '../gallery/gallery.vue'
|
|
||||||
import LinkPreview from '../link-preview/link-preview.vue'
|
|
||||||
import StatusContent from '../status_content/status_content.vue'
|
|
||||||
import ChatMessageDate from '../chat_message_date/chat_message_date.vue'
|
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
||||||
import {
|
|
||||||
faTimes,
|
|
||||||
faEllipsisH
|
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
library.add(
|
|
||||||
faTimes,
|
|
||||||
faEllipsisH
|
|
||||||
)
|
|
||||||
|
|
||||||
const ChatMessage = {
|
|
||||||
name: 'ChatMessage',
|
|
||||||
props: [
|
|
||||||
'author',
|
|
||||||
'edited',
|
|
||||||
'noHeading',
|
|
||||||
'chatViewItem',
|
|
||||||
'hoveredMessageChain'
|
|
||||||
],
|
|
||||||
emits: ['hover'],
|
|
||||||
components: {
|
|
||||||
Popover,
|
|
||||||
Attachment,
|
|
||||||
StatusContent,
|
|
||||||
UserAvatar,
|
|
||||||
Gallery,
|
|
||||||
LinkPreview,
|
|
||||||
ChatMessageDate
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// Returns HH:MM (hours and minutes) in local time.
|
|
||||||
createdAt () {
|
|
||||||
const time = this.chatViewItem.data.created_at
|
|
||||||
return time.toLocaleTimeString('en', { hour: '2-digit', minute: '2-digit', hour12: false })
|
|
||||||
},
|
|
||||||
isCurrentUser () {
|
|
||||||
return this.message.account_id === this.currentUser.id
|
|
||||||
},
|
|
||||||
message () {
|
|
||||||
return this.chatViewItem.data
|
|
||||||
},
|
|
||||||
userProfileLink () {
|
|
||||||
return generateProfileLink(this.author.id, this.author.screen_name, this.$store.state.instance.restrictedNicknames)
|
|
||||||
},
|
|
||||||
isMessage () {
|
|
||||||
return this.chatViewItem.type === 'message'
|
|
||||||
},
|
|
||||||
messageForStatusContent () {
|
|
||||||
return {
|
|
||||||
summary: '',
|
|
||||||
emojis: this.message.emojis,
|
|
||||||
raw_html: this.message.content || '',
|
|
||||||
text: this.message.content || '',
|
|
||||||
attachments: this.message.attachments
|
|
||||||
}
|
|
||||||
},
|
|
||||||
hasAttachment () {
|
|
||||||
return this.message.attachments.length > 0
|
|
||||||
},
|
|
||||||
...mapState({
|
|
||||||
betterShadow: state => state.interface.browserSupport.cssFilter,
|
|
||||||
currentUser: state => state.users.currentUser,
|
|
||||||
restrictedNicknames: state => state.instance.restrictedNicknames
|
|
||||||
}),
|
|
||||||
popoverMarginStyle () {
|
|
||||||
if (this.isCurrentUser) {
|
|
||||||
return {}
|
|
||||||
} else {
|
|
||||||
return { left: 50 }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
...mapGetters(['mergedConfig', 'findUser'])
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
hovered: false,
|
|
||||||
menuOpened: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onHover (bool) {
|
|
||||||
this.$emit('hover', { isHovered: bool, messageChainId: this.chatViewItem.messageChainId })
|
|
||||||
},
|
|
||||||
async deleteMessage () {
|
|
||||||
const confirmed = window.confirm(this.$t('chats.delete_confirm'))
|
|
||||||
if (confirmed) {
|
|
||||||
await this.$store.dispatch('deleteChatMessage', {
|
|
||||||
messageId: this.chatViewItem.data.id,
|
|
||||||
chatId: this.chatViewItem.data.chat_id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.hovered = false
|
|
||||||
this.menuOpened = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ChatMessage
|
|
|
@ -1,179 +0,0 @@
|
||||||
@import '../../_variables.scss';
|
|
||||||
|
|
||||||
.chat-message-wrapper {
|
|
||||||
|
|
||||||
&.hovered-message-chain {
|
|
||||||
.animated.Avatar {
|
|
||||||
canvas {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message-menu {
|
|
||||||
transition: opacity 0.1s;
|
|
||||||
opacity: 0;
|
|
||||||
position: absolute;
|
|
||||||
top: -0.8em;
|
|
||||||
|
|
||||||
button {
|
|
||||||
padding-top: 0.2em;
|
|
||||||
padding-bottom: 0.2em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-icon {
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover, .extra-button-popover.open & {
|
|
||||||
color: $fallback--text;
|
|
||||||
color: var(--text, $fallback--text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.popover {
|
|
||||||
width: 12em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message {
|
|
||||||
display: flex;
|
|
||||||
padding-bottom: 0.5em;
|
|
||||||
|
|
||||||
.status-body:hover {
|
|
||||||
--_still-image-img-visibility: visible;
|
|
||||||
--_still-image-canvas-visibility: hidden;
|
|
||||||
--_still-image-label-visibility: hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.avatar-wrapper {
|
|
||||||
margin-right: 0.72em;
|
|
||||||
width: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link-preview, .attachments {
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message-inner {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
max-width: 80%;
|
|
||||||
min-width: 10em;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
&.with-media {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.status {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
|
||||||
border-radius: $fallback--chatMessageRadius;
|
|
||||||
border-radius: var(--chatMessageRadius, $fallback--chatMessageRadius);
|
|
||||||
display: flex;
|
|
||||||
padding: 0.75em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.created-at {
|
|
||||||
position: relative;
|
|
||||||
float: right;
|
|
||||||
font-size: 0.8em;
|
|
||||||
margin: -1em 0 -0.5em 0;
|
|
||||||
font-style: italic;
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.without-attachment {
|
|
||||||
.message-content {
|
|
||||||
// TODO figure out how to do it properly
|
|
||||||
.RichContent::after {
|
|
||||||
margin-right: 5.4em;
|
|
||||||
content: " ";
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.pending {
|
|
||||||
.status-content.media-body, .created-at {
|
|
||||||
color: var(--faint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.error {
|
|
||||||
.status-content.media-body, .created-at {
|
|
||||||
color: $fallback--cRed;
|
|
||||||
color: var(--badgeNotification, $fallback--cRed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.incoming {
|
|
||||||
a {
|
|
||||||
color: var(--chatMessageIncomingLink, $fallback--link);
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
|
||||||
color: var(--chatMessageIncomingText, $fallback--text);
|
|
||||||
background-color: var(--chatMessageIncomingBg, $fallback--bg);
|
|
||||||
border: 1px solid var(--chatMessageIncomingBorder, --border);
|
|
||||||
}
|
|
||||||
|
|
||||||
.created-at {
|
|
||||||
a {
|
|
||||||
color: var(--chatMessageIncomingText, $fallback--text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message-menu {
|
|
||||||
left: 0.4rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.outgoing {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-content: end;
|
|
||||||
justify-content: flex-end;
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: var(--chatMessageOutgoingLink, $fallback--link);
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
|
||||||
color: var(--chatMessageOutgoingText, $fallback--text);
|
|
||||||
background-color: var(--chatMessageOutgoingBg, $fallback--lightBg);
|
|
||||||
border: 1px solid var(--chatMessageOutgoingBorder, --lightBg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message-inner {
|
|
||||||
align-items: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message-menu {
|
|
||||||
right: 0.4rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.visible {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message-date-separator {
|
|
||||||
text-align: center;
|
|
||||||
margin: 1.4em 0;
|
|
||||||
font-size: 0.9em;
|
|
||||||
user-select: none;
|
|
||||||
color: $fallback--text;
|
|
||||||
color: var(--faintedText, $fallback--text);
|
|
||||||
}
|
|
|
@ -1,103 +0,0 @@
|
||||||
<template>
|
|
||||||
<div
|
|
||||||
v-if="isMessage"
|
|
||||||
class="chat-message-wrapper"
|
|
||||||
:class="{ 'hovered-message-chain': hoveredMessageChain }"
|
|
||||||
@mouseover="onHover(true)"
|
|
||||||
@mouseleave="onHover(false)"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="chat-message"
|
|
||||||
:class="[{ 'outgoing': isCurrentUser, 'incoming': !isCurrentUser }]"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
v-if="!isCurrentUser"
|
|
||||||
class="avatar-wrapper"
|
|
||||||
>
|
|
||||||
<router-link
|
|
||||||
v-if="chatViewItem.isHead"
|
|
||||||
:to="userProfileLink"
|
|
||||||
>
|
|
||||||
<UserAvatar
|
|
||||||
:compact="true"
|
|
||||||
:better-shadow="betterShadow"
|
|
||||||
:user="author"
|
|
||||||
/>
|
|
||||||
</router-link>
|
|
||||||
</div>
|
|
||||||
<div class="chat-message-inner">
|
|
||||||
<div
|
|
||||||
class="status-body"
|
|
||||||
:style="{ 'min-width': message.attachment ? '80%' : '' }"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="media status"
|
|
||||||
:class="{ 'without-attachment': !hasAttachment, 'pending': chatViewItem.data.pending, 'error': chatViewItem.data.error }"
|
|
||||||
style="position: relative"
|
|
||||||
@mouseenter="hovered = true"
|
|
||||||
@mouseleave="hovered = false"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="chat-message-menu"
|
|
||||||
:class="{ 'visible': hovered || menuOpened }"
|
|
||||||
>
|
|
||||||
<Popover
|
|
||||||
trigger="click"
|
|
||||||
placement="top"
|
|
||||||
:bound-to-selector="isCurrentUser ? '' : '.scrollable-message-list'"
|
|
||||||
:bound-to="{ x: 'container' }"
|
|
||||||
:margin="popoverMarginStyle"
|
|
||||||
@show="menuOpened = true"
|
|
||||||
@close="menuOpened = false"
|
|
||||||
>
|
|
||||||
<template v-slot:content>
|
|
||||||
<div class="dropdown-menu">
|
|
||||||
<button
|
|
||||||
class="button-default dropdown-item dropdown-item-icon"
|
|
||||||
@click="deleteMessage"
|
|
||||||
>
|
|
||||||
<FAIcon icon="times" /> {{ $t("chats.delete") }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-slot:trigger>
|
|
||||||
<button
|
|
||||||
class="button-default menu-icon"
|
|
||||||
:title="$t('chats.more')"
|
|
||||||
>
|
|
||||||
<FAIcon icon="ellipsis-h" />
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<StatusContent
|
|
||||||
class="message-content"
|
|
||||||
:status="messageForStatusContent"
|
|
||||||
:full-content="true"
|
|
||||||
>
|
|
||||||
<template v-slot:footer>
|
|
||||||
<span
|
|
||||||
class="created-at"
|
|
||||||
>
|
|
||||||
{{ createdAt }}
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</StatusContent>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="chat-message-date-separator"
|
|
||||||
>
|
|
||||||
<ChatMessageDate :date="chatViewItem.date" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script src="./chat_message.js" ></script>
|
|
||||||
<style lang="scss">
|
|
||||||
@import './chat_message.scss';
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -1,83 +0,0 @@
|
||||||
import { mapState, mapGetters } from 'vuex'
|
|
||||||
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
|
|
||||||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
||||||
import {
|
|
||||||
faSearch,
|
|
||||||
faChevronLeft
|
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
library.add(
|
|
||||||
faSearch,
|
|
||||||
faChevronLeft
|
|
||||||
)
|
|
||||||
|
|
||||||
const chatNew = {
|
|
||||||
components: {
|
|
||||||
BasicUserCard,
|
|
||||||
UserAvatar
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
suggestions: [],
|
|
||||||
userIds: [],
|
|
||||||
loading: false,
|
|
||||||
query: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async created () {
|
|
||||||
const { chats } = await this.backendInteractor.chats()
|
|
||||||
chats.forEach(chat => this.suggestions.push(chat.account))
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
users () {
|
|
||||||
return this.userIds.map(userId => this.findUser(userId))
|
|
||||||
},
|
|
||||||
availableUsers () {
|
|
||||||
if (this.query.length !== 0) {
|
|
||||||
return this.users
|
|
||||||
} else {
|
|
||||||
return this.suggestions
|
|
||||||
}
|
|
||||||
},
|
|
||||||
...mapState({
|
|
||||||
currentUser: state => state.users.currentUser,
|
|
||||||
backendInteractor: state => state.api.backendInteractor
|
|
||||||
}),
|
|
||||||
...mapGetters(['findUser'])
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
goBack () {
|
|
||||||
this.$emit('cancel')
|
|
||||||
},
|
|
||||||
goToChat (user) {
|
|
||||||
this.$router.push({ name: 'chat', params: { recipient_id: user.id } })
|
|
||||||
},
|
|
||||||
onInput () {
|
|
||||||
this.search(this.query)
|
|
||||||
},
|
|
||||||
addUser (user) {
|
|
||||||
this.selectedUserIds.push(user.id)
|
|
||||||
this.query = ''
|
|
||||||
},
|
|
||||||
removeUser (userId) {
|
|
||||||
this.selectedUserIds = this.selectedUserIds.filter(id => id !== userId)
|
|
||||||
},
|
|
||||||
search (query) {
|
|
||||||
if (!query) {
|
|
||||||
this.loading = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = true
|
|
||||||
this.userIds = []
|
|
||||||
this.$store.dispatch('search', { q: query, resolve: true, type: 'accounts' })
|
|
||||||
.then(data => {
|
|
||||||
this.loading = false
|
|
||||||
this.userIds = data.accounts.map(a => a.id)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default chatNew
|
|
|
@ -1,31 +0,0 @@
|
||||||
.chat-new {
|
|
||||||
.input-wrap {
|
|
||||||
display: flex;
|
|
||||||
margin: 0.7em 0.5em 0.7em 0.5em;
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-icon {
|
|
||||||
margin-right: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.member-list {
|
|
||||||
padding-bottom: 0.7rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.basic-user-card:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: var(--selectedPost, $fallback--lightBg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.go-back-button {
|
|
||||||
text-align: center;
|
|
||||||
line-height: 1;
|
|
||||||
height: 100%;
|
|
||||||
align-self: start;
|
|
||||||
width: var(--__panel-heading-height-inner);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
<template>
|
|
||||||
<div
|
|
||||||
class="panel-default panel chat-new"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
ref="header"
|
|
||||||
class="panel-heading"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
class="button-unstyled go-back-button"
|
|
||||||
@click="goBack"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
size="lg"
|
|
||||||
icon="chevron-left"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="input-wrap">
|
|
||||||
<div class="input-search">
|
|
||||||
<FAIcon
|
|
||||||
class="search-icon fa-scale-110 fa-old-padding"
|
|
||||||
icon="search"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<input
|
|
||||||
ref="search"
|
|
||||||
v-model="query"
|
|
||||||
placeholder="Search people"
|
|
||||||
@input="onInput"
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<div class="member-list">
|
|
||||||
<div
|
|
||||||
v-for="user in availableUsers"
|
|
||||||
:key="user.id"
|
|
||||||
class="member"
|
|
||||||
>
|
|
||||||
<div @click.capture.prevent="goToChat(user)">
|
|
||||||
<BasicUserCard :user="user" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script src="./chat_new.js"></script>
|
|
||||||
<style lang="scss">
|
|
||||||
@import '../../_variables.scss';
|
|
||||||
@import './chat_new.scss';
|
|
||||||
</style>
|
|
|
@ -1,27 +0,0 @@
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
|
||||||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
|
||||||
import RichContent from 'src/components/rich_content/rich_content.jsx'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ChatTitle',
|
|
||||||
components: {
|
|
||||||
UserAvatar,
|
|
||||||
RichContent
|
|
||||||
},
|
|
||||||
props: [
|
|
||||||
'user', 'withAvatar'
|
|
||||||
],
|
|
||||||
computed: {
|
|
||||||
title () {
|
|
||||||
return this.user ? this.user.screen_name_ui : ''
|
|
||||||
},
|
|
||||||
htmlTitle () {
|
|
||||||
return this.user ? this.user.name_html : ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getUserProfileLink (user) {
|
|
||||||
return generateProfileLink(user.id, user.screen_name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,65 +0,0 @@
|
||||||
<template>
|
|
||||||
<div
|
|
||||||
class="chat-title"
|
|
||||||
:title="title"
|
|
||||||
>
|
|
||||||
<router-link
|
|
||||||
v-if="withAvatar && user"
|
|
||||||
class="avatar-container"
|
|
||||||
:to="getUserProfileLink(user)"
|
|
||||||
>
|
|
||||||
<UserAvatar
|
|
||||||
class="titlebar-avatar"
|
|
||||||
:user="user"
|
|
||||||
/>
|
|
||||||
</router-link>
|
|
||||||
<RichContent
|
|
||||||
v-if="user"
|
|
||||||
class="username"
|
|
||||||
:title="'@'+(user && user.screen_name_ui)"
|
|
||||||
:html="htmlTitle"
|
|
||||||
:emoji="user.emoji || []"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script src="./chat_title.js"></script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
@import '../../_variables.scss';
|
|
||||||
|
|
||||||
.chat-title {
|
|
||||||
display: flex;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
--emoji-size: 14px;
|
|
||||||
|
|
||||||
.username {
|
|
||||||
max-width: 100%;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: inline;
|
|
||||||
word-wrap: break-word;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.avatar-container {
|
|
||||||
align-self: center;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titlebar-avatar {
|
|
||||||
margin-right: 0.5em;
|
|
||||||
height: 1.5em;
|
|
||||||
width: 1.5em;
|
|
||||||
border-radius: $fallback--avatarAltRadius;
|
|
||||||
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
|
|
||||||
|
|
||||||
&.animated::before {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -22,12 +22,12 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
emits: ['update:modelValue'],
|
|
||||||
props: [
|
props: [
|
||||||
'modelValue',
|
'modelValue',
|
||||||
'indeterminate',
|
'indeterminate',
|
||||||
'disabled'
|
'disabled'
|
||||||
]
|
],
|
||||||
|
emits: ['update:modelValue']
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
flex: 0 0 2em;
|
flex: 0 0 2em;
|
||||||
min-width: 2em;
|
min-width: 2em;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
height: 100%;
|
height: 2em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.computedIndicator,
|
.computedIndicator,
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
:model-value="present"
|
:model-value="present"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
class="opt"
|
class="opt"
|
||||||
@update:modelValue="$emit('update:modelValue', typeof modelValue === 'undefined' ? fallback : undefined)"
|
@update:model-value="$emit('update:modelValue', typeof modelValue === 'undefined' ? fallback : undefined)"
|
||||||
/>
|
/>
|
||||||
<div class="input color-input-field">
|
<div class="input color-input-field">
|
||||||
<input
|
<input
|
||||||
|
@ -46,7 +46,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" src="./color_input.scss"></style>
|
|
||||||
<script>
|
<script>
|
||||||
import Checkbox from '../checkbox/checkbox.vue'
|
import Checkbox from '../checkbox/checkbox.vue'
|
||||||
import { hex2rgb } from '../../services/color_convert/color_convert.js'
|
import { hex2rgb } from '../../services/color_convert/color_convert.js'
|
||||||
|
@ -108,6 +107,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" src="./color_input.scss"></style>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.color-control {
|
.color-control {
|
||||||
|
|
37
src/components/confirm_modal/confirm_modal.js
Normal file
37
src/components/confirm_modal/confirm_modal.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
import DialogModal from '../dialog_modal/dialog_modal.vue'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This component emits the following events:
|
||||||
|
* cancelled, emitted when the action should not be performed;
|
||||||
|
* accepted, emitted when the action should be performed;
|
||||||
|
*
|
||||||
|
* The caller should close this dialog after receiving any of the two events.
|
||||||
|
*/
|
||||||
|
const ConfirmModal = {
|
||||||
|
components: {
|
||||||
|
DialogModal
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
cancelText: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
confirmText: {
|
||||||
|
type: String
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onCancel () {
|
||||||
|
this.$emit('cancelled')
|
||||||
|
},
|
||||||
|
onAccept () {
|
||||||
|
this.$emit('accepted')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ConfirmModal
|
39
src/components/confirm_modal/confirm_modal.vue
Normal file
39
src/components/confirm_modal/confirm_modal.vue
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
<template>
|
||||||
|
<dialog-modal
|
||||||
|
v-body-scroll-lock="true"
|
||||||
|
class="confirm-modal"
|
||||||
|
:on-cancel="onCancel"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<span v-text="title" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<slot />
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<button
|
||||||
|
class="btn button-default"
|
||||||
|
@click.prevent="onCancel"
|
||||||
|
v-text="cancelText"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
class="btn button-default button-positive"
|
||||||
|
@click.prevent="onAccept"
|
||||||
|
v-text="confirmText"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</dialog-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./confirm_modal.js"></script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '../../_variables';
|
||||||
|
|
||||||
|
.confirm-modal {
|
||||||
|
.button-positive {
|
||||||
|
border: 3px solid var(--accent, $fallback--link);
|
||||||
|
border-radius: var(--btnRadius, $fallback--btnRadius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,6 +1,8 @@
|
||||||
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 ThreadTree from '../thread_tree/thread_tree.vue'
|
||||||
|
import { WSConnectionStatus } from '../../services/api/api.service.js'
|
||||||
|
import { mapGetters, mapState } from 'vuex'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
|
@ -77,6 +79,9 @@ const conversation = {
|
||||||
const maxDepth = this.$store.getters.mergedConfig.maxDepthInThread - 2
|
const maxDepth = this.$store.getters.mergedConfig.maxDepthInThread - 2
|
||||||
return maxDepth >= 1 ? maxDepth : 1
|
return maxDepth >= 1 ? maxDepth : 1
|
||||||
},
|
},
|
||||||
|
streamingEnabled () {
|
||||||
|
return this.mergedConfig.useStreamingApi && this.mastoUserSocketStatus === WSConnectionStatus.JOINED
|
||||||
|
},
|
||||||
displayStyle () {
|
displayStyle () {
|
||||||
return this.$store.getters.mergedConfig.conversationDisplay
|
return this.$store.getters.mergedConfig.conversationDisplay
|
||||||
},
|
},
|
||||||
|
@ -262,11 +267,11 @@ const conversation = {
|
||||||
},
|
},
|
||||||
replies () {
|
replies () {
|
||||||
let i = 1
|
let i = 1
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
return reduce(this.conversation, (result, { id, in_reply_to_status_id }) => {
|
return reduce(this.conversation, (result, { id, in_reply_to_status_id }) => {
|
||||||
/* eslint-disable camelcase */
|
|
||||||
const irid = in_reply_to_status_id
|
const irid = in_reply_to_status_id
|
||||||
/* eslint-enable camelcase */
|
|
||||||
if (irid) {
|
if (irid) {
|
||||||
result[irid] = result[irid] || []
|
result[irid] = result[irid] || []
|
||||||
result[irid].push({
|
result[irid].push({
|
||||||
|
@ -339,7 +344,11 @@ const conversation = {
|
||||||
},
|
},
|
||||||
maybeHighlight () {
|
maybeHighlight () {
|
||||||
return this.isExpanded ? this.highlight : null
|
return this.isExpanded ? this.highlight : null
|
||||||
}
|
},
|
||||||
|
...mapGetters(['mergedConfig']),
|
||||||
|
...mapState({
|
||||||
|
mastoUserSocketStatus: state => state.api.mastoUserSocketStatus
|
||||||
|
})
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Status,
|
Status,
|
||||||
|
@ -395,6 +404,11 @@ const conversation = {
|
||||||
setHighlight (id) {
|
setHighlight (id) {
|
||||||
if (!id) return
|
if (!id) return
|
||||||
this.highlight = id
|
this.highlight = id
|
||||||
|
|
||||||
|
if (!this.streamingEnabled) {
|
||||||
|
this.$store.dispatch('fetchStatus', id)
|
||||||
|
}
|
||||||
|
|
||||||
this.$store.dispatch('fetchFavsAndRepeats', id)
|
this.$store.dispatch('fetchFavsAndRepeats', id)
|
||||||
this.$store.dispatch('fetchEmojiReactionsBy', id)
|
this.$store.dispatch('fetchEmojiReactionsBy', id)
|
||||||
},
|
},
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
:controlled-set-media-playing="(newVal) => toggleStatusContentProperty(status.id, 'mediaPlaying', newVal)"
|
:controlled-set-media-playing="(newVal) => toggleStatusContentProperty(status.id, 'mediaPlaying', newVal)"
|
||||||
|
|
||||||
@goto="setHighlight"
|
@goto="setHighlight"
|
||||||
@toggleExpanded="toggleExpanded"
|
@toggle-expanded="toggleExpanded"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-if="showOtherRepliesButtonBelowStatus && getReplies(status.id).length > 1"
|
v-if="showOtherRepliesButtonBelowStatus && getReplies(status.id).length > 1"
|
||||||
|
@ -184,7 +184,7 @@
|
||||||
:toggle-status-content-property="toggleStatusContentProperty"
|
:toggle-status-content-property="toggleStatusContentProperty"
|
||||||
|
|
||||||
@goto="setHighlight"
|
@goto="setHighlight"
|
||||||
@toggleExpanded="toggleExpanded"
|
@toggle-expanded="toggleExpanded"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue