diff --git a/.gitignore b/.gitignore index df91879d..5b2b6daf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /packages/ /vector/bundle.* /vector/components.css +/vector/config.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f94f797..94ad4602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,34 @@ +Changes in [0.7.3](https://github.com/vector-im/vector-web/releases/tag/v0.7.3) (2016-06-03) +============================================================================================ +[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.2...v0.7.3) + +* Update to react-sdk 0.6.3 + +Changes in [0.7.2](https://github.com/vector-im/vector-web/releases/tag/v0.7.2) (2016-06-02) +============================================================================================ +[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.1...v0.7.2) + + * Correctly bump the dep on new matrix-js-sdk and matrix-react-sdk + +Changes in [0.7.1](https://github.com/vector-im/vector-web/releases/tag/v0.7.1) (2016-06-02) +============================================================================================ +[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.0...v0.7.1) + + * Fix accidentally committed local changes to the default config.json (doh!) + +Changes in [0.7.0](https://github.com/vector-im/vector-web/releases/tag/v0.7.0) (2016-06-02) +============================================================================================ +[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.6.1...v0.7.0) + + * Update to matrix-react-sdk 0.6.0 - see + [changelog](https://github.com/matrix-org/matrix-react-sdk/blob/v0.6.0/CHANGELOG.md) + * Style selection color. + [\#1557](https://github.com/vector-im/vector-web/pull/1557) + * Fix NPE when loading the Settings page which infini-spinnered + [\#1518](https://github.com/vector-im/vector-web/pull/1518) + * Add option to enable email notifications + [\#1469](https://github.com/vector-im/vector-web/pull/1469) + Changes in [0.6.1](https://github.com/vector-im/vector-web/releases/tag/v0.6.1) (2016-04-22) ============================================================================================ [Full Changelog](https://github.com/vector-im/vector-web/compare/v0.6.0...v0.6.1) diff --git a/package.json b/package.json index 8a47fbee..bd4c1115 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vector-web", - "version": "0.6.1", + "version": "0.7.3", "description": "Vector webapp", "author": "matrix.org", "repository": { @@ -33,6 +33,7 @@ }, "dependencies": { "babel-polyfill": "^6.5.0", + "browser-request": "^0.3.3", "classnames": "^2.1.2", "draft-js": "^0.7.0", "extract-text-webpack-plugin": "^0.9.1", @@ -42,7 +43,7 @@ "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", "linkifyjs": "^2.0.0-beta.4", - "matrix-js-sdk": "^0.5.2", + "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", "matrix-react-sdk": "matrix-org/matrix-react-sdk#develop", "modernizr": "^3.1.0", "q": "^1.4.1", diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index a9ff9c0e..7f0b5754 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -72,6 +72,8 @@ module.exports = React.createClass({ propTypes: { // The array of threepids from the JS SDK (required for email notifications) threepids: React.PropTypes.array.isRequired, + // The brand string set when creating an email pusher + brand: React.PropTypes.string, }, getDefaultProps: function() { @@ -116,7 +118,9 @@ module.exports = React.createClass({ onEnableEmailNotificationsChange: function(address, event) { var emailPusherPromise; if (event.target.checked) { - emailPusherPromise = UserSettingsStore.addEmailPusher(address); + var data = {} + data['brand'] = this.props.brand || 'Vector'; + emailPusherPromise = UserSettingsStore.addEmailPusher(address, data); } else { var emailPusher = UserSettingsStore.getEmailPusher(this.state.pushers, address); emailPusher.kind = null; diff --git a/src/skins/vector/css/common.css b/src/skins/vector/css/common.css index f179a20f..c22a7def 100644 --- a/src/skins/vector/css/common.css +++ b/src/skins/vector/css/common.css @@ -228,3 +228,13 @@ input[type=text]:focus, textarea:focus { height: 1em; vertical-align: middle; } + +::-moz-selection { + background-color: #76CFA6; + color: white; +} + +::selection { + background-color: #76CFA6; + color: white; +} diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css index 6c0218b5..cb71d481 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css @@ -36,6 +36,14 @@ limitations under the License. margin-top: 8px ! important; } +.mx_EventTile_verified { + background-color: #eaf5f0; +} + +.mx_EventTile_unverified { + background-color: #ffa0a0; +} + .mx_EventTile .mx_SenderProfile { color: #454545; opacity: 0.5; diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/MemberDeviceInfo.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/MemberDeviceInfo.css new file mode 100644 index 00000000..86a304f6 --- /dev/null +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/MemberDeviceInfo.css @@ -0,0 +1,37 @@ +/* +Copyright 2016 OpenMarket Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_MemberDeviceInfo { + font-size: 12px; + margin-top: 5px; +} + +.mx_MemberDeviceInfo div { + display: inline; + margin-right: 5px; +} + +.mx_MemberDeviceInfo_textButton { + color: #fff; + background-color: #76cfa6; + height: 20px; + border-radius: 20px; + text-align: center; + padding-left: 1em; + padding-right: 1em; + + cursor: pointer; +} diff --git a/src/vector/index.js b/src/vector/index.js index 6d966d2f..8f3701cb 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -41,8 +41,9 @@ var ReactDOM = require("react-dom"); var sdk = require("matrix-react-sdk"); sdk.loadSkin(require('../component-index')); var VectorConferenceHandler = require('../VectorConferenceHandler'); -var configJson = require("../../config.json"); var UpdateChecker = require("./updater"); +var q = require('q'); +var request = require('browser-request'); var qs = require("querystring"); @@ -112,6 +113,8 @@ function parseQs(location) { // Here, we do some crude URL analysis to allow // deep-linking. function routeUrl(location) { + if (!window.matrixChat) return; + console.log("Routing URL "+window.location); var params = parseQs(location); var loginToken = params.loginToken; @@ -182,7 +185,25 @@ window.onload = function() { } } -function loadApp() { +function getConfig() { + let deferred = q.defer(); + + request( + { method: "GET", url: "config.json", json: true }, + (err, response, body) => { + if (err || response.status < 200 || response.status >= 300) { + deferred.reject({err: err, response: response}); + return; + } + + deferred.resolve(body); + } + ); + + return deferred.promise; +} + +async function loadApp() { if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) { if (confirm("Vector runs much better as an app on iOS. Get the app?")) { window.location = "https://itunes.apple.com/us/app/vector.im/id1083446067"; @@ -190,14 +211,32 @@ function loadApp() { } } else if (/Android/.test(navigator.userAgent)) { - if (confirm("Vector runs much better as an app on Vector. Get the app?")) { + if (confirm("Vector runs much better as an app on Android. Get the app?")) { window.location = "https://play.google.com/store/apps/details?id=im.vector.alpha"; return; } } + let configJson; + let configError; + try { + configJson = await getConfig(); + } catch (e) { + // On 404 errors, carry on without a config, + // but on other errors, fail, otherwise it will + // lead to subtle errors where the app runs with + // the default config if it fails to fetch config.json. + if (e.response.status != 404) { + configError = e; + } + } + console.log("Vector starting at "+window.location); - if (validBrowser) { + if (configError) { + window.matrixChat = ReactDOM.render(