Compare commits
118 Commits
nadonomy/e
...
v1.5.14
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
413b26d71b | ||
|
|
45ff2fdcde | ||
|
|
5bd155c294 | ||
|
|
51f4327ce1 | ||
|
|
37cebf38cc | ||
|
|
0a83f9c763 | ||
|
|
f5c5c1b991 | ||
|
|
bfcb46c4fd | ||
|
|
5b35d6e570 | ||
|
|
9269d9b669 | ||
|
|
ec32abbb89 | ||
|
|
c1884a26aa | ||
|
|
1d109bb067 | ||
|
|
35e443975d | ||
|
|
1963270d64 | ||
|
|
3072bbb0d7 | ||
|
|
1697cdc5a1 | ||
|
|
da249cbc40 | ||
|
|
5b94d8bbd7 | ||
|
|
8549755fd5 | ||
|
|
5c51063070 | ||
|
|
758d021f97 | ||
|
|
fea600ba0a | ||
|
|
fd385f8450 | ||
|
|
92d8ee355d | ||
|
|
1f94b25d25 | ||
|
|
8929cd9c08 | ||
|
|
24d85c5cd7 | ||
|
|
4b7cf489c8 | ||
|
|
990a96b56d | ||
|
|
cb23da12cb | ||
|
|
dec2f2a39e | ||
|
|
6315907585 | ||
|
|
6fb9fc4e6f | ||
|
|
df2b966acd | ||
|
|
b09b47543b | ||
|
|
a808d26764 | ||
|
|
e669c681e2 | ||
|
|
4d983f037e | ||
|
|
c10732736c | ||
|
|
bde5679d11 | ||
|
|
783f3c6955 | ||
|
|
4de93a8cdd | ||
|
|
4087ba0c5c | ||
|
|
cd399f0284 | ||
|
|
b41d318e62 | ||
|
|
97243e9c59 | ||
|
|
3aee541cb9 | ||
|
|
da455c2a14 | ||
|
|
679331323a | ||
|
|
350a52b44e | ||
|
|
0620da4351 | ||
|
|
c4bece1fd5 | ||
|
|
080076e3e4 | ||
|
|
f4ef7ba7e1 | ||
|
|
ffb7126582 | ||
|
|
e22ade38f9 | ||
|
|
ae9c02b456 | ||
|
|
9539c14f2f | ||
|
|
a560d3586a | ||
|
|
ffd155a6aa | ||
|
|
fbf4437159 | ||
|
|
f5ac675379 | ||
|
|
3d266cb237 | ||
|
|
4afe7a73c4 | ||
|
|
f377dfcad4 | ||
|
|
775e1fc4ae | ||
|
|
09e26d0882 | ||
|
|
acfeee3258 | ||
|
|
2b751d2ca6 | ||
|
|
9055d0b8b5 | ||
|
|
e1eb16ce46 | ||
|
|
6b959b4a76 | ||
|
|
7296b704a8 | ||
|
|
f02a74a449 | ||
|
|
3a8a5febe9 | ||
|
|
a0fbae0971 | ||
|
|
3b8a34917f | ||
|
|
5808ea2ba1 | ||
|
|
e348546e59 | ||
|
|
34f3671c09 | ||
|
|
3989f41985 | ||
|
|
bd8b3a9046 | ||
|
|
1aecc3d7e5 | ||
|
|
a366c68c38 | ||
|
|
93059366ab | ||
|
|
df9069090f | ||
|
|
77c5d55d38 | ||
|
|
a9fbf2f968 | ||
|
|
25a3449ad2 | ||
|
|
96c7765f5a | ||
|
|
b01c6e67fd | ||
|
|
6854f2d7e8 | ||
|
|
5913e3830b | ||
|
|
368d26af34 | ||
|
|
ebf4e03019 | ||
|
|
3e94b7d911 | ||
|
|
1fda6eb5ab | ||
|
|
8cef591c57 | ||
|
|
31faa4753c | ||
|
|
fe27939394 | ||
|
|
4155973b8a | ||
|
|
5949c432fa | ||
|
|
eba63ce9ab | ||
|
|
0b772ca50a | ||
|
|
d930d14735 | ||
|
|
8e2eab21ae | ||
|
|
98bd951366 | ||
|
|
7c8363c85e | ||
|
|
b419afad40 | ||
|
|
139bf536e4 | ||
|
|
e110c8ed9b | ||
|
|
20a89d67cb | ||
|
|
ce9a964956 | ||
|
|
296e7011e5 | ||
|
|
798d4dabc0 | ||
|
|
f44694ad44 | ||
|
|
e18157d5a0 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,3 +21,4 @@ electron/pub
|
||||
/config.local*.json
|
||||
/src/component-index.js
|
||||
/.tmp
|
||||
/webpack-stats.json
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
"test/svg/asimg",
|
||||
"test/svg/filters",
|
||||
|
||||
"test/url/parser",
|
||||
"test/url/urlsearchparams",
|
||||
|
||||
"test/cors",
|
||||
"test/iframe/sandbox",
|
||||
"test/json",
|
||||
|
||||
58
CHANGELOG.md
58
CHANGELOG.md
@@ -1,3 +1,61 @@
|
||||
Changes in [1.5.14](https://github.com/vector-im/riot-web/releases/tag/v1.5.14) (2020-03-30)
|
||||
============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.14-rc.1...v1.5.14)
|
||||
|
||||
* Upgrade JS SDK to 5.2.0 and React SDK to 2.3.0
|
||||
|
||||
Changes in [1.5.14-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.5.14-rc.1) (2020-03-26)
|
||||
======================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.13...v1.5.14-rc.1)
|
||||
|
||||
* Upgrade JS SDK to 5.2.0-rc.1 and React SDK to 2.3.0-rc.1
|
||||
* Update from Weblate
|
||||
[\#12890](https://github.com/vector-im/riot-web/pull/12890)
|
||||
* App load tweaks
|
||||
[\#12869](https://github.com/vector-im/riot-web/pull/12869)
|
||||
* Add review policy doc
|
||||
[\#12730](https://github.com/vector-im/riot-web/pull/12730)
|
||||
* Fix artifact searching in redeployer
|
||||
[\#12875](https://github.com/vector-im/riot-web/pull/12875)
|
||||
* Fix Jitsi wrapper being large by getting the config from elsewhere
|
||||
[\#12845](https://github.com/vector-im/riot-web/pull/12845)
|
||||
* Add webpack stats which will be used by CI and stored to artifacts
|
||||
[\#12832](https://github.com/vector-im/riot-web/pull/12832)
|
||||
* Revert "Remove useless app preloading from Jitsi widget wrapper"
|
||||
[\#12842](https://github.com/vector-im/riot-web/pull/12842)
|
||||
* Remove useless app preloading from Jitsi widget wrapper
|
||||
[\#12836](https://github.com/vector-im/riot-web/pull/12836)
|
||||
* Update from Weblate
|
||||
[\#12829](https://github.com/vector-im/riot-web/pull/12829)
|
||||
* Fix version for Docker builds
|
||||
[\#12799](https://github.com/vector-im/riot-web/pull/12799)
|
||||
* Register Mac electron specific Cmd+, shortcut to User Settings
|
||||
[\#12800](https://github.com/vector-im/riot-web/pull/12800)
|
||||
* Use a local widget wrapper for Jitsi calls
|
||||
[\#12780](https://github.com/vector-im/riot-web/pull/12780)
|
||||
* Delete shortcuts.md
|
||||
[\#12786](https://github.com/vector-im/riot-web/pull/12786)
|
||||
* Remove remainders of gemini-scrollbar and react-gemini-scrollbar
|
||||
[\#12756](https://github.com/vector-im/riot-web/pull/12756)
|
||||
* Update electron to v7.1.14
|
||||
[\#12762](https://github.com/vector-im/riot-web/pull/12762)
|
||||
* Add url tests to Modernizr
|
||||
[\#12735](https://github.com/vector-im/riot-web/pull/12735)
|
||||
* ElectronPlatform: Add support to remove events from the event index.
|
||||
[\#12703](https://github.com/vector-im/riot-web/pull/12703)
|
||||
* Bump minimist from 1.2.0 to 1.2.2 in /electron_app
|
||||
[\#12744](https://github.com/vector-im/riot-web/pull/12744)
|
||||
* Add docs and flag for custom theme support
|
||||
[\#12731](https://github.com/vector-im/riot-web/pull/12731)
|
||||
* Declare jsx in tsconfig for IDEs
|
||||
[\#12716](https://github.com/vector-im/riot-web/pull/12716)
|
||||
* Remove stuff that yarn install doesn't think we need
|
||||
[\#12713](https://github.com/vector-im/riot-web/pull/12713)
|
||||
* yarn upgrade
|
||||
[\#12691](https://github.com/vector-im/riot-web/pull/12691)
|
||||
* Support TypeScript for React components
|
||||
[\#12696](https://github.com/vector-im/riot-web/pull/12696)
|
||||
|
||||
Changes in [1.5.13](https://github.com/vector-im/riot-web/releases/tag/v1.5.13) (2020-03-17)
|
||||
============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.13-rc.1...v1.5.13)
|
||||
|
||||
@@ -223,6 +223,11 @@ Before attempting to develop on Riot you **must** read the [developer guide
|
||||
for `matrix-react-sdk`](https://github.com/matrix-org/matrix-react-sdk), which
|
||||
also defines the design, architecture and style for Riot too.
|
||||
|
||||
Before starting work on a feature, it's best to ensure your plan aligns well
|
||||
with our vision for Riot. Please chat with the team in
|
||||
[#riot-dev:matrix.org](https://matrix.to/#/#riot-dev:matrix.org) before you
|
||||
start so we can ensure it's something we'd be willing to merge.
|
||||
|
||||
You should also familiarise yourself with the ["Here be Dragons" guide
|
||||
](https://docs.google.com/document/d/12jYzvkidrp1h7liEuLIe6BMdU0NUjndUYI971O06ooM)
|
||||
to the tame & not-so-tame dragons (gotchas) which exist in the codebase.
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
"https://scalar-staging.vector.im/api",
|
||||
"https://scalar-staging.riot.im/scalar/api"
|
||||
],
|
||||
"integrations_jitsi_widget_url": "https://scalar.vector.im/api/widgets/jitsi.html",
|
||||
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
|
||||
"defaultCountryCode": "GB",
|
||||
"showLabsSettings": false,
|
||||
@@ -52,5 +51,9 @@
|
||||
},
|
||||
"settingDefaults": {
|
||||
"breadcrumbs": true
|
||||
},
|
||||
"jitsi": {
|
||||
"preferredDomain": "jitsi.riot.im",
|
||||
"externalApiUrl": "https://jitsi.riot.im/libs/external_api.min.js"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,13 @@ For a good example, see https://riot.im/develop/config.json.
|
||||
By default, this is "https://matrix.to" to generate matrix.to (spec) permalinks.
|
||||
Set this to your Riot instance URL if you run an unfederated server (eg:
|
||||
"https://riot.example.org").
|
||||
1. `jitsi`: Used to change the default conference options.
|
||||
1. `preferredDomain`: The domain name of the preferred Jitsi instance. Defaults
|
||||
to `jitsi.riot.im`. This is used whenever a user clicks on the voice/video
|
||||
call buttons - integration managers may use a different domain.
|
||||
1. `externalApiUrl`: The URL to the Jitsi Meet API script. This is required
|
||||
for showing any Jitsi widgets, no matter the source. Defaults to
|
||||
`https://jitsi.riot.im/libs/external_api.min.js`.
|
||||
|
||||
Note that `index.html` also has an og:image meta tag that is set to an image
|
||||
hosted on riot.im. This is the image used if links to your copy of Riot
|
||||
|
||||
@@ -98,3 +98,12 @@ person is online.
|
||||
|
||||
This adds padlocks to room list tiles and room header for invite only rooms.
|
||||
This feature flag (unlike most) is enabled by default.
|
||||
|
||||
## Custom themes (`feature_custom_themes`)
|
||||
|
||||
Custom themes are possible through Riot's [theme support](./theming.md), though
|
||||
normally these themes need to be defined in the config for Riot. This labs flag
|
||||
adds an ability for end users to add themes themselves by using a URL to the JSON
|
||||
theme definition.
|
||||
|
||||
For some sample themes, check out [aaronraimist/riot-web-themes](https://github.com/aaronraimist/riot-web-themes).
|
||||
|
||||
82
docs/review.md
Normal file
82
docs/review.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# Review Guidelines
|
||||
|
||||
The following summarises review guidelines that we follow for pull requests in
|
||||
Riot Web and other supporting repos. These are just guidelines (not strict
|
||||
rules) and may be updated over time.
|
||||
|
||||
## Code Review
|
||||
|
||||
When reviewing code, here are some things we look for and also things we avoid:
|
||||
|
||||
### We review for
|
||||
|
||||
* Correctness
|
||||
* Performance
|
||||
* Accessibility
|
||||
* Security
|
||||
* Comments and documentation where needed
|
||||
* Sharing knowledge of different areas among the team
|
||||
* Ensuring it's something we're comfortable maintaining for the long term
|
||||
* Progress indicators and local echo where appropriate with network activity
|
||||
|
||||
### We should avoid
|
||||
|
||||
* Style nits that are already handled by the linter
|
||||
* Dramatically increasing scope
|
||||
|
||||
### Good practices
|
||||
|
||||
* Use empathetic language
|
||||
* See also [Mindful Communication in Code
|
||||
Reviews](https://kickstarter.engineering/a-guide-to-mindful-communication-in-code-reviews-48aab5282e5e)
|
||||
and [How to Do Code Reviews Like a Human](https://mtlynch.io/human-code-reviews-1/)
|
||||
* Authors should prefer smaller commits for easier reviewing and bisection
|
||||
* Reviewers should be explicit about required versus optional changes
|
||||
* Reviews are conversations and the PR author should feel comfortable
|
||||
discussing and pushing back on changes before making them
|
||||
* Core team should lead by example through their tone and language
|
||||
* Take the time to thank and point out good code changes
|
||||
* Using softer language like "please" and "what do you think?" goes a long way
|
||||
towards making others feel like colleagues working towards a common goal
|
||||
|
||||
### Workflow
|
||||
|
||||
* Authors should request review from riot-web team by default (if someone on the
|
||||
team is clearly the expert in an area, a direct review request to them may be
|
||||
more appropriate)
|
||||
* Reviewers should remove the team review request and request review from
|
||||
themselves when starting a review to avoid double review
|
||||
* Authors should link to other layers of their PR in their PR before requesting
|
||||
review. Reviewers might be coming from different places and could miss other
|
||||
required PRs.
|
||||
* Avoid force pushing to a PR after first round of review
|
||||
* Use the GitHub default of merge commits when landing (avoid alternate options
|
||||
like squash or rebase)
|
||||
* PR author merges after review (assuming they have write access)
|
||||
* Assign issues only when in progress to indicate to others what can be picked
|
||||
up
|
||||
|
||||
## Design and Product Review
|
||||
|
||||
We want to ensure that all changes to Riot fit with our design and product
|
||||
vision. We often request review from those teams so they can provide their
|
||||
perspective.
|
||||
|
||||
In more detail, our usual process for changes that affect the UI or alter user
|
||||
functionality is:
|
||||
|
||||
* For changes that will go live when merged, always flag Design and Product
|
||||
teams as appropriate
|
||||
* For changes guarded by a feature flag, Design and Product review is not
|
||||
required (though may still be useful) since we can continue tweaking
|
||||
|
||||
As it can be difficult to review design work from looking at just the changed
|
||||
files in a PR, authors should be prepared for Design and / or Product teams to
|
||||
request a link to an ad-hoc build of Riot (hosted anywhere) that can be used for
|
||||
the review. In the future, we [hope to automate
|
||||
this](https://github.com/vector-im/riot-web/issues/12624) for every PR.
|
||||
|
||||
Before starting work on a feature, it's best to ensure your plan aligns well
|
||||
with our vision for Riot. Please chat with the team in
|
||||
[#riot-dev:matrix.org](https://matrix.to/#/#riot-dev:matrix.org) before you
|
||||
start so we can ensure it's something we'd be willing to merge.
|
||||
@@ -1,15 +0,0 @@
|
||||
# Keyboard Shortcuts
|
||||
|
||||
The modifier is <kbd>Ctrl</kbd> on Windows & Linux and <kbd>⌘</kbd> on Mac.
|
||||
|
||||
- <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>m</kbd> - toggle markdown
|
||||
- <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>d</kbd> - toggle mic mute
|
||||
- <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>e</kbd> - toggle video on/off
|
||||
- <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>k</kbd> - jump to named room
|
||||
- <kbd>↑</kbd>/<kbd>↓</kbd> - navigate old messages to edit when the composer is in focus
|
||||
- <kbd>↑</kbd>/<kbd>↓</kbd> - next/prev room when focus in room list
|
||||
- <kbd>Alt</kbd>+<kbd>↑</kbd>/<kbd>↓</kbd> - resend previous messages when the composer is in focus
|
||||
- <kbd>PageUp</kbd>/<kbd>PageDown</kbd> - scroll timeline up/down
|
||||
- <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>Home</kbd>/<kbd>End</kbd> - jump to
|
||||
start/end of the composer when focused, otherwise jump to timeline start/end
|
||||
- <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>`</kbd> - toggle the top left menu
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "riot-web",
|
||||
"productName": "Riot",
|
||||
"main": "src/electron-main.js",
|
||||
"version": "1.5.13",
|
||||
"version": "1.5.14",
|
||||
"description": "A feature-rich client for Matrix.org",
|
||||
"author": "New Vector Ltd.",
|
||||
"dependencies": {
|
||||
|
||||
@@ -40,6 +40,11 @@ const template = [
|
||||
{ role: 'zoomin', accelerator: 'CommandOrControl+=' },
|
||||
{ role: 'zoomout' },
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: 'Preferences',
|
||||
accelerator: 'Command+,', // Mac-only accelerator
|
||||
click() { global.mainWindow.webContents.send('preferences'); },
|
||||
},
|
||||
{ role: 'togglefullscreen' },
|
||||
{ role: 'toggledevtools' },
|
||||
],
|
||||
|
||||
@@ -500,9 +500,9 @@ minimist@0.0.8:
|
||||
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
|
||||
|
||||
minimist@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
||||
integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
|
||||
version "1.2.2"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.2.tgz#b00a00230a1108c48c169e69a291aafda3aacd63"
|
||||
integrity sha512-rIqbOrKb8GJmx/5bc2M0QchhUouMXSpd1RTclXsB41JdL+VtnojfaJR+h7F9k18/4kHUsBFgk80Uk+q569vjPA==
|
||||
|
||||
mkdirp@0.5.1, mkdirp@^0.5.1:
|
||||
version "0.5.1"
|
||||
|
||||
19
package.json
19
package.json
@@ -2,7 +2,7 @@
|
||||
"name": "riot-web",
|
||||
"productName": "Riot",
|
||||
"main": "electron_app/src/electron-main.js",
|
||||
"version": "1.5.13",
|
||||
"version": "1.5.14",
|
||||
"description": "A feature-rich client for Matrix.org",
|
||||
"author": "New Vector Ltd.",
|
||||
"repository": {
|
||||
@@ -37,16 +37,18 @@
|
||||
"reskindex:watch-react": "node scripts/yarn-sub.js matrix-react-sdk reskindex:watch",
|
||||
"clean": "rimraf lib webapp electron_app/dist",
|
||||
"build": "yarn clean && yarn build:genfiles && yarn build:compile && yarn build:types && yarn build:bundle",
|
||||
"build-stats": "yarn clean && yarn build:genfiles && yarn build:compile && yarn build:types && yarn build:bundle-stats",
|
||||
"build:res": "node scripts/copy-res.js",
|
||||
"build:genfiles": "yarn reskindex && yarn build:res",
|
||||
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
|
||||
"build:compile": "babel -d lib --verbose --extensions \".ts,.js\" src",
|
||||
"build:compile": "babel -d lib --verbose --extensions \".ts,.js,.tsx\" src",
|
||||
"build:bundle": "cross-env NODE_ENV=production webpack -p --progress --bail --mode production",
|
||||
"build:bundle-stats": "cross-env NODE_ENV=production webpack -p --progress --bail --mode production --json > webpack-stats.json",
|
||||
"build:electron": "yarn build && yarn install:electron && electron-builder -wml --ia32 --x64",
|
||||
"build:electron:linux": "yarn build && electron-builder -l --x64",
|
||||
"build:electron:macos": "yarn build && electron-builder -m --x64",
|
||||
"build:electron:windows": "yarn build && electron-builder -w --ia32 --x64",
|
||||
"build:types": "tsc --emitDeclarationOnly",
|
||||
"build:types": "tsc --emitDeclarationOnly --jsx react",
|
||||
"install:electron": "electron-builder install-app-deps",
|
||||
"dist": "scripts/package.sh",
|
||||
"start": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n reskindex,reskindex-react,res,riot-js \"yarn reskindex:watch\" \"yarn reskindex:watch-react\" \"yarn start:res\" \"yarn start:js\"",
|
||||
@@ -56,18 +58,17 @@
|
||||
"lint": "yarn lint:types && yarn lint:ts && yarn lint:js && yarn lint:style",
|
||||
"lint:js": "eslint src",
|
||||
"lint:ts": "echo 'We don't actually have a typescript linter at this layer because tslint is being removed from our stack. Presumably your TS is fine.'",
|
||||
"lint:types": "tsc --noEmit",
|
||||
"lint:types": "tsc --noEmit --jsx react",
|
||||
"lint:style": "stylelint 'res/css/**/*.scss'",
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"browser-request": "^0.3.3",
|
||||
"favico.js": "^0.3.10",
|
||||
"gemini-scrollbar": "github:matrix-org/gemini-scrollbar#91e1e566",
|
||||
"gfm.css": "^1.1.2",
|
||||
"highlight.js": "^9.13.1",
|
||||
"matrix-js-sdk": "5.1.1",
|
||||
"matrix-react-sdk": "2.2.3",
|
||||
"matrix-js-sdk": "5.2.0",
|
||||
"matrix-react-sdk": "2.3.0",
|
||||
"olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz",
|
||||
"postcss-easings": "^2.0.0",
|
||||
"prop-types": "^15.7.2",
|
||||
@@ -94,7 +95,7 @@
|
||||
"@babel/preset-typescript": "^7.7.4",
|
||||
"@babel/register": "^7.7.4",
|
||||
"@babel/runtime": "^7.7.6",
|
||||
"@types/react": "^16.9.17",
|
||||
"@types/react": "16.9",
|
||||
"@types/react-dom": "^16.9.4",
|
||||
"autoprefixer": "^9.7.3",
|
||||
"babel-eslint": "^10.0.3",
|
||||
@@ -153,7 +154,7 @@
|
||||
},
|
||||
"build": {
|
||||
"appId": "im.riot.app",
|
||||
"electronVersion": "7.1.12",
|
||||
"electronVersion": "7.1.14",
|
||||
"files": [
|
||||
"node_modules/**",
|
||||
"src/**"
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
"feature_invite_only_padlocks": "enable",
|
||||
"feature_event_indexing": "disable",
|
||||
"feature_bridge_state": "labs",
|
||||
"feature_presence_in_room_list": "labs"
|
||||
"feature_presence_in_room_list": "labs",
|
||||
"feature_custom_themes": "labs"
|
||||
},
|
||||
"welcomeUserId": "@riot-bot:matrix.org",
|
||||
"piwik": {
|
||||
|
||||
@@ -11,7 +11,7 @@ DIST_VERSION=$TAG
|
||||
# a few SHAs rather than a version.
|
||||
# Docker Hub doesn't always check out the tag and sometimes checks out the branch, so we should look
|
||||
# for an appropriately tagged branch as well (heads/v1.2.3).
|
||||
if [[ $BRANCH != 'HEAD' && $BRANCH != 'heads/v*' ]]
|
||||
if [[ $BRANCH != HEAD && ! $BRANCH =~ heads/v.+ ]]
|
||||
then
|
||||
REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD)
|
||||
JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)
|
||||
|
||||
@@ -133,9 +133,9 @@ def on_receive_buildkite_poke():
|
||||
for artifact in artifacts_array:
|
||||
if re.match(r"dist/.*.tar.gz", artifact['path']):
|
||||
artifact_to_deploy = artifact
|
||||
if artifact_to_deploy is None:
|
||||
print("No suitable artifacts found")
|
||||
return jsonify({})
|
||||
if artifact_to_deploy is None:
|
||||
print("No suitable artifacts found")
|
||||
return jsonify({})
|
||||
|
||||
# double paranoia check: make sure the artifact is on the right org too
|
||||
if required_api_prefix is not None and not artifact_to_deploy['url'].startswith(required_api_prefix):
|
||||
|
||||
22
src/@types/global.d.ts
vendored
Normal file
22
src/@types/global.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2020 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.
|
||||
*/
|
||||
|
||||
interface Window {
|
||||
Olm: {
|
||||
init: () => Promise<void>;
|
||||
};
|
||||
mxSendRageshake: (text: string, withLogs?: boolean) => void;
|
||||
}
|
||||
@@ -21,5 +21,7 @@
|
||||
"Your Riot is misconfigured": "Riot не е конфигуриран правилно",
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Riot конфигурацията ви съдържа невалиден JSON. Коригирайте проблема и презаредете страницата.",
|
||||
"The message from the parser is: %(message)s": "Грешката от парсъра е: %(message)s",
|
||||
"Invalid JSON": "Невалиден JSON"
|
||||
"Invalid JSON": "Невалиден JSON",
|
||||
"Open user settings": "Отвори потребителските настройки",
|
||||
"Go to your browser to complete Sign In": "Отидете в браузъра за да завършите влизането"
|
||||
}
|
||||
|
||||
@@ -21,5 +21,6 @@
|
||||
"Need help?": "Angen cymorth?",
|
||||
"Chat with Riot Bot": "Sgwrsio gyda Riot Bot",
|
||||
"Explore rooms": "Archwilio Ystafelloedd",
|
||||
"Room Directory": "Cyfeiriadur Ystafelloedd"
|
||||
"Room Directory": "Cyfeiriadur Ystafelloedd",
|
||||
"Go to your browser to complete Sign In": "Ewch i'ch porwr i gwblhau Mewngofnodi"
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Deine Riot Konfiguration enthält ungültiges JSON. Bitte korrigiere das Problem und lade die Seite neu.",
|
||||
"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"
|
||||
"Go to your browser to complete Sign In": "Gehe zu deinem Browser, um die Anmeldung abzuschließen",
|
||||
"Open user settings": "Öffne Nutzer-Einstellungen"
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"Unexpected error preparing the app. See console for details.": "Unexpected error preparing the app. See console for details.",
|
||||
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.",
|
||||
"Invalid configuration: no default server specified.": "Invalid configuration: no default server specified.",
|
||||
"Open user settings": "Open user settings",
|
||||
"Riot Desktop on %(platformName)s": "Riot Desktop on %(platformName)s",
|
||||
"Go to your browser to complete Sign In": "Go to your browser to complete Sign In",
|
||||
"Unknown device": "Unknown device",
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Viaj Riot-agordoj enhavas nevalidan JSON-on. Bonvolu korekti la problemon kaj reŝarĝi la paĝon.",
|
||||
"The message from the parser is: %(message)s": "La mesaĝo el la analizilo estas: %(message)s",
|
||||
"Invalid JSON": "Nevalida JSON",
|
||||
"Go to your browser to complete Sign In": "Iru al via foliumilo por fini la saluton"
|
||||
"Go to your browser to complete Sign In": "Iru al via foliumilo por fini la saluton",
|
||||
"Open user settings": "Malfermi agordojn de uzanto"
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Zure Riot konfigurazioak baliogabeko JSON kodea du. Zuzendu arazoa eta kargatu orria berriro.",
|
||||
"The message from the parser is: %(message)s": "Prozesatzailearen mezua hau da: %(message)s",
|
||||
"Invalid JSON": "JSON baliogabea",
|
||||
"Go to your browser to complete Sign In": "Joan zure nabigatzailera izena ematen bukatzeko"
|
||||
"Go to your browser to complete Sign In": "Joan zure nabigatzailera izena ematen bukatzeko",
|
||||
"Open user settings": "Ireki erabiltzailearen ezarpenak"
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Votre configuration de Riot contient du JSON non valide. Corrigez ce problème et rechargez la page.",
|
||||
"The message from the parser is: %(message)s": "Le message de l’analyseur est : %(message)s",
|
||||
"Invalid JSON": "JSON non valide",
|
||||
"Go to your browser to complete Sign In": "Utilisez votre navigateur pour terminer la connexion"
|
||||
"Go to your browser to complete Sign In": "Utilisez votre navigateur pour terminer la connexion",
|
||||
"Open user settings": "Ouvrir les paramètres utilisateur"
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "A Riot beállításod érvénytelen JSON szöveget tartalmaz. Kérlek javítsd és töltsd újra az oldalt.",
|
||||
"The message from the parser is: %(message)s": "A feldolgozó algoritmus üzenete: %(message)s",
|
||||
"Invalid JSON": "Érvénytelen JSON",
|
||||
"Go to your browser to complete Sign In": "A böngészőben fejezd be a bejelentkezést"
|
||||
"Go to your browser to complete Sign In": "A böngészőben fejezd be a bejelentkezést",
|
||||
"Open user settings": "Felhasználói beállítások megnyitása"
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "La tua configurazione di Riot contiene un JSON non valido. Correggi il problema e ricarica la pagina.",
|
||||
"The message from the parser is: %(message)s": "Il messaggio dal parser è: %(message)s",
|
||||
"Invalid JSON": "JSON non valido",
|
||||
"Go to your browser to complete Sign In": "Vai nel tuo browser per completare l'accesso"
|
||||
"Go to your browser to complete Sign In": "Vai nel tuo browser per completare l'accesso",
|
||||
"Open user settings": "Apri impostazioni utente"
|
||||
}
|
||||
|
||||
@@ -21,5 +21,7 @@
|
||||
"Need help?": "Тусламж хэрэгтэй юу?",
|
||||
"Chat with Riot Bot": "Риот боттой чатлах",
|
||||
"Explore rooms": "Өрөөнүүд үзэх",
|
||||
"Room Directory": "Өрөөний директор"
|
||||
"Room Directory": "Өрөөний директор",
|
||||
"Open user settings": "Хэрэглэгчийн тохиргоо нээх",
|
||||
"Go to your browser to complete Sign In": "Бүрэн нэвтрэхийн тулд вэб хөтөч рүү шилжинэ үү"
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Uw Riot-configuratie bevat ongeldige JSON. Corrigeer het probleem en herlaad de pagina.",
|
||||
"The message from the parser is: %(message)s": "De ontleder meldt: %(message)s",
|
||||
"Invalid JSON": "Ongeldige JSON",
|
||||
"Go to your browser to complete Sign In": "Ga naar uw browser om de aanmelding te voltooien"
|
||||
"Go to your browser to complete Sign In": "Ga naar uw browser om de aanmelding te voltooien",
|
||||
"Open user settings": "Open de gebruikersinstellingen"
|
||||
}
|
||||
|
||||
22
src/i18n/strings/oc.json
Normal file
22
src/i18n/strings/oc.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Vòstra configuracion Riot conten de JSON invalid. Mercés de corregir lo problèma e d’actualizar la pagina.",
|
||||
"The message from the parser is: %(message)s": "Lo messatge de l’analisaire es : %(message)s",
|
||||
"Invalid JSON": "Invalid JSON",
|
||||
"Your Riot is misconfigured": "Vòstre Riot es mal configurat",
|
||||
"Unexpected error preparing the app. See console for details.": "Error inesperada en preparant l’aplicacion. Vejatz la consòla pels detalhs.",
|
||||
"Riot Desktop on %(platformName)s": "Riot Desktop sus %(platformName)s",
|
||||
"Go to your browser to complete Sign In": "Anatz al navegador per acabar la connexion",
|
||||
"Unknown device": "Periferic desconegut",
|
||||
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s sus %(osName)s",
|
||||
"powered by Matrix": "propulsat per Matrix",
|
||||
"Custom Server Options": "Opcions de servidor personalizat",
|
||||
"Dismiss": "Refusar",
|
||||
"Welcome to Riot.im": "La benvenguda a Riot.im",
|
||||
"Decentralised, encrypted chat & collaboration powered by [matrix]": "Messatjariá chifrada, descentralizada e collaborativa propulsada per [matrix]",
|
||||
"Sign In": "Se connectar",
|
||||
"Create Account": "Crear un compte",
|
||||
"Need help?": "Besonh d’ajuda ?",
|
||||
"Chat with Riot Bot": "Charrar amb lo robòt Riot",
|
||||
"Explore rooms": "Percórrer las salas",
|
||||
"Room Directory": "Annuari de las sala"
|
||||
}
|
||||
@@ -1,25 +1,26 @@
|
||||
{
|
||||
"Custom Server Options": "Opções para Servidor Personalizado",
|
||||
"Custom Server Options": "Opções do Servidor Personalizado",
|
||||
"Dismiss": "Descartar",
|
||||
"powered by Matrix": "rodando a partir do Matrix",
|
||||
"powered by Matrix": "powered by Matrix",
|
||||
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s em %(osName)s",
|
||||
"Riot Desktop on %(platformName)s": "Riot para computadores desktop em %(platformName)s",
|
||||
"Riot Desktop on %(platformName)s": "Riot Desktop em %(platformName)s",
|
||||
"Unknown device": "Dispositivo desconhecido",
|
||||
"You need to be using HTTPS to place a screen-sharing call.": "Necessita de estar a usar HTTPS para poder iniciar uma chamada com partilha de ecrã.",
|
||||
"Welcome to Riot.im": "Bem-vindo ao Riot.im",
|
||||
"Decentralised, encrypted chat & collaboration powered by [matrix]": "Chat descentralizado, encriptado & colaborativo alimentado por [matrix]",
|
||||
"Decentralised, encrypted chat & collaboration powered by [matrix]": "Chat descentralizado, encriptado & colaborativo powered by [matrix]",
|
||||
"Chat with Riot Bot": "Falar com o Bot do Riot",
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "A sua configuração do RIOT contém JSON inválido. Por favor corriga o erro e recarregue a página.",
|
||||
"The message from the parser is: %(message)s": "A mensagem do analisador é: %(message)s",
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "A sua configuração do Riot contém JSON inválido. Por favor corrija o erro e recarregue a página.",
|
||||
"The message from the parser is: %(message)s": "A mensagem do parser é: %(message)s",
|
||||
"Invalid JSON": "JSON inválido",
|
||||
"Your Riot is misconfigured": "A sua configuração do RIOT está incorrecta.",
|
||||
"Your Riot is misconfigured": "Existe um erro na configuração do Riot",
|
||||
"Unexpected error preparing the app. See console for details.": "Erro inesperado na preparação da aplicação. Veja a consola para mais detalhes.",
|
||||
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuração inválida: só pode especificar uma das default_server_config, default_server_name,\nor default_hs_url.",
|
||||
"Invalid configuration: no default server specified.": "Configuração inválida: não existe especificação de servidor padrão.",
|
||||
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Pode usar as opções de custom server, para iniciar sessão noutros servidores Matrix.org, especificando o URL do homeserver diferente. Isto autoriza-lo-á a usar RIOT com a sua conta Matrix num servidor diferente",
|
||||
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuração inválida: só pode especificar uma das default_server_config, default_server_name, ou default_hs_url.",
|
||||
"Invalid configuration: no default server specified.": "Configuração inválida: servidor padrão não especificado.",
|
||||
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Pode usar as opções de servidor personalizado, para iniciar sessão noutros servidores Matrix, especificando o URL do homeserver diferente. Isto autoriza-lo-á a usar Riot com a sua conta Matrix num servidor diferente.",
|
||||
"Sign In": "Iniciar sessão",
|
||||
"Create Account": "Criar conta",
|
||||
"Need help?": "Ajuda?",
|
||||
"Explore rooms": "Explorar rooms",
|
||||
"Room Directory": "Diretório de rooms"
|
||||
"Room Directory": "Diretório de rooms",
|
||||
"Go to your browser to complete Sign In": "Abra o seu navegador para completar o inicio de sessão"
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Formësimi juaj i Riot-it përmban JSON. Ju lutemi, ndreqeni problemin dhe ringarkoni faqen.",
|
||||
"The message from the parser is: %(message)s": "Mesazhi prej procesit është: %(message)s",
|
||||
"Invalid JSON": "JSON i pavlefshëm",
|
||||
"Go to your browser to complete Sign In": "Që të plotësoni Hyrjen, kaloni te shfletuesi juaj"
|
||||
"Go to your browser to complete Sign In": "Që të plotësoni Hyrjen, kaloni te shfletuesi juaj",
|
||||
"Open user settings": "Hapni rregullime përdoruesi"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"%(appName)s via %(browserName)s on %(osName)s": "%(osName)s işletim sisteminde %(browserName)s ile %(appName)s",
|
||||
"Custom Server Options": "Özelleştirilebilir Sunucu Seçenekleri",
|
||||
"Dismiss": "Kapat",
|
||||
"powered by Matrix": "Matrix tarafından destekleniyor",
|
||||
"powered by Matrix": "Matrix'den besleniyor",
|
||||
"Riot Desktop on %(platformName)s": "%(platformName)s platformunda Riot Masaüstü",
|
||||
"Unknown device": "Bilinmeyen aygıt",
|
||||
"You need to be using HTTPS to place a screen-sharing call.": "Ekran paylaşımlı arama yapmak için HTTPS kullanıyor olmalısınız.",
|
||||
@@ -17,9 +17,11 @@
|
||||
"Room Directory": "Oda Dizini",
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Riot yapılandırmanız geçersiz JSON ifadesi içermektedir. Lütfen problemi düzeltin ve sayfayı yenileyin.",
|
||||
"Invalid JSON": "Geçersiz JSON",
|
||||
"Your Riot is misconfigured": "Rioutunuz hatalı yapılandırılmış",
|
||||
"Unexpected error preparing the app. See console for details.": "Uygulamayı hazırlarken beklenmeyen hata oluştu. Lütfen detaylar için konsola bakınız.",
|
||||
"Your Riot is misconfigured": "Riot hatalı ayarlanmış",
|
||||
"Unexpected error preparing the app. See console for details.": "Uygulama hazırlanırken beklenmeyen bir hata oldu. Detaylar için konsola bakın.",
|
||||
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Geçersiz yapılandırma: default_server_config, default_server_name, yada default_hs_url den sadece birisi seçilebilir.",
|
||||
"Invalid configuration: no default server specified.": "Geçersiz yapılandırma: varsayılan sunucu seçilmemiş.",
|
||||
"The message from the parser is: %(message)s": "Ayrıştırıcıdan gelen mesaj: %(message)s"
|
||||
"The message from the parser is: %(message)s": "Ayrıştırıcıdan gelen mesaj: %(message)s",
|
||||
"Go to your browser to complete Sign In": "Oturum açmayı tamamlamak için tarayıcınıza gidin",
|
||||
"Open user settings": "Kullanıcı ayarlarını aç"
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "您的 Riot 包含無效的 JSON。請修正問題並重新整理頁面。",
|
||||
"The message from the parser is: %(message)s": "從解析器而來的訊息為:%(message)s",
|
||||
"Invalid JSON": "無效的 JSON",
|
||||
"Go to your browser to complete Sign In": "到您的瀏覽器完成登入"
|
||||
"Go to your browser to complete Sign In": "到您的瀏覽器完成登入",
|
||||
"Open user settings": "開啟使用者設定"
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import olmWasmPath from 'olm/olm.wasm';
|
||||
|
||||
import React from 'react';
|
||||
// add React and ReactPerf to the global namespace, to make them easier to
|
||||
// access via the console
|
||||
@@ -29,7 +27,6 @@ import ReactDOM from 'react-dom';
|
||||
import * as sdk from 'matrix-react-sdk';
|
||||
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg';
|
||||
import * as VectorConferenceHandler from 'matrix-react-sdk/src/VectorConferenceHandler';
|
||||
import * as languageHandler from 'matrix-react-sdk/src/languageHandler';
|
||||
import {_t, _td, newTranslatableError} from 'matrix-react-sdk/src/languageHandler';
|
||||
import AutoDiscoveryUtils from 'matrix-react-sdk/src/utils/AutoDiscoveryUtils';
|
||||
import {AutoDiscovery} from "matrix-js-sdk/src/autodiscovery";
|
||||
@@ -39,17 +36,12 @@ import url from 'url';
|
||||
|
||||
import {parseQs, parseQsFromFragment} from './url_utils';
|
||||
|
||||
import ElectronPlatform from './platform/ElectronPlatform';
|
||||
import WebPlatform from './platform/WebPlatform';
|
||||
|
||||
import {MatrixClientPeg} from 'matrix-react-sdk/src/MatrixClientPeg';
|
||||
import SettingsStore from "matrix-react-sdk/src/settings/SettingsStore";
|
||||
import SdkConfig from "matrix-react-sdk/src/SdkConfig";
|
||||
import {setTheme} from "matrix-react-sdk/src/theme";
|
||||
|
||||
import Olm from 'olm';
|
||||
|
||||
import CallHandler from 'matrix-react-sdk/src/CallHandler';
|
||||
import {loadConfig, preparePlatform, loadLanguage, loadOlm} from "./init";
|
||||
|
||||
let lastLocationHashSet = null;
|
||||
|
||||
@@ -191,35 +183,11 @@ export async function loadApp() {
|
||||
await loadOlm();
|
||||
|
||||
// set the platform for react sdk
|
||||
if (window.ipcRenderer) {
|
||||
console.log("Using Electron platform");
|
||||
const plaf = new ElectronPlatform();
|
||||
PlatformPeg.set(plaf);
|
||||
} else {
|
||||
console.log("Using Web platform");
|
||||
PlatformPeg.set(new WebPlatform());
|
||||
}
|
||||
|
||||
preparePlatform();
|
||||
const platform = PlatformPeg.get();
|
||||
|
||||
let configJson;
|
||||
let configError;
|
||||
let configSyntaxError = false;
|
||||
try {
|
||||
configJson = await platform.getConfig();
|
||||
} catch (e) {
|
||||
configError = e;
|
||||
|
||||
if (e && e.err && e.err instanceof SyntaxError) {
|
||||
console.error("SyntaxError loading config:", e);
|
||||
configSyntaxError = true;
|
||||
configJson = {}; // to prevent errors between here and loading CSS for the error box
|
||||
}
|
||||
}
|
||||
|
||||
// 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.
|
||||
SdkConfig.put(configJson);
|
||||
// Load the config from the platform
|
||||
const configError = await loadConfig();
|
||||
|
||||
// Load language after loading config.json so that settingsDefaults.language can be applied
|
||||
await loadLanguage();
|
||||
@@ -248,7 +216,7 @@ export async function loadApp() {
|
||||
await setTheme();
|
||||
|
||||
// Now that we've loaded the theme (CSS), display the config syntax error if needed.
|
||||
if (configSyntaxError) {
|
||||
if (configError && configError.err && configError.err instanceof SyntaxError) {
|
||||
const errorMessage = (
|
||||
<div>
|
||||
<p>
|
||||
@@ -298,7 +266,7 @@ export async function loadApp() {
|
||||
config={newConfig}
|
||||
realQueryParams={params}
|
||||
startingFragmentQueryParams={fragparts.params}
|
||||
enableGuest={!configJson.disable_guests}
|
||||
enableGuest={!SdkConfig.get().disable_guests}
|
||||
onTokenLoginCompleted={onTokenLoginCompleted}
|
||||
initialScreenAfterLogin={getScreenFromLocation(window.location)}
|
||||
defaultDeviceDisplayName={platform.getDefaultDeviceDisplayName()}
|
||||
@@ -334,62 +302,6 @@ export async function loadApp() {
|
||||
}
|
||||
}
|
||||
|
||||
function loadOlm() {
|
||||
/* Load Olm. We try the WebAssembly version first, and then the legacy,
|
||||
* asm.js version if that fails. For this reason we need to wait for this
|
||||
* to finish before continuing to load the rest of the app. In future
|
||||
* we could somehow pass a promise down to react-sdk and have it wait on
|
||||
* that so olm can be loading in parallel with the rest of the app.
|
||||
*
|
||||
* We also need to tell the Olm js to look for its wasm file at the same
|
||||
* level as index.html. It really should be in the same place as the js,
|
||||
* ie. in the bundle directory, but as far as I can tell this is
|
||||
* completely impossible with webpack. We do, however, use a hashed
|
||||
* filename to avoid caching issues.
|
||||
*/
|
||||
return Olm.init({
|
||||
locateFile: () => olmWasmPath,
|
||||
}).then(() => {
|
||||
console.log("Using WebAssembly Olm");
|
||||
}).catch((e) => {
|
||||
console.log("Failed to load Olm: trying legacy version", e);
|
||||
return new Promise((resolve, reject) => {
|
||||
const s = document.createElement('script');
|
||||
s.src = 'olm_legacy.js'; // XXX: This should be cache-busted too
|
||||
s.onload = resolve;
|
||||
s.onerror = reject;
|
||||
document.body.appendChild(s);
|
||||
}).then(() => {
|
||||
// Init window.Olm, ie. the one just loaded by the script tag,
|
||||
// not 'Olm' which is still the failed wasm version.
|
||||
return window.Olm.init();
|
||||
}).then(() => {
|
||||
console.log("Using legacy Olm");
|
||||
}).catch((e) => {
|
||||
console.log("Both WebAssembly and asm.js Olm failed!", e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function loadLanguage() {
|
||||
const prefLang = SettingsStore.getValue("language", null, /*excludeDefault=*/true);
|
||||
let langs = [];
|
||||
|
||||
if (!prefLang) {
|
||||
languageHandler.getLanguagesFromBrowser().forEach((l) => {
|
||||
langs.push(...languageHandler.getNormalizedLanguageKeys(l));
|
||||
});
|
||||
} else {
|
||||
langs = [prefLang];
|
||||
}
|
||||
try {
|
||||
await languageHandler.setLanguage(langs);
|
||||
document.documentElement.setAttribute("lang", languageHandler.getCurrentLanguage());
|
||||
} catch (e) {
|
||||
console.error("Unable to set language", e);
|
||||
}
|
||||
}
|
||||
|
||||
async function verifyServerConfig() {
|
||||
let validatedConfig;
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
Copyright 2018, 2020 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.
|
||||
@@ -18,22 +18,25 @@ import request from 'browser-request';
|
||||
|
||||
// Load the config file. First try to load up a domain-specific config of the
|
||||
// form "config.$domain.json" and if that fails, fall back to config.json.
|
||||
export async function getVectorConfig(relativeLocation) {
|
||||
if (relativeLocation === undefined) relativeLocation = '';
|
||||
export async function getVectorConfig(relativeLocation: string='') {
|
||||
if (relativeLocation !== '' && !relativeLocation.endsWith('/')) relativeLocation += '/';
|
||||
|
||||
const specificConfigPromise = getConfig(`${relativeLocation}config.${document.domain}.json`);
|
||||
const generalConfigPromise = getConfig(relativeLocation + "config.json");
|
||||
|
||||
try {
|
||||
const configJson = await getConfig(`${relativeLocation}config.${document.domain}.json`);
|
||||
const configJson = await specificConfigPromise;
|
||||
// 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");
|
||||
return await generalConfigPromise;
|
||||
}
|
||||
}
|
||||
|
||||
function getConfig(configJsonFilename) {
|
||||
function getConfig(configJsonFilename: string): Promise<{}> {
|
||||
return new Promise(function(resolve, reject) {
|
||||
request(
|
||||
{ method: "GET", url: configJsonFilename, qs: { cachebuster: Date.now() } },
|
||||
@@ -21,7 +21,6 @@ limitations under the License.
|
||||
// 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
|
||||
require('gemini-scrollbar/gemini-scrollbar.css');
|
||||
require('gfm.css/gfm.css');
|
||||
require('highlight.js/styles/github.css');
|
||||
|
||||
|
||||
114
src/vector/init.ts
Normal file
114
src/vector/init.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
Copyright 2015, 2016 OpenMarket Ltd
|
||||
Copyright 2017 Vector Creations Ltd
|
||||
Copyright 2018, 2019, 2020 New Vector Ltd
|
||||
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
// @ts-ignore
|
||||
import olmWasmPath from "olm/olm.wasm";
|
||||
import Olm from 'olm';
|
||||
|
||||
import * as languageHandler from 'matrix-react-sdk/src/languageHandler';
|
||||
import SettingsStore from "matrix-react-sdk/src/settings/SettingsStore";
|
||||
import ElectronPlatform from "./platform/ElectronPlatform";
|
||||
import WebPlatform from "./platform/WebPlatform";
|
||||
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg';
|
||||
import SdkConfig from "matrix-react-sdk/src/SdkConfig";
|
||||
|
||||
|
||||
export function preparePlatform() {
|
||||
if ((<any>window).ipcRenderer) {
|
||||
console.log("Using Electron platform");
|
||||
const plaf = new ElectronPlatform();
|
||||
PlatformPeg.set(plaf);
|
||||
} else {
|
||||
console.log("Using Web platform");
|
||||
PlatformPeg.set(new WebPlatform());
|
||||
}
|
||||
}
|
||||
|
||||
export async function loadConfig(): Promise<Error | void> {
|
||||
const platform = PlatformPeg.get();
|
||||
|
||||
let configJson;
|
||||
try {
|
||||
configJson = await platform.getConfig();
|
||||
} catch (e) {
|
||||
return e;
|
||||
} finally {
|
||||
// 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.
|
||||
//
|
||||
// Note: this isn't called twice for some wrappers, like the Jitsi wrapper.
|
||||
SdkConfig.put(configJson || {});
|
||||
}
|
||||
}
|
||||
|
||||
export function loadOlm(): Promise<void> {
|
||||
/* Load Olm. We try the WebAssembly version first, and then the legacy,
|
||||
* asm.js version if that fails. For this reason we need to wait for this
|
||||
* to finish before continuing to load the rest of the app. In future
|
||||
* we could somehow pass a promise down to react-sdk and have it wait on
|
||||
* that so olm can be loading in parallel with the rest of the app.
|
||||
*
|
||||
* We also need to tell the Olm js to look for its wasm file at the same
|
||||
* level as index.html. It really should be in the same place as the js,
|
||||
* ie. in the bundle directory, but as far as I can tell this is
|
||||
* completely impossible with webpack. We do, however, use a hashed
|
||||
* filename to avoid caching issues.
|
||||
*/
|
||||
return Olm.init({
|
||||
locateFile: () => olmWasmPath,
|
||||
}).then(() => {
|
||||
console.log("Using WebAssembly Olm");
|
||||
}).catch((e) => {
|
||||
console.log("Failed to load Olm: trying legacy version", e);
|
||||
return new Promise((resolve, reject) => {
|
||||
const s = document.createElement('script');
|
||||
s.src = 'olm_legacy.js'; // XXX: This should be cache-busted too
|
||||
s.onload = resolve;
|
||||
s.onerror = reject;
|
||||
document.body.appendChild(s);
|
||||
}).then(() => {
|
||||
// Init window.Olm, ie. the one just loaded by the script tag,
|
||||
// not 'Olm' which is still the failed wasm version.
|
||||
return window.Olm.init();
|
||||
}).then(() => {
|
||||
console.log("Using legacy Olm");
|
||||
}).catch((e) => {
|
||||
console.log("Both WebAssembly and asm.js Olm failed!", e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export async function loadLanguage() {
|
||||
const prefLang = SettingsStore.getValue("language", null, /*excludeDefault=*/true);
|
||||
let langs = [];
|
||||
|
||||
if (!prefLang) {
|
||||
languageHandler.getLanguagesFromBrowser().forEach((l) => {
|
||||
langs.push(...languageHandler.getNormalizedLanguageKeys(l));
|
||||
});
|
||||
} else {
|
||||
langs = [prefLang];
|
||||
}
|
||||
try {
|
||||
await languageHandler.setLanguage(langs);
|
||||
document.documentElement.setAttribute("lang", languageHandler.getCurrentLanguage());
|
||||
} catch (e) {
|
||||
console.error("Unable to set language", e);
|
||||
}
|
||||
}
|
||||
19
src/vector/jitsi/index.html
Normal file
19
src/vector/jitsi/index.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Jitsi Widget</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jitsiContainer"><!-- the js will put the conference here --></div>
|
||||
<div id="joinButtonContainer">
|
||||
<div class="joinConferenceFloating">
|
||||
<div class="joinConferencePrompt">
|
||||
<!-- TODO: i18n -->
|
||||
<h2>Jitsi Video Conference</h2>
|
||||
<button type="button" id="joinButton">Join Conference</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
75
src/vector/jitsi/index.scss
Normal file
75
src/vector/jitsi/index.scss
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
Copyright 2020 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.
|
||||
*/
|
||||
|
||||
// TODO: Match the user's theme: https://github.com/vector-im/riot-web/issues/12794
|
||||
|
||||
@font-face {
|
||||
font-family: 'Nunito';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url('~matrix-react-sdk/res/fonts/Nunito/Nunito-Regular.ttf') format('truetype');
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Nunito, Arial, Helvetica, sans-serif;
|
||||
background-color: #181b21;
|
||||
color: #edf3ff;
|
||||
}
|
||||
|
||||
body, html {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#jitsiContainer {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#joinButtonContainer {
|
||||
display: table;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.joinConferenceFloating {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.joinConferencePrompt {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 90%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#joinButton {
|
||||
// A mix of AccessibleButton styles
|
||||
cursor: pointer;
|
||||
padding: 7px 18px;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
background-color: #03b381;
|
||||
border: 0;
|
||||
}
|
||||
123
src/vector/jitsi/index.ts
Normal file
123
src/vector/jitsi/index.ts
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
Copyright 2020 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.
|
||||
*/
|
||||
|
||||
// We have to trick webpack into loading our CSS for us.
|
||||
require("./index.scss");
|
||||
|
||||
import * as qs from 'querystring';
|
||||
import { Capability, WidgetApi } from "matrix-react-sdk/src/widgets/WidgetApi";
|
||||
|
||||
// Dev note: we use raw JS without many dependencies to reduce bundle size.
|
||||
// We do not need all of React to render a Jitsi conference.
|
||||
|
||||
declare var JitsiMeetExternalAPI: any;
|
||||
|
||||
let inConference = false;
|
||||
|
||||
// Jitsi params
|
||||
let jitsiDomain: string;
|
||||
let conferenceId: string;
|
||||
let displayName: string;
|
||||
let avatarUrl: string;
|
||||
let userId: string;
|
||||
|
||||
let widgetApi: WidgetApi;
|
||||
|
||||
(async function () {
|
||||
try {
|
||||
// The widget's options are encoded into the fragment to avoid leaking info to the server. The widget
|
||||
// spec on the other hand requires the widgetId and parentUrl to show up in the regular query string.
|
||||
const widgetQuery = qs.parse(window.location.hash.substring(1));
|
||||
const query = Object.assign({}, qs.parse(window.location.search.substring(1)), widgetQuery);
|
||||
const qsParam = (name: string, optional = false): string => {
|
||||
if (!optional && (!query[name] || typeof (query[name]) !== 'string')) {
|
||||
throw new Error(`Expected singular ${name} in query string`);
|
||||
}
|
||||
return <string>query[name];
|
||||
};
|
||||
|
||||
// Set this up as early as possible because Riot will be hitting it almost immediately.
|
||||
widgetApi = new WidgetApi(qsParam('parentUrl'), qsParam('widgetId'), [
|
||||
Capability.AlwaysOnScreen,
|
||||
Capability.GetRiotWebConfig,
|
||||
]);
|
||||
widgetApi.expectingExplicitReady = true;
|
||||
|
||||
// Populate the Jitsi params now
|
||||
jitsiDomain = qsParam('conferenceDomain');
|
||||
conferenceId = qsParam('conferenceId');
|
||||
displayName = qsParam('displayName', true);
|
||||
avatarUrl = qsParam('avatarUrl', true); // http not mxc
|
||||
userId = qsParam('userId');
|
||||
|
||||
await widgetApi.waitReady();
|
||||
await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen
|
||||
|
||||
const riotConfig = await widgetApi.getRiotConfig();
|
||||
|
||||
// Get the Jitsi Meet API loaded up as fast as possible, but ensure that the widget's postMessage
|
||||
// receiver (WidgetApi) is up and running first.
|
||||
const scriptTag = document.createElement("script");
|
||||
scriptTag.src = riotConfig['jitsi']['externalApiUrl'];
|
||||
document.body.appendChild(scriptTag);
|
||||
|
||||
// TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795)
|
||||
|
||||
document.getElementById("joinButton").onclick = () => joinConference();
|
||||
} catch (e) {
|
||||
console.error("Error setting up Jitsi widget", e);
|
||||
document.getElementById("jitsiContainer").innerText = "Failed to load Jitsi widget";
|
||||
switchVisibleContainers();
|
||||
}
|
||||
})();
|
||||
|
||||
function switchVisibleContainers() {
|
||||
inConference = !inConference;
|
||||
document.getElementById("jitsiContainer").style.visibility = inConference ? 'unset' : 'hidden';
|
||||
document.getElementById("joinButtonContainer").style.visibility = inConference ? 'hidden' : 'unset';
|
||||
}
|
||||
|
||||
function joinConference() { // event handler bound in HTML
|
||||
switchVisibleContainers();
|
||||
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
widgetApi.setAlwaysOnScreen(true); // ignored promise because we don't care if it works
|
||||
|
||||
const meetApi = new JitsiMeetExternalAPI(jitsiDomain, {
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
parentNode: document.querySelector("#jitsiContainer"),
|
||||
roomName: conferenceId,
|
||||
interfaceConfigOverwrite: {
|
||||
SHOW_JITSI_WATERMARK: false,
|
||||
SHOW_WATERMARK_FOR_GUESTS: false,
|
||||
MAIN_TOOLBAR_BUTTONS: [],
|
||||
VIDEO_LAYOUT_FIT: "height",
|
||||
},
|
||||
});
|
||||
if (displayName) meetApi.executeCommand("displayName", displayName);
|
||||
if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl);
|
||||
if (userId) meetApi.executeCommand("email", userId);
|
||||
|
||||
meetApi.on("readyToClose", () => {
|
||||
switchVisibleContainers();
|
||||
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
widgetApi.setAlwaysOnScreen(false); // ignored promise because we don't care if it works
|
||||
|
||||
document.getElementById("jitsiContainer").innerHTML = "";
|
||||
});
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -23,15 +23,29 @@ limitations under the License.
|
||||
import VectorBasePlatform, {updateCheckStatusEnum} from './VectorBasePlatform';
|
||||
import BaseEventIndexManager from 'matrix-react-sdk/src/indexing/BaseEventIndexManager';
|
||||
import dis from 'matrix-react-sdk/src/dispatcher';
|
||||
import { _t } from 'matrix-react-sdk/src/languageHandler';
|
||||
import { _t, _td } from 'matrix-react-sdk/src/languageHandler';
|
||||
import * as rageshake from 'matrix-react-sdk/src/rageshake/rageshake';
|
||||
import {MatrixClient} from "matrix-js-sdk";
|
||||
import Modal from "matrix-react-sdk/src/Modal";
|
||||
import InfoDialog from "matrix-react-sdk/src/components/views/dialogs/InfoDialog";
|
||||
import Spinner from "matrix-react-sdk/src/components/views/elements/Spinner";
|
||||
import {Categories, Modifiers, registerShortcut} from "matrix-react-sdk/src/accessibility/KeyboardShortcuts";
|
||||
import {Key} from "matrix-react-sdk/src/Keyboard";
|
||||
import React from "react";
|
||||
|
||||
const ipcRenderer = window.ipcRenderer;
|
||||
const isMac = navigator.platform.toUpperCase().includes('MAC');
|
||||
|
||||
// register Mac specific shortcuts
|
||||
if (isMac) {
|
||||
registerShortcut(Categories.NAVIGATION, {
|
||||
keybinds: [{
|
||||
modifiers: [Modifiers.COMMAND],
|
||||
key: Key.COMMA,
|
||||
}],
|
||||
description: _td("Open user settings"),
|
||||
});
|
||||
}
|
||||
|
||||
function platformFriendlyName(): string {
|
||||
// used to use window.process but the same info is available here
|
||||
@@ -122,6 +136,10 @@ class SeshatIndexManager extends BaseEventIndexManager {
|
||||
return this._ipcCall('addEventToIndex', ev, profile);
|
||||
}
|
||||
|
||||
async deleteEvent(eventId: string): Promise<boolean> {
|
||||
return this._ipcCall('deleteEvent', eventId);
|
||||
}
|
||||
|
||||
async isEventIndexEmpty(): Promise<boolean> {
|
||||
return this._ipcCall('isEventIndexEmpty');
|
||||
}
|
||||
@@ -204,6 +222,10 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||
ipcRenderer.on('ipcReply', this._onIpcReply.bind(this));
|
||||
ipcRenderer.on('update-downloaded', this.onUpdateDownloaded.bind(this));
|
||||
|
||||
ipcRenderer.on('preferences', () => {
|
||||
dis.dispatch({ action: 'view_user_settings' });
|
||||
});
|
||||
|
||||
this.startUpdateCheck = this.startUpdateCheck.bind(this);
|
||||
this.stopUpdateCheck = this.stopUpdateCheck.bind(this);
|
||||
}
|
||||
@@ -297,7 +319,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||
|
||||
supportsAutoHideMenuBar(): boolean {
|
||||
// This is irelevant on Mac as Menu bars don't live in the app window
|
||||
return !navigator.platform.toUpperCase().includes('MAC');
|
||||
return !isMac;
|
||||
}
|
||||
|
||||
async getAutoHideMenuBarEnabled(): boolean {
|
||||
@@ -310,7 +332,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||
|
||||
supportsMinimizeToTray(): boolean {
|
||||
// Things other than Mac support tray icons
|
||||
return !navigator.platform.toUpperCase().includes('MAC');
|
||||
return !isMac;
|
||||
}
|
||||
|
||||
async getMinimizeToTrayEnabled(): boolean {
|
||||
|
||||
@@ -50,7 +50,7 @@ function initRageshake() {
|
||||
|
||||
initRageshake();
|
||||
|
||||
global.mxSendRageshake = function(text, withLogs) {
|
||||
window.mxSendRageshake = function(text: string, withLogs?: boolean) {
|
||||
if (withLogs === undefined) withLogs = true;
|
||||
if (!text || !text.trim()) {
|
||||
console.error("Cannot send a rageshake without a message - please tell us what went wrong");
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
Copyright 2018, 2020 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.
|
||||
@@ -20,7 +20,7 @@ import * as qs from 'querystring';
|
||||
// so we're re-using query string like format
|
||||
//
|
||||
// returns {location, params}
|
||||
export function parseQsFromFragment(location) {
|
||||
export function parseQsFromFragment(location: Location) {
|
||||
// if we have a fragment, it will start with '#', which we need to drop.
|
||||
// (if we don't, this will return '').
|
||||
const fragment = location.hash.substring(1);
|
||||
@@ -41,6 +41,6 @@ export function parseQsFromFragment(location) {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function parseQs(location) {
|
||||
export function parseQs(location: Location) {
|
||||
return qs.parse(location.search.substring(1));
|
||||
}
|
||||
|
||||
@@ -9,11 +9,14 @@
|
||||
"sourceMap": false,
|
||||
"outDir": "./lib",
|
||||
"declaration": true,
|
||||
"jsx": "react",
|
||||
"types": [
|
||||
"node"
|
||||
"node",
|
||||
"react"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts"
|
||||
"./src/**/*.ts",
|
||||
"./src/**/*.tsx"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ module.exports = (env, argv) => {
|
||||
"bundle": "./src/vector/index.js",
|
||||
"indexeddb-worker": "./src/vector/indexeddb-worker.js",
|
||||
"mobileguide": "./src/vector/mobile_guide/index.js",
|
||||
"jitsi": "./src/vector/jitsi/index.ts",
|
||||
"usercontent": "./node_modules/matrix-react-sdk/src/usercontent/index.js",
|
||||
|
||||
// CSS themes
|
||||
@@ -55,6 +56,9 @@ module.exports = (env, argv) => {
|
||||
enforce: true,
|
||||
// Do not add `chunks: 'all'` here because you'll break the app entry point.
|
||||
},
|
||||
default: {
|
||||
reuseExistingChunk: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -82,7 +86,7 @@ module.exports = (env, argv) => {
|
||||
aliasFields: ['matrix_src_browser', 'browser'],
|
||||
|
||||
// We need to specify that TS can be resolved without an extension
|
||||
extensions: ['.js', '.json', '.ts'],
|
||||
extensions: ['.js', '.json', '.ts', '.tsx'],
|
||||
alias: {
|
||||
// alias any requires to the react module to the one in our path,
|
||||
// otherwise we tend to get the react source included twice when
|
||||
@@ -92,6 +96,9 @@ module.exports = (env, argv) => {
|
||||
|
||||
// same goes for js-sdk - we don't need two copies.
|
||||
"matrix-js-sdk": path.resolve(__dirname, 'node_modules/matrix-js-sdk'),
|
||||
// and prop-types and sanitize-html
|
||||
"prop-types": path.resolve(__dirname, 'node_modules/prop-types'),
|
||||
"sanitize-html": path.resolve(__dirname, 'node_modules/sanitize-html'),
|
||||
|
||||
// Define a variable so the i18n stuff can load
|
||||
"$webapp": path.resolve(__dirname, 'webapp'),
|
||||
@@ -303,13 +310,21 @@ 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'],
|
||||
excludeChunks: ['mobileguide', 'usercontent', 'jitsi'],
|
||||
minify: argv.mode === 'production',
|
||||
vars: {
|
||||
og_image_url: og_image_url,
|
||||
},
|
||||
}),
|
||||
|
||||
// This is the jitsi widget wrapper (embedded, so isolated stack)
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/vector/jitsi/index.html',
|
||||
filename: 'jitsi.html',
|
||||
minify: argv.mode === 'production',
|
||||
chunks: ['jitsi'],
|
||||
}),
|
||||
|
||||
// This is the mobile guide's entry point (separate for faster mobile loading)
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/vector/mobile_guide/index.html',
|
||||
|
||||
Reference in New Issue
Block a user