Compare commits

...

63 Commits

Author SHA1 Message Date
Bruno Windels
712d020dfa v0.16.5 2018-10-01 16:51:39 +02:00
Bruno Windels
5fc53f19f4 Prepare changelog for v0.16.5 2018-10-01 16:51:39 +02:00
Bruno Windels
957fde964b v0.16.5 2018-10-01 16:48:52 +02:00
Bruno Windels
b9688acdf5 bump both SDKs to latest version 2018-10-01 16:16:25 +02:00
David Baker
2a8c7b260a Don't show mobile guide if deep linking
Other part of https://github.com/vector-im/riot-web/issues/7378
2018-10-01 15:14:40 +02:00
David Baker
a2c7ef5424 Don't show custom server bit on matrix.org
On mobile guide

Part of https://github.com/vector-im/riot-web/issues/7378
2018-10-01 15:14:18 +02:00
Bruno Windels
57cdd26d4d v0.16.5-rc.1 2018-09-27 14:50:38 +01:00
Bruno Windels
582b67c42e v0.16.5-rc.1 2018-09-27 14:48:40 +01:00
Bruno Windels
44791a65b8 Revert "v0.16.5-rc.1"
This reverts commit 81dfe506ac.
2018-09-27 14:46:42 +01:00
Bruno Windels
f3214b7891 Prepare changelog for v0.16.5-rc.1 2018-09-27 14:43:05 +01:00
Bruno Windels
81dfe506ac v0.16.5-rc.1 2018-09-27 14:42:14 +01:00
Bruno Windels
2356524d1c bump matrix-js-sdk and matrix-react-sdk 2018-09-27 13:55:06 +01:00
Bruno Windels
a371bede4d Merge pull request #7395 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate.
2018-09-26 18:15:03 +01:00
Weblate
8793ad9f4f Merge remote-tracking branch 'origin/develop' into develop 2018-09-25 22:54:39 +00:00
Silvano
07b56426ad Translated using Weblate (Italian)
Currently translated at 100.0% (37 of 37 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/it/
2018-09-25 22:54:39 +00:00
Adolfo Jayme-Barrientos
43f9f2a0f2 Translated using Weblate (Catalan)
Currently translated at 97.2% (36 of 37 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/ca/
2018-09-25 22:54:38 +00:00
ali almi
d01824f711 Translated using Weblate (Arabic)
Currently translated at 81.0% (30 of 37 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/ar/
2018-09-25 22:54:38 +00:00
Matthew Hodgson
841c8fd41d Merge pull request #7355 from vector-im/travis/build-process
Reduce the number of terminals required to build riot-web to 1
2018-09-25 23:54:34 +01:00
Travis Ralston
4041f3db5c Send standard output/input from npm-sub.js to the parent proc 2018-09-25 15:54:38 -06:00
Travis Ralston
91304e70a1 Swap out the complicated canary stuff for serial execution
Fixes https://github.com/vector-im/riot-web/issues/7386
2018-09-25 15:49:14 -06:00
Travis Ralston
27c23058dc Alter build process to rely on canaries only
With the react-sdk and js-sdk having their `npm start`s split out (as per https://github.com/matrix-org/matrix-react-sdk/pull/2175 and https://github.com/matrix-org/matrix-js-sdk/pull/742) we can trigger an initial build ourselves and start the watcher afterwards. This canary approach has a very slight speed increase over serially running all the commands as the watcher can be started as early as possible.

This all can be improved and potentially eliminated with a bit more planning, however: https://github.com/vector-im/riot-web/issues/7386
2018-09-25 11:20:58 -06:00
Travis Ralston
8d7cec2a94 Add some comments to describe the build process 2018-09-24 17:57:18 -06:00
Travis Ralston
2b037ee146 Prevent races by blocking on SDK builds
If we don't block on SDK builds, then the riot-web build fails due to half-built dependencies. This needs to be done at two levels: the js-sdk because it is used by both the react-sdk and riot-web, and at the react-sdk because riot-web needs it. This means our build process is synchronous for js -> react -> riot, at least for the initial build. 

This does increase the startup time, particularly because the file watch timer is at 5 seconds. The timer is used to detect a storm of file changes in the underlying SDKs and give the build process some room to compile larger files if needed. 

The file watcher is accompanied by a "canary signal file" to prevent the build-blocking script from unblocking too early. Both the js and react SDKs build when `npm install` is run, so we ensure that we only listen for the `npm start` build for each SDK.

This is all done at the riot level instead of at the individual SDK levels (where we could use a canary file to signal up the stack) because:
* babel (used by the js-sdk) doesn't really provide an "end up build" signal
* webpack is a bit of a nightmare to get it to behave at times
* this blocking approach is really only applicable to riot-web, although may be useful to some other projects.

Hopefully that all makes sense.
2018-09-24 17:12:42 -06:00
Travis Ralston
c6da122e41 Fix npm link in the build script 2018-09-17 17:57:27 -06:00
Travis Ralston
67e9606d55 Reduce the number of terminals required to build riot-web to 1
A step towards a real solution for https://github.com/vector-im/riot-web/issues/7305

This approach makes use of `npm link` to remove the use of symlinks in the build process. The build process has also been altered to invoke the build process of each underlying SDK (react, js). This means that one can now `npm link` and `npm start` and have a working environment. 

At the same time, parallelshell was dropped due to lack of maintenance from the maintainer.
2018-09-17 17:50:03 -06:00
Ionut Zaharia
1b8f1f5610 Translated using Weblate (Romanian)
Currently translated at 100.0% (37 of 37 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/ro/
2018-09-11 21:09:43 +00:00
Weblate
4c6bb8846b Merge remote-tracking branch 'origin/develop' into develop 2018-09-10 10:48:57 +00:00
Victor Grousset
11a1915e61 Translated using Weblate (Esperanto)
Currently translated at 97.2% (36 of 37 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/eo/
2018-09-10 10:48:55 +00:00
David Baker
e58ac74aa2 Merge branch 'master' into develop 2018-09-10 11:48:19 +01:00
David Baker
2b18aa7d79 Merge branch 'release-v0.16.4' 2018-09-10 11:47:09 +01:00
David Baker
0f9c8235e1 v0.16.4 2018-09-10 11:43:23 +01:00
David Baker
8b0ae88987 Prepare changelog for v0.16.4 2018-09-10 11:43:23 +01:00
David Baker
d8aaae6d42 v0.16.4 2018-09-10 11:42:20 +01:00
David Baker
ce4c71ccfb Released js-sdk & react-sdk 2018-09-10 11:41:45 +01:00
Matthew Hodgson
5ef141913b remove ancient layering warning 2018-09-09 18:35:31 +01:00
Matthew Hodgson
d27db5a1c7 downgraded parallelshell due to https://github.com/darkguy2008/parallelshell/issues/57
thanks @ZerataX! :)
2018-09-09 10:48:03 +01:00
Matthew Hodgson
c2bd6e6da1 point deps at #develop to unbreak npm i 2018-09-09 10:25:33 +01:00
David Baker
d6406b48fd v0.16.4-rc.1 2018-09-07 14:42:52 +01:00
David Baker
d5b42d99f2 Prepare changelog for v0.16.4-rc.1 2018-09-07 14:42:51 +01:00
David Baker
42bac1620e v0.16.4-rc.1 2018-09-07 14:39:20 +01:00
David Baker
09130582ad js-sdk & react-sdk rc.1 2018-09-07 14:38:16 +01:00
David Baker
73239f5535 Merge pull request #7296 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate.
2018-09-07 14:07:30 +01:00
Weblate
22abe5a815 Merge remote-tracking branch 'origin/develop' into develop 2018-09-05 14:48:11 +00:00
David Baker
736450e184 Merge pull request #7288 from vector-im/bwindels/fixmobileguideloadedonriot
Fix config not loading & mobileguide script being loaded in riot
2018-09-05 15:48:04 +01:00
Bruno Windels
d10fda36af fix config not loading correctly anymore 2018-09-05 16:38:00 +02:00
Bruno Windels
8639b2858b dont load the mobileguide script in riot 2018-09-05 16:07:44 +02:00
Weblate
f47a9f93a5 Merge remote-tracking branch 'origin/develop' into develop 2018-09-05 10:31:06 +00:00
David Baker
52bbd8c764 Merge pull request #7272 from vector-im/dbkr/mobileguide
Instructions for installing mobile apps
2018-09-05 11:31:00 +01:00
Weblate
8ef2eec504 Merge remote-tracking branch 'origin/develop' into develop 2018-09-05 10:21:41 +00:00
Bruno Windels
1c5f16c332 Merge pull request #7265 from vector-im/dbkr/make_index_js_less_of_a_dogs_dinner
Tidy up index.js
2018-09-05 12:21:35 +02:00
Matthew Hodgson
588369d297 downgraded parallelshell due to https://github.com/darkguy2008/parallelshell/issues/57
thanks @ZerataX! :)
2018-09-04 20:32:06 +01:00
David Baker
e23195fd86 Conditionally show custom server bit 2018-09-04 10:08:52 +01:00
Matthew Hodgson
1b0cafd956 Merge pull request #7274 from gusttt/patch-1
Small typo in release notes v0.16.3
2018-09-04 09:50:39 +01:00
gusttt
81a624146b Small typo in release notes v0.16.3
Fixes  #7273
2018-09-04 08:16:29 +02:00
David Baker
9c8ef4240c Instructions for installing mobile apps
Replace the native js dialog with a page telling you how to
download the apps and how to set your HS URL.
2018-09-03 20:38:30 +01:00
Weblate
b59edf2690 Merge remote-tracking branch 'origin/develop' into develop 2018-09-03 13:39:35 +00:00
Andri
daa3e1351b Translated using Weblate (English (United States))
Currently translated at 100.0% (37 of 37 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/en_US/
2018-09-03 13:39:34 +00:00
David Baker
57999b460b Didn't mean to commit that file 2018-09-03 13:05:58 +01:00
David Baker
e2bad5bdc8 Tidy up index.js
Non-functional changes (before I start messing with it).

Switch to import, move code out of the top level, switch to one
consistent way of declaring functions, keep imports at the top.
2018-09-03 13:01:52 +01:00
Andri
2209059e84 Translated using Weblate (English (United States))
Currently translated at 100.0% (37 of 37 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/en_US/
2018-08-30 14:55:19 +00:00
Andrey Silversburg
b335da75db Translated using Weblate (Indonesian)
Currently translated at 100.0% (37 of 37 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/id/
2018-08-30 14:49:14 +00:00
Weblate
fbe6595b19 Merge remote-tracking branch 'origin/develop' into develop 2018-08-30 10:43:42 +00:00
Weblate
b30fd9d3bf Merge remote-tracking branch 'origin/develop' into develop 2018-08-30 10:38:37 +00:00
20 changed files with 3322 additions and 2302 deletions

1
.gitignore vendored
View File

@@ -19,3 +19,4 @@ electron/pub
/config.json.*
/config.local*.json
/src/component-index.js
/.tmp

View File

@@ -1,10 +1,49 @@
Changes in [0.16.5](https://github.com/vector-im/riot-web/releases/tag/v0.16.5) (2018-10-01)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.16.5-rc.1...v0.16.5)
* Don't show mobile guide if deep linking
[\#7415](https://github.com/vector-im/riot-web/pull/7415)
* Don't show custom server bit on matrix.org
[\#7408](https://github.com/vector-im/riot-web/pull/7408)
Changes in [0.16.5-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.16.5-rc.1) (2018-09-27)
======================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.16.4...v0.16.5-rc.1)
* Update from Weblate.
[\#7395](https://github.com/vector-im/riot-web/pull/7395)
* Reduce the number of terminals required to build riot-web to 1
[\#7355](https://github.com/vector-im/riot-web/pull/7355)
* Small typo in release notes v0.16.3
[\#7274](https://github.com/vector-im/riot-web/pull/7274)
Changes in [0.16.4](https://github.com/vector-im/riot-web/releases/tag/v0.16.4) (2018-09-10)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.16.4-rc.1...v0.16.4)
* No changes since rc.1
Changes in [0.16.4-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.16.4-rc.1) (2018-09-07)
======================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.16.3...v0.16.4-rc.1)
* Update from Weblate.
[\#7296](https://github.com/vector-im/riot-web/pull/7296)
* Fix config not loading & mobileguide script being loaded in riot
[\#7288](https://github.com/vector-im/riot-web/pull/7288)
* Instructions for installing mobile apps
[\#7272](https://github.com/vector-im/riot-web/pull/7272)
* Tidy up index.js
[\#7265](https://github.com/vector-im/riot-web/pull/7265)
Changes in [0.16.3](https://github.com/vector-im/riot-web/releases/tag/v0.16.3) (2018-09-03)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.16.3-rc.2...v0.16.3)
* SECURITY FIX: This version (and release candidates) pull in an upstream security
fix from electron to fix CVE-2018-15685. Electron users should update as soon as
possible. Riot-web run outsiude of Electron is unaffected.
possible. Riot-web run outside of Electron is unaffected.
Changes in [0.16.3-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.16.3-rc.2) (2018-08-31)
======================================================================================================
@@ -205,7 +244,7 @@ Changes in [0.15.0-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.1
======================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.15.0-rc.1...v0.15.0-rc.2)
* Update to matrix-react-sdk 0.12.4-rc.2
* Update to matrix-react-sdk 0.12.4-rc.2
Changes in [0.15.0-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.15.0-rc.1) (2018-05-09)
======================================================================================================
@@ -309,7 +348,7 @@ Changes in [0.14.0-rc.6](https://github.com/vector-im/riot-web/releases/tag/v0.1
======================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.14.0-rc.5...v0.14.0-rc.6)
* Bump react-sdk to [rc.6](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.12.0-rc.6)
* Bump react-sdk to [rc.6](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.12.0-rc.6)
Changes in [0.14.0-rc.5](https://github.com/vector-im/riot-web/releases/tag/v0.14.0-rc.5) (2018-04-09)
======================================================================================================

View File

@@ -64,12 +64,13 @@ Building From Source
Riot is a modular webapp built with modern ES6 and requires a npm build system
to build.
1. Install or update `node.js` so that your `node` is at least v6.3.0 (and `npm`
is at least v3.10.x).
1. Install or update `node.js` so that your `node` is at least v8.12.0 (and `npm`
is at least v5.x).
1. Clone the repo: `git clone https://github.com/vector-im/riot-web.git`.
1. Switch to the riot-web directory: `cd riot-web`.
1. If you're using the `develop` branch, install the develop versions of the
dependencies, as the released ones will be too old:
1. If you're using the `develop` branch then it is recommended to set up a proper
development environment ("Setting up a dev environment" below) however one can
install the develop versions of the dependencies instead:
```
scripts/fetch-develop.deps.sh
```
@@ -89,13 +90,9 @@ to build.
npm install
npm run build
```
However, we recommend setting up a proper development environment (see "Setting
up a dev environment" below) if you want to run your own copy of the
`develop` branch, as it makes it much easier to keep these dependencies
up-to-date. Or just use https://riot.im/develop - the continuous integration
release of the develop branch.
(Note that we don't reference the develop versions in git directly due to
https://github.com/npm/npm/issues/3055.)
Or just use https://riot.im/develop - the continuous integration release of the
develop branch. (Note that we don't reference the develop versions in git directly
due to https://github.com/npm/npm/issues/3055.)
1. Install the prerequisites: `npm install`.
1. Configure the app by copying `config.sample.json` to `config.json` and
modifying it (see below for details).
@@ -239,19 +236,7 @@ higher and lower level React components useful for building Matrix communication
apps using React.
After creating a new component you must run `npm run reskindex` to regenerate
the `component-index.js` for the app (used in future for skinning)
**However, as of July 2016 this layering abstraction is broken due to rapid
development on Riot forcing `matrix-react-sdk` to move fast at the expense of
maintaining a clear abstraction between the two.** Hacking on Riot inevitably
means hacking equally on `matrix-react-sdk`, and there are bits of
`matrix-react-sdk` behaviour incorrectly residing in the `riot-web` project
(e.g. matrix-react-sdk specific CSS), and a bunch of Riot specific behaviour
in the `matrix-react-sdk` (grep for `vector` / `riot`). This separation problem will be
solved asap once development on Riot (and thus matrix-react-sdk) has
stabilised. Until then, the two projects should basically be considered as a
single unit. In particular, `matrix-react-sdk` issues are currently filed
against `riot-web` in github.
the `component-index.js` for the app (used in future for skinning).
Please note that Riot is intended to run correctly without access to the public
internet. So please don't depend on resources (JS libs, CSS, images, fonts)
@@ -268,20 +253,19 @@ having to manually rebuild each time.
First clone and build `matrix-js-sdk`:
1. `git clone git@github.com:matrix-org/matrix-js-sdk.git`
1. `git clone https://github.com/matrix-org/matrix-js-sdk.git`
1. `pushd matrix-js-sdk`
1. `git checkout develop`
1. `npm install`
1. `npm install source-map-loader` # because webpack is made of fail (https://github.com/webpack/webpack/issues/1472)
1. `npm install source-map-loader` # because webpack is made of fail (https://github.com/webpack/webpack/issues/1472)
1. `popd`
Then similarly with `matrix-react-sdk`:
1. `git clone git@github.com:matrix-org/matrix-react-sdk.git`
1. `git clone https://github.com/matrix-org/matrix-react-sdk.git`
1. `pushd matrix-react-sdk`
1. `git checkout develop`
1. `npm install`
1. `rm -r node_modules/matrix-js-sdk; ln -s ../../matrix-js-sdk node_modules/`
1. `npm link ../matrix-js-sdk`
1. `popd`
Finally, build and start Riot itself:
@@ -290,8 +274,8 @@ Finally, build and start Riot itself:
1. `cd riot-web`
1. `git checkout develop`
1. `npm install`
1. `rm -r node_modules/matrix-js-sdk; ln -s ../../matrix-js-sdk node_modules/`
1. `rm -r node_modules/matrix-react-sdk; ln -s ../../matrix-react-sdk node_modules/`
1. `npm link ../matrix-js-sdk`
1. `npm link ../matrix-react-sdk`
1. `npm start`
1. Wait a few seconds for the initial build to finish; you should see something like:
```
@@ -310,10 +294,8 @@ Finally, build and start Riot itself:
disables caching, so do NOT use it in production.
1. Open http://127.0.0.1:8080/ in your browser to see your newly built Riot.
When you make changes to `matrix-react-sdk` or `matrix-js-sdk`, you will need
to run `npm run build` in the relevant directory. You can do this automatically
by instead running `npm start` in the directory, to start a development builder
which will watch for changes to the files and rebuild automatically.
When you make changes to `matrix-react-sdk` or `matrix-js-sdk` they should be
automatically picked up by webpack and built.
If you add or remove any components from the Riot skin, you will need to rebuild
the skin's index by running, `npm run reskindex`.

View File

@@ -2,7 +2,7 @@
"name": "riot-web",
"productName": "Riot",
"main": "src/electron-main.js",
"version": "0.16.3",
"version": "0.16.5",
"description": "A feature-rich client for Matrix.org",
"author": "Vector Creations Ltd.",
"dependencies": {

4759
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"name": "riot-web",
"productName": "Riot",
"main": "electron_app/src/electron-main.js",
"version": "0.16.3",
"version": "0.16.5",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
@@ -36,16 +36,22 @@
"build:bundle": "cross-env NODE_ENV=production webpack -p --progress --bail",
"build:bundle:dev": "webpack --optimize-occurence-order --progress --bail",
"build:electron": "npm run clean && npm run build && npm run install:electron && build -wml --ia32 --x64",
"build": "npm run reskindex && npm run build:res && npm run build:bundle",
"build:dev": "npm run reskindex && npm run build:res && npm run build:bundle:dev",
"build:react-sdk": "node scripts/npm-sub.js matrix-react-sdk run start:init",
"build:js-sdk": "node scripts/npm-sub.js matrix-js-sdk run start:init",
"build": "npm run build:js-sdk && npm run build:react-sdk && npm run reskindex && npm run build:res && npm run build:bundle",
"build:dev": "npm run build:js-sdk && npm run build:react-sdk && npm run reskindex && npm run build:res && npm run build:bundle:dev",
"dist": "scripts/package.sh",
"install:electron": "install-app-deps",
"electron": "npm run install:electron && electron .",
"start:res": "node scripts/copy-res.js -w",
"start:js": "webpack-dev-server --output-filename=bundles/_dev_/[name].js --output-chunk-file=bundles/_dev_/[name].js -w --progress",
"start:js:prod": "cross-env NODE_ENV=production webpack-dev-server -w --progress",
"start": "parallelshell \"npm run reskindex:watch\" \"npm run start:res\" \"npm run start:js\"",
"start:prod": "parallelshell \"npm run reskindex:watch\" \"npm run start:res\" \"npm run start:js:prod\"",
"start:js-sdk": "node scripts/npm-sub.js matrix-js-sdk run start:watch",
"start:js-sdk:prod": "cross-env NODE_ENV=production node scripts/npm-sub.js matrix-js-sdk run start:watch",
"start:react-sdk": "node scripts/npm-sub.js matrix-react-sdk run start:all",
"start:react-sdk:prod": "cross-env NODE_ENV=production node scripts/npm-sub.js matrix-react-sdk run start:all",
"start": "npm run build:js-sdk && npm run build:react-sdk && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n js-sdk,react-sdk,reskindex,res,riot-js \"npm run start:js-sdk\" \"npm run start:react-sdk\" \"npm run reskindex:watch\" \"npm run start:res\" \"npm run start:js\"",
"start:prod": "npm run build:js-sdk && npm run build:react-sdk && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n js-sdk,react-sdk,reskindex,res,riot-js \"npm run start:js-sdk:prod\" \"npm run start:react-sdk:prod\" \"npm run reskindex:watch\" \"npm run start:res\" \"npm run start:js:prod\"",
"lint": "eslint src/",
"lintall": "eslint src/ test/",
"clean": "rimraf lib webapp electron_app/dist",
@@ -64,8 +70,8 @@
"gemini-scrollbar": "matrix-org/gemini-scrollbar#b302279",
"gfm.css": "^1.1.1",
"highlight.js": "^9.0.0",
"matrix-js-sdk": "0.10.9",
"matrix-react-sdk": "0.13.3",
"matrix-js-sdk": "0.11.1",
"matrix-react-sdk": "0.13.5",
"modernizr": "^3.1.0",
"prop-types": "^15.5.10",
"react": "^15.6.0",
@@ -91,6 +97,7 @@
"babel-preset-react": "^6.16.0",
"babel-preset-stage-2": "^6.17.0",
"chokidar": "^1.6.1",
"concurrently": "^4.0.1",
"cpx": "^1.3.2",
"cross-env": "^4.0.0",
"css-raw-loader": "^0.1.1",
@@ -122,7 +129,6 @@
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"mocha": "^2.4.5",
"parallelshell": "^3.0.2",
"postcss-extend": "^1.0.5",
"postcss-import": "^9.0.0",
"postcss-loader": "^1.2.2",

View File

@@ -52,13 +52,7 @@ function dodep() {
echo "$repo set to branch "`git -C "$repo" rev-parse --abbrev-ref HEAD`
mkdir -p node_modules
rm -r "node_modules/$repo" 2>/dev/null || true
ln -sv "../$repo" node_modules/
(
cd $repo
npm install
)
npm link "./$repo" # This does an npm install for us
}
##############################
@@ -77,14 +71,15 @@ echo 'Setting up matrix-react-sdk'
dodep matrix-org matrix-react-sdk
# replace the version of js-sdk that got pulled into react-sdk with a symlink
# replace the version of js-sdk that got pulled into react-sdk with a link
# to our version. Make sure to do this *after* doing 'npm i' in react-sdk,
# otherwise npm helpfully moves another-json from matrix-js-sdk/node_modules
# into matrix-react-sdk/node_modules.
#
# (note this matches the instructions in the README.)
rm -r node_modules/matrix-react-sdk/node_modules/matrix-js-sdk
ln -s ../../matrix-js-sdk node_modules/matrix-react-sdk/node_modules/
cd matrix-react-sdk
npm link ../matrix-js-sdk
cd ../
echo -en 'travis_fold:end:matrix-react-sdk\r'

22
scripts/npm-sub.js Normal file
View File

@@ -0,0 +1,22 @@
const path = require('path');
const child_process = require('child_process');
const moduleName = process.argv[2];
if (!moduleName) {
console.error("Expected module name");
process.exit(1);
}
const argString = process.argv.length > 3 ? process.argv.slice(3).join(" ") : "";
if (!argString) {
console.error("Expected an npm argument string to use");
process.exit(1);
}
const modulePath = path.dirname(require.resolve(`${moduleName}/package.json`));
child_process.execSync("npm " + argString, {
env: process.env,
cwd: modulePath,
stdio: ['inherit', 'inherit', 'inherit'],
});

View File

@@ -4,5 +4,29 @@
"Riot is not supported on mobile web. Install the app?": "رايوت غير مدعوم في وضعية الويب على الهاتف. هل تريد تثبيت التطبيق ؟",
"Riot Desktop on %(platformName)s": "الواجهة المكتبية لرايوت على %(platformName)s",
"Unknown device": "جهاز مجهول",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s عبر %(browserName)s على %(osName)s"
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s عبر %(browserName)s على %(osName)s",
"You need to be using HTTPS to place a screen-sharing call.": "تحتاج الى استخدام الاتصال الآمن ( HTTPS) للسماح بمشاركة الشاشة",
"Co-ordination for Riot translators": "التنسيق لمترجمين Riot",
"powered by Matrix": "مشغل بواسطة Matrix",
"Welcome to Riot.im": "مرحبا بك في Riot.im",
"Dev chat for the Dendrite dev team": "Dev chat for the Dendrite dev team",
"Implementing VoIP services with Matrix": "تنفيذ خدمات VoIP مع Matrix",
"Discussion of the Identity Service API": "مناقشة واجهة برمجة التطبيقات لخدمة الهوية",
"Support for those using, running and writing other bridges": "دعم لأولئك الذين يستخدمون الجسور الأخرى ويديرونها وكتابتهم",
"Implementing VR services with Matrix": "تنفيذ خدمات الواقع الافتراضي مع Matrix",
"Search the room directory": "ابحث في دليل الغرفة",
"Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "توجد بالفعل الكثير من الغرف في Matrix ، مرتبطة بالشبكات القائمة (Slack، IRC، Gitter الخ) أو مستقلة. تحقق من الدليل!",
"Chat with Riot Bot": "الدردشة مع Riot Bot",
"Get started with some tips from Riot Bot!": "ابدأ ببعض النصائح من Riot Bot!",
"General discussion about Matrix and Riot": "مناقشة عامة حول Matrix و Riot",
"Discussion of all things Matrix!": "مناقشة كل شيء Matrix!",
"Riot/Web & Desktop chat": "Riot/Web & دردشة سطح المكتب",
"Riot/iOS & matrix-ios-sdk chat": "Riot/iOS & matrix-ios-sdk chat",
"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.": "تستطيع استخدام الخدما.يمكنك استخدام خيارات الخادم المخصص لتسجيل الدخول إلى خوادم Matrix الأخرى عن طريق تحديد عنوان URL لخادم Home آخر.<br/>هذا يسمح لك باستخدام Riot مع حساب Matrix موجود على خادم منزل مختلف.<br/><br/>يمكنك أيضًا تعيين خادم هوية مخصص ولكنك لن تتمكن من دعوة المستخدمين عن طريق عنوان البريد الإلكتروني ، أو دعوتك عبر عنوان البريد الإلكتروني بنفسك.",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "[matrix] تعاون مدعوم مواسطة &amp; دردشة لا مركزية ومشفرة",
"Matrix technical discussions": "مناقشات تقنية Matrix",
"Running Matrix services": "تشغيل خدمات Matrix",
"Community-run support for Synapse": "الدعم المجتمعي لـ Synapse",
"Admin support for Dendrite": "الدعم الاداري لـDendrite",
"Announcements about Synapse releases": "إعلانات حول إصدارات Synaps"
}

View File

@@ -3,14 +3,14 @@
"Custom Server Options": "Opcions de servidor personalitzat",
"Dismiss": "Omet",
"Unknown device": "Dispositiu desconegut",
"Welcome to Riot.im": "Benvingut a Riot.im",
"Welcome to Riot.im": "Us donem la benvinguda a Riot.im",
"Chat with Riot Bot": "Conversa amb el Bot de Riot",
"Riot is not supported on mobile web. Install the app?": "Riot no és compatible amb la web per a mòbils. Voleu instal·lar l'aplicació per a mòbils?",
"Riot Desktop on %(platformName)s": "Riot d'escriptori per a %(platformName)s",
"You need to be using HTTPS to place a screen-sharing call.": "Heu d'utilitzar HTTPS per poder fer una trucada amb pantalla compartida.",
"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.": "Podeu utilitzar opcions de servidor personalitzades per iniciar sessió en altres servidors Matrix especificant una URL diferent a la del servidor principal. <br/> Això us permet utilitzar Riot amb un compte de Matrix existent en un servidor d'origen diferent. <br/> <br/> També podeu establir un servidor d'identitat personalitzat, però no podreu convidar o ser convidat per correu electrònic.",
"powered by Matrix": "amb tecnologia de Matrix",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Xat descentralitzat, encriptat &amp; col·laboració amb tecnologia de [matrix]",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Xat descentralitzat, encriptat i col·laboratiu amb tecnologia de [matrix]",
"Search the room directory": "Cerqueu el directori de sales",
"Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "Ja existeixen moltes sales a Matrix vinculades a xarxes existents (Slack, IRC, Gitter, etc.) o independents. Feu un cop d'ull al directori!",
"Get started with some tips from Riot Bot!": "Comenceu amb alguns consells de Riot Bot!",

View File

@@ -33,5 +33,7 @@
"Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!",
"Riot/Android &amp; matrix-android-sdk chat": "Riot/Android &amp; matrix-android-sdk chat",
"Riot/Web &amp; Desktop chat": "Riot/Web &amp; Desktop chat",
"Riot/iOS &amp; matrix-ios-sdk chat": "Riot/iOS &amp; matrix-ios-sdk chat"
"Riot/iOS &amp; matrix-ios-sdk chat": "Riot/iOS &amp; matrix-ios-sdk chat",
"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.",
"Co-ordination for Riot translators": "Co-ordination for Riot translators"
}

View File

@@ -8,7 +8,7 @@
"You need to be using HTTPS to place a screen-sharing call.": "Vi devas uzi HTTPS por ekranvidadi.",
"Welcome to Riot.im": "Bonvenu al Riot.im",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Malcentra, ĉifrita babilado &amp; kunlaboro povigita de [matrix]",
"Search the room directory": "Serĉi en la ĉambrujo",
"Search the room directory": "Serĉi en la babilejo-listo",
"Chat with Riot Bot": "Babilu kun la roboto Riot Bot",
"Get started with some tips from Riot Bot!": "Komencu kun kelkaj sugestoj de la roboto Riot Bot!",
"General discussion about Matrix and Riot": "Ĝenerala diskutado pri Matrix kaj Riot",

View File

@@ -34,5 +34,6 @@
"Dev chat for the Riot/Web dev team": "Obrolan Developer untuk tim developer Riot/Web",
"Dev chat for the Dendrite dev team": "Obrolan Developer untuk tim developer Dendrite",
"Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "Banyak ruang sudah tersedia di Matrix, terhubung ke jaringan yang sudah ada (Slack, IRC, Gitter dls) atau independen. Cek direktori!",
"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.": "Anda dapat menggunakan opsi lain untuk mendaftar pada server Matrix yang berbeda dengan memasukkan URL server yang sesuai. <br/>Hal ini memungkinkan anda untuk menggunakan Riot dengan akun matrix yang telah tersedia pada Home server yang berbeda.<br/><br/>Anda juga dapat melakukan pengubahan identitas server akan tetapi akan berakibat tidak dapat mengundang pengguna melalui email, atau diundang melalui email."
"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.": "Anda dapat menggunakan opsi lain untuk mendaftar pada server Matrix yang berbeda dengan memasukkan URL server yang sesuai. <br/>Hal ini memungkinkan anda untuk menggunakan Riot dengan akun matrix yang telah tersedia pada Home server yang berbeda.<br/><br/>Anda juga dapat melakukan pengubahan identitas server akan tetapi akan berakibat tidak dapat mengundang pengguna melalui email, atau diundang melalui email.",
"Co-ordination for Riot translators": "Koordinasi dengan penerjemah Riot"
}

View File

@@ -1,11 +1,11 @@
{
"Custom Server Options": "Opzioni Server Personalizzate",
"Custom Server Options": "Opzioni server personalizzate",
"Dismiss": "Chiudi",
"powered by Matrix": "offerto da Matrix",
"Riot Desktop on %(platformName)s": "Riot Desktop su %(platformName)s",
"Riot is not supported on mobile web. Install the app?": "Riot non è supportato sul web mobile. Vuoi installare l'applicazione?",
"Riot is not supported on mobile web. Install the app?": "Riot non è supportato sul web mobile. Installare l'applicazione?",
"Unknown device": "Dispositivo sconosciuto",
"You need to be using HTTPS to place a screen-sharing call.": "Devi usare HTTPS per instaurare una chiamata con condivisione schermo.",
"You need to be using HTTPS to place a screen-sharing call.": "Devi usare HTTPS per effettuare una chiamata con la condivisione dello schermo.",
"Welcome to Riot.im": "Benvenuto/a su Riot.im",
"Search the room directory": "Cerca nella lista delle stanze",
"Chat with Riot Bot": "Chatta con Riot Bot",
@@ -27,8 +27,8 @@
"Implementing VoIP services with Matrix": "Implementazione servizi VoIP con Matrix",
"Discussion of the Identity Service API": "Discussione sull'Identity Service API",
"Support for those using, running and writing other bridges": "Supporto per chi usa, amministra e scrive altri bridge",
"Contributing code to Matrix and Riot": "Contributi al codice di Matrix e Riot",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s su %(osName)s",
"Contributing code to Matrix and Riot": "Contributi di codice per Matrix e Riot",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s tramite %(browserName)s su %(osName)s",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Chat criptate e collaborazioni decentralizzate offerte da [matrix]",
"Discussion of all things Matrix!": "Discussione su tutto quanto riguardi Matrix!",
"Dev chat for the Riot/Web dev team": "Chat per gli sviluppatori di Riot/Web",

View File

@@ -1,5 +1,39 @@
{
"Riot is not supported on mobile web. Install the app?": "Riot nu functionează pe mobil. Instalezi aplicaţia?",
"Riot Desktop on %(platformName)s": "Riot Desktop pe %(platformName)s",
"Unknown device": "Device necunoscut"
"Unknown device": "Device necunoscut",
"Custom Server Options": "Opțiuni Server Personalizate",
"Dismiss": "Închide",
"powered by Matrix": "propulsat de Matrix",
"Welcome to Riot.im": "Bun venit pe Riot.im",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Chat decentralizat, criptat &amp; colaborare propulsata de [matrix]",
"Search the room directory": "Caută în lista de camere",
"Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "Multe camere există deja in Matrix, conectate la rețele existente (Slack, IRC, Gitter etc) sau independente. Aruncă o privite in lista de camere!",
"Chat with Riot Bot": "Discută cu Riot Bot",
"Get started with some tips from Riot Bot!": "Începe cu câteva ponturi din partea Riot Bot!",
"General discussion about Matrix and Riot": "Discuție generală despre Matrix și Riot",
"Discussion of all things Matrix!": "Discuții despre toate subiectele Matrix!",
"Riot/Web &amp; Desktop chat": "Riot/Web &amp; Chat pentru desktop",
"Riot/iOS &amp; matrix-ios-sdk chat": "Riot/iOS &amp; chat pentru matrix-ios-sdk",
"Riot/Android &amp; matrix-android-sdk chat": "Riot/Android &amp; chat pentru matrix-android-sdk",
"Matrix technical discussions": "Discuții tehnice Matrix",
"Running Matrix services": "Rularea serviciilor Matrix",
"Community-run support for Synapse": "Suport cu ajutorul comunității pentru Synapse",
"Admin support for Dendrite": "Suport Administrare pentru Dendrite",
"Announcements about Synapse releases": "Anunțuri despre lansări Synapse",
"Support for those using and running matrix-appservice-irc": "Suport pentru cei care utilizează și rulează matrix-appservice-irc",
"Building services on Matrix": "Construirea serviciilor cu Matrix",
"Support for those using the Matrix spec": "Suport pentru cei ce utilizează specificațiile Matrix",
"Design and implementation of E2E in Matrix": "Designul și planificarea E2E în Matrix",
"Implementing VR services with Matrix": "Implementarea serviciilor VR cu Matrix",
"Implementing VoIP services with Matrix": "Implementarea serviciilor VoIP cu Matrix",
"Discussion of the Identity Service API": "Discuții despre API-ul Serviciul de Identitate",
"Support for those using, running and writing other bridges": "Suport pentru cei ce folosesc, rulează și programeaza alți conectori",
"Contributing code to Matrix and Riot": "Contribuirea codului pentru Matrix și Riot",
"Dev chat for the Riot/Web dev team": "Chat pentru echipa de dezvoltare Riot/Web",
"Dev chat for the Dendrite dev team": "Chat pentru echipa de dezvoltare Dendrite",
"Co-ordination for Riot translators": "Coordonare pentru translatorii Riot",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s pe %(osName)s",
"You need to be using HTTPS to place a screen-sharing call.": "Trebuie să folosești HTTPS pentru a plasa un apel de tip screen-sharing.",
"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.": "Poți folosi opțiunile server personalizate pentru a te conecta la alte servere Matrix prin specificarea unui URL de tip Home server diferit.<br/>Acestă opțiune îți permite să utilizezi Riot cu un cont existent pe un home server diferit.<br/><br/>Poți folosi și un server de identitate personalizat, dar nu vei putea invita alți utilizatori prin adresa de email sau să fii tu însuți invitat prim email."
}

67
src/vector/getconfig.js Normal file
View File

@@ -0,0 +1,67 @@
/*
Copyright 2018 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 Promise from 'bluebird';
import request from 'browser-request';
export async function getVectorConfig(relativeLocation) {
if (relativeLocation === undefined) relativeLocation = '';
if (relativeLocation !== '' && !relativeLocation.endsWith('/')) relativeLocation += '/';
try {
const configJson = await getConfig(`${relativeLocation}config.${document.domain}.json`);
// 404s succeed with an empty json config, so check that there are keys
if (Object.keys(configJson).length === 0) {
throw new Error(); // throw to enter the catch
}
return configJson;
} catch (e) {
return await getConfig(relativeLocation + "config.json");
}
}
function getConfig(configJsonFilename) {
let deferred = Promise.defer();
request(
{ method: "GET", url: configJsonFilename },
(err, response, body) => {
if (err || response.status < 200 || response.status >= 300) {
// Lack of a config isn't an error, we should
// just use the defaults.
// Also treat a blank config as no config, assuming
// the status code is 0, because we don't get 404s
// from file: URIs so this is the only way we can
// not fail if the file doesn't exist when loading
// from a file:// URI.
if (response) {
if (response.status == 404 || (response.status == 0 && body == '')) {
deferred.resolve({});
}
}
deferred.reject({err: err, response: response});
return;
}
// We parse the JSON ourselves rather than use the JSON
// parameter, since this throws a parse error on empty
// which breaks if there's no config.json and we're
// loading from the filesystem (see above).
deferred.resolve(JSON.parse(body));
}
);
return deferred.promise;
}

View File

@@ -1,6 +1,7 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright 2018 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.
@@ -15,8 +16,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
'use strict';
// Require common CSS here; this will make webpack process it into bundle.css.
// Our own CSS (which is themed) is imported via separate webpack entry points
// in webpack.config.js
@@ -25,36 +24,22 @@ require('gfm.css/gfm.css');
require('highlight.js/styles/github.css');
require('draft-js/dist/Draft.css');
const rageshake = require("matrix-react-sdk/lib/rageshake/rageshake");
rageshake.init().then(() => {
console.log("Initialised rageshake: See https://bugs.chromium.org/p/chromium/issues/detail?id=583193 to fix line numbers on Chrome.");
rageshake.cleanup();
}, (err) => {
console.error("Failed to initialise rageshake: " + err);
});
window.addEventListener('beforeunload', (e) => {
console.log('riot-web closing');
// try to flush the logs to indexeddb
rageshake.flush();
});
// add React and ReactPerf to the global namespace, to make them easier to
// access via the console
global.React = require("react");
import React from 'react';
// add React and ReactPerf to the global namespace, to make them easier to
// access via the console
global.React = React;
if (process.env.NODE_ENV !== 'production') {
global.Perf = require("react-addons-perf");
global.Perf = require('react-addons-perf');
}
var RunModernizrTests = require("./modernizr"); // this side-effects a global
var ReactDOM = require("react-dom");
var sdk = require("matrix-react-sdk");
const PlatformPeg = require("matrix-react-sdk/lib/PlatformPeg");
import RunModernizrTests from './modernizr'; // this side-effects a global
import ReactDOM from 'react-dom';
import sdk from 'matrix-react-sdk';
import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
sdk.loadSkin(require('../component-index'));
var VectorConferenceHandler = require('matrix-react-sdk/lib/VectorConferenceHandler');
import VectorConferenceHandler from 'matrix-react-sdk/lib/VectorConferenceHandler';
import Promise from 'bluebird';
var request = require('browser-request');
import request from 'browser-request';
import * as languageHandler from 'matrix-react-sdk/lib/languageHandler';
// Also import _t directly so we can call it just `_t` as this is what gen-i18n.js expects
import { _t } from 'matrix-react-sdk/lib/languageHandler';
@@ -69,12 +54,29 @@ import SettingsStore, {SettingLevel} from "matrix-react-sdk/lib/settings/Setting
import Tinter from 'matrix-react-sdk/lib/Tinter';
import SdkConfig from "matrix-react-sdk/lib/SdkConfig";
var lastLocationHashSet = null;
import rageshake from "matrix-react-sdk/lib/rageshake/rageshake";
var CallHandler = require("matrix-react-sdk/lib/CallHandler");
CallHandler.setConferenceHandler(VectorConferenceHandler);
import CallHandler from 'matrix-react-sdk/lib/CallHandler';
MatrixClientPeg.setIndexedDbWorkerScript(window.vector_indexeddb_worker_script);
import {getVectorConfig} from './getconfig';
let lastLocationHashSet = null;
function initRageshake() {
rageshake.init().then(() => {
console.log("Initialised rageshake: See https://bugs.chromium.org/p/chromium/issues/detail?id=583193 to fix line numbers on Chrome.");
window.addEventListener('beforeunload', (e) => {
console.log('riot-web closing');
// try to flush the logs to indexeddb
rageshake.flush();
});
rageshake.cleanup();
}, (err) => {
console.error("Failed to initialise rageshake: " + err);
});
}
function checkBrowserFeatures(featureList) {
if (!window.Modernizr) {
@@ -100,11 +102,6 @@ function checkBrowserFeatures(featureList) {
return featureComplete;
}
var validBrowser = checkBrowserFeatures([
"displaytable", "flexbox", "es5object", "es5function", "localstorage",
"objectfit", "indexeddb", "webworkers",
]);
// Parse the given window.location and return parameters that can be used when calling
// MatrixChat.showScreen(screen, params)
function getScreenFromLocation(location) {
@@ -135,7 +132,7 @@ function onHashChange(ev) {
// This will be called whenever the SDK changes screens,
// so a web page can update the URL bar appropriately.
var onNewScreen = function(screen) {
function onNewScreen(screen) {
console.log("newscreen "+screen);
var hash = '#/' + screen;
lastLocationHashSet = hash;
@@ -151,7 +148,7 @@ var onNewScreen = function(screen) {
// If we're in electron, we should never pass through a file:// URL otherwise
// the identity server will try to 302 the browser to it, which breaks horribly.
// so in that instance, hardcode to use riot.im/app for now instead.
var makeRegistrationUrl = function(params) {
function makeRegistrationUrl(params) {
let url;
if (window.location.protocol === "file:") {
url = 'https://riot.im/app/#/register';
@@ -177,8 +174,6 @@ var makeRegistrationUrl = function(params) {
return url;
}
window.addEventListener('hashchange', onHashChange);
function getConfig(configJsonFilename) {
let deferred = Promise.defer();
@@ -226,6 +221,12 @@ function onTokenLoginCompleted() {
}
async function loadApp() {
initRageshake();
MatrixClientPeg.setIndexedDbWorkerScript(window.vector_indexeddb_worker_script);
CallHandler.setConferenceHandler(VectorConferenceHandler);
window.addEventListener('hashchange', onHashChange);
await loadLanguage();
const fragparts = parseQsFromFragment(window.location);
@@ -239,15 +240,7 @@ async function loadApp() {
let configJson;
let configError;
try {
try {
configJson = await getConfig(`config.${document.domain}.json`);
// 404s succeed with an empty json config, so check that there are keys
if (Object.keys(configJson).length === 0) {
throw new Error(); // throw to enter the catch
}
} catch (e) {
configJson = await getConfig("config.json");
}
configJson = await getVectorConfig();
} catch (e) {
configError = e;
}
@@ -258,34 +251,18 @@ async function loadApp() {
// don't try to redirect to the native apps if we're
// verifying a 3pid (but after we've loaded the config)
const preventRedirect = Boolean(fragparts.params.client_secret);
// or if the user is following a deep link
// (https://github.com/vector-im/riot-web/issues/7378)
const preventRedirect = fragparts.params.client_secret || fragparts.location.length > 0;
if (!preventRedirect) {
if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
// FIXME: ugly status hardcoding
if (SettingsStore.getValue("theme") === 'status') {
window.location = "https://status.im/join-riot.html";
const isIos = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
const isAndroid = /Android/.test(navigator.userAgent);
if (isIos || isAndroid) {
if (!document.cookie.split(';').some((c) => c.startsWith('mobile_redirect_to_guide'))) {
window.location = "mobile_guide/";
return;
}
else {
if (confirm(_t("Riot is not supported on mobile web. Install the app?"))) {
window.location = "https://itunes.apple.com/us/app/vector.im/id1083446067";
return;
}
}
}
else if (/Android/.test(navigator.userAgent)) {
// FIXME: ugly status hardcoding
if (SettingsStore.getValue("theme") === 'status') {
window.location = "https://status.im/join-riot.html";
return;
}
else {
if (confirm(_t("Riot is not supported on mobile web. Install the app?"))) {
window.location = "https://play.google.com/store/apps/details?id=im.vector.alpha";
return;
}
}
}
}
@@ -325,17 +302,19 @@ async function loadApp() {
}
}
if (window.localStorage && window.localStorage.getItem('mx_accepts_unsupported_browser')) {
console.log('User has previously accepted risks in using an unsupported browser');
validBrowser = true;
}
const validBrowser = checkBrowserFeatures([
"displaytable", "flexbox", "es5object", "es5function", "localstorage",
"objectfit", "indexeddb", "webworkers",
]);
const acceptInvalidBrowser = window.localStorage && window.localStorage.getItem('mx_accepts_unsupported_browser');
console.log("Vector starting at "+window.location);
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) {
} else if (validBrowser || acceptInvalidBrowser) {
const platform = PlatformPeg.get();
platform.startUpdater();
@@ -362,7 +341,6 @@ async function loadApp() {
window.matrixChat = ReactDOM.render(
<CompatibilityPage onAccept={function() {
if (window.localStorage) window.localStorage.setItem('mx_accepts_unsupported_browser', true);
validBrowser = true;
console.log("User accepts the compatibility risks.");
loadApp();
}} />,

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
import {getVectorConfig} from '../getconfig';
function onBackToRiotClick() {
document.cookie = 'mobile_redirect_to_guide=false;path=/';
window.location.href = '../';
}
async function initPage() {
document.getElementById('back_to_riot_button').onclick = onBackToRiotClick;
const config = await getVectorConfig('..');
let hsUrl;
if (config && config['default_hs_url']) {
hsUrl = config['default_hs_url'];
}
if (hsUrl && !hsUrl.endsWith('/')) hsUrl += '/';
if (hsUrl && hsUrl !== 'https://matrix.org/') {
document.getElementById('step2_container').style.display = 'block';
document.getElementById('hs_url').innerHTML = hsUrl;
document.getElementById('step_login_header').innerHTML= 'Step 3: Register or Log in';
}
}
initPage();

View File

@@ -13,6 +13,8 @@ module.exports = {
"bundle": ["babel-polyfill", "./src/vector/index.js"],
"indexeddb-worker": "./src/vector/indexeddb-worker.js",
"mobileguide": "./src/vector/mobile_guide/index.js",
// We ship olm.js as a separate lump of javascript. This makes it get
// loaded via a separate <script/> tag in index.html (which loads it
// into the browser global `Olm`, where js-sdk expects to find it).
@@ -128,10 +130,16 @@ module.exports = {
// bottom of <head> or the bottom of <body>, and I'm a bit scared
// about moving them.
inject: false,
excludeChunks: ['mobileguide'],
vars: {
og_image_url: og_image_url,
},
}),
new HtmlWebpackPlugin({
template: './src/vector/mobile_guide/index.html',
filename: 'mobile_guide/index.html',
chunks: ['mobileguide'],
}),
],
devtool: 'source-map',