Compare commits

..

7 Commits

Author SHA1 Message Date
Travis Ralston
6fd28421b3 Appease random package in wrapper 2021-03-15 16:59:11 -06:00
Travis Ralston
e13cb66e32 Merge branch 'develop' into travis/inline-widgets 2021-03-15 16:37:40 -06:00
Travis Ralston
b06de25898 Update lockfiles 2020-03-16 19:29:31 -06:00
Travis Ralston
62a152b68a Update webpack 2020-03-16 19:24:58 -06:00
Travis Ralston
fe831dc8dd Merge branch 'develop' into travis/inline-widgets 2020-03-16 19:23:49 -06:00
Travis Ralston
7ff2b598af Wrapper for inline widget HTML 2019-06-14 19:49:06 -06:00
Travis Ralston
1b8fe9e782 Docs for inline widgets feature 2019-06-14 15:40:58 -06:00
35 changed files with 375 additions and 587 deletions

View File

@@ -7,14 +7,14 @@ assignees: ''
---
#### Is your suggestion related to a problem? Please describe.
**Is your suggestion related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
#### Describe the solution you'd like.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
#### Describe alternatives you've considered.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
#### Additional context
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -1,3 +0,0 @@
<!-- Please read CONTRIBUTING.md before submitting your pull request -->
<!-- Include a Sign-Off at the end of your Pull Request (as described in CONTRIBUTING.md), or on every commit -->

View File

@@ -1,87 +1,3 @@
Changes in [1.7.26](https://github.com/vector-im/element-web/releases/tag/v1.7.26) (2021-04-26)
===============================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.26-rc.1...v1.7.26)
* Upgrade to React SDK 3.19.0 and JS SDK 10.0.0
Changes in [1.7.26-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.26-rc.1) (2021-04-21)
=========================================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.25...v1.7.26-rc.1)
* Upgrade to React SDK 3.19.0-rc.1 and JS SDK 10.0.0-rc.1
* Translations update from Weblate
[\#17031](https://github.com/vector-im/element-web/pull/17031)
* Bump ssri from 6.0.1 to 6.0.2
[\#17010](https://github.com/vector-im/element-web/pull/17010)
* Fix `NODE_ENV` value for CI environments
[\#17003](https://github.com/vector-im/element-web/pull/17003)
* Use React production mode in CI builds
[\#16969](https://github.com/vector-im/element-web/pull/16969)
* Labs documentation for DND mode
[\#16962](https://github.com/vector-im/element-web/pull/16962)
* Rename blackboxing to new option ignore list
[\#16965](https://github.com/vector-im/element-web/pull/16965)
* Remove velocity-animate from lockfile
[\#16963](https://github.com/vector-im/element-web/pull/16963)
* Add mobile download link configuration
[\#16890](https://github.com/vector-im/element-web/pull/16890)
* Switch develop to not-staging Scalar by default
[\#16883](https://github.com/vector-im/element-web/pull/16883)
* Support a config option to skip login/welcome and go to SSO
[\#16880](https://github.com/vector-im/element-web/pull/16880)
Changes in [1.7.25](https://github.com/vector-im/element-web/releases/tag/v1.7.25) (2021-04-12)
===============================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.25-rc.1...v1.7.25)
* Upgrade to React SDK 3.18.0 and JS SDK 9.11.0
Changes in [1.7.25-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.25-rc.1) (2021-04-07)
=========================================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.24...v1.7.25-rc.1)
* Upgrade to React SDK 3.18.0-rc.1 and JS SDK 9.11.0-rc.1
* Translations update from Weblate
[\#16882](https://github.com/vector-im/element-web/pull/16882)
* Revert "Docker image: serve pre-compressed assets using gzip_static"
[\#16838](https://github.com/vector-im/element-web/pull/16838)
* Move native node modules documentation to element-desktop
[\#16814](https://github.com/vector-im/element-web/pull/16814)
* Add user settings for warn before exit
[\#16781](https://github.com/vector-im/element-web/pull/16781)
* Change ISSUE_TEMPLATE bold lines to proper headers
[\#16768](https://github.com/vector-im/element-web/pull/16768)
* Add example for deployment into Kubernetes
[\#16447](https://github.com/vector-im/element-web/pull/16447)
* Create bare-bones `PULL_REQUEST_TEMPLATE.md`
[\#16770](https://github.com/vector-im/element-web/pull/16770)
* Add webpack config and labs flag docs for voice messages
[\#16705](https://github.com/vector-im/element-web/pull/16705)
Changes in [1.7.24](https://github.com/vector-im/element-web/releases/tag/v1.7.24) (2021-03-29)
===============================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.24-rc.1...v1.7.24)
* Upgrade to React SDK 3.17.0 and JS SDK 9.10.0
Changes in [1.7.24-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.24-rc.1) (2021-03-25)
=========================================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.23...v1.7.24-rc.1)
* Upgrade to React SDK 3.17.0-rc.2 and JS SDK 9.10.0-rc.1
* Translations update from Weblate
[\#16766](https://github.com/vector-im/element-web/pull/16766)
* Docker image: serve pre-compressed assets using gzip_static
[\#16698](https://github.com/vector-im/element-web/pull/16698)
* Fix style lint issues
[\#16732](https://github.com/vector-im/element-web/pull/16732)
* Updated expected webpack output in setup guide
[\#16740](https://github.com/vector-im/element-web/pull/16740)
* Docs for `loginForWelcome`
[\#16468](https://github.com/vector-im/element-web/pull/16468)
* Disable rageshake persistence if no logs would be submitted
[\#16697](https://github.com/vector-im/element-web/pull/16697)
Changes in [1.7.23](https://github.com/vector-im/element-web/releases/tag/v1.7.23) (2021-03-15)
===============================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.23-rc.1...v1.7.23)
@@ -122,12 +38,12 @@ Changes in [1.7.22](https://github.com/vector-im/element-web/releases/tag/v1.7.2
## Security notice
Element Web 1.7.22 fixes (by upgrading to matrix-react-sdk 3.15.0) a moderate
Element Web 1.7.22 fixes (by upgrading to matrix-react-sdk 3.15.0) a low
severity issue (CVE-2021-21320) where the user content sandbox can be abused to
trick users into opening unexpected documents after several user interactions.
The content can be opened with a `blob` origin from the Matrix client, so it is
possible for a malicious document to access user messages and secrets. Thanks to
@keerok for responsibly disclosing this via Matrix's Security Disclosure Policy.
trick users into opening unexpected documents. The content is opened with a
`blob` origin that cannot access Matrix user data, so messages and secrets are
not at risk. Thanks to @keerok for responsibly disclosing this via Matrix's
Security Disclosure Policy.
## All changes

View File

@@ -202,12 +202,6 @@ docker build -t \
.
```
Running in Kubernetes
=====================
The provided element-web docker image can also be run from within a Kubernetes cluster.
See the [Kubernetes example](docs/kubernetes.md) for more details.
config.json
===========
@@ -304,10 +298,15 @@ yarn start
Wait a few seconds for the initial build to finish; you should see something like:
```
[element-js] <s> [webpack.Progress] 100%
[element-js]
[element-js] 「wdm」: 1840 modules
[element-js] 「wdm」: Compiled successfully.
Hash: b0af76309dd56d7275c8
Version: webpack 1.12.14
Time: 14533ms
Asset Size Chunks Chunk Names
bundle.js 4.2 MB 0 [emitted] main
bundle.css 91.5 kB 0 [emitted] main
bundle.js.map 5.29 MB 0 [emitted] main
bundle.css.map 116 kB 0 [emitted] main
+ 1013 hidden modules
```
Remember, the command will not terminate since it runs the web server
and rebuilds source files when they change. This development server also

View File

@@ -22,12 +22,9 @@ For a good example, see https://develop.element.io/config.json.
`default_hs_url` is specified. When multiple sources are specified, it is unclear
which should take priority and therefore the application cannot continue.
* As of Element 1.4.0, identity servers are optional. See [Identity servers](#identity-servers) below.
1. `sso_immediate_redirect`: When `true`, Element will assume the default server supports SSO
and attempt to send the user there to continue (if they aren't already logged in). Default
`false`. Note that this disables all usage of the welcome page.
1. `features`: Lookup of optional features that may be force-enabled (`true`) or force-disabled (`false`).
When features are not listed here, their defaults will be used, and users can turn them on/off if `showLabsSettings`
allows them to. The available optional experimental features vary from release to release and are
allows them to. The available optional experimental features vary from release to release and are
[documented](labs.md). The feature flag process is [documented](feature-flags.md) as well.
1. `showLabsSettings`: Shows the "labs" tab of user settings. Useful to allow users to turn on experimental features
they might not otherwise have access to.
@@ -75,9 +72,6 @@ For a good example, see https://develop.element.io/config.json.
1. `homeUrl`: Content shown on the inside of the app when a specific room is
not selected. By default, no home page is configured. If one is set, a
button to access it will be shown in the top left menu.
1. `loginForWelcome`: Overrides `welcomeUrl` to make the welcome page be the
same page as the login page when `true`. This effectively disables the
welcome page.
1. `defaultCountryCode`: The ISO 3166 alpha2 country code to use when showing
country selectors, like the phone number input on the registration page.
Defaults to `GB` if the given code is unknown or not provided.
@@ -116,16 +110,6 @@ For a good example, see https://develop.element.io/config.json.
1. `logo`: An HTTP URL to the avatar for the desktop build. Should be 24x24, ideally
an SVG.
1. `url`: An HTTP URL for where to send the user to download the desktop build.
1. `mobileBuilds`: Used to alter promotional links to the mobile app. By default the
builds are considered available and accessible from https://element.io. This config
option is typically used in a context of encouraging the user to try the mobile app
instead of a mobile/incompatible browser.
1. `ios`: The URL to the iOS build. If `null`, it will be assumed to be not available.
If not set, the default element.io builds will be used.
1. `android`: The URL to the Android build. If `null`, it will be assumed to be not available.
If not set, the default element.io builds will be used.
1. `fdroid`: The URL to the FDroid build. If `null`, it will be assumed to be not available.
If not set, the default element.io builds will be used.
1. `mobileGuideToast`: Whether to show a toast a startup which nudges users on
iOS and Android towards the native mobile apps. The toast redirects to the
mobile guide if they accept. Defaults to false.

View File

@@ -1,189 +0,0 @@
Running in Kubernetes
=====================
In case you would like to deploy element-web in a kubernetes cluster you can use
the provided Kubernetes example below as a starting point. Note that this example assumes the
Nginx ingress to be installed.
Note that the content of the required `config.json` is defined inside this yaml because it needs
to be put in your Kubernetes cluster as a `ConfigMap`.
So to use it you must create a file with this content as a starting point and modify it so it meets
the requirements of your environment.
Then you can deploy it to your cluster with something like `kubectl apply -f my-element-web.yaml`.
# This is an example of a POSSIBLE config for deploying a single element-web instance in Kubernetes
# Use the element-web namespace to put it all in.
apiVersion: v1
kind: Namespace
metadata:
name: element-web
---
# The config.json file is to be put into Kubernetes as a config file in such a way that
# the element web instance can read it.
# The code below shows how this can be done with the config.sample.json content.
apiVersion: v1
kind: ConfigMap
metadata:
name: element-config
namespace: element-web
data:
config.json: |
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://matrix-client.matrix.org",
"server_name": "matrix.org"
},
"m.identity_server": {
"base_url": "https://vector.im"
}
},
"disable_custom_urls": false,
"disable_guests": false,
"disable_login_language_selector": false,
"disable_3pid_login": false,
"brand": "Element",
"integrations_ui_url": "https://scalar.vector.im/",
"integrations_rest_url": "https://scalar.vector.im/api",
"integrations_widgets_urls": [
"https://scalar.vector.im/_matrix/integrations/v1",
"https://scalar.vector.im/api",
"https://scalar-staging.vector.im/_matrix/integrations/v1",
"https://scalar-staging.vector.im/api",
"https://scalar-staging.riot.im/scalar/api"
],
"bug_report_endpoint_url": "https://element.io/bugreports/submit",
"defaultCountryCode": "GB",
"showLabsSettings": false,
"features": {
"feature_new_spinner": false
},
"default_federate": true,
"default_theme": "light",
"roomDirectory": {
"servers": [
"matrix.org"
]
},
"piwik": {
"url": "https://piwik.riot.im/",
"whitelistedHSUrls": ["https://matrix.org"],
"whitelistedISUrls": ["https://vector.im", "https://matrix.org"],
"siteId": 1
},
"enable_presence_by_hs_url": {
"https://matrix.org": false,
"https://matrix-client.matrix.org": false
},
"settingDefaults": {
"breadcrumbs": true
},
"jitsi": {
"preferredDomain": "jitsi.riot.im"
}
}
---
# A deployment of the element-web for a single instance
apiVersion: apps/v1
kind: Deployment
metadata:
name: element
namespace: element-web
spec:
selector:
matchLabels:
app: element
replicas: 1
template:
metadata:
labels:
app: element
spec:
containers:
- name: element
image: vectorim/element-web:latest
volumeMounts:
- name: config-volume
mountPath: /app/config.json
subPath: config.json
ports:
- containerPort: 80
name: element
protocol: TCP
readinessProbe:
httpGet:
path: /
port: element
initialDelaySeconds: 2
periodSeconds: 3
livenessProbe:
httpGet:
path: /
port: element
initialDelaySeconds: 10
periodSeconds: 10
volumes:
- name: config-volume
configMap:
name: element-config
---
# Wrap it all in a Service
apiVersion: v1
kind: Service
metadata:
name: element
namespace: element-web
spec:
selector:
app: element
ports:
- name: default
protocol: TCP
port: 80
targetPort: 80
---
# An ingress definition to expose the service via a hostname
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: element
namespace: element-web
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/configuration-snippet: |
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "frame-ancestors 'none'";
spec:
rules:
- host: element.example.nl
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: element
port:
number: 80
---

View File

@@ -77,6 +77,13 @@ Ban lists are rooms within Matrix, proposed as [MSC2313](https://github.com/matr
[Mjolnir](https://github.com/matrix-org/mjolnir) is a set of moderation tools which support
ban lists.
## Inline widgets
`feature_inline_widgets` allows rendering and sending of inline widgets. Inline
widgets are typically polls or rich embedded content in rooms.
[#riot-web:matrix.org]: https://matrix.to/#/#riot-web:matrix.org
## Verifications in DMs (`feature_dm_verification`)
An implementation of [MSC2241](https://github.com/matrix-org/matrix-doc/pull/2241). When enabled, verification might not work with devices which don't support MSC2241.
@@ -123,15 +130,3 @@ or feedback for this functionality at this time.
Allows users to receive encrypted messages by creating a device that is stored
encrypted on the server, as described in [MSC2697](https://github.com/matrix-org/matrix-doc/pull/2697).
## Voice messages (`feature_voice_messages`) [In Development]
An in-progress implementation of [MSC2516](https://github.com/matrix-org/matrix-doc/pull/2516) to add
[voice messages](https://github.com/vector-im/element-web/issues/1358) to Element. Note that this feature
is currently under active development and therefore is entirely incomplete and may not work at all - it
is not recommended for general use at this time.
## Do not disturb (`feature_dnd`)
Enables UI for turning on "do not disturb" mode for the current device. When DND mode is engaged, popups
and notification noises are suppressed. Not perfect, but can help reduce noise.

View File

@@ -1,3 +1,60 @@
# Native Node Modules
This documentation moved to the [`element-desktop`](https://github.com/vector-im/element-desktop/blob/develop/docs/native-node-modules.md) repository.
For some features, the desktop version of Element can make use of native Node
modules. These allow Riot to integrate with the desktop in ways that a browser
cannot.
While native modules enable powerful new features, they must be complied for
each operating system. For official Element releases, we will always build these
modules from source to ensure we can trust the compiled output. In the future,
we may offer a pre-compiled path for those who want to use these features in a
custom build of Element without installing the various build tools required.
Do note that compiling a module for a particular operating system
(Linux/macOS/Windows) will need to be done on that operating system.
Cross-compiling from a host OS for a different target OS may be possible, but
we don't support this flow with Element dependencies at this time.
At the moment, we need to make some changes to the Element release process before
we can support native Node modules at release time, so these features are
currently disabled by default until that is resolved. The following sections
explain the manual steps you can use with a custom build of Element to enable
these features if you'd like to try them out.
## Adding Seshat for search in E2E encrypted rooms
Seshat is a native Node module that adds support for local event indexing and
full text search in E2E encrypted rooms.
Since Seshat is written in Rust, the Rust compiler and related tools need to be
installed before installing Seshat itself. To install Rust please consult the
official Rust [documentation](https://www.rust-lang.org/tools/install).
Seshat also depends on the SQLCipher library to store its data in encrypted form
on disk. You'll need to install it via your OS package manager.
After installing the Rust compiler and SQLCipher, Seshat support can be added
using yarn inside the `electron_app/` directory:
yarn add matrix-seshat
You will have to rebuild the native libraries against electron's version of
of node rather than your system node, using the `electron-build-env` tool.
This is also needed to when pulling in changes to Seshat using `yarn link`.
Again from the `electron_app/` directory:
yarn add electron-build-env
Recompiling Seshat itself can be done like so:
yarn run electron-build-env -- --electron 6.1.1 -- neon build matrix-seshat --release
Please make sure to include all the `--` as well as the `--release` command line
switch at the end. Modify your electron version accordingly depending on the
version that is installed on your system.
After this is done the Electron version of Element can be run from the main folder
as usual using:
yarn electron

View File

@@ -1,8 +1,8 @@
{
"default_server_name": "matrix.org",
"brand": "Element",
"integrations_ui_url": "https://scalar.vector.im/",
"integrations_rest_url": "https://scalar.vector.im/api",
"integrations_ui_url": "https://scalar-staging.vector.im/",
"integrations_rest_url": "https://scalar-staging.vector.im/api",
"integrations_widgets_urls": [
"https://scalar.vector.im/_matrix/integrations/v1",
"https://scalar.vector.im/api",

View File

@@ -1,6 +1,6 @@
{
"name": "element-web",
"version": "1.7.26",
"version": "1.7.23",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
@@ -58,11 +58,12 @@
"highlight.js": "^10.5.0",
"jsrsasign": "^10.1.5",
"katex": "^0.12.0",
"matrix-js-sdk": "10.0.0",
"matrix-react-sdk": "3.19.0",
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
"matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop",
"matrix-widget-api": "^0.1.0-beta.13",
"olm": "https://packages.matrix.org/npm/olm/olm-3.2.1.tgz",
"prop-types": "^15.7.2",
"random-string": "^0.2.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"sanitize-html": "github:apostrophecms/sanitize-html#3c7f93f2058f696f5359e3e58d464161647226db",

View File

@@ -22,7 +22,7 @@ limitations under the License.
background: -moz-linear-gradient(top, #c5e0f7 0%, #ffffff 100%);
background: -webkit-linear-gradient(top, #c5e0f7 0%, #ffffff 100%);
background: linear-gradient(to bottom, #c5e0f7 0%, #ffffff 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#c5e0f7', endColorstr='#ffffff', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c5e0f7', endColorstr='#ffffff',GradientType=0 );
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
width: 100%;
min-height: 100%;
@@ -41,7 +41,7 @@ limitations under the License.
margin-left: 4px;
margin-right: 4px;
min-width: 80px;
background-color: #03b381;
background-color: #03B381;
color: #fff;
cursor: pointer;
padding: 12px 22px;
@@ -54,7 +54,7 @@ limitations under the License.
}
.mx_HomePage_header {
color: #2e2f32;
color: #2E2F32;
display: flex;
align-items: center;
justify-content: center;
@@ -95,7 +95,7 @@ limitations under the License.
}
.mx_FooterLink {
color: #368bd6;
color: #368BD6;
text-decoration: none;
}
}

View File

@@ -14,4 +14,4 @@ JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)
VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop
CI_PACKAGE=true DIST_VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA scripts/package.sh
CI_PACKAGE=true DIST_VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA scripts/package.sh -d

View File

@@ -27,55 +27,7 @@ interface IProps {
}
const CompatibilityView: React.FC<IProps> = ({ onAccept }) => {
const {brand, mobileBuilds} = SdkConfig.get();
let ios = null;
const iosCustomUrl = mobileBuilds?.ios;
if (iosCustomUrl !== null) { // could be undefined or a string
ios = <>
<p><strong>iOS</strong> (iPhone or iPad)</p>
<a
href={iosCustomUrl || "https://apps.apple.com/app/vector/id1083446067"}
target="_blank"
className="mx_ClearDecoration"
>
<img height="48" src="themes/element/img/download/apple.svg" alt="Apple App Store" />
</a>
</>;
}
let android = [<p className="mx_Spacer" key="header"><strong>Android</strong></p>];
const andCustomUrl = mobileBuilds?.android;
const fdroidCustomUrl = mobileBuilds?.fdroid;
if (andCustomUrl !== null) { // undefined or string
android.push(<a
href={andCustomUrl || "https://play.google.com/store/apps/details?id=im.vector.app"}
target="_blank"
className="mx_ClearDecoration"
key="android"
>
<img height="48" src="themes/element/img/download/google.svg" alt="Google Play Store" />
</a>);
}
if (fdroidCustomUrl !== null) { // undefined or string
android.push(<a
href={fdroidCustomUrl || "https://f-droid.org/repository/browse/?fdid=im.vector.app"}
target="_blank"
className="mx_ClearDecoration"
key="fdroid"
>
<img height="48" src="themes/element/img/download/fdroid.svg" alt="F-Droid" />
</a>);
}
if (android.length === 1) { // just a header, meaning no links
android = [];
}
let mobileHeader = <h2 id="step2_heading">{_t("Use %(brand)s on mobile", {brand})}</h2>;
if (!android.length && !ios) {
mobileHeader = null;
}
const brand = SdkConfig.get().brand;
return <div className="mx_ErrorView">
<div className="mx_ErrorView_container">
<div className="mx_HomePage_header">
@@ -124,9 +76,30 @@ const CompatibilityView: React.FC<IProps> = ({ onAccept }) => {
<div className="mx_HomePage_col">
<div className="mx_HomePage_row">
<div>
{mobileHeader}
{ios}
{android}
<h2 id="step2_heading">Use Element on mobile</h2>
<p><strong>iOS</strong> (iPhone or iPad)</p>
<a
href="https://apps.apple.com/app/vector/id1083446067"
target="_blank"
className="mx_ClearDecoration"
>
<img height="48" src="themes/element/img/download/apple.svg" alt="Apple App Store" />
</a>
<p className="mx_Spacer"><strong>Android</strong></p>
<a
href="https://play.google.com/store/apps/details?id=im.vector.app"
target="_blank"
className="mx_ClearDecoration"
>
<img height="48" src="themes/element/img/download/google.svg" alt="Google Play Store" />
</a>
<a
href="https://f-droid.org/repository/browse/?fdid=im.vector.app"
target="_blank"
className="mx_ClearDecoration"
>
<img height="48" src="themes/element/img/download/fdroid.svg" alt="F-Droid" />
</a>
</div>
</div>
</div>

View File

@@ -2,7 +2,7 @@
"Welcome to Element": "Vítá vás Element",
"Unknown device": "Neznámé zařízení",
"You need to be using HTTPS to place a screen-sharing call.": "Pro uskutečnění hovoru se sdílením obrazovky musíte používat HTTPS.",
"Dismiss": "Zavřít",
"Dismiss": "Zahodit",
"powered by Matrix": "používá protokol Matrix",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Decentralizovaný, šifrovaný chat a spolupráce na platformě [matrix]",
"Sign In": "Přihlásit se",

View File

@@ -6,31 +6,31 @@
"Welcome to Element": "Willkommen bei Element",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Dezentrale, verschlüsselte Chat- &amp; Kollaborationslösung mittels [matrix]",
"Sign In": "Anmelden",
"Create Account": "Konto erstellen",
"Create Account": "Account erstellen",
"Explore rooms": "Räume erkunden",
"Unexpected error preparing the app. See console for details.": "Unerwarteter Fehler bei der Vorbereitung der App. Siehe in die Konsole für mehr Details.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Ungültige Konfiguration: Es kann nur eine der Optionen default_server_config, default_server_name oder default_hs_url angegeben werden.",
"Invalid configuration: no default server specified.": "Ungültige Konfiguration: Es wurde kein Standardserver angegeben.",
"The message from the parser is: %(message)s": "Die Nachricht des Parsers ist: %(message)s",
"Invalid JSON": "Ungültiges JSON",
"Go to your browser to complete Sign In": "Gehe zu deinem Browser, um die Anmeldung abzuschließen",
"Open user settings": "Benutzereinstellungen öffnen",
"Go to your browser to complete Sign In": "Gehe in deinen Browser, um die Anmeldung abzuschließen",
"Open user settings": "Öffne Nutzer-Einstellungen",
"Unable to load config file: please refresh the page to try again.": "Konfigurationsdatei kann nicht geladen werden: Bitte aktualisiere die Seite, um es erneut zu versuchen.",
"Missing indexeddb worker script!": "Fehlendes indexeddb-Arbeitsskript!",
"Missing indexeddb worker script!": "Fehlendes indexeddb Worker-Skript!",
"Previous/next recently visited room or community": "Vorheriger/nächster kürzlich besuchter Raum oder Community",
"Unsupported browser": "Nicht unterstützter Browser",
"Go to element.io": "Gehe zu element.io",
"Failed to start": "Start fehlgeschlagen",
"%(brand)s Desktop (%(platformName)s)": "%(brand)s Desktop (%(platformName)s)",
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Bitte installiere <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink> oder <safariLink>Safari</safariLink> für das beste Erlebnis.",
"You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "Du kannst deinen aktuellen Browser weiterhin verwenden. Es ist aber möglich, dass nicht alles richtig funktioniert oder das Aussehen der App inkorrekt ist.",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Bitte installiere <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, oder <safariLink>Safari</safariLink> für das beste Erlebnis.",
"You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "Du kannst deinen aktuellen Browser weiterhin verwenden, es kann aber sein, dass einige oder alle Funktionen nicht verfügbar stehen oder dass das Aussehen und die Bedienung der Anwendung nicht korrekt ist.",
"I understand the risks and wish to continue": "Ich verstehe die Risiken und möchte fortfahren",
"Your Element is misconfigured": "Dein Element ist falsch konfiguriert",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Deine Elementkonfiguration enthält ungültiges JSON. Bitte korrigiere das Problem und lade die Seite neu.",
"Download Completed": "Herunterladen fertiggestellt",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Deine Element Konfiguration enthält ungültiges JSON. Bitte korrigiere das Problem und lade die Seite neu.",
"Download Completed": "Download fertiggestellt",
"Open": "Öffnen",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s verwendet erweiterte Browserfunktionen, die von deinem Browser nicht unterstützt werden.",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s verwendet erweiterte Browserfunktionen, die von Ihrem aktuellen Browser nicht unterstützt werden.",
"Your browser can't run %(brand)s": "Dein Browser kann %(brand)s nicht ausführen",
"Powered by Matrix": "Betrieben mit Matrix"
}

View File

@@ -19,7 +19,6 @@
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(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.",
"Powered by Matrix": "Powered by Matrix",
"Use %(brand)s on mobile": "Use %(brand)s on mobile",
"Unsupported browser": "Unsupported browser",
"Your browser can't run %(brand)s": "Your browser can't run %(brand)s",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s uses advanced browser features which aren't supported by your current browser.",

View File

@@ -32,6 +32,5 @@
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Sinu Element'i seadistustes on vigased JSON-vormingus andmed. Palun paranda see viga ja laadi leht uuesti.",
"Your browser can't run %(brand)s": "%(brand)s ei toimi sinu brauseris",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s kasutab mitmeid uusi brauseri-põhiseid tehnoloogiaid, mis ei ole veel sinu veebibrauseris toetatud.",
"Powered by Matrix": "Põhineb Matrix'il",
"Use %(brand)s on mobile": "Kasuta %(brand)s rakendust nutiseadmes"
"Powered by Matrix": "Põhineb Matrix'il"
}

View File

@@ -7,7 +7,7 @@
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Messagerie et collaboration décentralisées et chiffrées, propulsées par [matrix]",
"Sign In": "Se connecter",
"Create Account": "Créer un compte",
"Explore rooms": "Parcourir les salons",
"Explore rooms": "Explorer les salons",
"Unexpected error preparing the app. See console for details.": "Une erreur inattendue est survenue pendant la préparation de lapplication. Consultez la console pour avoir des détails.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuration invalide : il ne faut spécifier quun des trois champs parmis default_server_config, default_server_name et default_hs_url.",
"Invalid configuration: no default server specified.": "Configuration invalide : aucun serveur par défaut spécifié.",

View File

@@ -7,30 +7,5 @@
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Meán comhrá agus comhoibriú, díláraithe agus criptithe, cumhachtaithe ag [matrix]",
"Sign In": "Sínigh Isteach",
"Create Account": "Déan cuntas a chruthú",
"Explore rooms": "Breathnaigh thart ar na seomraí",
"Your browser can't run %(brand)s": "Níl do bhrabhsálaí comhoiriúnach do %(brand)s",
"Go to your browser to complete Sign In": "Oscail do bhrabhsálaí agus críochnaigh an clárú",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Coinníonn do chumraíocht JSON neamhbhailí. Ceartaigh an fadhb agus athlódáil an leathanach le do thoil.",
"Your Element is misconfigured": "Níl do fheidhmchlár Element cumraithe i gceart",
"Previous/next recently visited room or community": "roimhe/chéad eile, seomra nó pobal is déanaí",
"Failed to start": "Theip chun tosú",
"I understand the risks and wish to continue": "Tuigim na rioscaí agus ba mhaith liom lean ar aghaidh",
"You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "An féidir leat úsáid do bhrabhsálaí reatha, ach nár oibrí roinnt nó gach gné agus nár thaispeántar an feidhmchlár i gceart.",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Suiteáil <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> chun an taithí is fearr a fháil.",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "Úsáideann %(brand)s gnéithe ardforbartha nach bhfuil ar fáil faoi do bhrabhsálaí reatha.",
"Unsupported browser": "Brabhsálaí gan tacaíocht",
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
"%(brand)s Desktop (%(platformName)s)": "%(brand)s deisce (%(platformName)s)",
"Unexpected error preparing the app. See console for details.": "Earráid nuair an feidhmchlár a hullmhú. Feic sa consól le haghaidh eolas.",
"Unable to load config file: please refresh the page to try again.": "Ní féidir an comhad cumraíochta a lódáil. Athnuaigh an leathanach chun déanamh iarracht arís le do thoil.",
"Download Completed": "Íoslódáil críochnaithe",
"Invalid JSON": "JSON neamhbhailí",
"The message from the parser is: %(message)s": "Is í an teachtaireacht as an parsálaí: %(message)s",
"Invalid configuration: no default server specified.": "Cumraíocht neamhbhailí: Níl aon freastalaí réamhshocraithe a sonrú.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Cumraíocht neamhbhailí: ní féidir ach ceann de default_server_config, default_server_name, nó default_hs_url a shonrú.",
"Missing indexeddb worker script!": "An script oibrí \"indexeddb\" ag iarraidh!",
"Powered by Matrix": "Cumhachtaithe ag Matrix",
"Go to element.io": "Téigh go element.io",
"Open user settings": "Oscail socruithe úsáideora",
"Open": "Oscail"
"Explore rooms": "Breathnaigh thart ar na seomraí"
}

View File

@@ -6,7 +6,7 @@
"Dismiss": "Atmesti",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Decentralizuoti, šifruoti pokalbiai ir bendradarbiavimas, veikiantis su [matrix]",
"Sign In": "Prisijungti",
"Create Account": "Sukurti Paskyrą",
"Create Account": "Sukurti paskyrą",
"Explore rooms": "Žvalgyti kambarius",
"The message from the parser is: %(message)s": "Analizatoriaus žinutė yra: %(message)s",
"Invalid JSON": "Klaidingas JSON",

View File

@@ -10,27 +10,5 @@
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Messatjariá chifrada, descentralizada e collaborativa propulsada per [matrix]",
"Sign In": "Se connectar",
"Create Account": "Crear un compte",
"Explore rooms": "Percórrer las salas",
"Missing indexeddb worker script!": "Lo worker script IndexedDB manca !",
"Invalid configuration: no default server specified.": "Configuracion invalida : pas de servidor per defauta especificat.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuracion invalida : podètz unicament especificar un camp entre default_server_config, default_server_name, o default_hs_url.",
"Failed to start": "Non se pòt pas lançar",
"Go to element.io": "Anar a element.io",
"I understand the risks and wish to continue": "Compréni los risques e vòli contunhar",
"You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "Podètz contunhar a utilizar lo vòstre navigator actual, mas qualques o totes las foncionalitats o/e l'apparéncia poirián mal foncionar .",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Si vos plai installatz <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, o <safariLink>Safari</safariLink> per una melhora experiéncia.",
"Your browser can't run %(brand)s": "Lo vòstre navigator non pòt pas executar %(brand)s",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s utiliza de foncions avançadas que lo vòstre navigator non suporta pas.",
"Unsupported browser": "Navigator incompatible",
"Powered by Matrix": "Fonciona ambé Matrix",
"You need to be using HTTPS to place a screen-sharing call.": "Devetz utilizar HTTPS per apelar ambé partatge d'ecran.",
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
"%(brand)s Desktop (%(platformName)s)": "%(brand)s de burèu (%(platformName)s)",
"Previous/next recently visited room or community": "Sala o comunautat recentament visitada precedenta/seguenta",
"Open user settings": "Dobrir los paramètres utilizaire",
"Open": "Dobrir",
"Download Completed": "Descargament acabat",
"Unable to load config file: please refresh the page to try again.": "Se pòt pas cargar lo fichièr de configuracion : si vos plai actualizatz la pagina per tornar ensajar.",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "La configuracion d'Element conténe de JSON invalid. Si vos plai corregitz lo problème e actualizatz la pagina.",
"Your Element is misconfigured": "Lo vòstre Element es mal configurat"
"Explore rooms": "Percórrer las salas"
}

View File

@@ -1,19 +1,13 @@
{
"powered by Matrix": "ใช้เทคโนโลยี Matrix",
"Dismiss": "ปิด",
"Dismiss": "ไม่สนใจ",
"Unknown device": "อุปกรณ์ที่ไม่รู้จัก",
"You need to be using HTTPS to place a screen-sharing call.": "คุณต้องใช้ HTTPS เพื่อเริ่มติดต่อแบบแบ่งปันหน้าจอ",
"Welcome to Element": "ยินดีต้อนรับสู่ Element",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "ระบบแชทและประสานงาน ไร้ศูนย์กลางและเข้ารหัสได้ โดยใช้เทคโนโลยีจาก [matrix]",
"The message from the parser is: %(message)s": "ข้อความจากตัวแยกวิเคราะห์คือ: %(message)s",
"The message from the parser is: %(message)s": "ข้อความจากparserคือ:%(message)s",
"Invalid JSON": "JSON ไม่ถูกต้อง",
"Sign In": "ลงชื่อเข้า",
"Sign In": "เข้าสู่ระบบ",
"Create Account": "สร้างบัญชี",
"Explore rooms": "สำรวจห้อง",
"Download Completed": "การดาวน์โหลดเสร็จสมบูรณ์",
"Open user settings": "เปิดการตั้งค่าผู้ใช้",
"Go to element.io": "ไปยัง element.io",
"Failed to start": "ไม่สามารถเริ่ม",
"Open": "เปิด",
"Powered by Matrix": "ขับเคลื่อนโดย Matrix"
"Explore rooms": "สำรวจห้อง"
}

View File

@@ -10,6 +10,5 @@
"Unknown device": "Allal arussin",
"Open user settings": "Ṛẓem tisɣal n unessemres",
"Dismiss": "Nexxel",
"Open": "Ṛẓem",
"The message from the parser is: %(message)s": "Tuzint seg tasna: %(message)s"
"Open": "Ṛẓem"
}

View File

@@ -1,12 +1,12 @@
{
"Dismiss": "忽略",
"Dismiss": "标记为已读",
"powered by Matrix": "由 Matrix 驱动",
"Unknown device": "未知设备",
"You need to be using HTTPS to place a screen-sharing call.": "您需要使用 HTTPS 以进行共享屏幕通话。",
"Welcome to Element": "欢迎来到 Element",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "去中心化、加密聊天与协作,由 [matrix] 驱动",
"Sign In": "登",
"Create Account": "创建账",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "去中心化、加密聊天&amp;与协作,由 [matrix] 驱动",
"Sign In": "登",
"Create Account": "创建账",
"Explore rooms": "探索聊天室",
"The message from the parser is: %(message)s": "语法分析器的信息:%(message)s",
"Invalid JSON": "无效的 JSON",
@@ -17,20 +17,20 @@
"Unable to load config file: please refresh the page to try again.": "无法加载配置文件:请再次刷新页面。",
"Open user settings": "打开用户设置",
"Previous/next recently visited room or community": "上一个 / 下一个最近访问的聊天室或社区",
"%(brand)s Desktop (%(platformName)s)": "%(brand)s 桌面版%(platformName)s",
"Go to your browser to complete Sign In": "转到您的浏览器完成登录",
"%(brand)s Desktop (%(platformName)s)": "%(brand)s 桌面版 (%(platformName)s)",
"Go to your browser to complete Sign In": "您的浏览器完成登录",
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
"Unsupported browser": "不支持的浏览器",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "请安装 <chromeLink>Chrome</chromeLink>、<firefoxLink>Firefox</firefoxLink> 或 <safariLink>Safari</safariLink> 以获得最佳体验。",
"You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "您可以继续使用您目前的浏览器,但部分或全部的功能可能无法正常工作,应用程序的外观可能也看起来不正确。",
"I understand the risks and wish to continue": "我了解风险并希望继续",
"Go to element.io": "前往 element.io",
"Go to element.io": " element.io",
"Failed to start": "启动失败",
"Your Element is misconfigured": "Element 配置错误",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Element 配置文件中包含无效的 JSON请改正错误并重新加载页面。",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Element 配置文件中包含无效的JSON请改正错误并重新加载页面。",
"Download Completed": "下载成功",
"Open": "打开",
"Your browser can't run %(brand)s": "浏览器无法运行 %(brand)s",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "当前浏览器不支持 %(brand)s 所需的高级浏览器特性。",
"Your browser can't run %(brand)s": "浏览器无法运行%(brand)s",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "当前浏览器不支持%(brand)s调用的高级浏览器特性。",
"Powered by Matrix": "由 Matrix 驱动"
}

View File

@@ -35,7 +35,6 @@ import SdkConfig from "matrix-react-sdk/src/SdkConfig";
import {parseQs, parseQsFromFragment} from './url_utils';
import VectorBasePlatform from "./platform/VectorBasePlatform";
import {createClient} from "matrix-js-sdk/src/matrix";
let lastLocationHashSet: string = null;
@@ -154,26 +153,6 @@ export async function loadApp(fragParams: {}) {
// Don't bother loading the app until the config is verified
const config = await verifyServerConfig();
// Before we continue, let's see if we're supposed to do an SSO redirect
const [userId] = await Lifecycle.getStoredSessionOwner();
const hasPossibleToken = !!userId;
const isReturningFromSso = !!params.loginToken;
const autoRedirect = config['sso_immediate_redirect'] === true;
if (!hasPossibleToken && !isReturningFromSso && autoRedirect) {
console.log("Bypassing app load to redirect to SSO");
const tempCli = createClient({
baseUrl: config['validated_server_config'].hsUrl,
idBaseUrl: config['validated_server_config'].isUrl,
});
PlatformPeg.get().startSingleSignOn(tempCli, "sso", `/${getScreenFromLocation(window.location).screen}`);
// We return here because startSingleSignOn() will asynchronously redirect us. We don't
// care to wait for it, and don't want to show any UI while we wait (not even half a welcome
// page). As such, just don't even bother loading the MatrixChat component.
return;
}
const MatrixChat = sdk.getComponent('structures.MatrixChat');
return <MatrixChat
onNewScreen={onNewScreen}

View File

@@ -92,7 +92,6 @@ async function start() {
// load init.ts async so that its code is not executed immediately and we can catch any exceptions
const {
rageshakePromise,
setupLogStorage,
preparePlatform,
loadOlm,
loadConfig,
@@ -139,9 +138,6 @@ async function start() {
await settled(loadConfigPromise); // wait for it to settle
// keep initialising so that we can show any possible error with as many features (theme, i18n) as possible
// now that the config is ready, try to persist logs
const persistLogsPromise = setupLogStorage();
// Load language after loading config.json so that settingsDefaults.language can be applied
const loadLanguagePromise = loadLanguage();
// as quickly as we possibly can, set a default theme...
@@ -201,11 +197,6 @@ async function start() {
await loadThemePromise;
await loadLanguagePromise;
// We don't care if the log persistence made it through successfully, but we do want to
// make sure it had a chance to load before we move on. It's prepared much higher up in
// the process, making this the first time we check that it did something.
await settled(persistLogsPromise);
// Finally, load the app. All of the other react-sdk imports are in this file which causes the skinner to
// run on the components.
await loadApp(fragparts.params);

View File

@@ -33,7 +33,7 @@ import PlatformPeg from "matrix-react-sdk/src/PlatformPeg";
import SdkConfig from "matrix-react-sdk/src/SdkConfig";
import {setTheme} from "matrix-react-sdk/src/theme";
import {initRageshake, initRageshakeStore} from "./rageshakesetup";
import { initRageshake } from "./rageshakesetup";
export const rageshakePromise = initRageshake();
@@ -51,14 +51,6 @@ export function preparePlatform() {
}
}
export function setupLogStorage() {
if (SdkConfig.get().bug_report_endpoint_url) {
return initRageshakeStore();
}
console.warn("No bug report endpoint set - logs will not be persisted");
return Promise.resolve();
}
export async function loadConfig() {
// XXX: We call this twice, once here and once in MatrixChat as a prop. We call it here to ensure
// granular settings are loaded correctly and to avoid duplicating the override logic for the theme.

View File

@@ -0,0 +1,105 @@
/*
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.
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.
*/
import randomString from "random-string";
// Dev note: This is largely inspired by Dimension. Used with permission.
// https://github.com/turt2live/matrix-dimension/blob/4f92d560266635e5a3c824606215b84e8c0b19f5/web/app/shared/services/scalar/scalar-widget.api.ts#L1
export default class WidgetApi {
_origin;
_widgetId;
_capabilities;
_inFlightRequests = {}; // { reqId => replyFn(payload) }
constructor(origin, widgetId, capabilities) {
this._origin = new URL(origin).origin;
this._widgetId = widgetId;
this._capabilities = capabilities;
const toWidgetActions = {
"capabilities": this._onCapabilitiesRequest.bind(this),
};
window.addEventListener("message", event => {
if (event.origin !== this._origin) return; // ignore due to invalid origin
if (!event.data) return;
if (event.data.widgetId !== this._widgetId) return;
const payload = event.data;
if (payload.api === "toWidget" && payload.action) {
console.log("[Inline Widget] Got toWidget: " + JSON.stringify(payload));
const handler = toWidgetActions[payload.action];
if (handler) handler(payload);
}
if (payload.api === "fromWidget" && this._inFlightRequests[payload.requestId]) {
console.log("[Inline Widget] Got fromWidget reply: " + JSON.stringify(payload));
const handler = this._inFlightRequests[payload.requestId];
delete this._inFlightRequests[payload.requestId];
handler(payload);
}
});
}
sendText(text) {
this.sendEvent("m.room.message", {msgtype: "m.text", body: text});
}
sendNotice(text) {
this.sendEvent("m.room.message", {msgtype: "m.notice", body: text});
}
sendEvent(eventType, content) {
this._callAction("send_event", {
type: eventType,
content: content,
});
}
_callAction(action, payload) {
if (!window.parent) {
return;
}
const request = {
api: "fromWidget",
widgetId: this._widgetId,
action: action,
requestId: randomString({length: 16}),
data: payload,
};
this._inFlightRequests[request.requestId] = () => {};
console.log("[Inline Widget] Sending fromWidget: ", request);
window.parent.postMessage(request, this._origin);
}
_replyPayload(incPayload, payload) {
if (!window.parent) {
return;
}
let request = JSON.parse(JSON.stringify(incPayload));
request["response"] = payload;
window.parent.postMessage(request, this._origin);
}
_onCapabilitiesRequest(payload) {
this._replyPayload(payload, {capabilities: this._capabilities});
}
}

View File

@@ -0,0 +1,5 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<body>
<div id="widgetHtml"></div>
</body>

View File

@@ -0,0 +1,71 @@
/*
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.
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.
*/
import queryString from "querystring";
import WidgetApi from "./WidgetApi";
let widgetApi;
try {
const qs = queryString.parse(window.location.search.substring(1));
if (!qs["widgetId"]) {
// noinspection ExceptionCaughtLocallyJS
throw new Error("Missing widgetId in query string");
}
if (!qs["parentUrl"]) {
// noinspection ExceptionCaughtLocallyJS
throw new Error("Missing parentUrl in query string");
}
const widgetOpts = JSON.parse(atob(window.location.hash
.substring(1)
.replace(/-/g, '+')
.replace(/_/g, '/')));
// This widget wrapper is always on the same origin as the client itself
widgetApi = new WidgetApi(qs["parentUrl"], qs["widgetId"], widgetOpts["capabilities"]);
document.getElementById("widgetHtml").innerHTML = widgetOpts['html'];
bindButtons();
} catch (e) {
console.error("[Inline Widget Wrapper] Error loading widget from URL: ", e);
document.getElementById("widgetHtml").innerText = "Failed to load widget";
}
function bindButtons() {
const buttons = document.getElementsByTagName("button");
if (!buttons) return;
for (const button of buttons) {
button.addEventListener("click", onClick);
}
}
function onClick(event) {
if (!event.target) return;
const action = event.target.getAttribute("data-mx-action");
if (!action) return; // TODO: Submit form or something?
const value = event.target.getAttribute("data-mx-value");
if (!value) return; // ignore - no value
if (action === "m.send_text") {
widgetApi.sendText(value);
} else if (action === "m.send_notice") {
widgetApi.sendNotice(value);
} else if (action === "m.send_hidden") {
widgetApi.sendEvent("m.room.hidden", {body: value});
} // else ignore
}
// TODO: Binding of forms, etc

View File

@@ -152,7 +152,7 @@ body {
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.92 33.32C20.92 34.2478 20.1679 35 19.24 35C13.0544 35 8.04001 29.9856 8.04001 23.8C8.04001 22.8722 8.79217 22.12 9.72001 22.12C10.6478 22.12 11.4 22.8722 11.4 23.8C11.4 28.1299 14.9101 31.64 19.24 31.64C20.1679 31.64 20.92 32.3922 20.92 33.32Z" fill="#0DBD8B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.68 24.9199C3.75216 24.9199 3 24.1678 3 23.2399C3 17.0543 8.01441 12.0399 14.2 12.0399C15.1278 12.0399 15.88 12.7921 15.88 13.7199C15.88 14.6478 15.1278 15.3999 14.2 15.3999C9.87009 15.3999 6.36 18.91 6.36 23.2399C6.36 24.1678 5.60784 24.9199 4.68 24.9199Z" fill="#0DBD8B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M29.32 17.0801C30.2478 17.0801 31 17.8322 31 18.7601C31 24.9457 25.9856 29.9601 19.8 29.9601C18.8722 29.9601 18.12 29.2079 18.12 28.2801C18.12 27.3522 18.8722 26.6001 19.8 26.6001C24.1299 26.6001 27.64 23.09 27.64 18.7601C27.64 17.8322 28.3922 17.0801 29.32 17.0801Z" fill="#0DBD8B"/>
</svg>
</svg>
</span>
<p>Set up Element on iOS or Android</p>
</div>
@@ -260,7 +260,6 @@ body {
</g>
</g>
</svg>
</a>
<a href="https://f-droid.org/repository/browse/?fdid=im.vector.app" target="_blank" class="mx_ClearDecoration">
<svg width="164px" height="48px" viewBox="0 0 157 46" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>Get it on F-Droid.</desc>

View File

@@ -399,18 +399,6 @@ export default class ElectronPlatform extends VectorBasePlatform {
return this._ipcCall('setAutoLaunchEnabled', enabled);
}
supportsWarnBeforeExit(): boolean {
return true;
}
async shouldWarnBeforeExit(): Promise<boolean> {
return this._ipcCall('shouldWarnBeforeExit');
}
async setWarnBeforeExit(enabled: boolean): Promise<void> {
return this._ipcCall('setWarnBeforeExit', enabled);
}
supportsAutoHideMenuBar(): boolean {
// This is irelevant on Mac as Menu bars don't live in the app window
return !isMac;

View File

@@ -31,12 +31,11 @@ import SdkConfig from "matrix-react-sdk/src/SdkConfig";
import sendBugReport from "matrix-react-sdk/src/rageshake/submit-rageshake";
export function initRageshake() {
// we manually check persistence for rageshakes ourselves
const prom = rageshake.init(/*setUpPersistence=*/false);
const prom = rageshake.init();
prom.then(() => {
console.log("Initialised rageshake.");
console.log("To fix line numbers in Chrome: " +
"Meatball menu → Settings → Ignore list → Add /rageshake\\.js$");
"Meatball menu → Settings → Blackboxing → Add /rageshake\\.js$");
window.addEventListener('beforeunload', (e) => {
console.log('element-web closing');
@@ -51,10 +50,6 @@ export function initRageshake() {
return prom;
}
export function initRageshakeStore() {
return rageshake.tryInitStorage();
}
window.mxSendRageshake = function(text: string, withLogs?: boolean) {
const url = SdkConfig.get().bug_report_endpoint_url;
if (!url) {

View File

@@ -5,27 +5,19 @@ const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const webpack = require("webpack");
let ogImageUrl = process.env.RIOT_OG_IMAGE_URL;
if (!ogImageUrl) ogImageUrl = 'https://app.element.io/themes/element/img/logos/opengraph.png';
let og_image_url = process.env.RIOT_OG_IMAGE_URL;
if (!og_image_url) og_image_url = 'https://app.element.io/themes/element/img/logos/opengraph.png';
const additionalPlugins = [
// This is where you can put your customisation replacements.
];
module.exports = (env, argv) => {
let nodeEnv = argv.mode;
if (process.env.CI_PACKAGE) {
// Don't run minification for CI builds (this is only set for runs on develop)
// We override this via environment variable to avoid duplicating the scripts
// in `package.json` just for a different mode.
argv.mode = "development";
// More and more people are using nightly build as their main client
// Libraries like React have a development build that is useful
// when working on the app but adds significant runtime overhead
// We want to use the React production build but not compile the whole
// application to productions standards
nodeEnv = "production";
}
const development = {};
@@ -52,6 +44,7 @@ module.exports = (env, argv) => {
"mobileguide": "./src/vector/mobile_guide/index.js",
"jitsi": "./src/vector/jitsi/index.ts",
"usercontent": "./node_modules/matrix-react-sdk/src/usercontent/index.js",
"inline-widget-wrapper": "./src/vector/inline_widget_wrapper/index.js",
// CSS themes
"theme-legacy": "./node_modules/matrix-react-sdk/res/themes/legacy-light/css/legacy-light.scss",
@@ -88,10 +81,6 @@ module.exports = (env, argv) => {
// we use a CSS optimizer too and need to manage it ourselves.
minimize: argv.mode === 'production',
minimizer: argv.mode === 'production' ? [new TerserPlugin({}), new OptimizeCSSAssetsPlugin({})] : [],
// Set the value of `process.env.NODE_ENV` for libraries like React
// See also https://v4.webpack.js.org/configuration/optimization/#optimizationnodeenv
nodeEnv,
},
resolve: {
@@ -164,8 +153,8 @@ module.exports = (env, argv) => {
},
loader: 'babel-loader',
options: {
cacheDirectory: true,
},
cacheDirectory: true
}
},
{
test: /\.css$/,
@@ -176,7 +165,7 @@ module.exports = (env, argv) => {
options: {
importLoaders: 1,
sourceMap: true,
},
}
},
{
loader: 'postcss-loader',
@@ -214,7 +203,7 @@ module.exports = (env, argv) => {
"local-plugins": true,
},
},
],
]
},
{
test: /\.scss$/,
@@ -225,7 +214,7 @@ module.exports = (env, argv) => {
options: {
importLoaders: 1,
sourceMap: true,
},
}
},
{
loader: 'postcss-loader',
@@ -253,7 +242,7 @@ module.exports = (env, argv) => {
"local-plugins": true,
},
},
],
]
},
{
test: /\.wasm$/,
@@ -264,18 +253,6 @@ module.exports = (env, argv) => {
outputPath: '.',
},
},
{
// Fix up the name of the opus-recorder worker (react-sdk dependency).
// We more or less just want it to be clear it's for opus and not something else.
test: /encoderWorker\.min\.js$/,
loader: "file-loader",
type: "javascript/auto", // https://github.com/webpack/webpack/issues/6725
options: {
// We deliberately override the name so it makes sense in debugging
name: 'opus-encoderWorker.min.[hash:7].[ext]',
outputPath: '.',
},
},
{
// cache-bust languages.json file placed in
// element-web/webapp/i18n during build by copy-res.js
@@ -323,7 +300,7 @@ module.exports = (env, argv) => {
},
],
},
],
]
},
plugins: [
@@ -341,10 +318,10 @@ module.exports = (env, argv) => {
// HtmlWebpackPlugin will screw up our formatting like the names
// of the themes and which chunks we actually care about.
inject: false,
excludeChunks: ['mobileguide', 'usercontent', 'jitsi'],
excludeChunks: ['mobileguide', 'usercontent', 'inline-widget-wrapper', 'jitsi'],
minify: argv.mode === 'production',
vars: {
og_image_url: ogImageUrl,
og_image_url: og_image_url,
},
}),
@@ -378,6 +355,13 @@ module.exports = (env, argv) => {
chunks: [],
}),
// This is an inline widget wrapper, similar to usercontent
new HtmlWebpackPlugin({
template: './src/vector/inline_widget_wrapper/index.html',
filename: 'inline_widget_wrapper/index.html',
chunks: ['inline-widget-wrapper'],
}),
// This is the usercontent sandbox's entry point (separate for iframing)
new HtmlWebpackPlugin({
template: './node_modules/matrix-react-sdk/src/usercontent/index.html',
@@ -450,7 +434,6 @@ function getAssetOutputPath(url, resourcePath) {
* be placed directly into things like CSS files.
*
* @param {string} path Some path to a file.
* @returns {string} converted path
*/
function toPublicPath(path) {
return path.replace(/\\/g, '/');

View File

@@ -7506,10 +7506,9 @@ mathml-tag-names@^2.1.3:
resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3"
integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==
matrix-js-sdk@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-10.0.0.tgz#571e97c8d8351715ac609ccedd38cad79d0b752e"
integrity sha512-40QN9HITqWBSYi/e8QQidDL6UOhWBpst437i+lHIqQ8a7SQtbcquDSRXWR22BjM2qbssR+02zfrLI/Kez7IoBQ==
"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop":
version "9.9.0"
resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/cd38fb9b4c349eb31feac14e806e710bf6431b72"
dependencies:
"@babel/runtime" "^7.12.5"
another-json "^0.2.0"
@@ -7529,10 +7528,9 @@ matrix-mock-request@^1.2.3:
bluebird "^3.5.0"
expect "^1.20.2"
matrix-react-sdk@3.19.0:
version "3.19.0"
resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.19.0.tgz#45e5794f9dae9b8fd6bdc2862ffd6e3a6650e282"
integrity sha512-xCRtq0u+qyYIAU/rUt7oQU0+sQboT1q1RRBzEvKca2usQRFH+EV4ahh97GCgg+u2IDiYb83bcVPcB4lGcCVLjg==
"matrix-react-sdk@github:matrix-org/matrix-react-sdk#develop":
version "3.16.0"
resolved "https://codeload.github.com/matrix-org/matrix-react-sdk/tar.gz/3154dd6cd441b7710a525e75512e1665adf60746"
dependencies:
"@babel/runtime" "^7.12.5"
await-lock "^2.1.0"
@@ -7560,10 +7558,9 @@ matrix-react-sdk@3.19.0:
katex "^0.12.0"
linkifyjs "^2.1.9"
lodash "^4.17.20"
matrix-js-sdk "10.0.0"
matrix-js-sdk "github:matrix-org/matrix-js-sdk#develop"
matrix-widget-api "^0.1.0-beta.13"
minimist "^1.2.5"
opus-recorder "^8.0.3"
pako "^2.0.3"
parse5 "^6.0.1"
png-chunks-extract "^1.0.0"
@@ -7582,6 +7579,7 @@ matrix-react-sdk@3.19.0:
tar-js "^0.3.0"
text-encoding-utf-8 "^1.0.2"
url "^0.11.0"
velocity-animate "^2.0.6"
what-input "^5.2.10"
zxcvbn "^4.4.2"
@@ -8470,11 +8468,6 @@ optionator@^0.9.1:
type-check "^0.4.0"
word-wrap "^1.2.3"
opus-recorder@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/opus-recorder/-/opus-recorder-8.0.3.tgz#f7b44f8f68500c9b96a15042a69f915fd9c1716d"
integrity sha512-8vXGiRwlJAavT9D3yYzukNVXQ8vEcKHcsQL/zXO24DQtJ0PLXvoPHNQPJrbMCdB4ypJgWDExvHF4JitQDL7dng==
original@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f"
@@ -9873,6 +9866,11 @@ raf@^3.1.0:
dependencies:
performance-now "^2.1.0"
random-string@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/random-string/-/random-string-0.2.0.tgz#a46e4375352beda9a0d7b0d19ed6d321ecd1d82d"
integrity sha1-pG5DdTUr7amg17DRntbTIezR2C0=
randomatic@^3.0.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed"
@@ -11058,9 +11056,9 @@ sshpk@^1.7.0:
tweetnacl "~0.14.0"
ssri@^6.0.1:
version "6.0.2"
resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.2.tgz#157939134f20464e7301ddba3e90ffa8f7728ac5"
integrity sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==
version "6.0.1"
resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8"
integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==
dependencies:
figgy-pudding "^3.5.1"
@@ -12102,6 +12100,11 @@ vary@~1.1.2:
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
velocity-animate@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/velocity-animate/-/velocity-animate-2.0.6.tgz#1811ca14df7fbbef05740256f6cec0fd1b76575f"
integrity sha512-tU+/UtSo3GkIjEfk2KM4e24DvpgX0+FzfLr7XqNwm9BCvZUtbCHPq/AFutx/Mkp2bXlUS9EcX8yxu8XmzAv2Kw==
vendors@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.4.tgz#e2b800a53e7a29b93506c3cf41100d16c4c4ad8e"