Skip to content

Commit b2459b2

Browse files
committed
Merge branch 'develop' of github.com:vector-im/vector-web into feature-rte
2 parents 819e06e + b7f1a3d commit b2459b2

9 files changed

Lines changed: 139 additions & 7 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/packages/
88
/vector/bundle.*
99
/vector/components.css
10+
/vector/config.json

‎CHANGELOG.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
Changes in [0.7.3](https://github.com/vector-im/vector-web/releases/tag/v0.7.3) (2016-06-03)
2+
============================================================================================
3+
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.2...v0.7.3)
4+
5+
* Update to react-sdk 0.6.3
6+
7+
Changes in [0.7.2](https://github.com/vector-im/vector-web/releases/tag/v0.7.2) (2016-06-02)
8+
============================================================================================
9+
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.1...v0.7.2)
10+
11+
* Correctly bump the dep on new matrix-js-sdk and matrix-react-sdk
12+
13+
Changes in [0.7.1](https://github.com/vector-im/vector-web/releases/tag/v0.7.1) (2016-06-02)
14+
============================================================================================
15+
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.0...v0.7.1)
16+
17+
* Fix accidentally committed local changes to the default config.json (doh!)
18+
19+
Changes in [0.7.0](https://github.com/vector-im/vector-web/releases/tag/v0.7.0) (2016-06-02)
20+
============================================================================================
21+
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.6.1...v0.7.0)
22+
23+
* Update to matrix-react-sdk 0.6.0 - see
24+
[changelog](https://github.com/matrix-org/matrix-react-sdk/blob/v0.6.0/CHANGELOG.md)
25+
* Style selection color.
26+
[\#1557](https://github.com/vector-im/vector-web/pull/1557)
27+
* Fix NPE when loading the Settings page which infini-spinnered
28+
[\#1518](https://github.com/vector-im/vector-web/pull/1518)
29+
* Add option to enable email notifications
30+
[\#1469](https://github.com/vector-im/vector-web/pull/1469)
31+
132
Changes in [0.6.1](https://github.com/vector-im/vector-web/releases/tag/v0.6.1) (2016-04-22)
233
============================================================================================
334
[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.6.0...v0.6.1)

‎package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vector-web",
3-
"version": "0.6.1",
3+
"version": "0.7.3",
44
"description": "Vector webapp",
55
"author": "matrix.org",
66
"repository": {
@@ -33,6 +33,7 @@
3333
},
3434
"dependencies": {
3535
"babel-polyfill": "^6.5.0",
36+
"browser-request": "^0.3.3",
3637
"classnames": "^2.1.2",
3738
"draft-js": "^0.7.0",
3839
"extract-text-webpack-plugin": "^0.9.1",
@@ -42,7 +43,7 @@
4243
"gfm.css": "^1.1.1",
4344
"highlight.js": "^9.0.0",
4445
"linkifyjs": "^2.0.0-beta.4",
45-
"matrix-js-sdk": "^0.5.2",
46+
"matrix-js-sdk": "matrix-org/matrix-js-sdk#develop",
4647
"matrix-react-sdk": "matrix-org/matrix-react-sdk#develop",
4748
"modernizr": "^3.1.0",
4849
"q": "^1.4.1",

‎src/components/views/settings/Notifications.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ module.exports = React.createClass({
7272
propTypes: {
7373
// The array of threepids from the JS SDK (required for email notifications)
7474
threepids: React.PropTypes.array.isRequired,
75+
// The brand string set when creating an email pusher
76+
brand: React.PropTypes.string,
7577
},
7678

7779
getDefaultProps: function() {
@@ -116,7 +118,9 @@ module.exports = React.createClass({
116118
onEnableEmailNotificationsChange: function(address, event) {
117119
var emailPusherPromise;
118120
if (event.target.checked) {
119-
emailPusherPromise = UserSettingsStore.addEmailPusher(address);
121+
var data = {}
122+
data['brand'] = this.props.brand || 'Vector';
123+
emailPusherPromise = UserSettingsStore.addEmailPusher(address, data);
120124
} else {
121125
var emailPusher = UserSettingsStore.getEmailPusher(this.state.pushers, address);
122126
emailPusher.kind = null;

‎src/skins/vector/css/common.css‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,13 @@ input[type=text]:focus, textarea:focus {
228228
height: 1em;
229229
vertical-align: middle;
230230
}
231+
232+
::-moz-selection {
233+
background-color: #76CFA6;
234+
color: white;
235+
}
236+
237+
::selection {
238+
background-color: #76CFA6;
239+
color: white;
240+
}

‎src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ limitations under the License.
3636
margin-top: 8px ! important;
3737
}
3838

39+
.mx_EventTile_verified {
40+
background-color: #eaf5f0;
41+
}
42+
43+
.mx_EventTile_unverified {
44+
background-color: #ffa0a0;
45+
}
46+
3947
.mx_EventTile .mx_SenderProfile {
4048
color: #454545;
4149
opacity: 0.5;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
Copyright 2016 OpenMarket Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_MemberDeviceInfo {
18+
font-size: 12px;
19+
margin-top: 5px;
20+
}
21+
22+
.mx_MemberDeviceInfo div {
23+
display: inline;
24+
margin-right: 5px;
25+
}
26+
27+
.mx_MemberDeviceInfo_textButton {
28+
color: #fff;
29+
background-color: #76cfa6;
30+
height: 20px;
31+
border-radius: 20px;
32+
text-align: center;
33+
padding-left: 1em;
34+
padding-right: 1em;
35+
36+
cursor: pointer;
37+
}

‎src/vector/index.js‎

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ var ReactDOM = require("react-dom");
4141
var sdk = require("matrix-react-sdk");
4242
sdk.loadSkin(require('../component-index'));
4343
var VectorConferenceHandler = require('../VectorConferenceHandler');
44-
var configJson = require("../../config.json");
4544
var UpdateChecker = require("./updater");
45+
var q = require('q');
46+
var request = require('browser-request');
4647

4748
var qs = require("querystring");
4849

@@ -112,6 +113,8 @@ function parseQs(location) {
112113
// Here, we do some crude URL analysis to allow
113114
// deep-linking.
114115
function routeUrl(location) {
116+
if (!window.matrixChat) return;
117+
115118
console.log("Routing URL "+window.location);
116119
var params = parseQs(location);
117120
var loginToken = params.loginToken;
@@ -182,22 +185,58 @@ window.onload = function() {
182185
}
183186
}
184187

185-
function loadApp() {
188+
function getConfig() {
189+
let deferred = q.defer();
190+
191+
request(
192+
{ method: "GET", url: "config.json", json: true },
193+
(err, response, body) => {
194+
if (err || response.status < 200 || response.status >= 300) {
195+
deferred.reject({err: err, response: response});
196+
return;
197+
}
198+
199+
deferred.resolve(body);
200+
}
201+
);
202+
203+
return deferred.promise;
204+
}
205+
206+
async function loadApp() {
186207
if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
187208
if (confirm("Vector runs much better as an app on iOS. Get the app?")) {
188209
window.location = "https://itunes.apple.com/us/app/vector.im/id1083446067";
189210
return;
190211
}
191212
}
192213
else if (/Android/.test(navigator.userAgent)) {
193-
if (confirm("Vector runs much better as an app on Vector. Get the app?")) {
214+
if (confirm("Vector runs much better as an app on Android. Get the app?")) {
194215
window.location = "https://play.google.com/store/apps/details?id=im.vector.alpha";
195216
return;
196217
}
197218
}
198219

220+
let configJson;
221+
let configError;
222+
try {
223+
configJson = await getConfig();
224+
} catch (e) {
225+
// On 404 errors, carry on without a config,
226+
// but on other errors, fail, otherwise it will
227+
// lead to subtle errors where the app runs with
228+
// the default config if it fails to fetch config.json.
229+
if (e.response.status != 404) {
230+
configError = e;
231+
}
232+
}
233+
199234
console.log("Vector starting at "+window.location);
200-
if (validBrowser) {
235+
if (configError) {
236+
window.matrixChat = ReactDOM.render(<div className="error">
237+
Unable to load config file: please refresh the page to try again.
238+
</div>, document.getElementById('matrixchat'));
239+
} else if (validBrowser) {
201240
var MatrixChat = sdk.getComponent('structures.MatrixChat');
202241
var fragParts = parseQsFromFragment(window.location);
203242
window.matrixChat = ReactDOM.render(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"default_hs_url": "https://matrix.org",
33
"default_is_url": "https://vector.im",
4+
"brand": "Vector",
45
"integrations_ui_url": "http://localhost:8081/",
56
"integrations_rest_url": "http://localhost:5050"
67
}

0 commit comments

Comments
 (0)