Skip to content

Commit 762f6aa

Browse files
author
nostradamos
committed
Merge remote-tracking branch 'upstream/develop' into fix_4821
2 parents 3600d1c + cf47b91 commit 762f6aa

80 files changed

Lines changed: 1803 additions & 325 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/ISSUE_TEMPLATE.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- Please report security issues by email to security@matrix.org -->
2+
13
<!-- This is a bug report template. By following the instructions below and
24
filling out the sections with your information, you will help the us to get all
35
the necessary data to fix your issue.

‎AUTHORS.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ include:
1313

1414
* Michael Telatynski (https://github.com/t3chguy)
1515
Improved consistency of inverted elements in dark theme across browsers
16+
17+
* Alexandr Korsak (https://github.com/oivoodoo)
18+
Improved multiple file uploading

‎config.sample.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"default_hs_url": "https://matrix.org",
33
"default_is_url": "https://vector.im",
4+
"disable_custom_urls": false,
5+
"disable_guests": false,
6+
"disable_login_language_selector": false,
7+
"disable_3pid_login": false,
48
"brand": "Riot",
59
"integrations_ui_url": "https://scalar.vector.im/",
610
"integrations_rest_url": "https://scalar.vector.im/api",
@@ -10,6 +14,8 @@
1014
"feature_pinning": "labs"
1115
},
1216
"default_federate": true,
17+
"welcomePageUrl": "home.html",
18+
"default_theme": "light",
1319
"roomDirectory": {
1420
"servers": [
1521
"matrix.org"

‎docs/skinning thoughts.md‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
== Skinning refactor ==
2+
3+
matrix-react-sdk
4+
- base images
5+
- base CSS
6+
- all the components needed to build a workable app (including the top layer)
7+
8+
riot-web: the riot skin
9+
- riot-specific classes (e.g. login header/footer)
10+
- riot-specific themes
11+
- light
12+
- dark
13+
14+
i.e. the only things which should go into riot-web are bits which apply vector-specific skinning
15+
specifically "Stuff that any other brand would not want to use. (e.g. riot logos, links, T&Cs)"
16+
- Questions:
17+
- Electron app? (should probably be a separate repo in its own right? but might as well go here for now)
18+
- index.html & index.js? (should be in matrix-react-sdk, given the SDK is useless without them?)
19+
20+
ideally matrix-react-sdk itself should ship with a default skin which actually works built in.
21+
22+
status skin (can go in the same app for now)
23+
- has status theme
24+
- which inherits from riot light theme
25+
- how do we share graphics between skins?
26+
- shove them into react-sdk, or...
27+
- guess we do ../../vector/img
28+
- this means keeping the skin name in the images (unless /img is a shortcut to the right skin's images)
29+
30+
out of scope:
31+
- making the components more independent, so they can be used in isolation.
32+
- that said, the bits which should probably be used by being embeded into a different app:
33+
- login/reg
34+
- RoomView + RoomSettings
35+
- MessageComposer
36+
- RoomList
37+
- MemberList
38+
- MemberInfo
39+
- Voip UI
40+
- UserSettings
41+
- sharing different js-sdks between the different isolated modules
42+
43+
other changes:
44+
- how do we handle i18n?
45+
- each skin should really be its own i18n project. As long as all the commonality stuff is in matrix-react-sdk this shouldn't be too bad.
46+
- ability to associate components with a given skin
47+
- skins/vector/src <-- components
48+
- skins/vector/css
49+
- skins/vector/img
50+
- skins/vector/fonts
51+
- gather together themes (per skin) into a single place too
52+
- skins/vector/themes/foo/css
53+
- skins/vector/themes/foo/img
54+
- skins/vector/themes/foo/fonts
55+
- ideally riot-web would contain almost nothing but skins/vector directory.
56+
- ability to entirely replace CSS rather than override it for a given theme
57+
- e.g. if we replace `Login.js` with `StatusLogin.js`, then we should similarly be able to replace `_Login.scss` with `_StatusLogin.scss`.
58+
59+
random thoughts;
60+
- should we be able to change the entire skin at runtime (more like wordpress) - to the extent of replacing entire components?
61+
- might pose security issues if a theme can be swapped out to replace MatrixChat or other fundamental functionality at runtime
62+
- if so, perhaps skins & themes should converge...
63+
64+
-----------------
65+
66+
Immediate plan for Status:
67+
* Implement it as a theme for the riot skin
68+
* Ideally move skins to a sensible level (possibly even including src?)

‎docs/translating-dev.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ function getColorName(hex) {
3636
## Adding variables inside a string.
3737

3838
1. Extend your ``_t()`` call. Instead of ``_t(STRING)`` use ``_t(STRING, {})``
39-
2. Decide how to name it. Please think about if the person who has to translate it can understand what it does.
40-
3. Add it to the array in ``_t`` for example ``_t(STRING, {variable: this.variable})``
41-
4. Add the variable inside the string. The syntax for variables is ``%(variable)s``. Please note the s at the end. The name of the variable has to match the previous used name.
39+
1. Decide how to name it. Please think about if the person who has to translate it can understand what it does. E.g. using the name 'recipient' is bad, because a translator does not know if it is the name of a person, an email address, a user ID, etc. Rather use e.g. recipientEmailAddress.
40+
1. Add it to the array in ``_t`` for example ``_t(STRING, {variable: this.variable})``
41+
1. Add the variable inside the string. The syntax for variables is ``%(variable)s``. Please note the _s_ at the end. The name of the variable has to match the previous used name.
42+
43+
- You can use the special ``count`` variable to choose between multiple versions of the same string, in order to get the correct pluralization. E.g. ``_t('You have %(count)s new messages', { count: 2 })`` would show 'You have 2 new messages', while ``_t('You have %(count)s new messages', { count: 1 })`` would show 'You have one new message' (assuming a singular version of the string has been added to the translation file. See above). Passing in ``count`` is much prefered over having an if-statement choose the correct string to use, because some languages have much more complicated plural rules than english (e.g. they might need a completely different form if there are three things rather than two).
44+
- If you want to translate text that includes e.g. hyperlinks or other HTML you have to also use tag substitution, e.g. ``_t('<a>Click here!</a>', {}, { 'a': (sub) => <a>{sub}</a> })``. If you don't do the tag substitution you will end up showing literally '<a>' rather than making a hyperlink.
45+
- You can also use React components with normal variable substitution if you want to insert HTML markup, e.g. ``_t('Your email address is %(emailAddress)s', { emailAddress: <i>{userEmailAddress}</i> })``.
4246

4347
## Things to know/Style Guides
4448

@@ -47,3 +51,5 @@ function getColorName(hex) {
4751
- If a string is presented in the UI with punctuation like a full stop, include this in the translation strings, since punctuation varies between languages too.
4852
- Avoid "translation in parts", i.e. concatenating translated strings or using translated strings in variable substitutions. Context is important for translations, and translating partial strings this way is simply not always possible.
4953
- Concatenating strings often also introduces an implicit assumption about word order (e.g. that the subject of the sentence comes first), which is incorrect for many languages.
54+
- Translation 'smell test': If you have a string that does not begin with a capital letter (is not the start of a sentence) or it ends with e.g. ':' or a preposition (e.g. 'to') you should recheck that you are not trying to translate a partial sentence.
55+
- If you have multiple strings, that are almost identical, except some part (e.g. a word or two) it is still better to translate the full sentence multiple times. It may seem like inefficient repetion, but unlike programming where you try to minimize repetition, translation is much faster if you have many, full, clear, sentences to work with, rather than fewer, but incomplete sentence fragments.

‎electron_app/riot.im/config.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"brand": "Riot",
66
"integrations_ui_url": "https://scalar.vector.im/",
77
"integrations_rest_url": "https://scalar.vector.im/api",
8+
"integrations_widgets_urls": [
9+
"https://scalar-staging.riot.im/scalar/api",
10+
"https://scalar.vector.im/api"
11+
],
812
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
913
"welcomeUserId": "@riot-bot:matrix.org",
1014
"roomDirectory": {

‎res/home-status.html‎

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
<style type="text/css">
2+
3+
/* we deliberately inline style here to avoid flash-of-CSS problems, and to avoid
4+
* voodoo where we have to set display: none by default
5+
*/
6+
7+
.mx_HomePage_container {
8+
text-align: center;
9+
display: block ! important;
10+
width: 690px;
11+
margin: 20px;
12+
}
13+
14+
.mx_HomePage_header {
15+
margin-top: 37px;
16+
margin-left: 10px;
17+
width: 670px;
18+
box-sizing: border-box;
19+
font-size: 18px;
20+
background-color: #fff;
21+
box-shadow: 0px 2px 10px 0px rgba(48,55,81,0.05);
22+
border-radius: 5px;
23+
padding: 20px 80px 20px 80px;
24+
align-items: center;
25+
}
26+
27+
.mx_HomePage_header h1 {
28+
font-size: 29px;
29+
margin-bottom: 10px;
30+
}
31+
32+
.mx_HomePage_intro h2 {
33+
margin-top: 32px;
34+
font-size: 25px;
35+
color: #49555F;
36+
}
37+
38+
.mx_HomePage_intro {
39+
margin: auto;
40+
width: 600px;
41+
margin-top: 40px;
42+
margin-bottom: 40px;
43+
font-size: 18px;
44+
}
45+
46+
.mx_HomePage_coc {
47+
font-size: 16px;
48+
}
49+
50+
.mx_HomePage_coc a {
51+
color: #4360DF;
52+
}
53+
54+
.mx_HomePage_room, .mx_HomePage_telegram {
55+
float: left;
56+
background-color: #fff;
57+
box-shadow: 0px 2px 10px 0px rgba(48,55,81,0.05);
58+
border-radius: 5px;
59+
margin: 10px;
60+
width: 210px;
61+
height: 250px;
62+
display: flex;
63+
flex-direction: column;
64+
align-items: center;
65+
}
66+
67+
.mx_HomePage_telegram {
68+
background-color: transparent;
69+
border: 1px solid rgba(113, 129, 142, 0.2);
70+
box-shadow: none;
71+
display: flex;
72+
align-items: center;
73+
justify-content: center;
74+
flex-direction: column;
75+
font-size: 16px;
76+
line-height: 25px;
77+
box-sizing: border-box;
78+
}
79+
80+
.mx_HomePage_telegram a {
81+
text-transform: uppercase;
82+
color: #4360DF;
83+
font-size: 13px;
84+
font-family: PostGrotesk-Medium, Arial, Helvetica, Sans-Serif;
85+
font-weight: 600;
86+
opacity: 1.0;
87+
transition: opacity .2s ease;
88+
}
89+
90+
.mx_HomePage_telegram a:hover {
91+
opacity: 0.5;
92+
}
93+
94+
.mx_HomePage_room .mx_HomePage_icon {
95+
margin-top: 24px;
96+
margin-bottom: 16px;
97+
width: 50px;
98+
height: 50px;
99+
}
100+
101+
.mx_HomePage_room .mx_HomePage_name {
102+
display: block;
103+
font-family: PostGrotesk-Medium, Arial, Helvetica, Sans-Serif;
104+
font-weight: 600;
105+
font-size: 15px;
106+
color: #49555F;
107+
line-height: 25px;
108+
margin: 0px 12px 0px 12px;
109+
}
110+
111+
.mx_HomePage_room .mx_HomePage_desc {
112+
flex: 1;
113+
display: block;
114+
margin: 0px 12px 0px 12px;
115+
font-size: 14px;
116+
line-height: 20px;
117+
}
118+
119+
.mx_HomePage_button {
120+
align-self: normal;
121+
margin: 12px;
122+
border-radius: 8px;
123+
border: 1px solid rgba(199, 206, 209, 0.12);
124+
background-color: #6CC1F6;
125+
font-size: 13px;
126+
font-family: PostGrotesk-Medium, Arial, Helvetica, Sans-Serif;
127+
font-weight: 600;
128+
text-transform: uppercase;
129+
letter-spacing: 1px;
130+
color: #fff ! important;
131+
cursor: pointer;
132+
outline: none;
133+
padding: 14px;
134+
box-sizing: border-box;
135+
padding-left: 1.5em;
136+
padding-right: 1.5em;
137+
}
138+
139+
</style>
140+
141+
<div class="mx_HomePage_container">
142+
<div class="mx_HomePage_header">
143+
<div>
144+
<h1>Welcome to Status Community Chat, powered by Riot.</h1>
145+
<p>For contributors, developers and Ethereum-enthusiasts who care about the movement for decentralization.</p>
146+
</div>
147+
</div>
148+
149+
<div class="mx_HomePage_intro">
150+
<h2>Our rooms</h2>
151+
<p>Please abide by the channels discussion categories and remain on topic to the specific category details listed.</p>
152+
<p class="mx_HomePage_coc">Before posting please refer to our <a href="https://wiki.status.im/Code_of_conduct">Code of Conduct</a></p>
153+
</div>
154+
155+
156+
<div class="mx_HomePage_room">
157+
<img class="mx_HomePage_icon" src="themes/status/img/a.png">
158+
<span class="mx_HomePage_name">#announcements</span>
159+
<span class="mx_HomePage_desc">Company wide announcements.</span>
160+
<a class="mx_HomePage_button" href="#/room/#announcements:status.im">Join</a>
161+
</div>
162+
<div class="mx_HomePage_room">
163+
<img class="mx_HomePage_icon" src="themes/status/img/i.png">
164+
<span class="mx_HomePage_name">#introductions</span>
165+
<span class="mx_HomePage_desc">Newcomer introductions.</span>
166+
<a class="mx_HomePage_button" href="#/room/#introductions:status.im">Join</a>
167+
</div>
168+
<div class="mx_HomePage_room">
169+
<img class="mx_HomePage_icon" src="themes/status/img/g.png">
170+
<span class="mx_HomePage_name">#general</span>
171+
<span class="mx_HomePage_desc">General discussions of Status.</span>
172+
<a class="mx_HomePage_button" href="#/room/#general:status.im">Join</a>
173+
</div>
174+
<div class="mx_HomePage_room">
175+
<img class="mx_HomePage_icon" src="themes/status/img/d.png">
176+
<span class="mx_HomePage_name">#dev-status</span>
177+
<span class="mx_HomePage_desc">Contributing to our codebase? Building a DApp or a chatbot? We're here to help.</span>
178+
<a class="mx_HomePage_button" href="#/room/#dev-status:status.im">Join</a>
179+
</div>
180+
<div class="mx_HomePage_room">
181+
<img class="mx_HomePage_icon" src="themes/status/img/n.png">
182+
<span class="mx_HomePage_name">#news-articles</span>
183+
<span class="mx_HomePage_desc">Share news, articles related to Ethereum or projects you're excited about</span>
184+
<a class="mx_HomePage_button" href="#/room/#news-articles:status.im">Join</a>
185+
</div>
186+
<div class="mx_HomePage_telegram">
187+
<p>
188+
Interested in market and cryptocurrency type discussions?
189+
</p>
190+
<a href="https://t.me/StatusNetworkChat">Join Telegram</a>
191+
</div>
192+
</div>

‎scripts/copy-res.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ const INCLUDE_LANGS = [
4343
const COPY_LIST = [
4444
["res/manifest.json", "webapp"],
4545
["res/home.html", "webapp"],
46+
["res/home-status.html", "webapp"],
4647
["res/home/**", "webapp/home"],
4748
["res/{media,vector-icons}/**", "webapp"],
4849
["res/flags/*", "webapp/flags/"],
49-
["src/skins/vector/{fonts,img}/**", "webapp"],
50+
["src/skins/vector/{fonts,img,themes}/**", "webapp"],
5051
["node_modules/emojione/assets/svg/*", "webapp/emojione/svg/"],
5152
["node_modules/emojione/assets/png/*", "webapp/emojione/png/"],
5253
["./config.json", "webapp", { directwatch: 1 }],

‎src/components/structures/BottomLeftMenu.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import sdk from 'matrix-react-sdk';
2121
import dis from 'matrix-react-sdk/lib/dispatcher';
2222
import Velocity from 'velocity-vector';
2323
import 'velocity-vector/velocity.ui';
24-
import UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore';
24+
import SettingsStore from "matrix-react-sdk/lib/settings/SettingsStore";
2525

2626
const CALLOUT_ANIM_DURATION = 1000;
2727

0 commit comments

Comments
 (0)