mirror of
https://github.com/element-hq/element-desktop.git
synced 2026-01-03 13:07:55 -05:00
Compare commits
432 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad337b1f7c | ||
|
|
8d380fe533 | ||
|
|
6e7913c7d1 | ||
|
|
9cb171f953 | ||
|
|
44310712f3 | ||
|
|
9b65962d26 | ||
|
|
8302e284a3 | ||
|
|
390e2306d0 | ||
|
|
60e61415ea | ||
|
|
f4be51959b | ||
|
|
397bc66522 | ||
|
|
4db0a0ac0c | ||
|
|
d353c68a75 | ||
|
|
0143b4b114 | ||
|
|
93dd8aa2ba | ||
|
|
140b0b8c29 | ||
|
|
744050d8f4 | ||
|
|
39f3e3b9c2 | ||
|
|
43c8b13d75 | ||
|
|
2d568f9688 | ||
|
|
3f49046980 | ||
|
|
53e7100033 | ||
|
|
b8cb53e11b | ||
|
|
c751470abf | ||
|
|
9860ac6b75 | ||
|
|
6e76d658b1 | ||
|
|
3aff9cb9eb | ||
|
|
6579ba80b4 | ||
|
|
37410e6bc4 | ||
|
|
b036113786 | ||
|
|
c579031afc | ||
|
|
ebcd68428e | ||
|
|
f63436a2cb | ||
|
|
c5dd6195f2 | ||
|
|
c3a36bb17d | ||
|
|
f3c1db3313 | ||
|
|
c57a173649 | ||
|
|
48dc1ab396 | ||
|
|
997f2c21bf | ||
|
|
a171fa417b | ||
|
|
115f25165a | ||
|
|
c1ca909c7c | ||
|
|
f61370505b | ||
|
|
02d0999b18 | ||
|
|
5b15bc9b5d | ||
|
|
6b4e6f6be6 | ||
|
|
10a11242ff | ||
|
|
e59a2588ec | ||
|
|
a7938ae514 | ||
|
|
cf3112a9a9 | ||
|
|
b23048c5ce | ||
|
|
c689529641 | ||
|
|
7b6ead738e | ||
|
|
b6b5547ad0 | ||
|
|
e28390fddb | ||
|
|
b18bcd9bed | ||
|
|
b470657cdb | ||
|
|
fc51063f7a | ||
|
|
099ecc468a | ||
|
|
99b5947d7d | ||
|
|
7418161475 | ||
|
|
40be024c9f | ||
|
|
b2f09570f7 | ||
|
|
c3f150f9f0 | ||
|
|
8a90a12683 | ||
|
|
e7bc785ae4 | ||
|
|
d1cb3092e8 | ||
|
|
a136ccbf4c | ||
|
|
231db351ec | ||
|
|
06b0f0fe01 | ||
|
|
4b71142a87 | ||
|
|
9726be5754 | ||
|
|
2293b6794c | ||
|
|
492bbcbe06 | ||
|
|
9cc1d91011 | ||
|
|
c08b62015e | ||
|
|
03abf9f9d0 | ||
|
|
69e4ec7287 | ||
|
|
cf5e1eb4d4 | ||
|
|
dd494103de | ||
|
|
57ba22f874 | ||
|
|
225456b8e0 | ||
|
|
03e59aa60c | ||
|
|
330e230f2c | ||
|
|
dee2ecdf6c | ||
|
|
f109065606 | ||
|
|
344800d835 | ||
|
|
8c99f0ad12 | ||
|
|
bc0e3bb317 | ||
|
|
b7e4e9e075 | ||
|
|
5055ad0aec | ||
|
|
8a1a315938 | ||
|
|
5958166348 | ||
|
|
767445e6f6 | ||
|
|
99a3a132b3 | ||
|
|
1b1c869419 | ||
|
|
b67d48d661 | ||
|
|
922bed58ab | ||
|
|
7f28e3f1e2 | ||
|
|
2fca2151b9 | ||
|
|
303a3d46f5 | ||
|
|
8de0368c7c | ||
|
|
950657a364 | ||
|
|
bc0f370821 | ||
|
|
1455687384 | ||
|
|
3efed87d38 | ||
|
|
0c43287f98 | ||
|
|
c539f603dc | ||
|
|
b2d00f6605 | ||
|
|
27bce3b92b | ||
|
|
439ea006bf | ||
|
|
315a2107d3 | ||
|
|
43527fb609 | ||
|
|
3c946967ce | ||
|
|
0a17382901 | ||
|
|
d3508f3039 | ||
|
|
0f6f947254 | ||
|
|
bebed00200 | ||
|
|
40a248a275 | ||
|
|
c86ad29b3d | ||
|
|
8ade746fec | ||
|
|
2733b2ad11 | ||
|
|
d74631a555 | ||
|
|
944bb3c717 | ||
|
|
7fad439078 | ||
|
|
f98d1672af | ||
|
|
debeef6ee6 | ||
|
|
28096f3a22 | ||
|
|
5efc4528a2 | ||
|
|
b216eca07a | ||
|
|
5ad645f024 | ||
|
|
75b41d65c1 | ||
|
|
cc5dc4d801 | ||
|
|
c4aeaadfbd | ||
|
|
7e34425d78 | ||
|
|
5f09505056 | ||
|
|
9def502c95 | ||
|
|
e09b01f303 | ||
|
|
32aacbdd9a | ||
|
|
e1554cbbe0 | ||
|
|
2b8c378773 | ||
|
|
fe7bf57565 | ||
|
|
cbaad79515 | ||
|
|
a7a8115b17 | ||
|
|
e694a8e30e | ||
|
|
cda4f8ccb4 | ||
|
|
4369b3a5ad | ||
|
|
933d0b80bf | ||
|
|
043e006f3b | ||
|
|
2a1acf0525 | ||
|
|
820e32e250 | ||
|
|
20e4459bb5 | ||
|
|
913c954eeb | ||
|
|
b5fdeddec3 | ||
|
|
38dab479b1 | ||
|
|
f385b1f1d5 | ||
|
|
298ccbe16c | ||
|
|
b8c99c6186 | ||
|
|
ca70486323 | ||
|
|
4bee175f16 | ||
|
|
628b37a2d1 | ||
|
|
9daf5ae413 | ||
|
|
19c8c5f580 | ||
|
|
989b4df6c6 | ||
|
|
21c40b796f | ||
|
|
ccb302b951 | ||
|
|
7d29046cba | ||
|
|
9c3e557333 | ||
|
|
6a7735247e | ||
|
|
c0f5ed15e2 | ||
|
|
56d9a86152 | ||
|
|
82def5ce37 | ||
|
|
5ec91d3a53 | ||
|
|
8b69982023 | ||
|
|
7e69c81e62 | ||
|
|
e64e6e642c | ||
|
|
7f24661357 | ||
|
|
c19baadcd3 | ||
|
|
ada58f826a | ||
|
|
46b1015478 | ||
|
|
8ae641bc59 | ||
|
|
8f4c827089 | ||
|
|
20ce3d10a3 | ||
|
|
72483a60cb | ||
|
|
de16099360 | ||
|
|
ae0213b663 | ||
|
|
b9510d0a0b | ||
|
|
c56aa9100f | ||
|
|
d59384f3e7 | ||
|
|
00ba42186b | ||
|
|
e950303966 | ||
|
|
105070716e | ||
|
|
3b4eb5c18e | ||
|
|
658304cc51 | ||
|
|
b7dd4e53a3 | ||
|
|
1fa6671a17 | ||
|
|
6526127998 | ||
|
|
b640d5e7e4 | ||
|
|
3f9495f19d | ||
|
|
1ff5387f1d | ||
|
|
5ae736e861 | ||
|
|
29d22aefd7 | ||
|
|
11602bb578 | ||
|
|
46ee80837a | ||
|
|
97178f4297 | ||
|
|
cd93f29691 | ||
|
|
48132c9eab | ||
|
|
4f58ba1b22 | ||
|
|
955be8417b | ||
|
|
c136f2cafc | ||
|
|
adfa845d9c | ||
|
|
017cfd70f4 | ||
|
|
d63c27c50a | ||
|
|
7edea00d4e | ||
|
|
ce26e7964d | ||
|
|
14a65fb0af | ||
|
|
cdbda52d9a | ||
|
|
55dffc8c52 | ||
|
|
100f08161d | ||
|
|
d4bf14b47f | ||
|
|
dabca5dc33 | ||
|
|
d11a7e77ac | ||
|
|
adfb4a424a | ||
|
|
5fc871492e | ||
|
|
3c68fe796f | ||
|
|
a996aff19b | ||
|
|
84990559ec | ||
|
|
fdf216ca75 | ||
|
|
f460cfa99a | ||
|
|
d2bc3a8a03 | ||
|
|
6a107f7095 | ||
|
|
ff4ebd4b39 | ||
|
|
76eef82274 | ||
|
|
d986555517 | ||
|
|
939c5b4588 | ||
|
|
f51001a460 | ||
|
|
db2fd9dd53 | ||
|
|
3d18ff16d1 | ||
|
|
9cdea580d3 | ||
|
|
68587e84ed | ||
|
|
58be4c62f7 | ||
|
|
c9c0ceb757 | ||
|
|
a46698559f | ||
|
|
c18b213699 | ||
|
|
b309562244 | ||
|
|
6c6a7d1bd6 | ||
|
|
6bff9f9a20 | ||
|
|
42139ec30d | ||
|
|
6edc4cb965 | ||
|
|
121bba1f35 | ||
|
|
b8adc66898 | ||
|
|
323c42bb72 | ||
|
|
8e51f6299c | ||
|
|
888ce434ff | ||
|
|
a223489511 | ||
|
|
9ca19d7de6 | ||
|
|
dce524f5bc | ||
|
|
48d66c0031 | ||
|
|
36438479fc | ||
|
|
f51acb78e0 | ||
|
|
343215925a | ||
|
|
a535efc1cc | ||
|
|
57496d89e5 | ||
|
|
5dc9ba94ca | ||
|
|
3d519f571f | ||
|
|
d9702e2f92 | ||
|
|
23ecc8573d | ||
|
|
7199a697f4 | ||
|
|
ecbcafe9ea | ||
|
|
8828838e8a | ||
|
|
c7c56f2f97 | ||
|
|
2c619a3a3f | ||
|
|
a4f6d68001 | ||
|
|
d4c48f68ec | ||
|
|
6ce89b667e | ||
|
|
d9bfd239c5 | ||
|
|
030fe38834 | ||
|
|
70c3446339 | ||
|
|
de0e7483a9 | ||
|
|
0b01b32e98 | ||
|
|
f7e5d0aa5f | ||
|
|
21f3847ccc | ||
|
|
e826c04c03 | ||
|
|
39404a62e6 | ||
|
|
4b7a442a73 | ||
|
|
6de76f5b02 | ||
|
|
7058196c25 | ||
|
|
1cd2ce9d34 | ||
|
|
542e2c6891 | ||
|
|
03ce222464 | ||
|
|
00fd261dc1 | ||
|
|
74ebc6cb22 | ||
|
|
a64516483b | ||
|
|
44c8f2c30f | ||
|
|
faa217c767 | ||
|
|
5ad0967b07 | ||
|
|
cda9f3f190 | ||
|
|
2c2addb282 | ||
|
|
19515b614f | ||
|
|
b646f78897 | ||
|
|
3b496c362b | ||
|
|
c4b7e856db | ||
|
|
cb1626cb9f | ||
|
|
a36321b697 | ||
|
|
353f5b35df | ||
|
|
8ae1a518fa | ||
|
|
edea42e30e | ||
|
|
fafd8fb206 | ||
|
|
f9e61d09c9 | ||
|
|
974514e2e6 | ||
|
|
b8d0d990bb | ||
|
|
ed1b9247c1 | ||
|
|
d3adfe3777 | ||
|
|
d45007cd1b | ||
|
|
ed00cfada3 | ||
|
|
3a660b2461 | ||
|
|
c6bbff5ffe | ||
|
|
fa8aef94af | ||
|
|
b7c31f17b5 | ||
|
|
62b6aa26ff | ||
|
|
d69f2a6d44 | ||
|
|
c1ed8ab377 | ||
|
|
df1c7f2498 | ||
|
|
0d00f3ea6c | ||
|
|
2ef3c8c1ab | ||
|
|
e373c03b2a | ||
|
|
99c13923ea | ||
|
|
80cb503c48 | ||
|
|
107efba6f3 | ||
|
|
239bab38ca | ||
|
|
e952b479ac | ||
|
|
231ac2bbb9 | ||
|
|
58543cacc8 | ||
|
|
8582e360b5 | ||
|
|
0e919f9992 | ||
|
|
b0a5003eaa | ||
|
|
6c0d8d5bda | ||
|
|
302f25054a | ||
|
|
82c88ca654 | ||
|
|
b9b7dcb264 | ||
|
|
90d5612548 | ||
|
|
e4583ed752 | ||
|
|
20dace2679 | ||
|
|
bc7231fb00 | ||
|
|
270daf1356 | ||
|
|
4957e9e24f | ||
|
|
7be314caf8 | ||
|
|
2b0ec9eb2f | ||
|
|
5220abbfd4 | ||
|
|
272f317415 | ||
|
|
0023fb25a2 | ||
|
|
783117fea9 | ||
|
|
4e61aad299 | ||
|
|
94dee7bece | ||
|
|
92f57ca880 | ||
|
|
7bd70e2eb6 | ||
|
|
8add8d7717 | ||
|
|
1d811b6f4b | ||
|
|
50a4069893 | ||
|
|
14415e2707 | ||
|
|
367dd5640c | ||
|
|
08ee24dfb6 | ||
|
|
9bb386f2b5 | ||
|
|
0f94667dea | ||
|
|
a71ac70a13 | ||
|
|
5a0f686b28 | ||
|
|
2170e494fb | ||
|
|
6ced94914f | ||
|
|
5ca16bf2fc | ||
|
|
f56dadd0ad | ||
|
|
215babb081 | ||
|
|
f71e2bf232 | ||
|
|
b146f50e91 | ||
|
|
e86e784359 | ||
|
|
afd578df71 | ||
|
|
b54ebc9008 | ||
|
|
30d03d64b3 | ||
|
|
e14c43a2fe | ||
|
|
8e16b1b5e0 | ||
|
|
161b024bf2 | ||
|
|
434215b24b | ||
|
|
df958ff56b | ||
|
|
89d4be6cb6 | ||
|
|
e9ecdde704 | ||
|
|
0e6ae2514a | ||
|
|
f5b51aecfe | ||
|
|
a88d1a838c | ||
|
|
3a3b9641e9 | ||
|
|
6e9407e7c1 | ||
|
|
7d3c203464 | ||
|
|
e9b4fb2245 | ||
|
|
2382cc56b1 | ||
|
|
b7a2810dc3 | ||
|
|
9eb6932f11 | ||
|
|
d1883aa2e8 | ||
|
|
2308ab9a83 | ||
|
|
b33205d607 | ||
|
|
df3d37586e | ||
|
|
fd68a83c08 | ||
|
|
b0f4a4debc | ||
|
|
7fac3a9b7c | ||
|
|
711967d19b | ||
|
|
e00eb4b952 | ||
|
|
caff0ef9f0 | ||
|
|
065f5d7adc | ||
|
|
67f0570af4 | ||
|
|
87125f4c59 | ||
|
|
bae3f08936 | ||
|
|
efc8baf1df | ||
|
|
c0ca8cd240 | ||
|
|
501611fa30 | ||
|
|
9d6cd6c7c0 | ||
|
|
d67f75779e | ||
|
|
26f283b56d | ||
|
|
e1b1020700 | ||
|
|
53d46343b8 | ||
|
|
aaddcef169 | ||
|
|
ba0210f8c1 | ||
|
|
99d1ed4ff1 | ||
|
|
045f122688 | ||
|
|
cbfb247ade | ||
|
|
eb4bf9e401 | ||
|
|
0cdf85e20b | ||
|
|
6e455f6bd4 | ||
|
|
0892ea5006 | ||
|
|
f344d8cac4 | ||
|
|
3decdb060e | ||
|
|
92f48eced9 | ||
|
|
045f6f8b42 | ||
|
|
358e3b8f7d | ||
|
|
c6ab88508f | ||
|
|
a4cbe3acab |
@@ -1,8 +0,0 @@
|
||||
steps:
|
||||
- label: ":eslint: Lint"
|
||||
command:
|
||||
- "yarn install"
|
||||
- "yarn lint"
|
||||
plugins:
|
||||
- docker#v3.0.1:
|
||||
image: "node:10"
|
||||
29
.eslintrc.js
29
.eslintrc.js
@@ -1,6 +1,10 @@
|
||||
module.exports = {
|
||||
plugins: ["matrix-org"],
|
||||
extends: [
|
||||
"plugin:matrix-org/javascript",
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 8,
|
||||
ecmaVersion: 2021,
|
||||
},
|
||||
env: {
|
||||
es6: true,
|
||||
@@ -8,15 +12,24 @@ module.exports = {
|
||||
// we also have some browser code (ie. the preload script)
|
||||
browser: true,
|
||||
},
|
||||
extends: ["matrix-org"],
|
||||
rules: {
|
||||
// js-sdk uses a babel rule which we can't use because we
|
||||
// don't use babel, so remove it & put the original back
|
||||
"babel/no-invalid-this": "off",
|
||||
"no-invalid-this": "error",
|
||||
"quotes": "off",
|
||||
"indent": "off",
|
||||
"prefer-promise-reject-errors": "off",
|
||||
"no-async-promise-executor": "off",
|
||||
}
|
||||
}
|
||||
},
|
||||
overrides: [{
|
||||
files: ["src/**/*.{ts,tsx}"],
|
||||
extends: [
|
||||
"plugin:matrix-org/typescript",
|
||||
],
|
||||
rules: {
|
||||
// Things we do that break the ideal style
|
||||
"prefer-promise-reject-errors": "off",
|
||||
"quotes": "off",
|
||||
|
||||
// We disable this while we're transitioning
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
},
|
||||
}],
|
||||
};
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
/dist
|
||||
/lib
|
||||
/webapp
|
||||
/webapp.asar
|
||||
/packages
|
||||
|
||||
474
CHANGELOG.md
474
CHANGELOG.md
@@ -1,3 +1,475 @@
|
||||
Changes in [1.7.32](https://github.com/vector-im/element-desktop/releases/tag/v1.7.32) (2021-07-05)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.31...v1.7.32)
|
||||
|
||||
* Fix the build: make the rootDir correct
|
||||
[\#224](https://github.com/vector-im/element-desktop/pull/224)
|
||||
* Fix i18n in Element Desktop
|
||||
[\#223](https://github.com/vector-im/element-desktop/pull/223)
|
||||
* Convert preload.js to Typescript so that it gets copied to `lib`
|
||||
[\#222](https://github.com/vector-im/element-desktop/pull/222)
|
||||
* Bundle the `lib` dir now, not `src`
|
||||
[\#221](https://github.com/vector-im/element-desktop/pull/221)
|
||||
* Initial Typescripting for Element Desktop
|
||||
[\#219](https://github.com/vector-im/element-desktop/pull/219)
|
||||
* Translations update from Weblate
|
||||
[\#220](https://github.com/vector-im/element-desktop/pull/220)
|
||||
* Fix Windows target arch in native build
|
||||
[\#218](https://github.com/vector-im/element-desktop/pull/218)
|
||||
* Add libera.chat to default room directory
|
||||
[\#217](https://github.com/vector-im/element-desktop/pull/217)
|
||||
* Add update and native build support for Apple silicon
|
||||
[\#216](https://github.com/vector-im/element-desktop/pull/216)
|
||||
* Add numpad accelerators for zooming
|
||||
[\#203](https://github.com/vector-im/element-desktop/pull/203)
|
||||
* Add warning dialog when custom config.json is invalid
|
||||
[\#201](https://github.com/vector-im/element-desktop/pull/201)
|
||||
* Don't show Quit warning on keyUp residual event
|
||||
[\#215](https://github.com/vector-im/element-desktop/pull/215)
|
||||
* Fix accelerator for save-image-as clashing with copy-link-address
|
||||
[\#213](https://github.com/vector-im/element-desktop/pull/213)
|
||||
|
||||
Changes in [1.7.31](https://github.com/vector-im/element-desktop/releases/tag/v1.7.31) (2021-06-21)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.31-rc.1...v1.7.31)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.31-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.31-rc.1) (2021-06-15)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.30...v1.7.31-rc.1)
|
||||
|
||||
* Upgrade to Electron 12.0.11
|
||||
[\#211](https://github.com/vector-im/element-desktop/pull/211)
|
||||
* Translations update from Weblate
|
||||
[\#214](https://github.com/vector-im/element-desktop/pull/214)
|
||||
* Upgrade to Node 14
|
||||
[\#212](https://github.com/vector-im/element-desktop/pull/212)
|
||||
* Bump npm-registry-fetch from 4.0.2 to 4.0.7
|
||||
[\#210](https://github.com/vector-im/element-desktop/pull/210)
|
||||
* Update electron-builder for Node 16 compatibility
|
||||
[\#204](https://github.com/vector-im/element-desktop/pull/204)
|
||||
* Bump hosted-git-info from 2.8.5 to 2.8.9
|
||||
[\#209](https://github.com/vector-im/element-desktop/pull/209)
|
||||
* Bump glob-parent from 5.1.1 to 5.1.2
|
||||
[\#206](https://github.com/vector-im/element-desktop/pull/206)
|
||||
* Bump dot-prop from 4.2.0 to 4.2.1
|
||||
[\#208](https://github.com/vector-im/element-desktop/pull/208)
|
||||
* Bump y18n from 3.2.1 to 3.2.2
|
||||
[\#207](https://github.com/vector-im/element-desktop/pull/207)
|
||||
* Bump normalize-url from 4.5.0 to 4.5.1
|
||||
[\#205](https://github.com/vector-im/element-desktop/pull/205)
|
||||
* Put Preferences menu item in correct location on macOS
|
||||
[\#200](https://github.com/vector-im/element-desktop/pull/200)
|
||||
* Switch zoomIn accelerator to default
|
||||
[\#202](https://github.com/vector-im/element-desktop/pull/202)
|
||||
|
||||
Changes in [1.7.30](https://github.com/vector-im/element-desktop/releases/tag/v1.7.30) (2021-06-07)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.30-rc.1...v1.7.30)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.30-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.30-rc.1) (2021-06-01)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.29...v1.7.30-rc.1)
|
||||
|
||||
* Translations update from Weblate
|
||||
[\#199](https://github.com/vector-im/element-desktop/pull/199)
|
||||
* Migrate to `eslint-plugin-matrix-org`
|
||||
[\#197](https://github.com/vector-im/element-desktop/pull/197)
|
||||
* Upgrade to Electron 12.0.9
|
||||
[\#198](https://github.com/vector-im/element-desktop/pull/198)
|
||||
|
||||
Changes in [1.7.29](https://github.com/vector-im/element-desktop/releases/tag/v1.7.29) (2021-05-24)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.29-rc.1...v1.7.29)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.29-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.29-rc.1) (2021-05-19)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.28...v1.7.29-rc.1)
|
||||
|
||||
* Translations update from Weblate
|
||||
[\#196](https://github.com/vector-im/element-desktop/pull/196)
|
||||
* Translations update from Weblate
|
||||
[\#195](https://github.com/vector-im/element-desktop/pull/195)
|
||||
|
||||
Changes in [1.7.28](https://github.com/vector-im/element-desktop/releases/tag/v1.7.28) (2021-05-17)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.28-rc.1...v1.7.28)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.28-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.28-rc.1) (2021-05-11)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.27...v1.7.28-rc.1)
|
||||
|
||||
* Add Windows native module requirements
|
||||
[\#190](https://github.com/vector-im/element-desktop/pull/190)
|
||||
* Prevent black screen when closing window while in full screen mode on macOS
|
||||
[\#192](https://github.com/vector-im/element-desktop/pull/192)
|
||||
|
||||
Changes in [1.7.27](https://github.com/vector-im/element-desktop/releases/tag/v1.7.27) (2021-05-10)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.27-rc.1...v1.7.27)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.27-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.27-rc.1) (2021-05-04)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.26...v1.7.27-rc.1)
|
||||
|
||||
* Translations update from Weblate
|
||||
[\#191](https://github.com/vector-im/element-desktop/pull/191)
|
||||
* Bump ssri from 6.0.1 to 6.0.2
|
||||
[\#187](https://github.com/vector-im/element-desktop/pull/187)
|
||||
* Disables HardwareMediaKeyHandling
|
||||
[\#180](https://github.com/vector-im/element-desktop/pull/180)
|
||||
* Translations update from Weblate
|
||||
[\#189](https://github.com/vector-im/element-desktop/pull/189)
|
||||
* Add internationalisation support
|
||||
[\#188](https://github.com/vector-im/element-desktop/pull/188)
|
||||
* Fix event index passphrase change process
|
||||
[\#186](https://github.com/vector-im/element-desktop/pull/186)
|
||||
|
||||
Changes in [1.7.26](https://github.com/vector-im/element-desktop/releases/tag/v1.7.26) (2021-04-26)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.26-rc.1...v1.7.26)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.26-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.26-rc.1) (2021-04-21)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.25...v1.7.26-rc.1)
|
||||
|
||||
* Remove Debian dependency libappindicator3-1
|
||||
[\#170](https://github.com/vector-im/element-desktop/pull/170)
|
||||
* Fix exit shortcuts for non QWERTY keyboards
|
||||
[\#185](https://github.com/vector-im/element-desktop/pull/185)
|
||||
* Fix using yarn run fetch with a specific version
|
||||
[\#182](https://github.com/vector-im/element-desktop/pull/182)
|
||||
* Switch nightly to not-staging Scalar by default
|
||||
[\#181](https://github.com/vector-im/element-desktop/pull/181)
|
||||
|
||||
Changes in [1.7.25](https://github.com/vector-im/element-desktop/releases/tag/v1.7.25) (2021-04-12)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.25-rc.1...v1.7.25)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.25-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.25-rc.1) (2021-04-07)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.24...v1.7.25-rc.1)
|
||||
|
||||
* Fix disabling spellchecker
|
||||
[\#179](https://github.com/vector-im/element-desktop/pull/179)
|
||||
* Upgrade to Electron 12.0.2
|
||||
[\#178](https://github.com/vector-im/element-desktop/pull/178)
|
||||
* Avoid exit listener to hijack other application shortcuts
|
||||
[\#177](https://github.com/vector-im/element-desktop/pull/177)
|
||||
* Migrate native-node-modules docs to element-desktop
|
||||
[\#176](https://github.com/vector-im/element-desktop/pull/176)
|
||||
* Add prompt to warn before quitting the application
|
||||
[\#173](https://github.com/vector-im/element-desktop/pull/173)
|
||||
* Upgrade to Electron 11.4.1
|
||||
[\#172](https://github.com/vector-im/element-desktop/pull/172)
|
||||
* Fix docker:build:native documentation typo
|
||||
[\#174](https://github.com/vector-im/element-desktop/pull/174)
|
||||
|
||||
Changes in [1.7.24](https://github.com/vector-im/element-desktop/releases/tag/v1.7.24) (2021-03-29)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.24-rc.1...v1.7.24)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.24-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.24-rc.1) (2021-03-25)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.23...v1.7.24-rc.1)
|
||||
|
||||
* No changes since 1.7.23
|
||||
|
||||
Changes in [1.7.23](https://github.com/vector-im/element-desktop/releases/tag/v1.7.23) (2021-03-15)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.23-rc.1...v1.7.23)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.23-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.23-rc.1) (2021-03-11)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.22...v1.7.23-rc.1)
|
||||
|
||||
* Fix disabling spell-checker
|
||||
[\#171](https://github.com/vector-im/element-desktop/pull/171)
|
||||
* Add multi language spell check
|
||||
[\#154](https://github.com/vector-im/element-desktop/pull/154)
|
||||
|
||||
Changes in [1.7.22](https://github.com/vector-im/element-desktop/releases/tag/v1.7.22) (2021-03-01)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.22-rc.1...v1.7.22)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.22-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.22-rc.1) (2021-02-24)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.21...v1.7.22-rc.1)
|
||||
|
||||
* Disable Countly
|
||||
[\#169](https://github.com/vector-im/element-desktop/pull/169)
|
||||
* Upgrade to Electron 11.2.3
|
||||
[\#168](https://github.com/vector-im/element-desktop/pull/168)
|
||||
|
||||
Changes in [1.7.21](https://github.com/vector-im/element-desktop/releases/tag/v1.7.21) (2021-02-16)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.21-rc.1...v1.7.21)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.21-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.21-rc.1) (2021-02-10)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.20...v1.7.21-rc.1)
|
||||
|
||||
* Fix desktop Matrix screen sharing
|
||||
[\#161](https://github.com/vector-im/element-desktop/pull/161)
|
||||
|
||||
Changes in [1.7.20](https://github.com/vector-im/element-desktop/releases/tag/v1.7.20) (2021-02-04)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.19...v1.7.20)
|
||||
|
||||
* No changes since 1.7.19
|
||||
|
||||
Changes in [1.7.19](https://github.com/vector-im/element-desktop/releases/tag/v1.7.19) (2021-02-03)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.19-rc.1...v1.7.19)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.19-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.19-rc.1) (2021-01-29)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.18...v1.7.19-rc.1)
|
||||
|
||||
* Remove Buildkite pipeline file
|
||||
[\#167](https://github.com/vector-im/element-desktop/pull/167)
|
||||
* Upgrade deps 2021-01-18
|
||||
[\#166](https://github.com/vector-im/element-desktop/pull/166)
|
||||
* package: Bump our seshat version
|
||||
[\#164](https://github.com/vector-im/element-desktop/pull/164)
|
||||
* Enable context isolation, bridge expected IPC
|
||||
[\#163](https://github.com/vector-im/element-desktop/pull/163)
|
||||
|
||||
Changes in [1.7.18](https://github.com/vector-im/element-desktop/releases/tag/v1.7.18) (2021-01-26)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.17...v1.7.18)
|
||||
|
||||
* No changes since 1.7.17
|
||||
|
||||
Changes in [1.7.17](https://github.com/vector-im/element-desktop/releases/tag/v1.7.17) (2021-01-18)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.17-rc.1...v1.7.17)
|
||||
|
||||
* [Release] package: Bump our seshat version
|
||||
[\#165](https://github.com/vector-im/element-desktop/pull/165)
|
||||
|
||||
Changes in [1.7.17-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.17-rc.1) (2021-01-13)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.16...v1.7.17-rc.1)
|
||||
|
||||
* package: Bump our Seshat version
|
||||
[\#162](https://github.com/vector-im/element-desktop/pull/162)
|
||||
* Upgrade to Electron 10.2.0
|
||||
[\#159](https://github.com/vector-im/element-desktop/pull/159)
|
||||
|
||||
Changes in [1.7.16](https://github.com/vector-im/element-desktop/releases/tag/v1.7.16) (2020-12-21)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.16-rc.1...v1.7.16)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.16-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.16-rc.1) (2020-12-16)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.15...v1.7.16-rc.1)
|
||||
|
||||
* Bump ini from 1.3.5 to 1.3.8
|
||||
[\#158](https://github.com/vector-im/element-desktop/pull/158)
|
||||
* Add gitter.im to room directory
|
||||
[\#157](https://github.com/vector-im/element-desktop/pull/157)
|
||||
|
||||
Changes in [1.7.15](https://github.com/vector-im/element-desktop/releases/tag/v1.7.15) (2020-12-07)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.15-rc.1...v1.7.15)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.15-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.15-rc.1) (2020-12-02)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.14...v1.7.15-rc.1)
|
||||
|
||||
* No changes since 1.7.14
|
||||
|
||||
Changes in [1.7.14](https://github.com/vector-im/element-desktop/releases/tag/v1.7.14) (2020-11-23)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.14-rc.1...v1.7.14)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.14-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.14-rc.1) (2020-11-18)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.13...v1.7.14-rc.1)
|
||||
|
||||
* Correct spelling mistakes
|
||||
[\#151](https://github.com/vector-im/element-desktop/pull/151)
|
||||
|
||||
Changes in [1.7.13](https://github.com/vector-im/element-desktop/releases/tag/v1.7.13) (2020-11-09)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.13-rc.1...v1.7.13)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.13-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.13-rc.1) (2020-11-04)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.12...v1.7.13-rc.1)
|
||||
|
||||
* Add countly experiment to develop/nightly configs
|
||||
[\#150](https://github.com/vector-im/element-desktop/pull/150)
|
||||
|
||||
Changes in [1.7.12](https://github.com/vector-im/element-desktop/releases/tag/v1.7.12) (2020-10-28)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.11...v1.7.12)
|
||||
|
||||
* No changes since 1.7.11
|
||||
|
||||
Changes in [1.7.11](https://github.com/vector-im/element-desktop/releases/tag/v1.7.11) (2020-10-26)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.11-rc.1...v1.7.11)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.11-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.11-rc.1) (2020-10-21)
|
||||
=============================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.10...v1.7.11-rc.1)
|
||||
|
||||
* Bump npm-user-validate from 1.0.0 to 1.0.1
|
||||
[\#148](https://github.com/vector-im/element-desktop/pull/148)
|
||||
* Use keytar for the seshat passphrase.
|
||||
[\#147](https://github.com/vector-im/element-desktop/pull/147)
|
||||
* Upgrade to Electron 10.1.3
|
||||
[\#146](https://github.com/vector-im/element-desktop/pull/146)
|
||||
|
||||
Changes in [1.7.10](https://github.com/vector-im/element-desktop/releases/tag/v1.7.10) (2020-10-20)
|
||||
===================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.9...v1.7.10)
|
||||
|
||||
* No changes since 1.7.9
|
||||
|
||||
Changes in [1.7.9](https://github.com/vector-im/element-desktop/releases/tag/v1.7.9) (2020-10-12)
|
||||
=================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.9-rc.1...v1.7.9)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.9-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.9-rc.1) (2020-10-07)
|
||||
===========================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.8...v1.7.9-rc.1)
|
||||
|
||||
* package.json: Bump the seshat version.
|
||||
[\#145](https://github.com/vector-im/element-desktop/pull/145)
|
||||
* Explicitly depend on `request` as webcontents-handler requires it
|
||||
[\#144](https://github.com/vector-im/element-desktop/pull/144)
|
||||
* Upgrade png-to-ico
|
||||
[\#143](https://github.com/vector-im/element-desktop/pull/143)
|
||||
* Point 'new issue' link at issue-type choice page
|
||||
[\#142](https://github.com/vector-im/element-desktop/pull/142)
|
||||
|
||||
Changes in [1.7.8](https://github.com/vector-im/element-desktop/releases/tag/v1.7.8) (2020-09-28)
|
||||
=================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.8-rc.1...v1.7.8)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.8-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.8-rc.1) (2020-09-23)
|
||||
===========================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.7...v1.7.8-rc.1)
|
||||
|
||||
* Fix neon error by upgrading Seshat
|
||||
[\#141](https://github.com/vector-im/element-desktop/pull/141)
|
||||
* Upgrade to Electron 10.1.1
|
||||
[\#140](https://github.com/vector-im/element-desktop/pull/140)
|
||||
|
||||
Changes in [1.7.7](https://github.com/vector-im/element-desktop/releases/tag/v1.7.7) (2020-09-14)
|
||||
=================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.6...v1.7.7)
|
||||
|
||||
* No changes since 1.7.6
|
||||
|
||||
Changes in [1.7.6](https://github.com/vector-im/element-desktop/releases/tag/v1.7.6) (2020-09-14)
|
||||
=================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.6-rc.1...v1.7.6)
|
||||
|
||||
* No changes since rc.1
|
||||
|
||||
Changes in [1.7.6-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.6-rc.1) (2020-09-09)
|
||||
===========================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.5...v1.7.6-rc.1)
|
||||
|
||||
* Update to Element pipeline name
|
||||
[\#139](https://github.com/vector-im/element-desktop/pull/139)
|
||||
* Bump bl from 4.0.2 to 4.0.3
|
||||
[\#137](https://github.com/vector-im/element-desktop/pull/137)
|
||||
|
||||
Changes in [1.7.5](https://github.com/vector-im/element-desktop/releases/tag/v1.7.5) (2020-09-01)
|
||||
=================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.5-rc.1...v1.7.5)
|
||||
|
||||
* No changes since 1.7.5-rc.1
|
||||
|
||||
Changes in [1.7.5-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.5-rc.1) (2020-08-26)
|
||||
===========================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.4...v1.7.5-rc.1)
|
||||
|
||||
* Settings v3: Update configs for new feature flag behaviour
|
||||
[\#135](https://github.com/vector-im/element-desktop/pull/135)
|
||||
* Add reaction preview labs flags to nightly
|
||||
[\#134](https://github.com/vector-im/element-desktop/pull/134)
|
||||
|
||||
Changes in [1.7.4](https://github.com/vector-im/element-desktop/releases/tag/v1.7.4) (2020-08-17)
|
||||
=================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.4-rc.1...v1.7.4)
|
||||
|
||||
* No changes since 1.7.4-rc.1
|
||||
|
||||
Changes in [1.7.4-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.4-rc.1) (2020-08-13)
|
||||
===========================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.3...v1.7.4-rc.1)
|
||||
|
||||
* Update policy links to element.io
|
||||
[\#132](https://github.com/vector-im/element-desktop/pull/132)
|
||||
* Update bug report submission URL
|
||||
[\#131](https://github.com/vector-im/element-desktop/pull/131)
|
||||
* Update code signing cert for Windows
|
||||
[\#130](https://github.com/vector-im/element-desktop/pull/130)
|
||||
* Replace Riot with Element in docs and comments
|
||||
[\#129](https://github.com/vector-im/element-desktop/pull/129)
|
||||
* Fix order of README steps
|
||||
[\#128](https://github.com/vector-im/element-desktop/pull/128)
|
||||
* Upgrade to Electron 9.1.2
|
||||
[\#127](https://github.com/vector-im/element-desktop/pull/127)
|
||||
|
||||
Changes in [1.7.3](https://github.com/vector-im/element-desktop/releases/tag/v1.7.3) (2020-08-05)
|
||||
=================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.3-rc.1...v1.7.3)
|
||||
|
||||
* No changes since 1.7.3-rc.1
|
||||
|
||||
Changes in [1.7.3-rc.1](https://github.com/vector-im/riot-desktop/releases/tag/v1.7.3-rc.1) (2020-07-31)
|
||||
========================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-desktop/compare/v1.7.2...v1.7.3-rc.1)
|
||||
|
||||
* Clean up linting
|
||||
[\#126](https://github.com/vector-im/riot-desktop/pull/126)
|
||||
* Update renaming workaround for 'Element' name
|
||||
[\#125](https://github.com/vector-im/riot-desktop/pull/125)
|
||||
|
||||
Changes in [1.7.2](https://github.com/vector-im/riot-desktop/releases/tag/v1.7.2) (2020-07-27)
|
||||
==============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-desktop/compare/v1.7.1...v1.7.2)
|
||||
@@ -246,7 +718,7 @@ Changes in [1.6.0-rc.1](https://github.com/vector-im/riot-desktop/releases/tag/v
|
||||
[\#57](https://github.com/vector-im/riot-desktop/pull/57)
|
||||
* Remove welcome user from config
|
||||
[\#56](https://github.com/vector-im/riot-desktop/pull/56)
|
||||
* electron-main: Immediatelly set the eventIndex variable to null when
|
||||
* electron-main: Immediately set the eventIndex variable to null when
|
||||
closing.
|
||||
[\#55](https://github.com/vector-im/riot-desktop/pull/55)
|
||||
* Enable Seshat on Nightly
|
||||
|
||||
47
README.md
47
README.md
@@ -17,7 +17,7 @@ Since this package is just the Electron wrapper for Element Web, it doesn't cont
|
||||
so the first step is to get a working copy of Element Web. There are a few ways of doing this:
|
||||
|
||||
```
|
||||
# Fetch the prebuilt release Element package from the riot.im GitHub releases page. The version
|
||||
# Fetch the prebuilt release Element package from the element-web GitHub releases page. The version
|
||||
# fetched will be the same as the local element-desktop package.
|
||||
# We're explicitly asking for no config, so the packaged Element will have no config.json.
|
||||
yarn run fetch --noverify --cfgdir ''
|
||||
@@ -35,7 +35,7 @@ yarn run fetch --cfgdir ''
|
||||
|
||||
...or either of the above, but fetching a specific version of Element:
|
||||
```
|
||||
# Fetch the prebuilt release Element package from the riot.im GitHub releases page. The version
|
||||
# Fetch the prebuilt release Element package from the element-web GitHub releases page. The version
|
||||
# fetched will be the same as the local element-desktop package.
|
||||
yarn run fetch --noverify --cfgdir '' v1.5.6
|
||||
```
|
||||
@@ -43,8 +43,8 @@ yarn run fetch --noverify --cfgdir '' v1.5.6
|
||||
If you only want to run the app locally and don't need to build packages, you can
|
||||
provide the `webapp` directory directly:
|
||||
```
|
||||
# Assuming you've checked out and built a copy of riot-web in ../riot-web
|
||||
ln -s ../riot-web/webapp ./
|
||||
# Assuming you've checked out and built a copy of element-web in ../element-web
|
||||
ln -s ../element-web/webapp ./
|
||||
```
|
||||
|
||||
[TODO: add support for fetching develop builds, arbitrary URLs and arbitrary paths]
|
||||
@@ -55,6 +55,20 @@ Building
|
||||
Now you have a copy of Element, you're ready to build packages. If you'd just like to
|
||||
run Element locally, skip to the next section.
|
||||
|
||||
If you'd like to build the native modules (for searching in encrypted rooms and
|
||||
secure storage), do this first. This will take 10 minutes or so, and will
|
||||
require a number of native tools to be installed, depending on your OS (eg.
|
||||
rust, tcl, make/nmake). If you don't need these features, you can skip this
|
||||
step.
|
||||
```
|
||||
yarn run build:native
|
||||
```
|
||||
|
||||
On Windows, this will automatically determine the architecture to build for based
|
||||
on the environment. Make sure that you have all the [tools required to perform the native modules build](docs/windows-requirements.md)
|
||||
|
||||
Now you can build the package:
|
||||
|
||||
```
|
||||
yarn run build
|
||||
```
|
||||
@@ -75,16 +89,6 @@ yarn run build64
|
||||
|
||||
This build step will not build any native modules.
|
||||
|
||||
If you'd like to build the native modules (for searching in encrypted rooms):
|
||||
This will take 10 minutes or so, and will require a number of native tools
|
||||
to be installed, depending on your OS (eg. rust, tcl, make/nmake).
|
||||
```
|
||||
yarn run build:native
|
||||
```
|
||||
|
||||
On Windows, this will automatically determine the architecture to build for based
|
||||
on the environment (ie. set up by vcvarsall.bat).
|
||||
|
||||
You can also build using docker, which will always produce the linux package:
|
||||
```
|
||||
# Run this once to make the docker image
|
||||
@@ -92,7 +96,7 @@ yarn run docker:setup
|
||||
|
||||
yarn run docker:install
|
||||
# if you want to build the native modules (this will take a while)
|
||||
yarn run docker:buildnative
|
||||
yarn run docker:build:native
|
||||
yarn run docker:build
|
||||
```
|
||||
|
||||
@@ -118,7 +122,7 @@ mkdir myconfig
|
||||
cp /path/to/my/config.json myconfig/
|
||||
yarn run fetch --cfgdir myconfig
|
||||
```
|
||||
The config dir for the official Element.im app is in `riot.im`. If you use this,
|
||||
The config dir for the official Element app is in `element.io`. If you use this,
|
||||
your app will auto-update itself using builds from element.io.
|
||||
|
||||
Profiles
|
||||
@@ -144,9 +148,18 @@ $PROFILE` in which case it becomes `Element-$PROFILE`, or it is using one of
|
||||
the above created by a pre-1.7 install, in which case it will be `Riot` or
|
||||
`Riot-$PROFILE`.
|
||||
|
||||
Translations
|
||||
==========================
|
||||
|
||||
To add a new translation, head to the [translating doc](https://github.com/vector-im/element-web/blob/develop/docs/translating.md).
|
||||
|
||||
For a developer guide, see the [translating dev doc](https://github.com/vector-im/element-web/blob/develop/docs/translating-dev.md).
|
||||
|
||||
[<img src="https://translate.element.io/widgets/element-desktop/-/multi-auto.svg" alt="translationsstatus" width="340">](https://translate.element.io/engage/element-desktop/?utm_source=widget)
|
||||
|
||||
Report bugs & give feedback
|
||||
==========================
|
||||
|
||||
If you run into any bugs or have feedback you'd like to share, please let us know on GitHub.
|
||||
|
||||
To help avoid duplicate issues, please [view existing issues](https://github.com/vector-im/riot-web/issues?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc) first (and add a +1) or [create a new issue](https://github.com/vector-im/riot-web/issues/new) if you can't find it. Please note that this issue tracker is associated with the [Riot-Web](https://github.com/vector-im/riot-web) repo, but is also applied to the code in this repo as well.
|
||||
To help avoid duplicate issues, please [view existing issues](https://github.com/vector-im/element-web/issues?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc) first (and add a +1) or [create a new issue](https://github.com/vector-im/element-web/issues/new/choose) if you can't find it. Please note that this issue tracker is associated with the [element-web](https://github.com/vector-im/element-web) repo, but is also applied to the code in this repo as well.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <tchar.h>
|
||||
|
||||
/*
|
||||
* This just runs 'Element (Riot).exe' with the same args as
|
||||
* This just runs 'Element.exe' with the same args as
|
||||
* this process was invoked with. This gets around the fact that
|
||||
* squirrel always tries to run an executable with the same name,
|
||||
* so fails to restart if the app's name has changed.
|
||||
@@ -15,7 +15,7 @@ void _tmain( int argc, TCHAR *argv[] )
|
||||
char cmdLine[32767];
|
||||
|
||||
LPSTR cmdLinePos = cmdLine;
|
||||
LPSTR toRun = "\"Element (Riot).exe\" ";
|
||||
LPSTR toRun = "\"Element.exe\" ";
|
||||
strncpy(cmdLinePos, toRun, strlen(toRun));
|
||||
cmdLinePos += strlen(toRun);
|
||||
|
||||
|
||||
Binary file not shown.
@@ -30,7 +30,7 @@ ENV LC_ALL C.UTF-8
|
||||
|
||||
ENV DEBUG_COLORS true
|
||||
ENV FORCE_COLOR true
|
||||
ENV NODE_VERSION 12.16.1
|
||||
ENV NODE_VERSION 14.17.0
|
||||
|
||||
# this package is used for snapcraft and we should not clear apt list - to avoid apt-get update during snap build
|
||||
RUN curl -L https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz | tar xz -C /usr/local --strip-components=1 && \
|
||||
|
||||
61
docs/native-node-modules.md
Normal file
61
docs/native-node-modules.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# Native Node Modules
|
||||
|
||||
For some features, the desktop version of Element can make use of native Node
|
||||
modules. These allow Element to integrate with the desktop in ways that a browser
|
||||
cannot.
|
||||
|
||||
While native modules enable powerful new features, they must be complied for
|
||||
each operating system. For official Element releases, we will always build these
|
||||
modules from source to ensure we can trust the compiled output. In the future,
|
||||
we may offer a pre-compiled path for those who want to use these features in a
|
||||
custom build of Element without installing the various build tools required.
|
||||
|
||||
Do note that compiling a module for a particular operating system
|
||||
(Linux/macOS/Windows) will need to be done on that operating system.
|
||||
Cross-compiling from a host OS for a different target OS may be possible, but
|
||||
we don't support this flow with Element dependencies at this time.
|
||||
|
||||
The process is automated by [vector-im/element-builder](https://github.com/vector-im/element-builder)
|
||||
when releasing.
|
||||
The following sections explain the manual steps you can use with a custom build of Element to enable
|
||||
these features if you'd like to try them out.
|
||||
It is possible to [build those native modules locally automatically](https://github.com/vector-im/element-desktop#building).
|
||||
|
||||
```
|
||||
yarn run build:native
|
||||
```
|
||||
## Adding Seshat for search in E2E encrypted rooms
|
||||
|
||||
Seshat is a native Node module that adds support for local event indexing and
|
||||
full text search in E2E encrypted rooms.
|
||||
|
||||
Since Seshat is written in Rust, the Rust compiler and related tools need to be
|
||||
installed before installing Seshat itself. To install Rust please consult the
|
||||
official Rust [documentation](https://www.rust-lang.org/tools/install).
|
||||
|
||||
Seshat also depends on the SQLCipher library to store its data in encrypted form
|
||||
on disk. You'll need to install it via your OS package manager.
|
||||
|
||||
After installing the Rust compiler and SQLCipher, Seshat support can be added
|
||||
using yarn at the root of this project:
|
||||
|
||||
yarn add matrix-seshat
|
||||
|
||||
You will have to rebuild the native libraries against electron's version of
|
||||
of node rather than your system node, using the `electron-build-env` tool.
|
||||
This is also needed to when pulling in changes to Seshat using `yarn link`.
|
||||
|
||||
yarn add electron-build-env
|
||||
|
||||
Recompiling Seshat itself can be done like so:
|
||||
|
||||
yarn run electron-build-env -- --electron 6.1.1 -- neon build matrix-seshat --release
|
||||
|
||||
Please make sure to include all the `--` as well as the `--release` command line
|
||||
switch at the end. Modify your electron version accordingly depending on the
|
||||
version that is installed on your system.
|
||||
|
||||
After this is done the Electron version of Element can be run from the main folder
|
||||
as usual using:
|
||||
|
||||
yarn start
|
||||
26
docs/windows-requirements.md
Normal file
26
docs/windows-requirements.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Windows
|
||||
|
||||
## Requirements to build native modules
|
||||
|
||||
If you want to build native modules, make sure that the following tools are installed on your system.
|
||||
|
||||
- [Node 14](https://nodejs.org)
|
||||
- [Python 3](https://www.python.org/downloads/)
|
||||
- [Strawberry Perl](https://strawberryperl.com/)
|
||||
- [Rust](https://rustup.rs/)
|
||||
- [Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) with the following configuration:
|
||||
- On the Workloads tab:
|
||||
- Desktop & Mobile -> C++ build tools
|
||||
- On the Individual components tab:
|
||||
- MSVC VS 2019 C++ build tools
|
||||
- Windows 10 SDK (latest version available)
|
||||
- C++ CMake tools for Windows
|
||||
|
||||
Once installed make sure all those utilities are accessible in your `PATH`.
|
||||
In order to load all the C++ utilities installed by Visual Studio you can run the following in a terminal window.
|
||||
|
||||
```
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
|
||||
```
|
||||
|
||||
You can replace `amd64` with `x86` depending on your CPU architecture.
|
||||
@@ -1,34 +1,34 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF0jCCBLqgAwIBAgIRAISYBqZi3VvCUeSfHXF+cbwwDQYJKoZIhvcNAQELBQAw
|
||||
MIIF8DCCBNigAwIBAgIRAIZSd8hNVs3w8AhJIsQSoYYwDQYJKoZIhvcNAQELBQAw
|
||||
gZExCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
|
||||
BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTcwNQYD
|
||||
VQQDEy5DT01PRE8gUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gQ29kZSBTaWduaW5n
|
||||
IENBMB4XDTE3MDgyMzAwMDAwMFoXDTIwMDgyMjIzNTk1OVowgdgxETAPBgNVBAUT
|
||||
IENBMB4XDTIwMDczMDAwMDAwMFoXDTIzMDczMDIzNTk1OVowgfMxETAPBgNVBAUT
|
||||
CDEwODczNjYxMRMwEQYLKwYBBAGCNzwCAQMTAkdCMR0wGwYDVQQPExRQcml2YXRl
|
||||
IE9yZ2FuaXphdGlvbjELMAkGA1UEBhMCR0IxETAPBgNVBBEMCFdDMVIgNEFHMQ8w
|
||||
DQYDVQQIDAZMb25kb24xDzANBgNVBAcMBkxvbmRvbjEbMBkGA1UECQwSMjYgUmVk
|
||||
IExpb24gU3F1YXJlMRcwFQYDVQQKDA5OZXcgVmVjdG9yIEx0ZDEXMBUGA1UEAwwO
|
||||
TmV3IFZlY3RvciBMdGQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7
|
||||
X0HP3oM/SVr6PboD03ndtYTONZDcJ/GJ3EyYi6UNrcbKjuDHwPktx9hjAhNjcVkG
|
||||
lmuTEPluPj9DbvjaTrers0cQsAS1vJ0RHjLfA93Flg1ys9Q6OThUMw77FtFPtiJU
|
||||
z5cSYzfFAhn/4dv7BcgGptn+Mv/8CaTu+RUZJUgoSlRWcT1TREmxkzWotbblqsHO
|
||||
zjDmUg20tL5/qpt6BSWsNespf5udKQFXMtqkczBcLvBLmql0vurVcQy8BibB+Q89
|
||||
QKwRzwLgaIa7O8WEssFcW8uJe9s0SNtUy8ehbuoSxpA/DbHFwsiDbNA78vp7HrqM
|
||||
qY6t6OIgLtDYBFCfe/btAgMBAAGjggHaMIIB1jAfBgNVHSMEGDAWgBTfj/MgDOnK
|
||||
pgTYW1g3Kj2rRtyDSTAdBgNVHQ4EFgQUH+mDOdRkF3bYDxCWEaGB4lxiCxcwDgYD
|
||||
VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwMw
|
||||
EQYJYIZIAYb4QgEBBAQDAgQQMEYGA1UdIAQ/MD0wOwYMKwYBBAGyMQECAQYBMCsw
|
||||
KQYIKwYBBQUHAgEWHWh0dHBzOi8vc2VjdXJlLmNvbW9kby5jb20vQ1BTMFUGA1Ud
|
||||
HwROMEwwSqBIoEaGRGh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0NPTU9ET1JTQUV4
|
||||
dGVuZGVkVmFsaWRhdGlvbkNvZGVTaWduaW5nQ0EuY3JsMIGGBggrBgEFBQcBAQR6
|
||||
MHgwUAYIKwYBBQUHMAKGRGh0dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NPTU9ET1JT
|
||||
QUV4dGVuZGVkVmFsaWRhdGlvbkNvZGVTaWduaW5nQ0EuY3J0MCQGCCsGAQUFBzAB
|
||||
hhhodHRwOi8vb2NzcC5jb21vZG9jYS5jb20wJgYDVR0RBB8wHaAbBggrBgEFBQcI
|
||||
A6APMA0MC0dCLTEwODczNjYxMA0GCSqGSIb3DQEBCwUAA4IBAQBJ2aH4aixh0aiz
|
||||
4WKlK+LMVLHpQ2POE3FZYNpAW7o1q2YDGEADXdGrygPE9NCGNBXKo0CAemCYNWfX
|
||||
Ov/jdoiMfeqW3vrZ66oEy8OqbvJSwK1xmomWuYw3wYPWcPVG+YbWYD2CGdQu8jTz
|
||||
fzAJCpvAuY3Wji3fQjiecAC7JCSB4fBHa0ALJOmiSqKQUUpkXs5kW7O0lPBnHzNF
|
||||
2tQGltXMSIrq1QfFtcreMyKlwDOxPIh360dv5aHhaeSRDRKxq7uq5ikQF2gjKx4k
|
||||
ieg2HRbAW6fVPpFr4zRS5umpeZV3i06i11VQQPS/mA/OBEXyaqzx4mr6B7U6ptrp
|
||||
jMqiUv2w
|
||||
IE9yZ2FuaXphdGlvbjELMAkGA1UEBhMCR0IxDzANBgNVBBEMBlc0IDFRVTEYMBYG
|
||||
A1UECAwPTG9uZG9uLCBDaXR5IG9mMQ8wDQYDVQQHDAZMb25kb24xJzAlBgNVBAkM
|
||||
HjE0IFR1cm5oYW0gR3JlZW4sIFRlcnJhY2UgTWV3czEbMBkGA1UECgwSTmV3IFZl
|
||||
Y3RvciBMaW1pdGVkMRswGQYDVQQDDBJOZXcgVmVjdG9yIExpbWl0ZWQwggEiMA0G
|
||||
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDKDnGul2M7oCCN+3veGf7yfakSfMjK
|
||||
Kqeylyo0Nj8dUleNQvsRo0OHxIWJlbHDYglxebT109MqgyASr0SoeiqvXOSSFACD
|
||||
MYFoyerRGMnXEuomTU0y7+FE3p/hcim8+C5gS+rHr3YaJJuzzXRztjjCBGoY4was
|
||||
h9V8kYiyMMK0xi2WftOCBa1yYS32CInHIZVmdhzoK4k4YzSYIp57BWvnIUlDyCYk
|
||||
slNfp0SFbDrOGa7kbmy8HRfWPLjNmW5PPIrsf8LlnVRBfmTeUIJtV31w/FuMjeir
|
||||
pzYjzooXmpIrj96ecxdc9thP6etCUazvpowjfewu7UNWRUhGPtYn8v8rAgMBAAGj
|
||||
ggHdMIIB2TAfBgNVHSMEGDAWgBTfj/MgDOnKpgTYW1g3Kj2rRtyDSTAdBgNVHQ4E
|
||||
FgQUB9su4pCQXE5ZWFhB1eo48992LEcwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB
|
||||
/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwMwEQYJYIZIAYb4QgEBBAQDAgQQMEkG
|
||||
A1UdIARCMEAwNQYMKwYBBAGyMQECAQYBMCUwIwYIKwYBBQUHAgEWF2h0dHBzOi8v
|
||||
c2VjdGlnby5jb20vQ1BTMAcGBWeBDAEDMFUGA1UdHwROMEwwSqBIoEaGRGh0dHA6
|
||||
Ly9jcmwuY29tb2RvY2EuY29tL0NPTU9ET1JTQUV4dGVuZGVkVmFsaWRhdGlvbkNv
|
||||
ZGVTaWduaW5nQ0EuY3JsMIGGBggrBgEFBQcBAQR6MHgwUAYIKwYBBQUHMAKGRGh0
|
||||
dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NPTU9ET1JTQUV4dGVuZGVkVmFsaWRhdGlv
|
||||
bkNvZGVTaWduaW5nQ0EuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5jb21v
|
||||
ZG9jYS5jb20wJgYDVR0RBB8wHaAbBggrBgEFBQcIA6APMA0MC0dCLTEwODczNjYx
|
||||
MA0GCSqGSIb3DQEBCwUAA4IBAQBZ8/YtqW/+VUoV8knKpdhMR2uTn8AEyVmfmoZA
|
||||
Ly5kdCRoKvFm/z4VK4cqF7gsUDxRIgDuMKKbWTtr1FEXuaZkUkOjicNcdYxc0pDn
|
||||
nFKBWAv5pN5OmnC9cVqIG7PtvD+8bKVzDdQRjpGMy6PY4rN2PYGfQ7KGgddEDD6m
|
||||
oM51jI/OTvCeU0Tyl0bixKEmpUJvbeQM9Ul2Y1o5Enx1Q9uda8xATb0HCMKgJ+GC
|
||||
iFHL2DNC3j1xK4QoZEIYgbTscj9rK4OMEov3PT/e1FwQyB5V9xdJ5i1MDBDD9fAf
|
||||
OiVgf90SffT7TgWUbA4Z+PtQHq/qNma0+dZWyeq7zYn2IIX3
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"update_base_url": "https://packages.riot.im/nightly/update/",
|
||||
"default_server_name": "matrix.org",
|
||||
"brand": "Element Nightly",
|
||||
"integrations_ui_url": "https://scalar-staging.vector.im/",
|
||||
"integrations_rest_url": "https://scalar-staging.vector.im/api",
|
||||
"integrations_ui_url": "https://scalar.vector.im/",
|
||||
"integrations_rest_url": "https://scalar.vector.im/api",
|
||||
"integrations_widgets_urls": [
|
||||
"https://scalar.vector.im/_matrix/integrations/v1",
|
||||
"https://scalar.vector.im/api",
|
||||
@@ -12,28 +12,18 @@
|
||||
"https://scalar-staging.riot.im/scalar/api"
|
||||
],
|
||||
"hosting_signup_link": "https://element.io/matrix-services?utm_source=element-web&utm_medium=web",
|
||||
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
|
||||
"features": {
|
||||
"feature_new_spinner": "labs",
|
||||
"feature_pinning": "labs",
|
||||
"feature_custom_status": "labs",
|
||||
"feature_custom_tags": "labs",
|
||||
"feature_state_counters": "labs",
|
||||
"feature_many_integration_managers": "labs",
|
||||
"feature_mjolnir": "labs",
|
||||
"feature_dm_verification": "labs",
|
||||
"feature_bridge_state": "labs",
|
||||
"feature_presence_in_room_list": "labs",
|
||||
"feature_custom_themes": "labs"
|
||||
},
|
||||
"bug_report_endpoint_url": "https://element.io/bugreports/submit",
|
||||
"showLabsSettings": true,
|
||||
"piwik": {
|
||||
"url": "https://piwik.riot.im/",
|
||||
"siteId": 1,
|
||||
"policyUrl": "https://matrix.org/legal/riot-im-cookie-policy"
|
||||
"policyUrl": "https://element.io/cookie-policy"
|
||||
},
|
||||
"roomDirectory": {
|
||||
"servers": [
|
||||
"matrix.org"
|
||||
"matrix.org",
|
||||
"gitter.im",
|
||||
"libera.chat"
|
||||
]
|
||||
},
|
||||
"enable_presence_by_hs_url": {
|
||||
@@ -42,11 +32,11 @@
|
||||
},
|
||||
"terms_and_conditions_links": [
|
||||
{
|
||||
"url": "https://riot.im/privacy",
|
||||
"url": "https://element.io/privacy",
|
||||
"text": "Privacy Policy"
|
||||
},
|
||||
{
|
||||
"url": "https://matrix.org/legal/riot-im-cookie-policy",
|
||||
"url": "https://element.io/cookie-policy",
|
||||
"text": "Cookie Policy"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -3,7 +3,8 @@ License: Apache-2.0
|
||||
Vendor: support@element.io
|
||||
Architecture: amd64
|
||||
Maintainer: support@element.io
|
||||
Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libappindicator3-1, libsecret-1-0, libsqlcipher0
|
||||
Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libsecret-1-0, libsqlcipher0
|
||||
Recommends: libappindicator3-1
|
||||
Section: net
|
||||
Priority: extra
|
||||
Homepage: https://element.io/
|
||||
|
||||
@@ -12,16 +12,19 @@
|
||||
"https://scalar-staging.riot.im/scalar/api"
|
||||
],
|
||||
"hosting_signup_link": "https://element.io/matrix-services?utm_source=element-web&utm_medium=web",
|
||||
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
|
||||
"bug_report_endpoint_url": "https://element.io/bugreports/submit",
|
||||
"roomDirectory": {
|
||||
"servers": [
|
||||
"matrix.org"
|
||||
"matrix.org",
|
||||
"gitter.im",
|
||||
"libera.chat"
|
||||
]
|
||||
},
|
||||
"showLabsSettings": false,
|
||||
"piwik": {
|
||||
"url": "https://piwik.riot.im/",
|
||||
"siteId": 1,
|
||||
"policyUrl": "https://matrix.org/legal/riot-im-cookie-policy"
|
||||
"policyUrl": "https://element.io/cookie-policy"
|
||||
},
|
||||
"enable_presence_by_hs_url": {
|
||||
"https://matrix.org": false,
|
||||
@@ -29,11 +32,11 @@
|
||||
},
|
||||
"terms_and_conditions_links": [
|
||||
{
|
||||
"url": "https://riot.im/privacy",
|
||||
"url": "https://element.io/privacy",
|
||||
"text": "Privacy Policy"
|
||||
},
|
||||
{
|
||||
"url": "https://matrix.org/legal/riot-im-cookie-policy",
|
||||
"url": "https://element.io/cookie-policy",
|
||||
"text": "Cookie Policy"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -3,7 +3,8 @@ License: Apache-2.0
|
||||
Vendor: support@element.io
|
||||
Architecture: amd64
|
||||
Maintainer: support@element.io
|
||||
Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libappindicator3-1, libsecret-1-0, libsqlcipher0
|
||||
Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libsecret-1-0, libsqlcipher0
|
||||
Recommends: libappindicator3-1
|
||||
Replaces: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)
|
||||
Breaks: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)
|
||||
Section: net
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -34,7 +34,7 @@ async function buildOpenSslWin(hakEnv, moduleInfo) {
|
||||
const version = moduleInfo.cfg.dependencies.openssl;
|
||||
const openSslDir = path.join(moduleInfo.moduleDotHakDir, `openssl-${version}`);
|
||||
|
||||
const openSslArch = hakEnv.arch === 'x64' ? 'VC-WIN64A' : 'VC-WIN32';
|
||||
const openSslArch = hakEnv.getTargetArch() === 'x64' ? 'VC-WIN64A' : 'VC-WIN32';
|
||||
|
||||
console.log("Building openssl in " + openSslDir);
|
||||
await new Promise((resolve, reject) => {
|
||||
@@ -182,9 +182,36 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
|
||||
if (hakEnv.isMac()) {
|
||||
args.push('--with-crypto-lib=commoncrypto');
|
||||
}
|
||||
args.push('CFLAGS=-DSQLITE_HAS_CODEC');
|
||||
|
||||
if (!hakEnv.isHost()) {
|
||||
// In the nonsense world of `configure`, it is assumed you are building
|
||||
// a compiler like `gcc`, so the `host` option actually means the target
|
||||
// the build output runs on.
|
||||
args.push(`--host=${hakEnv.getTargetId()}`);
|
||||
}
|
||||
|
||||
const cflags = [
|
||||
'-DSQLITE_HAS_CODEC',
|
||||
];
|
||||
|
||||
if (!hakEnv.isHost()) {
|
||||
// `clang` uses more logical option naming.
|
||||
cflags.push(`--target=${hakEnv.getTargetId()}`);
|
||||
}
|
||||
|
||||
if (cflags.length) {
|
||||
args.push(`CFLAGS=${cflags.join(' ')}`);
|
||||
}
|
||||
|
||||
const ldflags = [];
|
||||
|
||||
if (hakEnv.isMac()) {
|
||||
args.push('LDFLAGS=-framework Security -framework Foundation');
|
||||
ldflags.push('-framework Security');
|
||||
ldflags.push('-framework Foundation');
|
||||
}
|
||||
|
||||
if (ldflags.length) {
|
||||
args.push(`LDFLAGS=${ldflags.join(' ')}`);
|
||||
}
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
@@ -248,7 +275,11 @@ async function buildMatrixSeshat(hakEnv, moduleInfo) {
|
||||
// the build scripts since they run on the host, but vcvarsall.bat sets the c
|
||||
// compiler in the path to be the one for the target, so we just use the matching
|
||||
// toolchain for the target architecture which makes everything happy.
|
||||
env.RUSTUP_TOOLCHAIN = hakEnv.arch == 'x64' ? 'stable-x86_64-pc-windows-msvc' : 'stable-i686-pc-windows-msvc';
|
||||
env.RUSTUP_TOOLCHAIN = `stable-${hakEnv.getTargetId()}`;
|
||||
}
|
||||
|
||||
if (!hakEnv.isHost()) {
|
||||
env.CARGO_BUILD_TARGET = hakEnv.getTargetId();
|
||||
}
|
||||
|
||||
console.log("Running neon with env", env);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -34,7 +34,10 @@ module.exports = async function(hakEnv, moduleInfo) {
|
||||
});
|
||||
}
|
||||
|
||||
const tools = [['python', '--version']]; // node-gyp uses python for reasons beyond comprehension
|
||||
const tools = [
|
||||
['rustc', '--version'],
|
||||
['python', '--version'], // node-gyp uses python for reasons beyond comprehension
|
||||
];
|
||||
if (hakEnv.isWin()) {
|
||||
tools.push(['perl', '--version']); // for openssl configure
|
||||
tools.push(['patch', '--version']); // to patch sqlcipher Makefile.msc
|
||||
@@ -57,4 +60,18 @@ module.exports = async function(hakEnv, moduleInfo) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Ensure Rust target exists
|
||||
await new Promise((resolve, reject) => {
|
||||
childProcess.execFile('rustup', ['target', 'list', '--installed'], (err, out) => {
|
||||
if (err) {
|
||||
reject("Can't find rustup");
|
||||
}
|
||||
const target = hakEnv.getTargetId();
|
||||
if (!out.includes(target)) {
|
||||
reject(`Rust target ${target} not installed`);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
74
package.json
74
package.json
@@ -1,77 +1,93 @@
|
||||
{
|
||||
"name": "element-desktop",
|
||||
"productName": "Element",
|
||||
"main": "src/electron-main.js",
|
||||
"version": "1.7.2",
|
||||
"main": "lib/electron-main.js",
|
||||
"version": "1.7.32",
|
||||
"description": "A feature-rich client for Matrix.org",
|
||||
"author": "Element",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vector-im/riot-desktop"
|
||||
"url": "https://github.com/vector-im/element-desktop"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"files": [],
|
||||
"scripts": {
|
||||
"i18n": "matrix-gen-i18n",
|
||||
"prunei18n": "matrix-prune-i18n",
|
||||
"diff-i18n": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && matrix-gen-i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
|
||||
"mkdirs": "mkdirp packages deploys",
|
||||
"fetch": "yarn run mkdirs && node scripts/fetch-package.js",
|
||||
"asar-webapp": "asar p webapp webapp.asar",
|
||||
"start": "electron .",
|
||||
"lint": "eslint src/ scripts/ hak/",
|
||||
"start": "yarn run build:ts && yarn run build:res && electron .",
|
||||
"lint": "yarn lint:types && yarn lint:js",
|
||||
"lint:js": "eslint src/ scripts/ hak/",
|
||||
"lint:types": "tsc --noEmit",
|
||||
"build:native": "yarn run hak",
|
||||
"build32": "electron-builder --ia32",
|
||||
"build64": "electron-builder --x64",
|
||||
"build": "electron-builder",
|
||||
"docker:setup": "docker build -t riot-desktop-dockerbuild dockerbuild",
|
||||
"build32": "yarn run build:ts && yarn run build:res && electron-builder --ia32",
|
||||
"build64": "yarn run build:ts && yarn run build:res && electron-builder --x64",
|
||||
"build": "yarn run build:ts && yarn run build:res && electron-builder",
|
||||
"build:ts": "tsc",
|
||||
"build:res": "node scripts/copy-res.js",
|
||||
"docker:setup": "docker build -t element-desktop-dockerbuild dockerbuild",
|
||||
"docker:build:native": "scripts/in-docker.sh yarn run hak",
|
||||
"docker:build": "scripts/in-docker.sh yarn run build",
|
||||
"docker:install": "scripts/in-docker.sh yarn install",
|
||||
"debrepo": "scripts/mkrepo.sh",
|
||||
"clean": "rimraf webapp.asar dist packages deploys",
|
||||
"clean": "rimraf webapp.asar dist packages deploys lib",
|
||||
"hak": "node scripts/hak/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"auto-launch": "^5.0.1",
|
||||
"electron-store": "^2.0.0",
|
||||
"electron-window-state": "^4.1.0",
|
||||
"auto-launch": "^5.0.5",
|
||||
"counterpart": "^0.18.6",
|
||||
"electron-store": "^6.0.1",
|
||||
"electron-window-state": "^5.0.3",
|
||||
"minimist": "^1.2.3",
|
||||
"png-to-ico": "^1.0.2"
|
||||
"png-to-ico": "^2.1.1",
|
||||
"request": "^2.88.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/auto-launch": "^5.0.1",
|
||||
"@types/counterpart": "^0.18.1",
|
||||
"@types/minimist": "^1.2.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.17.0",
|
||||
"@typescript-eslint/parser": "^4.17.0",
|
||||
"asar": "^2.0.1",
|
||||
"electron-builder": "^22.7.0",
|
||||
"electron-builder-squirrel-windows": "^22.7.0",
|
||||
"electron-devtools-installer": "^2.2.4",
|
||||
"electron-notarize": "^0.2.0",
|
||||
"eslint": "7.3.1",
|
||||
"eslint-config-google": "^0.7.1",
|
||||
"eslint-config-matrix-org": "^0.1.2",
|
||||
"eslint-plugin-babel": "^4.1.2",
|
||||
"chokidar": "^3.5.2",
|
||||
"electron": "12.0.11",
|
||||
"electron-builder": "22.11.4",
|
||||
"electron-builder-squirrel-windows": "22.11.4",
|
||||
"electron-devtools-installer": "^3.1.1",
|
||||
"electron-notarize": "^1.0.0",
|
||||
"eslint": "7.18.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
"eslint-plugin-matrix-org": "github:matrix-org/eslint-plugin-matrix-org#main",
|
||||
"find-npm-prefix": "^1.0.2",
|
||||
"fs-extra": "^8.1.0",
|
||||
"glob": "^7.1.6",
|
||||
"matrix-js-sdk": "8.0.0",
|
||||
"matrix-web-i18n": "github:matrix-org/matrix-web-i18n",
|
||||
"mkdirp": "^1.0.3",
|
||||
"needle": "^2.5.0",
|
||||
"node-pre-gyp": "^0.15.0",
|
||||
"npm": "^6.14.6",
|
||||
"npm": "^6.14.11",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.1.3",
|
||||
"tar": "^6.0.1"
|
||||
"semver": "^7.3.4",
|
||||
"tar": "^6.1.0",
|
||||
"typescript": "^4.1.3"
|
||||
},
|
||||
"hakDependencies": {
|
||||
"matrix-seshat": "^2.1.0",
|
||||
"matrix-seshat": "^2.2.3",
|
||||
"keytar": "^5.6.0"
|
||||
},
|
||||
"build": {
|
||||
"appId": "im.riot.app",
|
||||
"electronVersion": "9.0.5",
|
||||
"electronVersion": "12.0.12",
|
||||
"files": [
|
||||
"package.json",
|
||||
{
|
||||
"from": ".hak/hakModules",
|
||||
"to": "node_modules"
|
||||
},
|
||||
"src/**"
|
||||
"lib/**"
|
||||
],
|
||||
"extraResources": [
|
||||
{
|
||||
|
||||
48
release.sh
48
release.sh
@@ -9,52 +9,4 @@ set -e
|
||||
|
||||
cd `dirname $0`
|
||||
|
||||
for i in matrix-js-sdk
|
||||
do
|
||||
echo "Checking version of $i..."
|
||||
depver=`cat package.json | jq -r .devDependencies[\"$i\"]`
|
||||
latestver=`yarn info -s $i dist-tags.next`
|
||||
if [ "$depver" != "$latestver" ]
|
||||
then
|
||||
echo "The latest version of $i is $latestver but package.json depends on $depver."
|
||||
echo -n "Type 'u' to auto-upgrade, 'c' to continue anyway, or 'a' to abort:"
|
||||
read resp
|
||||
if [ "$resp" != "u" ] && [ "$resp" != "c" ]
|
||||
then
|
||||
echo "Aborting."
|
||||
exit 1
|
||||
fi
|
||||
if [ "$resp" == "u" ]
|
||||
then
|
||||
echo "Upgrading $i to $latestver..."
|
||||
yarn add -ED $i@$latestver
|
||||
git add -u
|
||||
# The `-e` flag opens the editor and gives you a chance to check
|
||||
# the upgrade for correctness.
|
||||
git commit -m "Upgrade $i to $latestver" -e
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
./node_modules/matrix-js-sdk/release.sh -n -z "$@"
|
||||
|
||||
release="${1#v}"
|
||||
prerelease=0
|
||||
# We check if this build is a prerelease by looking to
|
||||
# see if the version has a hyphen in it. Crude,
|
||||
# but semver doesn't support postreleases so anything
|
||||
# with a hyphen is a prerelease.
|
||||
echo $release | grep -q '-' && prerelease=1
|
||||
|
||||
if [ $prerelease -eq 0 ]
|
||||
then
|
||||
# For a release, reset SDK deps back to the `develop` branch.
|
||||
for i in matrix-js-sdk
|
||||
do
|
||||
echo "Resetting $i to develop branch..."
|
||||
yarn add -D github:matrix-org/$i#develop
|
||||
git add -u
|
||||
git commit -m "Reset $i back to develop branch"
|
||||
done
|
||||
git push origin develop
|
||||
fi
|
||||
|
||||
@@ -2,12 +2,4 @@
|
||||
|
||||
set -ex
|
||||
|
||||
scripts/fetchdep.sh matrix-org matrix-js-sdk
|
||||
|
||||
pushd matrix-js-sdk
|
||||
yarn link
|
||||
yarn install $@
|
||||
popd
|
||||
|
||||
yarn link matrix-js-sdk
|
||||
yarn install $@
|
||||
|
||||
121
scripts/copy-res.js
Executable file
121
scripts/copy-res.js
Executable file
@@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// copies resources into the lib directory.
|
||||
|
||||
const parseArgs = require('minimist');
|
||||
const chokidar = require('chokidar');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const argv = parseArgs(process.argv.slice(2), {});
|
||||
|
||||
const watch = argv.w;
|
||||
const verbose = argv.v;
|
||||
|
||||
function errCheck(err) {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
const I18N_BASE_PATH = "src/i18n/strings/";
|
||||
const INCLUDE_LANGS = fs.readdirSync(I18N_BASE_PATH).filter(fn => fn.endsWith(".json"));
|
||||
|
||||
// Ensure lib, lib/i18n and lib/i18n/strings all exist
|
||||
fs.mkdirSync('lib/i18n/strings', { recursive: true });
|
||||
|
||||
function genLangFile(file, dest) {
|
||||
let translations = {};
|
||||
[file].forEach(function(f) {
|
||||
if (fs.existsSync(f)) {
|
||||
try {
|
||||
Object.assign(
|
||||
translations,
|
||||
JSON.parse(fs.readFileSync(f).toString()),
|
||||
);
|
||||
} catch (e) {
|
||||
console.error("Failed: " + f, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
translations = weblateToCounterpart(translations);
|
||||
|
||||
const json = JSON.stringify(translations, null, 4);
|
||||
const filename = path.basename(file);
|
||||
|
||||
fs.writeFileSync(dest + filename, json);
|
||||
if (verbose) {
|
||||
console.log("Generated language file: " + filename);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert translation key from weblate format
|
||||
* (which only supports a single level) to counterpart
|
||||
* which requires object values for 'count' translations.
|
||||
*
|
||||
* eg.
|
||||
* "there are %(count)s badgers|one": "a badger",
|
||||
* "there are %(count)s badgers|other": "%(count)s badgers"
|
||||
* becomes
|
||||
* "there are %(count)s badgers": {
|
||||
* "one": "a badger",
|
||||
* "other": "%(count)s badgers"
|
||||
* }
|
||||
*/
|
||||
function weblateToCounterpart(inTrs) {
|
||||
const outTrs = {};
|
||||
|
||||
for (const key of Object.keys(inTrs)) {
|
||||
const keyParts = key.split('|', 2);
|
||||
if (keyParts.length === 2) {
|
||||
let obj = outTrs[keyParts[0]];
|
||||
if (obj === undefined) {
|
||||
obj = {};
|
||||
outTrs[keyParts[0]] = obj;
|
||||
}
|
||||
obj[keyParts[1]] = inTrs[key];
|
||||
} else {
|
||||
outTrs[key] = inTrs[key];
|
||||
}
|
||||
}
|
||||
|
||||
return outTrs;
|
||||
}
|
||||
|
||||
/*
|
||||
watch the input files for a given language,
|
||||
regenerate the file, and regenerating languages.json with the new filename
|
||||
*/
|
||||
function watchLanguage(file, dest) {
|
||||
// XXX: Use a debounce because for some reason if we read the language
|
||||
// file immediately after the FS event is received, the file contents
|
||||
// appears empty. Possibly https://github.com/nodejs/node/issues/6112
|
||||
let makeLangDebouncer;
|
||||
const makeLang = () => {
|
||||
if (makeLangDebouncer) {
|
||||
clearTimeout(makeLangDebouncer);
|
||||
}
|
||||
makeLangDebouncer = setTimeout(() => {
|
||||
genLangFile(file, dest);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
chokidar.watch(file)
|
||||
.on('add', makeLang)
|
||||
.on('change', makeLang)
|
||||
.on('error', errCheck);
|
||||
}
|
||||
|
||||
// language resources
|
||||
const I18N_DEST = "lib/i18n/strings/";
|
||||
INCLUDE_LANGS.forEach((file) => {
|
||||
genLangFile(I18N_BASE_PATH + file, I18N_DEST);
|
||||
}, {});
|
||||
|
||||
if (watch) {
|
||||
INCLUDE_LANGS.forEach(file => watchLanguage(I18N_BASE_PATH + file, I18N_DEST));
|
||||
}
|
||||
@@ -11,15 +11,15 @@ const needle = require('needle');
|
||||
|
||||
const riotDesktopPackageJson = require('../package.json');
|
||||
|
||||
const PUB_KEY_URL = "https://packages.riot.im/riot-release-key.asc";
|
||||
const PACKAGE_URL_PREFIX = "https://github.com/vector-im/riot-web/releases/download/";
|
||||
const PUB_KEY_URL = "https://packages.riot.im/element-release-key.asc";
|
||||
const PACKAGE_URL_PREFIX = "https://github.com/vector-im/element-web/releases/download/";
|
||||
const ASAR_PATH = 'webapp.asar';
|
||||
|
||||
const {setPackageVersion, setDebVersion} = require('./set-version.js');
|
||||
const { setPackageVersion } = require('./set-version.js');
|
||||
|
||||
async function getLatestDevelopUrl(bkToken) {
|
||||
const buildsResult = await needle('get',
|
||||
"https://api.buildkite.com/v2/organizations/matrix-dot-org/pipelines/riot-web/builds",
|
||||
"https://api.buildkite.com/v2/organizations/matrix-dot-org/pipelines/element-web/builds",
|
||||
{
|
||||
branch: 'develop',
|
||||
state: 'passed',
|
||||
@@ -55,7 +55,7 @@ async function getLatestDevelopUrl(bkToken) {
|
||||
let dlUrl;
|
||||
let dlFilename;
|
||||
for (const artifact of artifactsResult.body) {
|
||||
if (artifact.filename && /^riot-.*\.tar.gz$/.test(artifact.filename)) {
|
||||
if (artifact.filename && /^element-.*\.tar.gz$/.test(artifact.filename)) {
|
||||
dlUrl = artifact.download_url;
|
||||
dlFilename = artifact.filename;
|
||||
break;
|
||||
@@ -149,7 +149,7 @@ async function main() {
|
||||
|
||||
if (targetVersion === undefined) {
|
||||
targetVersion = 'v' + riotDesktopPackageJson.version;
|
||||
filename = 'riot-' + targetVersion + '.tar.gz';
|
||||
filename = 'element-' + targetVersion + '.tar.gz';
|
||||
url = PACKAGE_URL_PREFIX + targetVersion + '/' + filename;
|
||||
} else if (targetVersion === 'develop') {
|
||||
const buildKiteApiKey = process.env.BUILDKITE_API_KEY;
|
||||
@@ -164,7 +164,7 @@ async function main() {
|
||||
[filename, url] = await getLatestDevelopUrl(buildKiteApiKey);
|
||||
verify = false; // develop builds aren't signed
|
||||
} else {
|
||||
filename = 'riot-' + targetVersion + '.tar.gz';
|
||||
filename = 'element-' + targetVersion + '.tar.gz';
|
||||
url = PACKAGE_URL_PREFIX + targetVersion + '/' + filename;
|
||||
setVersion = true;
|
||||
}
|
||||
@@ -283,7 +283,6 @@ async function main() {
|
||||
const semVer = targetVersion.slice(1);
|
||||
console.log("Updating version to " + semVer);
|
||||
await setPackageVersion(semVer);
|
||||
await setDebVersion(semVer);
|
||||
}
|
||||
|
||||
console.log("Done!");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -41,8 +41,8 @@ async function copy(hakEnv, moduleInfo) {
|
||||
|
||||
if (moduleInfo.cfg.copy) {
|
||||
console.log(
|
||||
"Copying " + moduleInfo.cfg.prune + " from " +
|
||||
moduleInfo.moduleOutDir + " to " + moduleInfo.moduleOutDir,
|
||||
"Copying files from " +
|
||||
moduleInfo.moduleBuildDir + " to " + moduleInfo.moduleOutDir,
|
||||
);
|
||||
const files = await new Promise(async (resolve, reject) => {
|
||||
glob(moduleInfo.cfg.copy, {
|
||||
|
||||
@@ -37,7 +37,7 @@ async function fetch(hakEnv, moduleInfo) {
|
||||
if (haveModuleBuildDir) return;
|
||||
|
||||
await new Promise((resolve) => {
|
||||
npm.load({'loglevel': 'silent'}, resolve);
|
||||
npm.load({ 'loglevel': 'silent' }, resolve);
|
||||
});
|
||||
|
||||
console.log("Fetching " + moduleInfo.name + " at version " + moduleInfo.version);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -18,6 +18,7 @@ const path = require('path');
|
||||
const os = require('os');
|
||||
|
||||
const nodePreGypVersioning = require('node-pre-gyp/lib/util/versioning');
|
||||
const { TARGETS, getHost, isHostId } = require('./target');
|
||||
|
||||
function getElectronVersion(packageJson) {
|
||||
// should we pick the version of an installed electron
|
||||
@@ -33,7 +34,7 @@ function getRuntime(packageJson) {
|
||||
return electronVersion ? 'electron' : 'node-webkit';
|
||||
}
|
||||
|
||||
function getTarget(packageJson) {
|
||||
function getRuntimeVersion(packageJson) {
|
||||
const electronVersion = getElectronVersion(packageJson);
|
||||
if (electronVersion) {
|
||||
return electronVersion;
|
||||
@@ -42,30 +43,24 @@ function getTarget(packageJson) {
|
||||
}
|
||||
}
|
||||
|
||||
function detectArch() {
|
||||
if (process.platform === 'win32') {
|
||||
// vcvarsall.bat (the script that sets up the environment for
|
||||
// visual studio build tools) sets an env var to tell us what
|
||||
// architecture the active build tools target, so we auto-detect
|
||||
// this.
|
||||
const targetArch = process.env.VSCMD_ARG_TGT_ARCH;
|
||||
if (targetArch === 'x86') {
|
||||
return 'ia32';
|
||||
} else if (targetArch === 'x64') {
|
||||
return 'x64';
|
||||
}
|
||||
}
|
||||
return process.arch;
|
||||
}
|
||||
|
||||
module.exports = class HakEnv {
|
||||
constructor(prefix, packageJson) {
|
||||
constructor(prefix, packageJson, targetId) {
|
||||
let target;
|
||||
if (targetId) {
|
||||
target = TARGETS[targetId];
|
||||
} else {
|
||||
target = getHost();
|
||||
}
|
||||
|
||||
if (!target) {
|
||||
throw new Error(`Unknown target ${targetId}!`);
|
||||
}
|
||||
|
||||
Object.assign(this, {
|
||||
// what we're targeting
|
||||
runtime: getRuntime(packageJson),
|
||||
target: getTarget(packageJson),
|
||||
platform: process.platform,
|
||||
arch: detectArch(),
|
||||
runtimeVersion: getRuntimeVersion(packageJson),
|
||||
target,
|
||||
|
||||
// paths
|
||||
projectRoot: prefix,
|
||||
@@ -76,34 +71,46 @@ module.exports = class HakEnv {
|
||||
getRuntimeAbi() {
|
||||
return nodePreGypVersioning.get_runtime_abi(
|
||||
this.runtime,
|
||||
this.target,
|
||||
this.runtimeVersion,
|
||||
);
|
||||
}
|
||||
|
||||
// {node_abi}-{platform}-{arch}
|
||||
getNodeTriple() {
|
||||
return this.getRuntimeAbi() + '-' + this.platform + '-' + this.arch;
|
||||
return this.getRuntimeAbi() + '-' + this.target.platform + '-' + this.target.arch;
|
||||
}
|
||||
|
||||
getTargetId() {
|
||||
return this.target.id;
|
||||
}
|
||||
|
||||
isWin() {
|
||||
return this.platform === 'win32';
|
||||
return this.target.platform === 'win32';
|
||||
}
|
||||
|
||||
isMac() {
|
||||
return this.platform === 'darwin';
|
||||
return this.target.platform === 'darwin';
|
||||
}
|
||||
|
||||
isLinux() {
|
||||
return this.platform === 'linux';
|
||||
return this.target.platform === 'linux';
|
||||
}
|
||||
|
||||
getTargetArch() {
|
||||
return this.target.arch;
|
||||
}
|
||||
|
||||
isHost() {
|
||||
return isHostId(this.target.id);
|
||||
}
|
||||
|
||||
makeGypEnv() {
|
||||
return Object.assign({}, process.env, {
|
||||
npm_config_target: this.target,
|
||||
npm_config_arch: this.arch,
|
||||
npm_config_target_arch: this.arch,
|
||||
npm_config_arch: this.target.arch,
|
||||
npm_config_target_arch: this.target.arch,
|
||||
npm_config_disturl: 'https://atom.io/download/electron',
|
||||
npm_config_runtime: this.runtime,
|
||||
npm_config_target: this.runtimeVersion,
|
||||
npm_config_build_from_source: true,
|
||||
npm_config_devdir: path.join(os.homedir(), ".electron-gyp"),
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -53,7 +53,19 @@ async function main() {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const hakEnv = new HakEnv(prefix, packageJson);
|
||||
// Apply `--target <target>` option if specified
|
||||
const targetIndex = process.argv.indexOf('--target');
|
||||
let targetId;
|
||||
if (targetIndex >= 0) {
|
||||
if ((targetIndex + 1) >= process.argv.length) {
|
||||
console.error("--target option specified without a target");
|
||||
process.exit(1);
|
||||
}
|
||||
// Extract target ID and remove from args
|
||||
targetId = process.argv.splice(targetIndex, 2)[1];
|
||||
}
|
||||
|
||||
const hakEnv = new HakEnv(prefix, packageJson, targetId);
|
||||
|
||||
const deps = {};
|
||||
|
||||
@@ -133,4 +145,7 @@ async function main() {
|
||||
}
|
||||
}
|
||||
|
||||
main().catch(() => process.exit(1));
|
||||
main().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
82
scripts/hak/target.js
Normal file
82
scripts/hak/target.js
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
/*
|
||||
Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS FILE IS GENERATED, NOT MEANT FOR EDITING DIRECTLY
|
||||
* The original source is `target.ts` in the `element-builder` repo. You can
|
||||
* edit it over there, run `yarn build`, and paste the changes here. It is
|
||||
* currently assumed this file will rarely change, so a spearate package is not
|
||||
* yet warranted.
|
||||
*/
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isHost = exports.isHostId = exports.getHost = exports.ENABLED_TARGETS = exports.TARGETS = void 0;
|
||||
const aarch64AppleDarwin = {
|
||||
id: 'aarch64-apple-darwin',
|
||||
platform: 'darwin',
|
||||
arch: 'arm64',
|
||||
};
|
||||
const i686PcWindowsMsvc = {
|
||||
id: 'i686-pc-windows-msvc',
|
||||
platform: 'win32',
|
||||
arch: 'ia32',
|
||||
vcVarsArch: 'x86',
|
||||
};
|
||||
const x8664PcWindowsMsvc = {
|
||||
id: 'x86_64-pc-windows-msvc',
|
||||
platform: 'win32',
|
||||
arch: 'x64',
|
||||
vcVarsArch: 'amd64',
|
||||
};
|
||||
const x8664AppleDarwin = {
|
||||
id: 'x86_64-apple-darwin',
|
||||
platform: 'darwin',
|
||||
arch: 'x64',
|
||||
};
|
||||
const x8664UnknownLinuxGnu = {
|
||||
id: 'x86_64-unknown-linux-gnu',
|
||||
platform: 'linux',
|
||||
arch: 'x64',
|
||||
};
|
||||
exports.TARGETS = {
|
||||
'aarch64-apple-darwin': aarch64AppleDarwin,
|
||||
'i686-pc-windows-msvc': i686PcWindowsMsvc,
|
||||
'x86_64-pc-windows-msvc': x8664PcWindowsMsvc,
|
||||
'x86_64-apple-darwin': x8664AppleDarwin,
|
||||
'x86_64-unknown-linux-gnu': x8664UnknownLinuxGnu,
|
||||
};
|
||||
// The set of targets we build by default, sorted by increasing complexity so
|
||||
// that we fail fast when the native host target fails.
|
||||
exports.ENABLED_TARGETS = [
|
||||
exports.TARGETS['x86_64-apple-darwin'],
|
||||
exports.TARGETS['aarch64-apple-darwin'],
|
||||
exports.TARGETS['x86_64-unknown-linux-gnu'],
|
||||
exports.TARGETS['i686-pc-windows-msvc'],
|
||||
];
|
||||
function getHost() {
|
||||
return Object.values(exports.TARGETS).find(target => (target.platform === process.platform &&
|
||||
target.arch === process.arch));
|
||||
}
|
||||
exports.getHost = getHost;
|
||||
function isHostId(id) {
|
||||
return getHost()?.id === id;
|
||||
}
|
||||
exports.isHostId = isHostId;
|
||||
function isHost(target) {
|
||||
return getHost()?.id === target.id;
|
||||
}
|
||||
exports.isHost = isHost;
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker inspect riot-desktop-dockerbuild 2> /dev/null > /dev/null
|
||||
docker inspect element-desktop-dockerbuild 2> /dev/null > /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
echo "Docker image riot-desktop-dockerbuild not found. Have you run yarn run docker:setup?"
|
||||
echo "Docker image element-desktop-dockerbuild not found. Have you run yarn run docker:setup?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -17,4 +17,4 @@ docker run --rm -ti \
|
||||
-v ${PWD}/docker/.gnupg:/root/.gnupg \
|
||||
-v ~/.cache/electron:/root/.cache/electron \
|
||||
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
|
||||
riot-desktop-dockerbuild "$@"
|
||||
element-desktop-dockerbuild "$@"
|
||||
|
||||
@@ -22,10 +22,10 @@ cp $confdir/conf_distributions $repodir/conf/distributions
|
||||
pushd $repodir
|
||||
for i in `cat conf/distributions | grep Codename | cut -d ' ' -f 2`
|
||||
do
|
||||
reprepro includedeb $i $distdir/riot-desktop_${ver}_amd64.deb
|
||||
reprepro includedeb $i $distdir/element-desktop_${ver}_amd64.deb
|
||||
done
|
||||
|
||||
tar cvzf $distdir/riot-desktop_repo_$ver.tar.gz .
|
||||
tar cvzf $distdir/element-desktop_repo_$ver.tar.gz .
|
||||
|
||||
popd
|
||||
|
||||
|
||||
@@ -52,4 +52,4 @@ if (require.main === module) {
|
||||
main(process.argv.slice(2)).then((ret) => process.exit(ret));
|
||||
}
|
||||
|
||||
module.exports = {versionFromAsar, setPackageVersion};
|
||||
module.exports = { versionFromAsar, setPackageVersion };
|
||||
|
||||
14
src/preload.js → src/@types/global.d.ts
vendored
14
src/preload.js → src/@types/global.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2018, 2019 New Vector Ltd
|
||||
Copyright 2021 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.
|
||||
@@ -14,7 +14,13 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
import { BrowserWindow } from "electron";
|
||||
|
||||
// expose ipcRenderer to the renderer process
|
||||
window.ipcRenderer = ipcRenderer;
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface Global {
|
||||
mainWindow: BrowserWindow;
|
||||
appQuitting: boolean;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
/*
|
||||
Copyright 2016 Aviral Dasgupta
|
||||
Copyright 2016 OpenMarket Ltd
|
||||
Copyright 2018, 2019 New Vector Ltd
|
||||
Copyright 2017, 2019 Michael Telatynski <7t3chguy@gmail.com>
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
Copyright 2018 - 2021 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -21,32 +20,33 @@ limitations under the License.
|
||||
// Squirrel on windows starts the app with various flags
|
||||
// as hooks to tell us when we've been installed/uninstalled
|
||||
// etc.
|
||||
const checkSquirrelHooks = require('./squirrelhooks');
|
||||
if (checkSquirrelHooks()) return;
|
||||
import { checkSquirrelHooks } from "./squirrelhooks";
|
||||
if (checkSquirrelHooks()) process.exit(1);
|
||||
|
||||
const argv = require('minimist')(process.argv, {
|
||||
alias: {help: "h"},
|
||||
import { app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater, protocol, dialog } from "electron";
|
||||
import AutoLaunch from "auto-launch";
|
||||
import path from "path";
|
||||
import windowStateKeeper from 'electron-window-state';
|
||||
import Store from 'electron-store';
|
||||
import fs, { promises as afs } from "fs";
|
||||
import crypto from "crypto";
|
||||
import { URL } from "url";
|
||||
import minimist from "minimist";
|
||||
|
||||
import * as tray from "./tray";
|
||||
import { buildMenuTemplate } from './vectormenu';
|
||||
import webContentsHandler from './webcontents-handler';
|
||||
import * as updater from './updater';
|
||||
import { getProfileFromDeeplink, protocolInit, recordSSOSession } from './protocol';
|
||||
import { _t, AppLocalization } from './language-helper';
|
||||
|
||||
const argv = minimist(process.argv, {
|
||||
alias: { help: "h" },
|
||||
});
|
||||
|
||||
const {app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater, protocol} = require('electron');
|
||||
const AutoLaunch = require('auto-launch');
|
||||
const path = require('path');
|
||||
|
||||
const tray = require('./tray');
|
||||
const vectorMenu = require('./vectormenu');
|
||||
const webContentsHandler = require('./webcontents-handler');
|
||||
const updater = require('./updater');
|
||||
const {getProfileFromDeeplink, protocolInit, recordSSOSession} = require('./protocol');
|
||||
|
||||
const windowStateKeeper = require('electron-window-state');
|
||||
const Store = require('electron-store');
|
||||
|
||||
const fs = require('fs');
|
||||
const afs = fs.promises;
|
||||
|
||||
const crypto = require('crypto');
|
||||
let keytar;
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
keytar = require('keytar');
|
||||
} catch (e) {
|
||||
if (e.code === "MODULE_NOT_FOUND") {
|
||||
@@ -61,9 +61,8 @@ let Seshat;
|
||||
let SeshatRecovery;
|
||||
let ReindexError;
|
||||
|
||||
const seshatPassphrase = "DEFAULT_PASSPHRASE";
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const seshatModule = require('matrix-seshat');
|
||||
Seshat = seshatModule.Seshat;
|
||||
SeshatRecovery = seshatModule.SeshatRecovery;
|
||||
@@ -85,6 +84,7 @@ let vectorConfig;
|
||||
let iconPath;
|
||||
let trayConfig;
|
||||
let launcher;
|
||||
let appLocalization;
|
||||
|
||||
if (argv["help"]) {
|
||||
console.log("Options:");
|
||||
@@ -179,10 +179,11 @@ async function setupGlobals() {
|
||||
]);
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
vectorConfig = require(asarPath + 'config.json');
|
||||
} catch (e) {
|
||||
// it would be nice to check the error code here and bail if the config
|
||||
// is unparseable, but we get MODULE_NOT_FOUND in the case of a missing
|
||||
// is unparsable, but we get MODULE_NOT_FOUND in the case of a missing
|
||||
// file or invalid json, so node is just very unhelpful.
|
||||
// Continue with the defaults (ie. an empty config)
|
||||
vectorConfig = {};
|
||||
@@ -190,6 +191,7 @@ async function setupGlobals() {
|
||||
|
||||
try {
|
||||
// Load local config and use it to override values from the one baked with the build
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const localConfig = require(path.join(app.getPath('userData'), 'config.json'));
|
||||
|
||||
// If the local config has a homeserver defined, don't use the homeserver from the build
|
||||
@@ -205,6 +207,16 @@ async function setupGlobals() {
|
||||
|
||||
vectorConfig = Object.assign(vectorConfig, localConfig);
|
||||
} catch (e) {
|
||||
if (e instanceof SyntaxError) {
|
||||
dialog.showMessageBox({
|
||||
type: "error",
|
||||
title: `Your ${vectorConfig.brand || 'Element'} is misconfigured`,
|
||||
message: `Your custom ${vectorConfig.brand || 'Element'} configuration contains invalid JSON. ` +
|
||||
`Please correct the problem and reopen ${vectorConfig.brand || 'Element'}.`,
|
||||
detail: e.message || "",
|
||||
});
|
||||
}
|
||||
|
||||
// Could not load local config, this is expected in most cases.
|
||||
}
|
||||
|
||||
@@ -247,13 +259,44 @@ async function moveAutoLauncher() {
|
||||
}
|
||||
|
||||
const eventStorePath = path.join(app.getPath('userData'), 'EventStore');
|
||||
const store = new Store({ name: "electron-config" });
|
||||
const store = new Store<{
|
||||
warnBeforeExit?: boolean;
|
||||
minimizeToTray?: boolean;
|
||||
spellCheckerEnabled?: boolean;
|
||||
autoHideMenuBar?: boolean;
|
||||
locale?: string | string[];
|
||||
}>({ name: "electron-config" });
|
||||
|
||||
let eventIndex = null;
|
||||
|
||||
let mainWindow = null;
|
||||
global.appQuitting = false;
|
||||
|
||||
const exitShortcuts = [
|
||||
(input, platform) => platform !== 'darwin' && input.alt && input.key.toUpperCase() === 'F4',
|
||||
(input, platform) => platform !== 'darwin' && input.control && input.key.toUpperCase() === 'Q',
|
||||
(input, platform) => platform === 'darwin' && input.meta && input.key.toUpperCase() === 'Q',
|
||||
];
|
||||
|
||||
const warnBeforeExit = (event, input) => {
|
||||
const shouldWarnBeforeExit = store.get('warnBeforeExit', true);
|
||||
const exitShortcutPressed =
|
||||
input.type === 'keyDown' && exitShortcuts.some(shortcutFn => shortcutFn(input, process.platform));
|
||||
|
||||
if (shouldWarnBeforeExit && exitShortcutPressed) {
|
||||
const shouldCancelCloseRequest = dialog.showMessageBoxSync(mainWindow, {
|
||||
type: "question",
|
||||
buttons: [_t("Cancel"), _t("Close Element")],
|
||||
message: _t("Are you sure you want to quit?"),
|
||||
defaultId: 1,
|
||||
cancelId: 0,
|
||||
}) === 0;
|
||||
|
||||
if (shouldCancelCloseRequest) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const deleteContents = async (p) => {
|
||||
for (const entry of await afs.readdir(p)) {
|
||||
@@ -262,6 +305,18 @@ const deleteContents = async (p) => {
|
||||
}
|
||||
};
|
||||
|
||||
async function randomArray(size) {
|
||||
return new Promise((resolve, reject) => {
|
||||
crypto.randomBytes(size, (err, buf) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(buf.toString("base64").replace(/=+$/g, ''));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// handle uncaught errors otherwise it displays
|
||||
// stack traces in popup dialogs, which is terrible (which
|
||||
// it will do any time the auto update poke fails, and there's
|
||||
@@ -329,6 +384,15 @@ ipcMain.on('ipcCall', async function(ev, payload) {
|
||||
launcher.disable();
|
||||
}
|
||||
break;
|
||||
case 'setLanguage':
|
||||
appLocalization.setAppLocale(args[0]);
|
||||
break;
|
||||
case 'shouldWarnBeforeExit':
|
||||
ret = store.get('warnBeforeExit', true);
|
||||
break;
|
||||
case 'setWarnBeforeExit':
|
||||
store.set('warnBeforeExit', args[0]);
|
||||
break;
|
||||
case 'getMinimizeToTrayEnabled':
|
||||
ret = tray.hasTray();
|
||||
break;
|
||||
@@ -374,50 +438,32 @@ ipcMain.on('ipcCall', async function(ev, payload) {
|
||||
mainWindow.webContents.goForward();
|
||||
}
|
||||
break;
|
||||
case 'setLanguage': {
|
||||
// work around `setSpellCheckerLanguages` being case-sensitive by converting to expected case
|
||||
const caseMap = {};
|
||||
const availableLanguages = mainWindow.webContents.session.availableSpellCheckerLanguages;
|
||||
availableLanguages.forEach(lang => {
|
||||
caseMap[lang.toLowerCase()] = lang;
|
||||
});
|
||||
case 'setSpellCheckLanguages':
|
||||
if (args[0] && args[0].length > 0) {
|
||||
mainWindow.webContents.session.setSpellCheckerEnabled(true);
|
||||
store.set("spellCheckerEnabled", true);
|
||||
|
||||
if (!caseMap["en"]) {
|
||||
// default special-case for `en` as in Riot is actually implies `en-GB`. `en-US` is distinct.
|
||||
// this way if `en` is requested and not available and `en-GB` is available it'll be used.
|
||||
caseMap["en"] = caseMap["en-gb"];
|
||||
}
|
||||
|
||||
const languages = new Set();
|
||||
args[0].forEach(lang => {
|
||||
const lcLang = lang.toLowerCase();
|
||||
if (caseMap[lcLang]) {
|
||||
languages.add(caseMap[lcLang]);
|
||||
return;
|
||||
try {
|
||||
mainWindow.webContents.session.setSpellCheckerLanguages(args[0]);
|
||||
} catch (er) {
|
||||
console.log("There were problems setting the spellcheck languages", er);
|
||||
}
|
||||
|
||||
// as a fallback if the language is unknown check if the language group is known, e.g en for en-AU
|
||||
const langGroup = lcLang.split("-")[0];
|
||||
if (caseMap[langGroup]) {
|
||||
languages.add(caseMap[langGroup]);
|
||||
return;
|
||||
}
|
||||
|
||||
// as a further fallback, pick all other matching variants from the same language group
|
||||
// this means that if we cannot find `ar-dz` or `ar` for example, we will pick `ar-*` to
|
||||
// offer a spellcheck which is least likely to wrongly red underline something.
|
||||
availableLanguages.forEach(availableLang => {
|
||||
if (availableLang.startsWith(langGroup)) {
|
||||
languages.add(availableLang);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (languages.size > 0) {
|
||||
mainWindow.webContents.session.setSpellCheckerLanguages([...languages]);
|
||||
} else {
|
||||
mainWindow.webContents.session.setSpellCheckerEnabled(false);
|
||||
store.set("spellCheckerEnabled", false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'getSpellCheckLanguages':
|
||||
if (store.get("spellCheckerEnabled", true)) {
|
||||
ret = mainWindow.webContents.session.getSpellCheckerLanguages();
|
||||
} else {
|
||||
ret = [];
|
||||
}
|
||||
break;
|
||||
case 'getAvailableSpellCheckLanguages':
|
||||
ret = mainWindow.webContents.session.availableSpellCheckerLanguages;
|
||||
break;
|
||||
|
||||
case 'startSSOFlow':
|
||||
recordSSOSession(args[0]);
|
||||
break;
|
||||
@@ -439,16 +485,7 @@ ipcMain.on('ipcCall', async function(ev, payload) {
|
||||
|
||||
case 'createPickleKey':
|
||||
try {
|
||||
const randomArray = await new Promise((resolve, reject) => {
|
||||
crypto.randomBytes(32, (err, buf) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(buf);
|
||||
}
|
||||
});
|
||||
});
|
||||
const pickleKey = randomArray.toString("base64").replace(/=+$/g, '');
|
||||
const pickleKey = await randomArray(32);
|
||||
await keytar.setPassword("element.io", `${args[0]}|${args[1]}`, pickleKey);
|
||||
ret = pickleKey;
|
||||
} catch (e) {
|
||||
@@ -479,6 +516,26 @@ ipcMain.on('ipcCall', async function(ev, payload) {
|
||||
});
|
||||
});
|
||||
|
||||
const seshatDefaultPassphrase = "DEFAULT_PASSPHRASE";
|
||||
async function getOrCreatePassphrase(key) {
|
||||
if (keytar) {
|
||||
try {
|
||||
const storedPassphrase = await keytar.getPassword("element.io", key);
|
||||
if (storedPassphrase !== null) {
|
||||
return storedPassphrase;
|
||||
} else {
|
||||
const newPassphrase = await randomArray(32);
|
||||
await keytar.setPassword("element.io", key, newPassphrase);
|
||||
return newPassphrase;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Error getting the event index passphrase out of the secret store", e);
|
||||
}
|
||||
} else {
|
||||
return seshatDefaultPassphrase;
|
||||
}
|
||||
}
|
||||
|
||||
ipcMain.on('seshat', async function(ev, payload) {
|
||||
if (!mainWindow) return;
|
||||
|
||||
@@ -503,42 +560,41 @@ ipcMain.on('seshat', async function(ev, payload) {
|
||||
|
||||
case 'initEventIndex':
|
||||
if (eventIndex === null) {
|
||||
const userId = args[0];
|
||||
const deviceId = args[1];
|
||||
const passphraseKey = `seshat|${userId}|${deviceId}`;
|
||||
|
||||
const passphrase = await getOrCreatePassphrase(passphraseKey);
|
||||
|
||||
try {
|
||||
await afs.mkdir(eventStorePath, {recursive: true});
|
||||
eventIndex = new Seshat(eventStorePath, {passphrase: seshatPassphrase});
|
||||
await afs.mkdir(eventStorePath, { recursive: true });
|
||||
eventIndex = new Seshat(eventStorePath, { passphrase });
|
||||
} catch (e) {
|
||||
if (e instanceof ReindexError) {
|
||||
// If this is a reindex error, the index schema
|
||||
// changed. Try to open the database in recovery mode,
|
||||
// reindex the database and finally try to open the
|
||||
// database again.
|
||||
try {
|
||||
const recoveryIndex = new SeshatRecovery(eventStorePath, {
|
||||
passphrase: seshatPassphrase,
|
||||
});
|
||||
const recoveryIndex = new SeshatRecovery(eventStorePath, {
|
||||
passphrase,
|
||||
});
|
||||
|
||||
const userVersion = await recoveryIndex.getUserVersion();
|
||||
const userVersion = await recoveryIndex.getUserVersion();
|
||||
|
||||
// If our user version is 0 we'll delete the db
|
||||
// anyways so reindexing it is a waste of time.
|
||||
if (userVersion === 0) {
|
||||
await recoveryIndex.shutdown();
|
||||
// If our user version is 0 we'll delete the db
|
||||
// anyways so reindexing it is a waste of time.
|
||||
if (userVersion === 0) {
|
||||
await recoveryIndex.shutdown();
|
||||
|
||||
try {
|
||||
await deleteContents(eventStorePath);
|
||||
} catch (e) {
|
||||
}
|
||||
} else {
|
||||
await recoveryIndex.reindex();
|
||||
try {
|
||||
await deleteContents(eventStorePath);
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
eventIndex = new Seshat(eventStorePath, {
|
||||
passphrase: seshatPassphrase,
|
||||
});
|
||||
} catch (e) {
|
||||
sendError(payload.id, e);
|
||||
return;
|
||||
} else {
|
||||
await recoveryIndex.reindex();
|
||||
}
|
||||
|
||||
eventIndex = new Seshat(eventStorePath, { passphrase });
|
||||
} else {
|
||||
sendError(payload.id, e);
|
||||
return;
|
||||
@@ -763,6 +819,9 @@ protocol.registerSchemesAsPrivileged([{
|
||||
// transition into the user's browser.
|
||||
app.enableSandbox();
|
||||
|
||||
// We disable media controls here. We do this because calls use audio and video elements and they sometimes capture the media keys. See https://github.com/vector-im/element-web/issues/15704
|
||||
app.commandLine.appendSwitch('disable-features', 'HardwareMediaKeyHandling,MediaSessionService');
|
||||
|
||||
app.on('ready', async () => {
|
||||
try {
|
||||
await setupGlobals();
|
||||
@@ -779,6 +838,7 @@ app.on('ready', async () => {
|
||||
|
||||
if (argv['devtools']) {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const { default: installExt, REACT_DEVELOPER_TOOLS, REACT_PERF } = require('electron-devtools-installer');
|
||||
installExt(REACT_DEVELOPER_TOOLS)
|
||||
.then((name) => console.log(`Added Extension: ${name}`))
|
||||
@@ -793,17 +853,17 @@ app.on('ready', async () => {
|
||||
|
||||
protocol.registerFileProtocol('vector', (request, callback) => {
|
||||
if (request.method !== 'GET') {
|
||||
callback({error: -322}); // METHOD_NOT_SUPPORTED from chromium/src/net/base/net_error_list.h
|
||||
callback({ error: -322 }); // METHOD_NOT_SUPPORTED from chromium/src/net/base/net_error_list.h
|
||||
return null;
|
||||
}
|
||||
|
||||
const parsedUrl = new URL(request.url);
|
||||
if (parsedUrl.protocol !== 'vector:') {
|
||||
callback({error: -302}); // UNKNOWN_URL_SCHEME
|
||||
callback({ error: -302 }); // UNKNOWN_URL_SCHEME
|
||||
return;
|
||||
}
|
||||
if (parsedUrl.host !== 'vector') {
|
||||
callback({error: -105}); // NAME_NOT_RESOLVED
|
||||
callback({ error: -105 }); // NAME_NOT_RESOLVED
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -811,7 +871,7 @@ app.on('ready', async () => {
|
||||
|
||||
// path starts with a '/'
|
||||
if (target[0] !== '') {
|
||||
callback({error: -6}); // FILE_NOT_FOUND
|
||||
callback({ error: -6 }); // FILE_NOT_FOUND
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -823,7 +883,7 @@ app.on('ready', async () => {
|
||||
if (target[1] === 'webapp') {
|
||||
baseDir = asarPath;
|
||||
} else {
|
||||
callback({error: -6}); // FILE_NOT_FOUND
|
||||
callback({ error: -6 }); // FILE_NOT_FOUND
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -833,7 +893,7 @@ app.on('ready', async () => {
|
||||
|
||||
const relTarget = path.normalize(path.join(...target.slice(2)));
|
||||
if (relTarget.startsWith('..')) {
|
||||
callback({error: -6}); // FILE_NOT_FOUND
|
||||
callback({ error: -6 }); // FILE_NOT_FOUND
|
||||
return;
|
||||
}
|
||||
const absTarget = path.join(baseDir, relTarget);
|
||||
@@ -876,17 +936,15 @@ app.on('ready', async () => {
|
||||
nodeIntegration: false,
|
||||
//sandbox: true, // We enable sandboxing from app.enableSandbox() above
|
||||
enableRemoteModule: false,
|
||||
// We don't use this: it's useful for the preload script to
|
||||
// share a context with the main page so we can give select
|
||||
// objects to the main page. The sandbox option isolates the
|
||||
// main page from the background script.
|
||||
contextIsolation: false,
|
||||
contextIsolation: true,
|
||||
webgl: false,
|
||||
spellcheck: true,
|
||||
},
|
||||
});
|
||||
mainWindow.loadURL('vector://vector/webapp/');
|
||||
Menu.setApplicationMenu(vectorMenu);
|
||||
|
||||
// Handle spellchecker
|
||||
// For some reason spellCheckerEnabled isn't persisted so we have to use the store here
|
||||
mainWindow.webContents.session.setSpellCheckerEnabled(store.get("spellCheckerEnabled", true));
|
||||
|
||||
// Create trayIcon icon
|
||||
if (store.get('minimizeToTray', true)) tray.create(trayConfig);
|
||||
@@ -902,17 +960,27 @@ app.on('ready', async () => {
|
||||
}
|
||||
});
|
||||
|
||||
mainWindow.webContents.on('before-input-event', warnBeforeExit);
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = global.mainWindow = null;
|
||||
});
|
||||
mainWindow.on('close', (e) => {
|
||||
mainWindow.on('close', async (e) => {
|
||||
// If we are not quitting and have a tray icon then minimize to tray
|
||||
if (!global.appQuitting && (tray.hasTray() || process.platform === 'darwin')) {
|
||||
// On Mac, closing the window just hides it
|
||||
// (this is generally how single-window Mac apps
|
||||
// behave, eg. Mail.app)
|
||||
e.preventDefault();
|
||||
mainWindow.hide();
|
||||
|
||||
if (mainWindow.isFullScreen()) {
|
||||
mainWindow.once('leave-full-screen', () => mainWindow.hide());
|
||||
|
||||
mainWindow.setFullScreen(false);
|
||||
} else {
|
||||
mainWindow.hide();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -929,6 +997,14 @@ app.on('ready', async () => {
|
||||
}
|
||||
|
||||
webContentsHandler(mainWindow.webContents);
|
||||
|
||||
appLocalization = new AppLocalization({
|
||||
store,
|
||||
components: [
|
||||
() => tray.initApplicationMenu(),
|
||||
() => Menu.setApplicationMenu(buildMenuTemplate()),
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
@@ -947,7 +1023,7 @@ function beforeQuit() {
|
||||
}
|
||||
|
||||
app.on('before-quit', beforeQuit);
|
||||
app.on('before-quit-for-update', beforeQuit);
|
||||
autoUpdater.on('before-quit-for-update', beforeQuit);
|
||||
|
||||
app.on('second-instance', (ev, commandLine, workingDirectory) => {
|
||||
// If other instance launched with --hidden then skip showing window
|
||||
12
src/i18n/strings/ar.json
Normal file
12
src/i18n/strings/ar.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"File": "مَلَفّ",
|
||||
"Close": "إغلاق",
|
||||
"Actual Size": "الحَجمُ الفِعلي",
|
||||
"View": "الاِطِّلاع",
|
||||
"Select All": "تَحدِيدُ الكُل",
|
||||
"Delete": "حَذف",
|
||||
"Copy": "نَسخ",
|
||||
"Edit": "تَحرير",
|
||||
"Close Element": "إغلَاقُ Element",
|
||||
"Cancel": "إلغَاء"
|
||||
}
|
||||
1
src/i18n/strings/basefile.json
Normal file
1
src/i18n/strings/basefile.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
46
src/i18n/strings/de.json
Normal file
46
src/i18n/strings/de.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Speech": "Sprache",
|
||||
"Paste and Match Style": "Einfügen und Formatierung beibehalten",
|
||||
"Stop Speaking": "Aufnahme beenden",
|
||||
"Start Speaking": "Aufnahme starten",
|
||||
"Services": "Dienste",
|
||||
"Are you sure you want to quit?": "Wirklich beenden?",
|
||||
"Add to dictionary": "Wörterbuch hinzufügen",
|
||||
"The image failed to save": "Das Bild konnte nicht gespeichert werden",
|
||||
"Failed to save image": "Bild kann nicht gespeichert werden",
|
||||
"Save image as...": "Bild speichern unter...",
|
||||
"Copy link address": "Link-Adresse kopieren",
|
||||
"Copy email address": "Email-Adresse kopieren",
|
||||
"Copy image": "Bild kopieren",
|
||||
"File": "Datei",
|
||||
"Bring All to Front": "Alles in den Vordergrund",
|
||||
"Zoom": "Zoom",
|
||||
"Unhide": "Wieder anzeigen",
|
||||
"Hide Others": "Andere verstecken",
|
||||
"Hide": "Verstecken",
|
||||
"About": "Über",
|
||||
"Element Help": "Hilfe zu Element",
|
||||
"Help": "Hilfe",
|
||||
"Close": "Schließen",
|
||||
"Minimize": "Minimieren",
|
||||
"Window": "Fenster",
|
||||
"Toggle Developer Tools": "Developer-Tools an/aus",
|
||||
"Toggle Full Screen": "Vollbildschirm an/aus",
|
||||
"Preferences": "Einstellungen",
|
||||
"Zoom Out": "Verkleinern",
|
||||
"Zoom In": "Vergrößern",
|
||||
"Actual Size": "Tatsächliche Größe",
|
||||
"View": "Ansicht",
|
||||
"Select All": "Alles auswählen",
|
||||
"Delete": "Löschen",
|
||||
"Paste": "Einfügen",
|
||||
"Copy": "Kopieren",
|
||||
"Cut": "Ausschneiden",
|
||||
"Redo": "Wiederherstellen",
|
||||
"Undo": "Rückgängig",
|
||||
"Edit": "Bearbeiten",
|
||||
"Quit": "Beenden",
|
||||
"Show/Hide": "Anzeigen/Ausblenden",
|
||||
"Close Element": "Element schließen",
|
||||
"Cancel": "Abbrechen"
|
||||
}
|
||||
46
src/i18n/strings/en_EN.json
Normal file
46
src/i18n/strings/en_EN.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Cancel": "Cancel",
|
||||
"Close Element": "Close Element",
|
||||
"Are you sure you want to quit?": "Are you sure you want to quit?",
|
||||
"Show/Hide": "Show/Hide",
|
||||
"Quit": "Quit",
|
||||
"Edit": "Edit",
|
||||
"Undo": "Undo",
|
||||
"Redo": "Redo",
|
||||
"Cut": "Cut",
|
||||
"Copy": "Copy",
|
||||
"Paste": "Paste",
|
||||
"Paste and Match Style": "Paste and Match Style",
|
||||
"Delete": "Delete",
|
||||
"Select All": "Select All",
|
||||
"View": "View",
|
||||
"Actual Size": "Actual Size",
|
||||
"Zoom In": "Zoom In",
|
||||
"Zoom Out": "Zoom Out",
|
||||
"Preferences": "Preferences",
|
||||
"Toggle Full Screen": "Toggle Full Screen",
|
||||
"Toggle Developer Tools": "Toggle Developer Tools",
|
||||
"Window": "Window",
|
||||
"Minimize": "Minimize",
|
||||
"Close": "Close",
|
||||
"Help": "Help",
|
||||
"Element Help": "Element Help",
|
||||
"About": "About",
|
||||
"Services": "Services",
|
||||
"Hide": "Hide",
|
||||
"Hide Others": "Hide Others",
|
||||
"Unhide": "Unhide",
|
||||
"Speech": "Speech",
|
||||
"Start Speaking": "Start Speaking",
|
||||
"Stop Speaking": "Stop Speaking",
|
||||
"Zoom": "Zoom",
|
||||
"Bring All to Front": "Bring All to Front",
|
||||
"File": "File",
|
||||
"Copy image": "Copy image",
|
||||
"Copy email address": "Copy email address",
|
||||
"Copy link address": "Copy link address",
|
||||
"Save image as...": "Save image as...",
|
||||
"Failed to save image": "Failed to save image",
|
||||
"The image failed to save": "The image failed to save",
|
||||
"Add to dictionary": "Add to dictionary"
|
||||
}
|
||||
46
src/i18n/strings/es.json
Normal file
46
src/i18n/strings/es.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Add to dictionary": "Añadir al diccionario",
|
||||
"The image failed to save": "La imagen no se ha podido guardar",
|
||||
"Failed to save image": "No se ha podido guardar la imagen",
|
||||
"Save image as...": "Guardar imagen como...",
|
||||
"Copy link address": "Copiar dirección de enlace",
|
||||
"Copy email address": "Copiar dirección de correo",
|
||||
"Copy image": "Copiar imagen",
|
||||
"File": "Archivo",
|
||||
"Bring All to Front": "Traer todas al primer plano",
|
||||
"Zoom": "Zoom",
|
||||
"Start Speaking": "Empezar a hablar",
|
||||
"Stop Speaking": "Parar de hablar",
|
||||
"Speech": "Dictado",
|
||||
"Unhide": "Mostrar",
|
||||
"Hide Others": "Ocultar otros",
|
||||
"Hide": "Ocultar",
|
||||
"Services": "Servicios",
|
||||
"About": "Acerca de",
|
||||
"Element Help": "Ayuda de Element",
|
||||
"Help": "Ayuda",
|
||||
"Close": "Cerrar",
|
||||
"Minimize": "Minimizar",
|
||||
"Window": "Ventana",
|
||||
"Toggle Developer Tools": "Abrir/cerrar herramientas de desarrollo",
|
||||
"Toggle Full Screen": "Entrar/salir de pantalla completa",
|
||||
"Preferences": "Preferencias",
|
||||
"Zoom Out": "Alejar",
|
||||
"Zoom In": "Acercar",
|
||||
"Actual Size": "Tamaño real",
|
||||
"View": "Ver",
|
||||
"Select All": "Seleccionar todo",
|
||||
"Delete": "Eliminar",
|
||||
"Paste and Match Style": "Pegar manteniendo estilo",
|
||||
"Paste": "Pegar",
|
||||
"Copy": "Copiar",
|
||||
"Cut": "Cortar",
|
||||
"Redo": "Rehacer",
|
||||
"Undo": "Deshacer",
|
||||
"Edit": "Editar",
|
||||
"Quit": "Salir",
|
||||
"Show/Hide": "Ver/Ocultar",
|
||||
"Are you sure you want to quit?": "¿Quieres salir?",
|
||||
"Close Element": "Cerrar Element",
|
||||
"Cancel": "Cancelar"
|
||||
}
|
||||
46
src/i18n/strings/et.json
Normal file
46
src/i18n/strings/et.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Element Help": "Rakenduse Element abiteave",
|
||||
"About": "Rakenduse teave",
|
||||
"The image failed to save": "Seda pilti ei õnnestunud salvestada",
|
||||
"Add to dictionary": "Lisa sõnastikku",
|
||||
"Failed to save image": "Pildi salvestamine ei õnnestunud",
|
||||
"Save image as...": "Salvesta pilt kui...",
|
||||
"Copy link address": "Kopeeri lingi aadress",
|
||||
"Copy email address": "Kopeeri e-posti aadress",
|
||||
"Copy image": "Kopeeri pilt",
|
||||
"File": "Fail",
|
||||
"Bring All to Front": "Too kõik esiplaanile",
|
||||
"Zoom": "Suumi",
|
||||
"Stop Speaking": "Lõpeta rääkimine",
|
||||
"Start Speaking": "Alusta rääkimist",
|
||||
"Speech": "Kõne",
|
||||
"Unhide": "Näita uuesti",
|
||||
"Hide Others": "Peida muud",
|
||||
"Hide": "Peida",
|
||||
"Services": "Teenused",
|
||||
"Help": "Abiteave",
|
||||
"Close": "Sulge",
|
||||
"Minimize": "Vähenda",
|
||||
"Window": "Aken",
|
||||
"Toggle Developer Tools": "Arendaja töövahendid sisse/välja",
|
||||
"Toggle Full Screen": "Täisekraanivaade sisse/välja",
|
||||
"Preferences": "Seadistused",
|
||||
"Zoom Out": "Vähenda",
|
||||
"Zoom In": "Suurenda",
|
||||
"Actual Size": "Näita tavasuuruses",
|
||||
"View": "Vaata",
|
||||
"Select All": "Vali kõik",
|
||||
"Delete": "Kustuta",
|
||||
"Paste and Match Style": "Aseta kasutades sama stiili",
|
||||
"Paste": "Aseta",
|
||||
"Copy": "Kopeeri",
|
||||
"Cut": "Lõika",
|
||||
"Redo": "Tee uuesti",
|
||||
"Undo": "Võta tagasi",
|
||||
"Edit": "Muuda",
|
||||
"Quit": "Välju",
|
||||
"Show/Hide": "Näita/peida",
|
||||
"Are you sure you want to quit?": "Kas sa kindlasti soovid rakendusest väljuda?",
|
||||
"Close Element": "Sulge Element",
|
||||
"Cancel": "Tühista"
|
||||
}
|
||||
46
src/i18n/strings/fi.json
Normal file
46
src/i18n/strings/fi.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Paste": "Liitä",
|
||||
"Paste and Match Style": "Liitä ja sovita tyyli",
|
||||
"Add to dictionary": "Lisää sanakirjaan",
|
||||
"The image failed to save": "Kuvan tallennus epäonnistui",
|
||||
"Failed to save image": "Kuvan tallennus epäonnistui",
|
||||
"Save image as...": "Tallenna kuva nimellä...",
|
||||
"Copy link address": "Kopioi linkin osoite",
|
||||
"Copy email address": "Kopioi sähköpostiosoite",
|
||||
"Copy image": "Kopioi kuva",
|
||||
"File": "Tiedosto",
|
||||
"Bring All to Front": "Tuo kaikki eteen",
|
||||
"Zoom": "Suurennus",
|
||||
"Stop Speaking": "Lopeta puhe",
|
||||
"Start Speaking": "Aloita puhe",
|
||||
"Speech": "Puhe",
|
||||
"Unhide": "Palauta näkyviin",
|
||||
"Hide Others": "Piilota muut",
|
||||
"Hide": "Piilota",
|
||||
"Services": "Palvelut",
|
||||
"About": "Tietoja",
|
||||
"Element Help": "Elementin ohjeet",
|
||||
"Help": "Apua",
|
||||
"Close": "Sulje",
|
||||
"Minimize": "Pienennä",
|
||||
"Window": "Ikkuna",
|
||||
"Toggle Developer Tools": "Näytä tai piilota kehittäjätyökalut",
|
||||
"Toggle Full Screen": "Vaihda koko näyttö-tilaa",
|
||||
"Preferences": "Asetukset",
|
||||
"Zoom Out": "Pienennä",
|
||||
"Zoom In": "Suurenna",
|
||||
"Actual Size": "Alkuperäinen koko",
|
||||
"View": "Näytä",
|
||||
"Select All": "Valitse kaikki",
|
||||
"Delete": "Poista",
|
||||
"Copy": "Kopioi",
|
||||
"Cut": "Leikkaa",
|
||||
"Redo": "Tee uudestaan",
|
||||
"Undo": "Peru",
|
||||
"Edit": "Muokkaa",
|
||||
"Quit": "Lopeta",
|
||||
"Show/Hide": "Näytä/Piilota",
|
||||
"Are you sure you want to quit?": "Oletko varma että haluat poistua?",
|
||||
"Close Element": "Sulje Element",
|
||||
"Cancel": "Peruuta"
|
||||
}
|
||||
45
src/i18n/strings/fr.json
Normal file
45
src/i18n/strings/fr.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"Undo": "Annuler",
|
||||
"Edit": "Modifier",
|
||||
"Quit": "Quitter",
|
||||
"Show/Hide": "Afficher/Masquer",
|
||||
"Are you sure you want to quit?": "Êtes-vous sûr de vouloir quitter ?",
|
||||
"Close Element": "Fermer Element",
|
||||
"Cancel": "Annuler",
|
||||
"Unhide": "Dé-masquer",
|
||||
"Hide Others": "Masquer les autres",
|
||||
"Hide": "Masquer",
|
||||
"Services": "Services",
|
||||
"About": "À propos",
|
||||
"Element Help": "Aide d’Element",
|
||||
"Help": "Aide",
|
||||
"Close": "Fermer",
|
||||
"Minimize": "Minimiser",
|
||||
"Window": "Fenêtre",
|
||||
"Toggle Developer Tools": "Basculer les outils de développement",
|
||||
"Toggle Full Screen": "Basculer le plein écran",
|
||||
"Preferences": "Préférences",
|
||||
"Zoom Out": "Dé-zoomer",
|
||||
"Zoom In": "Zoomer",
|
||||
"Actual Size": "Taille réelle",
|
||||
"View": "Afficher",
|
||||
"Select All": "Tout sélectionner",
|
||||
"Delete": "Supprimer",
|
||||
"Paste and Match Style": "Copier avec le style de destination",
|
||||
"Paste": "Coller",
|
||||
"Copy": "Copier",
|
||||
"Cut": "Couper",
|
||||
"Speech": "Dictée",
|
||||
"Add to dictionary": "Ajouter au dictionnaire",
|
||||
"The image failed to save": "L’image n’a pas pu être sauvegardée",
|
||||
"Failed to save image": "Échec de la sauvegarde de l’image",
|
||||
"Save image as...": "Enregistrer l’image sous…",
|
||||
"Copy link address": "Copier l’adresse du lien",
|
||||
"Copy email address": "Copier l’adresse e-mail",
|
||||
"Copy image": "Copier l’image",
|
||||
"File": "Fichier",
|
||||
"Bring All to Front": "Tout amener au premier plan",
|
||||
"Zoom": "Zoom",
|
||||
"Stop Speaking": "Arrêter la dictée",
|
||||
"Start Speaking": "Commencer la dictée"
|
||||
}
|
||||
46
src/i18n/strings/gl.json
Normal file
46
src/i18n/strings/gl.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Add to dictionary": "Engadir ao dicionario",
|
||||
"The image failed to save": "Non se gardou a imaxe",
|
||||
"Failed to save image": "Fallou o gardado da imaxe",
|
||||
"Save image as...": "Gardar imaxe como...",
|
||||
"Copy link address": "Copiar enderezo da ligazón",
|
||||
"Copy email address": "Copiar enderezo de email",
|
||||
"Copy image": "Copiar imaxe",
|
||||
"File": "Ficheiro",
|
||||
"Bring All to Front": "Traer todo á fronte",
|
||||
"Zoom": "Aumento",
|
||||
"Stop Speaking": "Deixa de falar",
|
||||
"Start Speaking": "Comeza a falar",
|
||||
"Speech": "Falar",
|
||||
"Unhide": "Desagochar",
|
||||
"Hide Others": "Agochar outras",
|
||||
"Hide": "Agochar",
|
||||
"Services": "Servizos",
|
||||
"About": "Acerca de",
|
||||
"Element Help": "Axuda de Element",
|
||||
"Help": "Axuda",
|
||||
"Close": "Pechar",
|
||||
"Minimize": "Minimizar",
|
||||
"Window": "Ventá",
|
||||
"Toggle Developer Tools": "Activar ferramentas de desenvolvemento",
|
||||
"Toggle Full Screen": "Activar pantalla completa",
|
||||
"Preferences": "Preferencias",
|
||||
"Zoom Out": "Diminuir",
|
||||
"Zoom In": "Aumentar",
|
||||
"Actual Size": "Tamaño real",
|
||||
"View": "Ver",
|
||||
"Select All": "Elexir todo",
|
||||
"Delete": "Eliminar",
|
||||
"Paste and Match Style": "Pegar e imitar estilo",
|
||||
"Paste": "Pegar",
|
||||
"Copy": "Copiar",
|
||||
"Cut": "Cortar",
|
||||
"Redo": "Refacer",
|
||||
"Undo": "Desfacer",
|
||||
"Edit": "Editar",
|
||||
"Quit": "Saír",
|
||||
"Show/Hide": "Mostrar/Agochar",
|
||||
"Are you sure you want to quit?": "Tes a certeza de que queres saír?",
|
||||
"Close Element": "Pechar Element",
|
||||
"Cancel": "Cancelar"
|
||||
}
|
||||
13
src/i18n/strings/hr.json
Normal file
13
src/i18n/strings/hr.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"Paste": "Zalijepiti",
|
||||
"Copy": "Kopirati",
|
||||
"Cut": "Izrezati",
|
||||
"Redo": "Preurediti",
|
||||
"Undo": "Poništi",
|
||||
"Edit": "Uredi",
|
||||
"Quit": "Prestati",
|
||||
"Show/Hide": "Pokaži/sakrij",
|
||||
"Are you sure you want to quit?": "Jesi li siguran da želiš odustati?",
|
||||
"Close Element": "Zatvori Element",
|
||||
"Cancel": "Otkazati"
|
||||
}
|
||||
46
src/i18n/strings/hu.json
Normal file
46
src/i18n/strings/hu.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Add to dictionary": "Hozzáadás a szótárhoz",
|
||||
"The image failed to save": "A kép mentése sikertelen",
|
||||
"Failed to save image": "Kép mentése sikertelen",
|
||||
"Save image as...": "Kép mentése másként...",
|
||||
"Copy link address": "Hivatkozás másolása",
|
||||
"Copy email address": "E-mail cím másolása",
|
||||
"Copy image": "Kép másolása",
|
||||
"File": "Fájl",
|
||||
"Bring All to Front": "Mindent előtérbe hoz",
|
||||
"Zoom": "Nagyítás",
|
||||
"Stop Speaking": "Fejezze be a beszédet",
|
||||
"Start Speaking": "Kezdjen beszélni",
|
||||
"Speech": "Beszéd",
|
||||
"Unhide": "Felfed",
|
||||
"Hide Others": "Minden mást eltakar",
|
||||
"Hide": "Eltakar",
|
||||
"Services": "Szolgáltatás",
|
||||
"About": "Névjegy",
|
||||
"Element Help": "Element segítség",
|
||||
"Help": "Segítség",
|
||||
"Close": "Bezár",
|
||||
"Minimize": "Lecsukás",
|
||||
"Window": "Ablak",
|
||||
"Toggle Developer Tools": "Fejlesztői eszközök",
|
||||
"Toggle Full Screen": "Teljes képernyő",
|
||||
"Preferences": "Beállítások",
|
||||
"Zoom Out": "Kicsinyít",
|
||||
"Zoom In": "Nagyít",
|
||||
"Actual Size": "Jelenlegi méret",
|
||||
"View": "Nézet",
|
||||
"Select All": "Mind kijelölése",
|
||||
"Delete": "Töröl",
|
||||
"Paste and Match Style": "Beillesztés formázással",
|
||||
"Paste": "Beillesztés",
|
||||
"Copy": "Másol",
|
||||
"Cut": "Kivág",
|
||||
"Redo": "Újra",
|
||||
"Undo": "Visszavon",
|
||||
"Edit": "Szerkeszt",
|
||||
"Quit": "Kilép",
|
||||
"Show/Hide": "Megmutat/Elrejt",
|
||||
"Are you sure you want to quit?": "Biztos, hogy kilép?",
|
||||
"Close Element": "Element bezárása",
|
||||
"Cancel": "Mégsem"
|
||||
}
|
||||
46
src/i18n/strings/is.json
Normal file
46
src/i18n/strings/is.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Add to dictionary": "Bæta við orðabók",
|
||||
"The image failed to save": "Myndin mistóksts að vista",
|
||||
"Failed to save image": "Mistókst að vista mynd",
|
||||
"Save image as...": "Vista mynd sem...",
|
||||
"Copy link address": "Afrita nethlekk",
|
||||
"Copy email address": "Afrita tölvupóstfang",
|
||||
"Copy image": "Afrita mynd",
|
||||
"File": "Skrá",
|
||||
"Bring All to Front": "Koma Öllum að Framan",
|
||||
"Zoom": "Stærð",
|
||||
"Stop Speaking": "Hætta Tal",
|
||||
"Start Speaking": "Byrja Tal",
|
||||
"Speech": "Tal",
|
||||
"Unhide": "Birta",
|
||||
"Hide Others": "Fela Aðra",
|
||||
"Hide": "Fela",
|
||||
"Services": "Þjónustur",
|
||||
"About": "Um",
|
||||
"Element Help": "Element Hjálp",
|
||||
"Help": "Hjálp",
|
||||
"Close": "Loka",
|
||||
"Minimize": "Lágmarka",
|
||||
"Window": "Gluggi",
|
||||
"Toggle Developer Tools": "Skipta Framkvæmdaraðilaverkfæri",
|
||||
"Toggle Full Screen": "Skipta um Fullskjá",
|
||||
"Preferences": "Stillingar",
|
||||
"Zoom Out": "Minnka",
|
||||
"Zoom In": "Stækka",
|
||||
"Actual Size": "Raunveruleg Stærð",
|
||||
"View": "Skoða",
|
||||
"Select All": "Velja Allt",
|
||||
"Delete": "Eyða",
|
||||
"Paste and Match Style": "Líma og Passa Stíl",
|
||||
"Paste": "Líma",
|
||||
"Copy": "Afrita",
|
||||
"Cut": "Klippa",
|
||||
"Redo": "Endurgera",
|
||||
"Undo": "Afturkalla",
|
||||
"Edit": "Breyta",
|
||||
"Quit": "Hætta",
|
||||
"Show/Hide": "Sýna/Fela",
|
||||
"Are you sure you want to quit?": "Ertu viss um að þú viljir hætta?",
|
||||
"Close Element": "Loka Element",
|
||||
"Cancel": "Hætta við"
|
||||
}
|
||||
46
src/i18n/strings/it.json
Normal file
46
src/i18n/strings/it.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Add to dictionary": "Aggiungi al dizionario",
|
||||
"The image failed to save": "Non è stato possibile salvare l'immagine",
|
||||
"Failed to save image": "Salvataggio immagine fallito",
|
||||
"Save image as...": "Salva immagine come...",
|
||||
"Copy link address": "Copia indirizzo collegamento",
|
||||
"Copy email address": "Copia indirizzo email",
|
||||
"Copy image": "Copia immagine",
|
||||
"File": "File",
|
||||
"Bring All to Front": "Porta tutto in primo piano",
|
||||
"Zoom": "Zoom",
|
||||
"Start Speaking": "Inizia a parlare",
|
||||
"Unhide": "Mostra",
|
||||
"Hide Others": "Nascondi gli altri",
|
||||
"Hide": "Nascondi",
|
||||
"Services": "Servizi",
|
||||
"About": "Al riguardo",
|
||||
"Element Help": "Aiuto di Element",
|
||||
"Help": "Aiuto",
|
||||
"Close": "Chiudi",
|
||||
"Minimize": "Riduci",
|
||||
"Window": "Finestra",
|
||||
"Toggle Developer Tools": "Attiva strumenti per sviluppatori",
|
||||
"Toggle Full Screen": "Passa a schermo intero",
|
||||
"Preferences": "Preferenze",
|
||||
"Zoom Out": "Rimpicciolisci",
|
||||
"Zoom In": "Ingrandisci",
|
||||
"Actual Size": "Dimensione effettiva",
|
||||
"View": "Vedi",
|
||||
"Select All": "Seleziona tutto",
|
||||
"Delete": "Elimina",
|
||||
"Paste and Match Style": "Incolla e abbina lo stile",
|
||||
"Paste": "Incolla",
|
||||
"Copy": "Copia",
|
||||
"Cut": "Taglia",
|
||||
"Redo": "Ripeti",
|
||||
"Undo": "Annulla",
|
||||
"Edit": "Modifica",
|
||||
"Quit": "Esci",
|
||||
"Show/Hide": "Mostra/Nascondi",
|
||||
"Are you sure you want to quit?": "Vuoi veramente uscire?",
|
||||
"Close Element": "Chiudi Element",
|
||||
"Cancel": "Annulla",
|
||||
"Stop Speaking": "Smetti di parlare",
|
||||
"Speech": "Dettatura"
|
||||
}
|
||||
3
src/i18n/strings/nb_NO.json
Normal file
3
src/i18n/strings/nb_NO.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"Toggle Developer Tools": "Veksle Utvikleralternativer"
|
||||
}
|
||||
46
src/i18n/strings/pt_BR.json
Normal file
46
src/i18n/strings/pt_BR.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Add to dictionary": "Adicionar a dicionário",
|
||||
"The image failed to save": "A imagem falhou para salvar",
|
||||
"Failed to save image": "Falha para salvar imagem",
|
||||
"Save image as...": "Salvar imagem como...",
|
||||
"Copy link address": "Copiar endereço de link",
|
||||
"Copy email address": "Copiar endereço de email",
|
||||
"Copy image": "Copiar imagem",
|
||||
"File": "Arquivo",
|
||||
"Zoom": "Zoom",
|
||||
"Stop Speaking": "Parar de Falar",
|
||||
"Start Speaking": "Começar a Falar",
|
||||
"Speech": "Fala",
|
||||
"Unhide": "Desesconder",
|
||||
"Hide": "Esconder",
|
||||
"Services": "Serviços",
|
||||
"About": "Sobre",
|
||||
"Element Help": "Ajuda de Element",
|
||||
"Help": "Ajuda",
|
||||
"Close": "Fechar",
|
||||
"Minimize": "Minimizar",
|
||||
"Window": "Janela",
|
||||
"Toggle Developer Tools": "Ativar/Desativar Ferramentas de Desenvolvimento",
|
||||
"Toggle Full Screen": "Pôr em/Tirar de Tela Cheia",
|
||||
"Preferences": "Preferências",
|
||||
"Zoom Out": "Dar Zoom Out",
|
||||
"Zoom In": "Dar Zoom In",
|
||||
"Actual Size": "Tamanho de Verdade",
|
||||
"View": "Visualizar",
|
||||
"Select All": "Selecionar Todas",
|
||||
"Delete": "Deletar",
|
||||
"Paste and Match Style": "Colar e Adequar Estilo",
|
||||
"Paste": "Colar",
|
||||
"Copy": "Copiar",
|
||||
"Cut": "Cortar",
|
||||
"Redo": "Refazer",
|
||||
"Undo": "Desfazer",
|
||||
"Edit": "Editar",
|
||||
"Quit": "Sair",
|
||||
"Show/Hide": "Mostrar/Esconder",
|
||||
"Are you sure you want to quit?": "Você tem certeza que você quer sair?",
|
||||
"Close Element": "Fechar Element",
|
||||
"Cancel": "Cancelar",
|
||||
"Bring All to Front": "Trazer Todas Para Frente",
|
||||
"Hide Others": "Esconder Outras(os)"
|
||||
}
|
||||
1
src/i18n/strings/ro.json
Normal file
1
src/i18n/strings/ro.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
46
src/i18n/strings/ru.json
Normal file
46
src/i18n/strings/ru.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Edit": "Изменить",
|
||||
"Quit": "Выйти",
|
||||
"Close Element": "Закрыть Element",
|
||||
"Cancel": "Отмена",
|
||||
"Show/Hide": "Показать/скрыть",
|
||||
"Are you sure you want to quit?": "Вы уверены, что хотите выйти?",
|
||||
"Copy email address": "Копировать адрес почты",
|
||||
"Copy image": "Копировать изображение",
|
||||
"File": "Файл",
|
||||
"Zoom": "Масштаб",
|
||||
"Unhide": "Показать",
|
||||
"Hide": "Скрыть",
|
||||
"Services": "Сервисы",
|
||||
"About": "О программе",
|
||||
"Element Help": "Справка Element",
|
||||
"Help": "Справка",
|
||||
"Close": "Закрыть",
|
||||
"Minimize": "Свернуть",
|
||||
"Window": "Окно",
|
||||
"Toggle Developer Tools": "Переключить инструменты разработчика",
|
||||
"Toggle Full Screen": "Переключить полноэкранный режим",
|
||||
"Preferences": "Параметры",
|
||||
"Zoom Out": "Уменьшить",
|
||||
"Zoom In": "Увеличить",
|
||||
"Actual Size": "Фактический размер",
|
||||
"View": "Просмотр",
|
||||
"Select All": "Выбрать все",
|
||||
"Delete": "Удалить",
|
||||
"Paste": "Вставить",
|
||||
"Copy": "Копировать",
|
||||
"Cut": "Вырезать",
|
||||
"Redo": "Повторить",
|
||||
"Undo": "Отменить",
|
||||
"Save image as...": "Сохранить изображение как...",
|
||||
"Copy link address": "Копировать ссылку",
|
||||
"Add to dictionary": "Добавить в словарь",
|
||||
"The image failed to save": "Не удалось сохранить изображение",
|
||||
"Failed to save image": "Не удалось сохранить изображение",
|
||||
"Bring All to Front": "Вынести всё вперёд",
|
||||
"Stop Speaking": "Перестаньте говорить",
|
||||
"Start Speaking": "Говорите",
|
||||
"Speech": "Голос",
|
||||
"Hide Others": "Скрыть прочие",
|
||||
"Paste and Match Style": "Вставить с тем же стилем"
|
||||
}
|
||||
46
src/i18n/strings/sv.json
Normal file
46
src/i18n/strings/sv.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Save image as...": "Spara bild som...",
|
||||
"Copy link address": "Kopiera länkadress",
|
||||
"Copy email address": "Kopiera e-postadress",
|
||||
"Copy image": "Kopiera bild",
|
||||
"File": "Arkiv",
|
||||
"Bring All to Front": "Lägg alla överst",
|
||||
"Stop Speaking": "Sluta tala",
|
||||
"Start Speaking": "Börja tala",
|
||||
"Speech": "Tal",
|
||||
"Hide Others": "Göm övriga",
|
||||
"Hide": "Göm",
|
||||
"Services": "Tjänster",
|
||||
"About": "Om",
|
||||
"Element Help": "Element Hjälp",
|
||||
"Help": "Hjälp",
|
||||
"Close": "Stäng",
|
||||
"Minimize": "Minimera",
|
||||
"Window": "Fönster",
|
||||
"Preferences": "Inställningar",
|
||||
"Actual Size": "Verklig storlek",
|
||||
"View": "Visa",
|
||||
"Select All": "Markera allt",
|
||||
"Delete": "Radera",
|
||||
"Paste and Match Style": "Klistra in och matcha stilen",
|
||||
"Paste": "Klistra in",
|
||||
"Copy": "Kopiera",
|
||||
"Cut": "Klipp ut",
|
||||
"Redo": "Gör om",
|
||||
"Undo": "Ångra",
|
||||
"Edit": "Redigera",
|
||||
"Quit": "Avsluta",
|
||||
"Cancel": "Avbryt",
|
||||
"Zoom": "Zooma",
|
||||
"Toggle Developer Tools": "Växla utvecklarverktyg",
|
||||
"Toggle Full Screen": "Växla helskärm",
|
||||
"Unhide": "Göm inte",
|
||||
"Zoom Out": "Zooma ut",
|
||||
"Zoom In": "Zooma in",
|
||||
"Close Element": "Stäng Element",
|
||||
"Show/Hide": "Visa/dölj",
|
||||
"Add to dictionary": "Lägg till i ordlistan",
|
||||
"The image failed to save": "Bilden sparades inte",
|
||||
"Failed to save image": "Misslyckades med att spara bilden",
|
||||
"Are you sure you want to quit?": "Är du säker att du vill avsluta?"
|
||||
}
|
||||
46
src/i18n/strings/ta.json
Normal file
46
src/i18n/strings/ta.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Zoom": "பெரிதாக்குதல்",
|
||||
"Minimize": "சிறிதாக்கு",
|
||||
"Toggle Developer Tools": "படைப்பாளர் கருவிகளை நிலைமாற்று",
|
||||
"Toggle Full Screen": "முழு திரையை நிலைமாற்று",
|
||||
"Paste and Match Style": "ஒட்டு மற்றும் நடையை பொறுத்து",
|
||||
"Add to dictionary": "அகராதியில் சேர்",
|
||||
"The image failed to save": "படம் சேமிக்கத் தவறிவிட்டது",
|
||||
"Failed to save image": "படத்தைச் சேமிப்பதில் தோல்வி",
|
||||
"Save image as...": "படத்தை இவ்வாறு சேமி...",
|
||||
"Copy link address": "இணைப்பு முகவரியை நகலெடு",
|
||||
"Copy email address": "மின்னஞ்சல் முகவரியை நகலெடு",
|
||||
"Copy image": "படத்தை நகலெடு",
|
||||
"File": "கோப்பு",
|
||||
"Bring All to Front": "அனைத்தையும் முன்னால் கொண்டுவா",
|
||||
"Stop Speaking": "பேசுவதை நிறுத்து",
|
||||
"Start Speaking": "பேசத் துவங்கு",
|
||||
"Speech": "பேச்சு",
|
||||
"Unhide": "காட்டு",
|
||||
"Hide Others": "மற்றதை மறை",
|
||||
"Hide": "மறை",
|
||||
"Services": "சேவைகள்",
|
||||
"About": "இதனைப் பற்றி",
|
||||
"Element Help": "எலிமெண்ட் உதவி",
|
||||
"Help": "உதவி",
|
||||
"Close": "மூடு",
|
||||
"Window": "சாளரம்",
|
||||
"Preferences": "விருப்பத்தேர்வுகள்",
|
||||
"Zoom Out": "சிறிதாக்கு",
|
||||
"Zoom In": "பெரிதாக்கு",
|
||||
"Actual Size": "உண்மையான அளவு",
|
||||
"View": "காட்சி",
|
||||
"Select All": "அனைத்தையும் தெரிவுசெய்",
|
||||
"Delete": "அழி",
|
||||
"Paste": "ஒட்டு",
|
||||
"Copy": "நகலெடு",
|
||||
"Cut": "வெட்டு",
|
||||
"Redo": "மீண்டும் செய்",
|
||||
"Undo": "செயல்தவிர்",
|
||||
"Edit": "திருத்து",
|
||||
"Quit": "வெளியேறு",
|
||||
"Show/Hide": "காட்டு/மறை",
|
||||
"Are you sure you want to quit?": "நீங்கள் நிச்சயம் வெளியேற விரும்புகிறீர்களா?",
|
||||
"Close Element": "எலிமெண்ட் ஐ மூடு",
|
||||
"Cancel": "ரத்துசெய்"
|
||||
}
|
||||
46
src/i18n/strings/zh_Hans.json
Normal file
46
src/i18n/strings/zh_Hans.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Add to dictionary": "添加到字典",
|
||||
"The image failed to save": "图片保存失败",
|
||||
"Failed to save image": "图片保存失败",
|
||||
"Save image as...": "保存图片为……",
|
||||
"Copy link address": "复制链接地址",
|
||||
"Copy email address": "复制邮箱地址",
|
||||
"Copy image": "复制图片",
|
||||
"File": "文件",
|
||||
"Bring All to Front": "置前",
|
||||
"Zoom": "放大",
|
||||
"Stop Speaking": "停止讲话",
|
||||
"Start Speaking": "开始讲话",
|
||||
"Speech": "讲话",
|
||||
"Unhide": "显示",
|
||||
"Hide Others": "隐藏其他",
|
||||
"Hide": "隐藏",
|
||||
"Services": "服务",
|
||||
"About": "关于",
|
||||
"Element Help": "Element 帮助",
|
||||
"Help": "帮助",
|
||||
"Close": "关闭",
|
||||
"Minimize": "最小化",
|
||||
"Window": "窗口",
|
||||
"Toggle Developer Tools": "切换开发工具",
|
||||
"Toggle Full Screen": "切换全屏",
|
||||
"Preferences": "外观",
|
||||
"Zoom Out": "缩小",
|
||||
"Zoom In": "放大",
|
||||
"Actual Size": "实际大小",
|
||||
"View": "查看",
|
||||
"Select All": "选中全部",
|
||||
"Delete": "删除",
|
||||
"Paste and Match Style": "粘贴并匹配样式",
|
||||
"Paste": "粘贴",
|
||||
"Copy": "复制",
|
||||
"Cut": "剪贴",
|
||||
"Redo": "重做",
|
||||
"Undo": "撤销",
|
||||
"Edit": "编辑",
|
||||
"Quit": "退出",
|
||||
"Show/Hide": "显示/隐藏",
|
||||
"Are you sure you want to quit?": "你确定要退出吗?",
|
||||
"Close Element": "关闭 Element",
|
||||
"Cancel": "取消"
|
||||
}
|
||||
134
src/language-helper.ts
Normal file
134
src/language-helper.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
Copyright 2021 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 counterpart from "counterpart";
|
||||
import type Store from 'electron-store';
|
||||
|
||||
const DEFAULT_LOCALE = "en";
|
||||
|
||||
export function _td(text: string): string {
|
||||
return text;
|
||||
}
|
||||
|
||||
type SubstitutionValue = number | string;
|
||||
|
||||
interface IVariables {
|
||||
[key: string]: SubstitutionValue;
|
||||
count?: number;
|
||||
}
|
||||
|
||||
export function _t(text: string, variables: IVariables = {}): string {
|
||||
const args = Object.assign({ interpolate: false }, variables);
|
||||
|
||||
const { count } = args;
|
||||
|
||||
// Horrible hack to avoid https://github.com/vector-im/element-web/issues/4191
|
||||
// The interpolation library that counterpart uses does not support undefined/null
|
||||
// values and instead will throw an error. This is a problem since everywhere else
|
||||
// in JS land passing undefined/null will simply stringify instead, and when converting
|
||||
// valid ES6 template strings to i18n strings it's extremely easy to pass undefined/null
|
||||
// if there are no existing null guards. To avoid this making the app completely inoperable,
|
||||
// we'll check all the values for undefined/null and stringify them here.
|
||||
Object.keys(args).forEach((key) => {
|
||||
if (args[key] === undefined) {
|
||||
console.warn("safeCounterpartTranslate called with undefined interpolation name: " + key);
|
||||
args[key] = 'undefined';
|
||||
}
|
||||
if (args[key] === null) {
|
||||
console.warn("safeCounterpartTranslate called with null interpolation name: " + key);
|
||||
args[key] = 'null';
|
||||
}
|
||||
});
|
||||
let translated = counterpart.translate(text, args);
|
||||
if (translated === undefined && count !== undefined) {
|
||||
// counterpart does not do fallback if no pluralisation exists
|
||||
// in the preferred language, so do it here
|
||||
translated = counterpart.translate(text, Object.assign({}, args, { locale: DEFAULT_LOCALE }));
|
||||
}
|
||||
|
||||
// The translation returns text so there's no XSS vector here (no unsafe HTML, no code execution)
|
||||
return translated;
|
||||
}
|
||||
|
||||
type Component = () => void;
|
||||
|
||||
type TypedStore = Store<{ locale?: string | string[] }>;
|
||||
|
||||
export class AppLocalization {
|
||||
private static readonly STORE_KEY = "locale";
|
||||
|
||||
private readonly store: TypedStore;
|
||||
private readonly localizedComponents: Set<Component>;
|
||||
|
||||
constructor({ store, components = [] }: { store: TypedStore, components: Component[] }) {
|
||||
counterpart.registerTranslations("en", this.fetchTranslationJson("en_EN"));
|
||||
counterpart.setFallbackLocale('en');
|
||||
counterpart.setSeparator('|');
|
||||
|
||||
if (Array.isArray(components)) {
|
||||
this.localizedComponents = new Set(components);
|
||||
}
|
||||
|
||||
this.store = store;
|
||||
if (this.store.has(AppLocalization.STORE_KEY)) {
|
||||
const locales = this.store.get(AppLocalization.STORE_KEY);
|
||||
this.setAppLocale(locales);
|
||||
}
|
||||
|
||||
this.resetLocalizedUI();
|
||||
}
|
||||
|
||||
public fetchTranslationJson(locale: string): Record<string, string> {
|
||||
try {
|
||||
console.log("Fetching translation json for locale: " + locale);
|
||||
return require(`./i18n/strings/${locale}.json`);
|
||||
} catch (e) {
|
||||
console.log(`Could not fetch translation json for locale: '${locale}'`, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public setAppLocale(locales: string | string[]): void {
|
||||
console.log(`Changing application language to ${locales}`);
|
||||
|
||||
if (!Array.isArray(locales)) {
|
||||
locales = [locales];
|
||||
}
|
||||
|
||||
locales.forEach(locale => {
|
||||
const translations = this.fetchTranslationJson(locale);
|
||||
if (translations !== null) {
|
||||
counterpart.registerTranslations(locale, translations);
|
||||
}
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore - this looks like a bug but is out of scope for this conversion
|
||||
counterpart.setLocale(locales);
|
||||
this.store.set(AppLocalization.STORE_KEY, locales);
|
||||
|
||||
this.resetLocalizedUI();
|
||||
}
|
||||
|
||||
public resetLocalizedUI(): void {
|
||||
console.log("Resetting the UI components after locale change");
|
||||
this.localizedComponents.forEach(componentSetup => {
|
||||
if (typeof componentSetup === "function") {
|
||||
componentSetup();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
77
src/preload.ts
Normal file
77
src/preload.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
Copyright 2018, 2019, 2021 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 { ipcRenderer, desktopCapturer, contextBridge, IpcRendererEvent, SourcesOptions } from 'electron';
|
||||
|
||||
// Expose only expected IPC wrapper APIs to the renderer process to avoid
|
||||
// handing out generalised messaging access.
|
||||
|
||||
const CHANNELS = [
|
||||
"app_onAction",
|
||||
"before-quit",
|
||||
"check_updates",
|
||||
"install_update",
|
||||
"ipcCall",
|
||||
"ipcReply",
|
||||
"loudNotification",
|
||||
"preferences",
|
||||
"seshat",
|
||||
"seshatReply",
|
||||
"setBadgeCount",
|
||||
"update-downloaded",
|
||||
"userDownloadCompleted",
|
||||
"userDownloadOpen",
|
||||
];
|
||||
|
||||
interface ISource {
|
||||
id: string;
|
||||
name: string;
|
||||
thumbnailURL: string;
|
||||
}
|
||||
|
||||
contextBridge.exposeInMainWorld(
|
||||
"electron",
|
||||
{
|
||||
on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): void {
|
||||
if (!CHANNELS.includes(channel)) {
|
||||
console.error(`Unknown IPC channel ${channel} ignored`);
|
||||
return;
|
||||
}
|
||||
ipcRenderer.on(channel, listener);
|
||||
},
|
||||
send(channel: string, ...args: any[]): void {
|
||||
if (!CHANNELS.includes(channel)) {
|
||||
console.error(`Unknown IPC channel ${channel} ignored`);
|
||||
return;
|
||||
}
|
||||
ipcRenderer.send(channel, ...args);
|
||||
},
|
||||
async getDesktopCapturerSources(options: SourcesOptions): Promise<ISource[]> {
|
||||
const sources = await desktopCapturer.getSources(options);
|
||||
const desktopCapturerSources: ISource[] = [];
|
||||
|
||||
for (const source of sources) {
|
||||
desktopCapturerSources.push({
|
||||
id: source.id,
|
||||
name: source.name,
|
||||
thumbnailURL: source.thumbnail.toDataURL(),
|
||||
});
|
||||
}
|
||||
|
||||
return desktopCapturerSources;
|
||||
},
|
||||
},
|
||||
);
|
||||
102
src/protocol.js
102
src/protocol.js
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
const {app} = require("electron");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
const PROTOCOL = "element://";
|
||||
const SEARCH_PARAM = "element-desktop-ssoid";
|
||||
const STORE_FILE_NAME = "sso-sessions.json";
|
||||
|
||||
// we getPath userData before electron-main changes it, so this is the default value
|
||||
const storePath = path.join(app.getPath("userData"), STORE_FILE_NAME);
|
||||
|
||||
const processUrl = (url) => {
|
||||
if (!global.mainWindow) return;
|
||||
console.log("Handling link: ", url);
|
||||
global.mainWindow.loadURL(url.replace(PROTOCOL, "vector://"));
|
||||
};
|
||||
|
||||
const readStore = () => {
|
||||
try {
|
||||
const s = fs.readFileSync(storePath, { encoding: "utf8" });
|
||||
const o = JSON.parse(s);
|
||||
return typeof o === "object" ? o : {};
|
||||
} catch (e) {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
const writeStore = (data) => {
|
||||
fs.writeFileSync(storePath, JSON.stringify(data));
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
recordSSOSession: (sessionID) => {
|
||||
const userDataPath = app.getPath('userData');
|
||||
const store = readStore();
|
||||
for (const key in store) {
|
||||
// ensure each instance only has one (the latest) session ID to prevent the file growing unbounded
|
||||
if (store[key] === userDataPath) {
|
||||
delete store[key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
store[sessionID] = userDataPath;
|
||||
writeStore(store);
|
||||
},
|
||||
getProfileFromDeeplink: (args) => {
|
||||
// check if we are passed a profile in the SSO callback url
|
||||
const deeplinkUrl = args.find(arg => arg.startsWith('element://'));
|
||||
if (deeplinkUrl && deeplinkUrl.includes(SEARCH_PARAM)) {
|
||||
const parsedUrl = new URL(deeplinkUrl);
|
||||
if (parsedUrl.protocol === 'element:') {
|
||||
const ssoID = parsedUrl.searchParams.get(SEARCH_PARAM);
|
||||
const store = readStore();
|
||||
console.log("Forwarding to profile: ", store[ssoID]);
|
||||
return store[ssoID];
|
||||
}
|
||||
}
|
||||
},
|
||||
protocolInit: () => {
|
||||
// get all args except `hidden` as it'd mean the app would not get focused
|
||||
// XXX: passing args to protocol handlers only works on Windows, so unpackaged deep-linking
|
||||
// --profile/--profile-dir are passed via the SEARCH_PARAM var in the callback url
|
||||
const args = process.argv.slice(1).filter(arg => arg !== "--hidden" && arg !== "-hidden");
|
||||
if (app.isPackaged) {
|
||||
app.setAsDefaultProtocolClient('element', process.execPath, args);
|
||||
} else if (process.platform === 'win32') { // on Mac/Linux this would just cause the electron binary to open
|
||||
// special handler for running without being packaged, e.g `electron .` by passing our app path to electron
|
||||
app.setAsDefaultProtocolClient('element', process.execPath, [app.getAppPath(), ...args]);
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
// Protocol handler for macos
|
||||
app.on('open-url', function(ev, url) {
|
||||
ev.preventDefault();
|
||||
processUrl(url);
|
||||
});
|
||||
} else {
|
||||
// Protocol handler for win32/Linux
|
||||
app.on('second-instance', (ev, commandLine) => {
|
||||
const url = commandLine[commandLine.length - 1];
|
||||
if (!url.startsWith(PROTOCOL)) return;
|
||||
processUrl(url);
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
103
src/protocol.ts
Normal file
103
src/protocol.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
|
||||
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 { app } from "electron";
|
||||
import { URL } from "url";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
||||
const PROTOCOL = "element://";
|
||||
const SEARCH_PARAM = "element-desktop-ssoid";
|
||||
const STORE_FILE_NAME = "sso-sessions.json";
|
||||
|
||||
// we getPath userData before electron-main changes it, so this is the default value
|
||||
const storePath = path.join(app.getPath("userData"), STORE_FILE_NAME);
|
||||
|
||||
function processUrl(url: string): void {
|
||||
if (!global.mainWindow) return;
|
||||
console.log("Handling link: ", url);
|
||||
global.mainWindow.loadURL(url.replace(PROTOCOL, "vector://"));
|
||||
}
|
||||
|
||||
function readStore(): object {
|
||||
try {
|
||||
const s = fs.readFileSync(storePath, { encoding: "utf8" });
|
||||
const o = JSON.parse(s);
|
||||
return typeof o === "object" ? o : {};
|
||||
} catch (e) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function writeStore(data: object): void {
|
||||
fs.writeFileSync(storePath, JSON.stringify(data));
|
||||
}
|
||||
|
||||
export function recordSSOSession(sessionID: string): void {
|
||||
const userDataPath = app.getPath('userData');
|
||||
const store = readStore();
|
||||
for (const key in store) {
|
||||
// ensure each instance only has one (the latest) session ID to prevent the file growing unbounded
|
||||
if (store[key] === userDataPath) {
|
||||
delete store[key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
store[sessionID] = userDataPath;
|
||||
writeStore(store);
|
||||
}
|
||||
|
||||
export function getProfileFromDeeplink(args): string | undefined {
|
||||
// check if we are passed a profile in the SSO callback url
|
||||
const deeplinkUrl = args.find(arg => arg.startsWith('element://'));
|
||||
if (deeplinkUrl && deeplinkUrl.includes(SEARCH_PARAM)) {
|
||||
const parsedUrl = new URL(deeplinkUrl);
|
||||
if (parsedUrl.protocol === 'element:') {
|
||||
const ssoID = parsedUrl.searchParams.get(SEARCH_PARAM);
|
||||
const store = readStore();
|
||||
console.log("Forwarding to profile: ", store[ssoID]);
|
||||
return store[ssoID];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function protocolInit(): void {
|
||||
// get all args except `hidden` as it'd mean the app would not get focused
|
||||
// XXX: passing args to protocol handlers only works on Windows, so unpackaged deep-linking
|
||||
// --profile/--profile-dir are passed via the SEARCH_PARAM var in the callback url
|
||||
const args = process.argv.slice(1).filter(arg => arg !== "--hidden" && arg !== "-hidden");
|
||||
if (app.isPackaged) {
|
||||
app.setAsDefaultProtocolClient('element', process.execPath, args);
|
||||
} else if (process.platform === 'win32') { // on Mac/Linux this would just cause the electron binary to open
|
||||
// special handler for running without being packaged, e.g `electron .` by passing our app path to electron
|
||||
app.setAsDefaultProtocolClient('element', process.execPath, [app.getAppPath(), ...args]);
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
// Protocol handler for macos
|
||||
app.on('open-url', function(ev, url) {
|
||||
ev.preventDefault();
|
||||
processUrl(url);
|
||||
});
|
||||
} else {
|
||||
// Protocol handler for win32/Linux
|
||||
app.on('second-instance', (ev, commandLine) => {
|
||||
const url = commandLine[commandLine.length - 1];
|
||||
if (!url.startsWith(PROTOCOL)) return;
|
||||
processUrl(url);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -14,12 +14,12 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const spawn = require('child_process').spawn;
|
||||
const {app} = require('electron');
|
||||
const fsProm = require('fs').promises;
|
||||
import path from "path";
|
||||
import { spawn } from "child_process";
|
||||
import { app } from "electron";
|
||||
import { promises as fsProm } from "fs";
|
||||
|
||||
function runUpdateExe(args) {
|
||||
function runUpdateExe(args: string[]): Promise<void> {
|
||||
// Invokes Squirrel's Update.exe which will do things for us like create shortcuts
|
||||
// Note that there's an Update.exe in the app-x.x.x directory and one in the parent
|
||||
// directory: we need to run the one in the parent directory, because it discovers
|
||||
@@ -33,7 +33,7 @@ function runUpdateExe(args) {
|
||||
});
|
||||
}
|
||||
|
||||
function checkSquirrelHooks() {
|
||||
export function checkSquirrelHooks(): boolean {
|
||||
if (process.platform !== 'win32') return false;
|
||||
|
||||
const cmd = process.argv[1];
|
||||
@@ -51,6 +51,19 @@ function checkSquirrelHooks() {
|
||||
appDataDir, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'New Vector Ltd',
|
||||
);
|
||||
return fsProm.rmdir(startMenuDir, { recursive: true });
|
||||
}).then(() => {
|
||||
// same for 'Element (Riot) which is old now too (we have to try to delete both because
|
||||
// we don't know what version we're updating from, but of course we do know this version
|
||||
// is 'Element' so the two old ones are all safe to delete).
|
||||
const appDataDir = process.env.APPDATA;
|
||||
if (!appDataDir) return;
|
||||
const oldStartMenuLink = path.join(
|
||||
appDataDir, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Element', 'Element (Riot).lnk',
|
||||
);
|
||||
return fsProm.unlink(oldStartMenuLink).catch(() => {});
|
||||
}).then(() => {
|
||||
const oldDesktopShortcut = path.join(app.getPath('desktop'), 'Element (Riot).lnk');
|
||||
return fsProm.unlink(oldDesktopShortcut).catch(() => {});
|
||||
}).then(() => {
|
||||
const oldDesktopShortcut = path.join(app.getPath('desktop'), 'Riot.lnk');
|
||||
return fsProm.unlink(oldDesktopShortcut).catch(() => {});
|
||||
@@ -69,5 +82,3 @@ function checkSquirrelHooks() {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = checkSquirrelHooks;
|
||||
@@ -15,57 +15,48 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const {app, Tray, Menu, nativeImage} = require('electron');
|
||||
const pngToIco = require('png-to-ico');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
import { app, Tray, Menu, nativeImage } from "electron";
|
||||
import pngToIco from "png-to-ico";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import { _t } from "./language-helper";
|
||||
|
||||
let trayIcon = null;
|
||||
let trayIcon: Tray = null;
|
||||
|
||||
exports.hasTray = function hasTray() {
|
||||
export function hasTray(): boolean {
|
||||
return (trayIcon !== null);
|
||||
};
|
||||
}
|
||||
|
||||
exports.destroy = function() {
|
||||
export function destroy(): void {
|
||||
if (trayIcon) {
|
||||
trayIcon.destroy();
|
||||
trayIcon = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
exports.create = function(config) {
|
||||
function toggleWin(): void {
|
||||
if (global.mainWindow.isVisible() && !global.mainWindow.isMinimized()) {
|
||||
global.mainWindow.hide();
|
||||
} else {
|
||||
if (global.mainWindow.isMinimized()) global.mainWindow.restore();
|
||||
if (!global.mainWindow.isVisible()) global.mainWindow.show();
|
||||
global.mainWindow.focus();
|
||||
}
|
||||
}
|
||||
|
||||
interface IConfig {
|
||||
icon_path: string; // eslint-disable-line camelcase
|
||||
brand: string;
|
||||
}
|
||||
|
||||
export function create(config: IConfig): void {
|
||||
// no trays on darwin
|
||||
if (process.platform === 'darwin' || trayIcon) return;
|
||||
|
||||
const toggleWin = function() {
|
||||
if (global.mainWindow.isVisible() && !global.mainWindow.isMinimized()) {
|
||||
global.mainWindow.hide();
|
||||
} else {
|
||||
if (global.mainWindow.isMinimized()) global.mainWindow.restore();
|
||||
if (!global.mainWindow.isVisible()) global.mainWindow.show();
|
||||
global.mainWindow.focus();
|
||||
}
|
||||
};
|
||||
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: `Show/Hide ${config.brand}`,
|
||||
click: toggleWin,
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: 'Quit',
|
||||
click: function() {
|
||||
app.quit();
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const defaultIcon = nativeImage.createFromPath(config.icon_path);
|
||||
|
||||
trayIcon = new Tray(defaultIcon);
|
||||
trayIcon.setToolTip(config.brand);
|
||||
trayIcon.setContextMenu(contextMenu);
|
||||
initApplicationMenu();
|
||||
trayIcon.on('click', toggleWin);
|
||||
|
||||
let lastFavicon = null;
|
||||
@@ -103,4 +94,26 @@ exports.create = function(config) {
|
||||
global.mainWindow.webContents.on('page-title-updated', function(ev, title) {
|
||||
trayIcon.setToolTip(title);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export function initApplicationMenu(): void {
|
||||
if (!trayIcon) {
|
||||
return;
|
||||
}
|
||||
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: _t('Show/Hide'),
|
||||
click: toggleWin,
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: _t('Quit'),
|
||||
click: function() {
|
||||
app.quit();
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
trayIcon.setContextMenu(contextMenu);
|
||||
}
|
||||
@@ -1,16 +1,32 @@
|
||||
const { app, autoUpdater, ipcMain } = require('electron');
|
||||
/*
|
||||
Copyright 2016-2021 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 { app, autoUpdater, ipcMain } from "electron";
|
||||
|
||||
const UPDATE_POLL_INTERVAL_MS = 60 * 60 * 1000;
|
||||
const INITIAL_UPDATE_DELAY_MS = 30 * 1000;
|
||||
|
||||
function installUpdate() {
|
||||
function installUpdate(): void {
|
||||
// for some reason, quitAndInstall does not fire the
|
||||
// before-quit event, so we need to set the flag here.
|
||||
global.appQuitting = true;
|
||||
autoUpdater.quitAndInstall();
|
||||
}
|
||||
|
||||
function pollForUpdates() {
|
||||
function pollForUpdates(): void {
|
||||
try {
|
||||
autoUpdater.checkForUpdates();
|
||||
} catch (e) {
|
||||
@@ -18,8 +34,7 @@ function pollForUpdates() {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {};
|
||||
module.exports.start = function startAutoUpdate(updateBaseUrl) {
|
||||
export function start(updateBaseUrl: string): void {
|
||||
if (updateBaseUrl.slice(-1) !== '/') {
|
||||
updateBaseUrl = updateBaseUrl + '/';
|
||||
}
|
||||
@@ -37,7 +52,7 @@ module.exports.start = function startAutoUpdate(updateBaseUrl) {
|
||||
// rely on NSURLConnection setting the User-Agent to what we expect,
|
||||
// and also acts as a convenient cache-buster to ensure that when the
|
||||
// app updates it always gets a fresh value to avoid update-looping.
|
||||
url = `${updateBaseUrl}macos/?localVersion=${encodeURIComponent(app.getVersion())}`;
|
||||
url = `${updateBaseUrl}macos/${process.arch}/?localVersion=${encodeURIComponent(app.getVersion())}`;
|
||||
} else if (process.platform === 'win32') {
|
||||
url = `${updateBaseUrl}win32/${process.arch}/`;
|
||||
} else {
|
||||
@@ -48,6 +63,7 @@ module.exports.start = function startAutoUpdate(updateBaseUrl) {
|
||||
}
|
||||
|
||||
if (url) {
|
||||
console.log(`Update URL: ${url}`);
|
||||
autoUpdater.setFeedURL(url);
|
||||
// We check for updates ourselves rather than using 'updater' because we need to
|
||||
// do it in the main process (and we don't really need to check every 10 minutes:
|
||||
@@ -63,18 +79,25 @@ module.exports.start = function startAutoUpdate(updateBaseUrl) {
|
||||
// will fail if running in debug mode
|
||||
console.log('Couldn\'t enable update checking', err);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
ipcMain.on('install_update', installUpdate);
|
||||
ipcMain.on('check_updates', pollForUpdates);
|
||||
|
||||
function ipcChannelSendUpdateStatus(status) {
|
||||
function ipcChannelSendUpdateStatus(status: boolean | string): void {
|
||||
if (!global.mainWindow) return;
|
||||
global.mainWindow.webContents.send('check_updates', status);
|
||||
}
|
||||
|
||||
interface ICachedUpdate {
|
||||
releaseNotes: string;
|
||||
releaseName: string;
|
||||
releaseDate: Date;
|
||||
updateURL: string;
|
||||
}
|
||||
|
||||
// cache the latest update which has been downloaded as electron offers no api to read it
|
||||
let latestUpdateDownloaded;
|
||||
let latestUpdateDownloaded: ICachedUpdate;
|
||||
autoUpdater.on('update-available', function() {
|
||||
ipcChannelSendUpdateStatus(true);
|
||||
}).on('update-not-available', function() {
|
||||
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const {app, shell, Menu} = require('electron');
|
||||
|
||||
// Menu template from http://electron.atom.io/docs/api/menu/, edited
|
||||
const template = [
|
||||
{
|
||||
label: '&Edit',
|
||||
submenu: [
|
||||
{ role: 'undo' },
|
||||
{ role: 'redo' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'cut' },
|
||||
{ role: 'copy' },
|
||||
{ role: 'paste' },
|
||||
{ role: 'pasteandmatchstyle' },
|
||||
{ role: 'delete' },
|
||||
{ role: 'selectall' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '&View',
|
||||
submenu: [
|
||||
{ type: 'separator' },
|
||||
{ role: 'resetzoom' },
|
||||
{ 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' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '&Window',
|
||||
role: 'window',
|
||||
submenu: [
|
||||
{ role: 'minimize' },
|
||||
{ role: 'close' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '&Help',
|
||||
role: 'help',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Element Help',
|
||||
click() { shell.openExternal('https://element.io/help'); },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// macOS has specific menu conventions...
|
||||
if (process.platform === 'darwin') {
|
||||
template.unshift({
|
||||
// first macOS menu is the name of the app
|
||||
label: app.name,
|
||||
submenu: [
|
||||
{ role: 'about' },
|
||||
{ type: 'separator' },
|
||||
{
|
||||
role: 'services',
|
||||
submenu: [],
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{ role: 'hide' },
|
||||
{ role: 'hideothers' },
|
||||
{ role: 'unhide' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'quit' },
|
||||
],
|
||||
});
|
||||
// Edit menu.
|
||||
// This has a 'speech' section on macOS
|
||||
template[1].submenu.push(
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: 'Speech',
|
||||
submenu: [
|
||||
{ role: 'startspeaking' },
|
||||
{ role: 'stopspeaking' },
|
||||
],
|
||||
});
|
||||
|
||||
// Window menu.
|
||||
// This also has specific functionality on macOS
|
||||
template[3].submenu = [
|
||||
{
|
||||
label: 'Close',
|
||||
accelerator: 'CmdOrCtrl+W',
|
||||
role: 'close',
|
||||
},
|
||||
{
|
||||
label: 'Minimize',
|
||||
accelerator: 'CmdOrCtrl+M',
|
||||
role: 'minimize',
|
||||
},
|
||||
{
|
||||
label: 'Zoom',
|
||||
role: 'zoom',
|
||||
},
|
||||
{
|
||||
type: 'separator',
|
||||
},
|
||||
{
|
||||
label: 'Bring All to Front',
|
||||
role: 'front',
|
||||
},
|
||||
];
|
||||
} else {
|
||||
template.unshift({
|
||||
label: '&File',
|
||||
submenu: [
|
||||
// For some reason, 'about' does not seem to work on windows.
|
||||
/*{
|
||||
role: 'about'
|
||||
},*/
|
||||
{ role: 'quit' },
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = Menu.buildFromTemplate(template);
|
||||
|
||||
245
src/vectormenu.ts
Normal file
245
src/vectormenu.ts
Normal file
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
Copyright 2016 OpenMarket Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { app, shell, Menu, MenuItem, MenuItemConstructorOptions } from 'electron';
|
||||
import { _t } from './language-helper';
|
||||
|
||||
const isMac = process.platform === 'darwin';
|
||||
|
||||
export function buildMenuTemplate(): Menu {
|
||||
// Menu template from http://electron.atom.io/docs/api/menu/, edited
|
||||
const template: Array<(MenuItemConstructorOptions) | (MenuItem)> = [
|
||||
{
|
||||
label: _t('Edit'),
|
||||
accelerator: 'e',
|
||||
submenu: [
|
||||
{
|
||||
role: 'undo',
|
||||
label: _t('Undo'),
|
||||
},
|
||||
{
|
||||
role: 'redo',
|
||||
label: _t('Redo'),
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
role: 'cut',
|
||||
label: _t('Cut'),
|
||||
},
|
||||
{
|
||||
role: 'copy',
|
||||
label: _t('Copy'),
|
||||
},
|
||||
{
|
||||
role: 'paste',
|
||||
label: _t('Paste'),
|
||||
},
|
||||
{
|
||||
role: 'pasteAndMatchStyle',
|
||||
label: _t('Paste and Match Style'),
|
||||
},
|
||||
{
|
||||
role: 'delete',
|
||||
label: _t('Delete'),
|
||||
},
|
||||
{
|
||||
role: 'selectAll',
|
||||
label: _t('Select All'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: _t('View'),
|
||||
accelerator: 'V',
|
||||
submenu: [
|
||||
{ type: 'separator' },
|
||||
{
|
||||
role: 'resetZoom',
|
||||
accelerator: 'CmdOrCtrl+Num0',
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
role: 'zoomIn',
|
||||
accelerator: 'CmdOrCtrl+NumAdd',
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
role: 'zoomOut',
|
||||
accelerator: 'CmdOrCtrl+NumSub',
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
role: 'resetZoom',
|
||||
label: _t('Actual Size'),
|
||||
},
|
||||
{
|
||||
role: 'zoomIn',
|
||||
label: _t('Zoom In'),
|
||||
},
|
||||
{
|
||||
role: 'zoomOut',
|
||||
label: _t('Zoom Out'),
|
||||
},
|
||||
{ type: 'separator' },
|
||||
// in macOS the Preferences menu item goes in the first menu
|
||||
...(!isMac ? [{
|
||||
label: _t('Preferences'),
|
||||
click() { global.mainWindow.webContents.send('preferences'); },
|
||||
}] : []),
|
||||
{
|
||||
role: 'togglefullscreen',
|
||||
label: _t('Toggle Full Screen'),
|
||||
},
|
||||
{
|
||||
role: 'toggleDevTools',
|
||||
label: _t('Toggle Developer Tools'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: _t('Window'),
|
||||
accelerator: 'w',
|
||||
role: 'window',
|
||||
submenu: [
|
||||
{
|
||||
role: 'minimize',
|
||||
label: _t('Minimize'),
|
||||
},
|
||||
{
|
||||
role: 'close',
|
||||
label: _t('Close'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: _t('Help'),
|
||||
accelerator: 'h',
|
||||
role: 'help',
|
||||
submenu: [
|
||||
{
|
||||
label: _t('Element Help'),
|
||||
click() { shell.openExternal('https://element.io/help'); },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// macOS has specific menu conventions...
|
||||
if (isMac) {
|
||||
template.unshift({
|
||||
// first macOS menu is the name of the app
|
||||
role: 'appMenu',
|
||||
label: app.name,
|
||||
submenu: [
|
||||
{
|
||||
role: 'about',
|
||||
label: _t('About') + ' ' + app.name,
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: _t('Preferences') + '…',
|
||||
accelerator: 'Command+,', // Mac-only accelerator
|
||||
click() { global.mainWindow.webContents.send('preferences'); },
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
role: 'services',
|
||||
label: _t('Services'),
|
||||
submenu: [],
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
role: 'hide',
|
||||
label: _t('Hide'),
|
||||
},
|
||||
{
|
||||
role: 'hideOthers',
|
||||
label: _t('Hide Others'),
|
||||
},
|
||||
{
|
||||
role: 'unhide',
|
||||
label: _t('Unhide'),
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
role: 'quit',
|
||||
label: _t('Quit'),
|
||||
},
|
||||
],
|
||||
});
|
||||
// Edit menu.
|
||||
// This has a 'speech' section on macOS
|
||||
(template[1].submenu as MenuItemConstructorOptions[]).push(
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: _t('Speech'),
|
||||
submenu: [
|
||||
{
|
||||
role: 'startSpeaking',
|
||||
label: _t('Start Speaking'),
|
||||
},
|
||||
{
|
||||
role: 'stopSpeaking',
|
||||
label: _t('Stop Speaking'),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// Window menu.
|
||||
// This also has specific functionality on macOS
|
||||
template[3].submenu = [
|
||||
{
|
||||
label: _t('Close'),
|
||||
accelerator: 'CmdOrCtrl+W',
|
||||
role: 'close',
|
||||
},
|
||||
{
|
||||
label: _t('Minimize'),
|
||||
accelerator: 'CmdOrCtrl+M',
|
||||
role: 'minimize',
|
||||
},
|
||||
{
|
||||
label: _t('Zoom'),
|
||||
role: 'zoom',
|
||||
},
|
||||
{
|
||||
type: 'separator',
|
||||
},
|
||||
{
|
||||
label: _t('Bring All to Front'),
|
||||
role: 'front',
|
||||
},
|
||||
];
|
||||
} else {
|
||||
template.unshift({
|
||||
label: _t('File'),
|
||||
accelerator: 'f',
|
||||
submenu: [
|
||||
// For some reason, 'about' does not seem to work on windows.
|
||||
/*{
|
||||
role: 'about',
|
||||
label: _t('About'),
|
||||
},*/
|
||||
{
|
||||
role: 'quit',
|
||||
label: _t('Quit'),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
return Menu.buildFromTemplate(template);
|
||||
}
|
||||
@@ -1,18 +1,49 @@
|
||||
const {clipboard, nativeImage, Menu, MenuItem, shell, dialog, ipcMain} = require('electron');
|
||||
const url = require('url');
|
||||
const fs = require('fs');
|
||||
const request = require('request');
|
||||
const path = require('path');
|
||||
/*
|
||||
Copyright 2021 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 {
|
||||
clipboard,
|
||||
nativeImage,
|
||||
Menu,
|
||||
MenuItem,
|
||||
shell,
|
||||
dialog,
|
||||
ipcMain,
|
||||
NativeImage,
|
||||
WebContents,
|
||||
ContextMenuParams,
|
||||
DownloadItem,
|
||||
MenuItemConstructorOptions,
|
||||
IpcMainEvent,
|
||||
} from 'electron';
|
||||
import url from 'url';
|
||||
import fs from 'fs';
|
||||
import request from 'request';
|
||||
import path from 'path';
|
||||
import { _t } from './language-helper';
|
||||
|
||||
const MAILTO_PREFIX = "mailto:";
|
||||
|
||||
const PERMITTED_URL_SCHEMES = [
|
||||
const PERMITTED_URL_SCHEMES: string[] = [
|
||||
'http:',
|
||||
'https:',
|
||||
MAILTO_PREFIX,
|
||||
];
|
||||
|
||||
function safeOpenURL(target) {
|
||||
function safeOpenURL(target: string): void {
|
||||
// openExternal passes the target to open/start/xdg-open,
|
||||
// so put fairly stringent limits on what can be opened
|
||||
// (for instance, open /bin/sh does indeed open a terminal
|
||||
@@ -27,7 +58,7 @@ function safeOpenURL(target) {
|
||||
}
|
||||
}
|
||||
|
||||
function onWindowOrNavigate(ev, target) {
|
||||
function onWindowOrNavigate(ev: Event, target: string): void {
|
||||
// always prevent the default: if something goes wrong,
|
||||
// we don't want to end up opening it in the electron
|
||||
// app, as we could end up opening any sort of random
|
||||
@@ -36,7 +67,7 @@ function onWindowOrNavigate(ev, target) {
|
||||
safeOpenURL(target);
|
||||
}
|
||||
|
||||
function writeNativeImage(filePath, img) {
|
||||
function writeNativeImage(filePath: string, img: NativeImage): Promise<void> {
|
||||
switch (filePath.split('.').pop().toLowerCase()) {
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
@@ -49,8 +80,7 @@ function writeNativeImage(filePath, img) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onLinkContextMenu(ev, params) {
|
||||
function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: WebContents): void {
|
||||
let url = params.linkURL || params.srcURL;
|
||||
|
||||
if (url.startsWith('vector://vector/webapp')) {
|
||||
@@ -73,9 +103,10 @@ function onLinkContextMenu(ev, params) {
|
||||
|
||||
if (params.hasImageContents) {
|
||||
popupMenu.append(new MenuItem({
|
||||
label: '&Copy image',
|
||||
label: _t('Copy image'),
|
||||
accelerator: 'c',
|
||||
click() {
|
||||
ev.sender.copyImageAt(params.x, params.y);
|
||||
webContents.copyImageAt(params.x, params.y);
|
||||
},
|
||||
}));
|
||||
}
|
||||
@@ -85,14 +116,16 @@ function onLinkContextMenu(ev, params) {
|
||||
// Special-case e-mail URLs to strip the `mailto:` like modern browsers do
|
||||
if (url.startsWith(MAILTO_PREFIX)) {
|
||||
popupMenu.append(new MenuItem({
|
||||
label: 'Copy email &address',
|
||||
label: _t('Copy email address'),
|
||||
accelerator: 'a',
|
||||
click() {
|
||||
clipboard.writeText(url.substr(MAILTO_PREFIX.length));
|
||||
},
|
||||
}));
|
||||
} else {
|
||||
popupMenu.append(new MenuItem({
|
||||
label: 'Copy link &address',
|
||||
label: _t('Copy link address'),
|
||||
accelerator: 'a',
|
||||
click() {
|
||||
clipboard.writeText(url);
|
||||
},
|
||||
@@ -104,10 +137,11 @@ function onLinkContextMenu(ev, params) {
|
||||
// only the renderer can resolve them so don't give the user an option to.
|
||||
if (params.hasImageContents && !url.startsWith('blob:')) {
|
||||
popupMenu.append(new MenuItem({
|
||||
label: 'Sa&ve image as...',
|
||||
label: _t('Save image as...'),
|
||||
accelerator: 's',
|
||||
async click() {
|
||||
const targetFileName = params.titleText || "image.png";
|
||||
const {filePath} = await dialog.showSaveDialog({
|
||||
const { filePath } = await dialog.showSaveDialog({
|
||||
defaultPath: targetFileName,
|
||||
});
|
||||
|
||||
@@ -123,8 +157,8 @@ function onLinkContextMenu(ev, params) {
|
||||
console.error(err);
|
||||
dialog.showMessageBox({
|
||||
type: "error",
|
||||
title: "Failed to save image",
|
||||
message: "The image failed to save",
|
||||
title: _t("Failed to save image"),
|
||||
message: _t("The image failed to save"),
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -136,8 +170,8 @@ function onLinkContextMenu(ev, params) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
function _CutCopyPasteSelectContextMenus(params) {
|
||||
const options = [];
|
||||
function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemConstructorOptions[] {
|
||||
const options: MenuItemConstructorOptions[] = [];
|
||||
|
||||
if (params.misspelledWord) {
|
||||
params.dictionarySuggestions.forEach(word => {
|
||||
@@ -151,7 +185,7 @@ function _CutCopyPasteSelectContextMenus(params) {
|
||||
options.push({
|
||||
type: 'separator',
|
||||
}, {
|
||||
label: 'Add to dictionary',
|
||||
label: _t('Add to dictionary'),
|
||||
click: (menuItem, browserWindow) => {
|
||||
browserWindow.webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord);
|
||||
},
|
||||
@@ -162,29 +196,33 @@ function _CutCopyPasteSelectContextMenus(params) {
|
||||
|
||||
options.push({
|
||||
role: 'cut',
|
||||
label: 'Cu&t',
|
||||
label: _t('Cut'),
|
||||
accelerator: 't',
|
||||
enabled: params.editFlags.canCut,
|
||||
}, {
|
||||
role: 'copy',
|
||||
label: '&Copy',
|
||||
label: _t('Copy'),
|
||||
accelerator: 'c',
|
||||
enabled: params.editFlags.canCopy,
|
||||
}, {
|
||||
role: 'paste',
|
||||
label: '&Paste',
|
||||
label: _t('Paste'),
|
||||
accelerator: 'p',
|
||||
enabled: params.editFlags.canPaste,
|
||||
}, {
|
||||
role: 'pasteandmatchstyle',
|
||||
role: 'pasteAndMatchStyle',
|
||||
enabled: params.editFlags.canPaste,
|
||||
}, {
|
||||
role: 'selectall',
|
||||
label: "Select &All",
|
||||
role: 'selectAll',
|
||||
label: _t("Select All"),
|
||||
accelerator: 'a',
|
||||
enabled: params.editFlags.canSelectAll,
|
||||
});
|
||||
return options;
|
||||
}
|
||||
|
||||
function onSelectedContextMenu(ev, params) {
|
||||
const items = _CutCopyPasteSelectContextMenus(params);
|
||||
const items = cutCopyPasteSelectContextMenus(params);
|
||||
const popupMenu = Menu.buildFromTemplate(items);
|
||||
|
||||
// popup() requires an options object even for no options
|
||||
@@ -192,12 +230,13 @@ function onSelectedContextMenu(ev, params) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
function onEditableContextMenu(ev, params) {
|
||||
const items = [
|
||||
function onEditableContextMenu(ev: Event, params: ContextMenuParams) {
|
||||
const items: MenuItemConstructorOptions[] = [
|
||||
{ role: 'undo' },
|
||||
{ role: 'redo', enabled: params.editFlags.canRedo },
|
||||
{ type: 'separator' },
|
||||
].concat(_CutCopyPasteSelectContextMenus(params));
|
||||
...cutCopyPasteSelectContextMenus(params),
|
||||
];
|
||||
|
||||
const popupMenu = Menu.buildFromTemplate(items);
|
||||
|
||||
@@ -206,20 +245,20 @@ function onEditableContextMenu(ev, params) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
ipcMain.on('userDownloadOpen', function(ev, {path}) {
|
||||
ipcMain.on('userDownloadOpen', function(ev: IpcMainEvent, { path }) {
|
||||
shell.openPath(path);
|
||||
});
|
||||
|
||||
module.exports = (webContents) => {
|
||||
export default (webContents: WebContents): void => {
|
||||
webContents.on('new-window', onWindowOrNavigate);
|
||||
webContents.on('will-navigate', (ev, target) => {
|
||||
webContents.on('will-navigate', (ev: Event, target: string): void => {
|
||||
if (target.startsWith("vector://")) return;
|
||||
return onWindowOrNavigate(ev, target);
|
||||
});
|
||||
|
||||
webContents.on('context-menu', function(ev, params) {
|
||||
webContents.on('context-menu', function(ev: Event, params: ContextMenuParams): void {
|
||||
if (params.linkURL || params.srcURL) {
|
||||
onLinkContextMenu(ev, params);
|
||||
onLinkContextMenu(ev, params, webContents);
|
||||
} else if (params.selectionText) {
|
||||
onSelectedContextMenu(ev, params);
|
||||
} else if (params.isEditable) {
|
||||
@@ -227,7 +266,7 @@ module.exports = (webContents) => {
|
||||
}
|
||||
});
|
||||
|
||||
webContents.session.on('will-download', (event, item) => {
|
||||
webContents.session.on('will-download', (event: Event, item: DownloadItem): void => {
|
||||
item.once('done', (event, state) => {
|
||||
if (state === 'completed') {
|
||||
const savePath = item.getSavePath();
|
||||
24
tsconfig.json
Normal file
24
tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"target": "es2016",
|
||||
"noImplicitAny": false,
|
||||
"sourceMap": false,
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
"declaration": true,
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"es2019",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user