Merge branch 'develop' of github.com:vector-im/vector-web into feature-rte
This commit is contained in:
commit
b2459b2dc6
9 changed files with 139 additions and 7 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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(<div className="error">
|
||||
Unable to load config file: please refresh the page to try again.
|
||||
</div>, document.getElementById('matrixchat'));
|
||||
} else if (validBrowser) {
|
||||
var MatrixChat = sdk.getComponent('structures.MatrixChat');
|
||||
var fragParts = parseQsFromFragment(window.location);
|
||||
window.matrixChat = ReactDOM.render(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue