Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Weblate 2019-01-30 12:49:44 +00:00
commit 2cc6f36b68
23 changed files with 1214 additions and 466 deletions

View file

@ -1,5 +1,6 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -21,9 +22,9 @@ import { _t } from 'matrix-react-sdk/lib/languageHandler';
import SettingsStore from 'matrix-react-sdk/lib/settings/SettingsStore';
module.exports = React.createClass({
displayName: 'VectorLoginFooter',
displayName: 'VectorAuthFooter',
statics: {
replaces: 'LoginFooter',
replaces: 'AuthFooter',
},
render: function() {
@ -32,11 +33,11 @@ module.exports = React.createClass({
if (SettingsStore.getValue("theme") === 'status') return <div />;
return (
<div className="mx_Login_links">
<a href="https://medium.com/@RiotChat">blog</a>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="https://twitter.com/@RiotChat">twitter</a>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="https://github.com/vector-im/riot-web">github</a>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="https://matrix.org">{ _t('powered by Matrix') }</a>
<div className="mx_AuthFooter">
<a href="https://medium.com/@RiotChat" target="_blank" rel="noopener">blog</a>
<a href="https://twitter.com/@RiotChat" target="_blank" rel="noopener">twitter</a>
<a href="https://github.com/vector-im/riot-web" target="_blank" rel="noopener">github</a>
<a href="https://matrix.org" target="_blank" rel="noopener">{ _t('powered by Matrix') }</a>
</div>
);
},

View file

@ -1,5 +1,6 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -23,9 +24,9 @@ const i = [1, 2, 3, 4, 5][Math.floor(Math.random() * 5)];
const DEFAULT_LOGO_URI = "themes/riot/img/logos/riot-im-logo-" + i + ".svg";
module.exports = React.createClass({
displayName: 'VectorLoginHeader',
displayName: 'VectorAuthHeaderLogo',
statics: {
replaces: 'LoginHeader',
replaces: 'AuthHeaderLogo',
},
propTypes: {
icon: PropTypes.string,
@ -33,10 +34,8 @@ module.exports = React.createClass({
render: function() {
return (
<div className="mx_Login_header">
<div className="mx_Login_logo">
<img src={this.props.icon || DEFAULT_LOGO_URI} alt="Riot" />
</div>
<div className="mx_AuthHeaderLogo">
<img src={this.props.icon || DEFAULT_LOGO_URI} alt="Riot" />
</div>
);
},

View file

@ -16,9 +16,12 @@ limitations under the License.
*/
const React = require("react");
const sanitizeHtml = require("sanitize-html");
import { _t } from 'matrix-react-sdk/lib/languageHandler';
/**
* This is identical to `CustomServerDialog` except for replacing "this app"
* with "Riot".
*/
module.exports = React.createClass({
displayName: 'VectorCustomServerDialog',
statics: {
@ -32,13 +35,17 @@ module.exports = React.createClass({
{ _t('Custom Server Options') }
</div>
<div className="mx_Dialog_content">
<span dangerouslySetInnerHTML={{__html: sanitizeHtml(_t(
"You can use the custom server options to sign into other Matrix "+
"servers by specifying a different Home server URL.<br/>This allows "+
"you to use Riot with an existing Matrix account on a different home "+
"server.<br/><br/>You can also set a custom identity server but you won't "+
"be able to invite users by email address, or be invited by email address yourself.",
))}} />
<p>{_t(
"You can use the custom server options to sign into other " +
"Matrix servers by specifying a different homeserver URL. This " +
"allows you to use Riot with an existing Matrix account on a " +
"different homeserver.",
)}</p>
<p>{_t(
"You can also set a custom identity server, but you won't be " +
"able to invite users by email address, or be invited by email " +
"address yourself.",
)}</p>
</div>
<div className="mx_Dialog_buttons">
<button onClick={this.props.onFinished} autoFocus={true}>

View file

@ -1,13 +1,13 @@
{
"Riot is not supported on mobile web. Install the app?": "Riot is not supported on mobile web. Install the app?",
"Riot Desktop on %(platformName)s": "Riot Desktop on %(platformName)s",
"Unknown device": "Unknown device",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s on %(osName)s",
"You need to be using HTTPS to place a screen-sharing call.": "You need to be using HTTPS to place a screen-sharing call.",
"Custom Server Options": "Custom Server Options",
"You can use the custom server options to sign into other Matrix servers by specifying a different Home server URL.<br/>This allows you to use Riot with an existing Matrix account on a different home server.<br/><br/>You can also set a custom identity server but you won't be able to invite users by email address, or be invited by email address yourself.": "You can use the custom server options to sign into other Matrix servers by specifying a different Home server URL.<br/>This allows you to use Riot with an existing Matrix account on a different home server.<br/><br/>You can also set a custom identity server but you won't be able to invite users by email address, or be invited by email address yourself.",
"Dismiss": "Dismiss",
"powered by Matrix": "powered by Matrix",
"Custom Server Options": "Custom Server Options",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.",
"You can also set a custom identity server, but you won't be able to invite users by email address, or be invited by email address yourself.": "You can also set a custom identity server, but you won't be able to invite users by email address, or be invited by email address yourself.",
"Dismiss": "Dismiss",
"Welcome to Riot.im": "Welcome to Riot.im",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Decentralised, encrypted chat &amp; collaboration powered by [matrix]",
"Search the room directory": "Search the room directory",

View file

@ -34,13 +34,13 @@
} %>
</head>
<body style="height: 100%;">
<section id="matrixchat" style="height: 100%;"></section>
<section id="matrixchat" style="height: 100%; overflow: auto;"></section>
<noscript>Sorry, Riot requires JavaScript to be enabled.</noscript> <!-- TODO: Translate this? -->
<script>
window.vector_indexeddb_worker_script = '<%= htmlWebpackPlugin.files.chunks['indexeddb-worker'].entry %>';
</script>
<script src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script>
<img src="img/warning.svg" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<audio id="messageAudio">
<source src="media/message.ogg" type="audio/ogg" />
<source src="media/message.mp3" type="audio/mpeg" />

View file

@ -24,6 +24,8 @@ require('gfm.css/gfm.css');
require('highlight.js/styles/github.css');
require('draft-js/dist/Draft.css');
import olmWasmPath from 'olm/olm.wasm';
import './rageshakesetup';
import React from 'react';
@ -140,7 +142,7 @@ function onNewScreen(screen) {
// so in that instance, hardcode to use riot.im/app for now instead.
function makeRegistrationUrl(params) {
let url;
if (window.location.protocol === "file:") {
if (window.location.protocol === "vector:") {
url = 'https://riot.im/app/#/register';
} else {
url = (
@ -279,7 +281,7 @@ async function loadApp() {
// as quickly as we possibly can, set a default theme...
let a;
const theme = SettingsStore.getValue("theme");
const theme = "dharma";//SettingsStore.getValue("theme");
for (let i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
const href = a.getAttribute("href");
if (!href) continue;
@ -379,18 +381,19 @@ function loadOlm() {
*
* We also need to tell the Olm js to look for its wasm file at the same
* level as index.html. It really should be in the same place as the js,
* ie. in the bundle directory, to avoid caching issues, but as far as I
* can tell this is completely impossible with webpack.
* ie. in the bundle directory, but as far as I can tell this is
* completely impossible with webpack. We do, however, use a hashed
* filename to avoid caching issues.
*/
return Olm.init({
locateFile: () => 'olm.wasm',
locateFile: () => olmWasmPath,
}).then(() => {
console.log("Using WebAssembly Olm");
}).catch((e) => {
console.log("Failed to load Olm: trying legacy version");
return new Promise((resolve, reject) => {
const s = document.createElement('script');
s.src = 'olm_legacy.js';
s.src = 'olm_legacy.js'; // XXX: This should be cache-busted too
s.onload = resolve;
s.onerror = reject;
document.body.appendChild(s);

View file

@ -28,17 +28,17 @@ const ipcRenderer = window.ipcRenderer;
function platformFriendlyName(): string {
// used to use window.process but the same info is available here
if (navigator.userAgent.indexOf('Macintosh')) {
if (navigator.userAgent.includes('Macintosh')) {
return 'macOS';
} else if (navigator.userAgent.indexOf('FreeBSD')) {
} else if (navigator.userAgent.includes('FreeBSD')) {
return 'FreeBSD';
} else if (navigator.userAgent.indexOf('OpenBSD')) {
} else if (navigator.userAgent.includes('OpenBSD')) {
return 'OpenBSD';
} else if (navigator.userAgent.indexOf('SunOS')) {
} else if (navigator.userAgent.includes('SunOS')) {
return 'SunOS';
} else if (navigator.userAgent.indexOf('Windows')) {
} else if (navigator.userAgent.includes('Windows')) {
return 'Windows';
} else if (navigator.userAgent.indexOf('Linux')) {
} else if (navigator.userAgent.includes('Linux')) {
return 'Linux';
} else {
return 'Unknown';
@ -136,7 +136,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
// maybe we should pass basic styling (italics, bold, underline) through from MD
// we only have to strip out < and > as the spec doesn't include anything about things like &amp;
// so we shouldn't assume that all implementations will treat those properly. Very basic tag parsing is done.
if (navigator.userAgent.indexOf('Linux')) {
if (navigator.userAgent.includes('Linux')) {
msg = msg.replace(/</g, '&lt;').replace(/>/g, '&gt;');
}