From 3c6d87b52b68d2612e9466405d092cc51cd407f7 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 25 May 2018 16:31:22 +0100 Subject: [PATCH 001/379] add skin --- webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webpack.config.js b/webpack.config.js index 2a116f5777..4b78c308bd 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -25,6 +25,7 @@ module.exports = { // CSS themes "theme-light": "./node_modules/matrix-react-sdk/res/themes/light/css/light.scss", "theme-dark": "./node_modules/matrix-react-sdk/res/themes/dark/css/dark.scss", + "theme-dharma": "./node_modules/matrix-react-sdk/res/themes/dharma/css/dharma.scss", "theme-status": "./res/themes/status/css/status.scss", }, module: { From dbd4d5e7797e35ae18c9ed77e7045081c0c417b6 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 16 Oct 2018 18:56:32 +0200 Subject: [PATCH 002/379] update /experimental --- foo | 1 + 1 file changed, 1 insertion(+) create mode 100644 foo diff --git a/foo b/foo new file mode 100644 index 0000000000..f83ba24262 --- /dev/null +++ b/foo @@ -0,0 +1 @@ +please update /experimental From 9d33255850186474b0c397bbb6352b7e86cb3a09 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 17 Oct 2018 11:29:04 +0200 Subject: [PATCH 003/379] remove foo file to trigger jenkins --- foo | 1 - 1 file changed, 1 deletion(-) delete mode 100644 foo diff --git a/foo b/foo deleted file mode 100644 index f83ba24262..0000000000 --- a/foo +++ /dev/null @@ -1 +0,0 @@ -please update /experimental From ab1f68df93e398d963780179ea99695ca6356db7 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 23 Oct 2018 15:50:09 +0200 Subject: [PATCH 004/379] apply changes from dharma theme to status theme --- res/themes/status/css/_status.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/res/themes/status/css/_status.scss b/res/themes/status/css/_status.scss index c99af14e94..f0259e454c 100644 --- a/res/themes/status/css/_status.scss +++ b/res/themes/status/css/_status.scss @@ -128,6 +128,7 @@ $input-fg-color: rgba(74, 74, 74, 0.9); // context menus $menu-border-color: rgba(187, 187, 187, 0.5); $menu-bg-color: #f6f6f6; +$menu-selected-color: #f5f8fa; $avatar-initial-color: #ffffff; $avatar-bg-color: transparent; @@ -162,6 +163,15 @@ $roomtile-name-color: #ffffff; $roomtile-selected-bg-color: #465561; $roomtile-focused-bg-color: #6d8597; +$username-variant1-color: #1e7ddc; +$username-variant2-color: #a756a8; +$username-variant3-color: #7ac9a1; +$username-variant4-color: #f2809d; +$username-variant5-color: #ffc666; +$username-variant6-color: #76ddd7; +$username-variant7-color: #45529b; +$username-variant8-color: #bfd251; + $roomsublist-background: rgba(0, 0, 0, 0.2); $roomsublist-label-fg-color: #ffffff; $roomsublist-label-bg-color: $secondary-accent-color; From c68770c0aa85506ec5b42183bdf45240c2fe546b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 23 Oct 2018 15:51:06 +0200 Subject: [PATCH 005/379] ignore setting and always show dharma theme for now --- src/vector/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector/index.js b/src/vector/index.js index 1d47491e4f..dea1bfbc17 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -271,7 +271,7 @@ async function loadApp() { // as quickly as we possibly can, set a default theme... const styleElements = Object.create(null); let a; - const theme = SettingsStore.getValue("theme"); + const theme = "dharma";//SettingsStore.getValue("theme"); for (let i = 0; (a = document.getElementsByTagName("link")[i]); i++) { const href = a.getAttribute("href"); if (!href) continue; From 03dcc97ce922939592690b33e7e54b5024186488 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 24 Oct 2018 13:56:42 +0200 Subject: [PATCH 006/379] add new variables to status --- res/themes/status/css/_status.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/res/themes/status/css/_status.scss b/res/themes/status/css/_status.scss index f0259e454c..d4035ebbb0 100644 --- a/res/themes/status/css/_status.scss +++ b/res/themes/status/css/_status.scss @@ -117,7 +117,11 @@ $primary-hairline-color: #e5e5e5; // used for the border of input text fields $input-border-color: #c9cfd4; +$input-darker-bg-color: #c1c9d6; +$input-darker-fg-color: #9fa9ba; +$button-bg-color: #7ac9a1; +$button-fg-color: white; // apart from login forms, which have stronger border $strong-input-border-color: #c7c7c7; From 06740e54801709b2028382d1221b15e546537d4f Mon Sep 17 00:00:00 2001 From: Akarshan Biswas Date: Fri, 16 Nov 2018 15:08:21 +0000 Subject: [PATCH 007/379] Translated using Weblate (Hindi) Currently translated at 100.0% (37 of 37 strings) Translation: Riot Web/riot-web Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/hi/ --- src/i18n/strings/hi.json | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/hi.json b/src/i18n/strings/hi.json index 0967ef424b..eaaf4f075a 100644 --- a/src/i18n/strings/hi.json +++ b/src/i18n/strings/hi.json @@ -1 +1,39 @@ -{} +{ + "Riot is not supported on mobile web. Install the app?": "रायट फ़ोन पर समर्थन नहीं हैं। एप्लिकेशन इनस्टॉल करना चाहेंगे ?", + "Riot Desktop on %(platformName)s": "%(platformName)s पर रायट डेस्कटॉप", + "Unknown device": "अज्ञात यन्त्र", + "%(appName)s via %(browserName)s on %(osName)s": "%(osName)s पर %(browserName)s के माध्यम से %(appName)s", + "You need to be using HTTPS to place a screen-sharing call.": "स्क्रीन साझा करने के लिए आपको HTTPS का उपयोग करने की आवश्यकता है।", + "Custom Server Options": "कस्टम सर्वर विकल्प", + "You can use the custom server options to sign into other Matrix servers by specifying a different Home server URL.
This allows you to use Riot with an existing Matrix account on a different home server.

You can also set a custom identity server but you won't be able to invite users by email address, or be invited by email address yourself.": "आप एक अलग होम सर्वर यूआरएल निर्दिष्ट करके अन्य मैट्रिक्स सर्वरों में साइन इन करने के लिए कस्टम सर्वर विकल्प का उपयोग कर सकते हैं।
यह आपको एक अलग होम सर्वर पर मौजूदा मैट्रिक्स खाते के साथ रायट का उपयोग करने की अनुमति देता है।

आप अपना आइडेंटिटी सर्वर भी सेट कर सकते हैं लेकिन आप ईमेल पते से उपयोगकर्ताओं को आमंत्रित नहीं कर पाएंगे, या ईमेल पते से स्वयं आमंत्रित नहीं हों सकेंगे।", + "Dismiss": "खारिज", + "powered by Matrix": "मैट्रिक्स द्वारा संचालित", + "Welcome to Riot.im": "Riot.im में आपका स्वागत है", + "Decentralised, encrypted chat & collaboration powered by [matrix]": "[मैट्रिक्स] द्वारा संचालित विकेंद्रीकृत, एन्क्रिप्टेड चैट और सहयोगिता", + "Search the room directory": "रूम डायरेक्टरी को खोजें", + "Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "मौजूदा नेटवर्क से जुड़े मैट्रिक्स में बहुत से कमरे पहले से मौजूद हैं (स्लैक, आईआरसी, गिटर इत्यादि) या स्वतंत्र। डायरेक्टरी देखें!", + "Chat with Riot Bot": "रायट बॉट के साथ चैट करें", + "Get started with some tips from Riot Bot!": "रायट बॉट से कुछ सुझावों के साथ शुरू करें!", + "General discussion about Matrix and Riot": "मैट्रिक्स और रायट के बारे में सामान्य चर्चा", + "Discussion of all things Matrix!": "मैट्रिक्स की सभी चीजों की चर्चा!", + "Riot/Web & Desktop chat": "रायट/वेब और डेस्कटॉप चैट", + "Riot/iOS & matrix-ios-sdk chat": "रायट / iOS और matrix-ios-sdk चैट", + "Riot/Android & matrix-android-sdk chat": "रायट / एंड्रॉइड और matrix-android-sdk चैट", + "Matrix technical discussions": "मैट्रिक्स तकनीकी चर्चाएं", + "Running Matrix services": "मैट्रिक्स सेवाएं चलाना", + "Community-run support for Synapse": "सामुदायिक चालित Synapse के लिए समर्थन", + "Admin support for Dendrite": "डेंडर्राइट के लिए व्यवस्थापक समर्थन", + "Announcements about Synapse releases": "Synapse रिलीज के बारे में घोषणाएं", + "Support for those using and running matrix-appservice-irc": "Matrix-appservice-irc का उपयोग और चलाने वाले लोगों के लिए समर्थन", + "Building services on Matrix": "मैट्रिक्स पर सेवाएं बनाना", + "Support for those using the Matrix spec": "मैट्रिक्स spec का उपयोग करने वालों के लिए समर्थन", + "Design and implementation of E2E in Matrix": "मैट्रिक्स में E2E के डिजाइन और कार्यान्वयन", + "Implementing VR services with Matrix": "मैट्रिक्स के साथ VR सेवाओं को लागू करना", + "Implementing VoIP services with Matrix": "मैट्रिक्स के साथ वीओआईपी सेवाओं को लागू करना", + "Discussion of the Identity Service API": "आइडेंटिटी सर्विस API की चर्चा", + "Support for those using, running and writing other bridges": "अन्य ब्रिज का उपयोग, चलाने और लिखने वालों के लिए समर्थन", + "Contributing code to Matrix and Riot": "मैट्रिक्स और रायट में कोड योगदान करना", + "Dev chat for the Riot/Web dev team": "रायट / वेब डेव टीम के लिए डेवलपर चैट", + "Dev chat for the Dendrite dev team": "डेन्ड्राइट देव टीम के लिए डेवलपर चैट", + "Co-ordination for Riot translators": "रायट अनुवादकों के लिए समन्वय" +} From c15151a0af392ad5104635b950557fdac3c82e11 Mon Sep 17 00:00:00 2001 From: Akarshan Biswas Date: Fri, 16 Nov 2018 15:20:26 +0000 Subject: [PATCH 008/379] Translated using Weblate (Hindi) Currently translated at 100.0% (37 of 37 strings) Translation: Riot Web/riot-web Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/hi/ --- src/i18n/strings/hi.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/i18n/strings/hi.json b/src/i18n/strings/hi.json index eaaf4f075a..e6d735db8d 100644 --- a/src/i18n/strings/hi.json +++ b/src/i18n/strings/hi.json @@ -1,9 +1,9 @@ { - "Riot is not supported on mobile web. Install the app?": "रायट फ़ोन पर समर्थन नहीं हैं। एप्लिकेशन इनस्टॉल करना चाहेंगे ?", - "Riot Desktop on %(platformName)s": "%(platformName)s पर रायट डेस्कटॉप", + "Riot is not supported on mobile web. Install the app?": "रायट फ़ोन पर समर्थन नहीं हैं। एप्लिकेशन इनस्टॉल करना चाहेंगे ?", + "Riot Desktop on %(platformName)s": "%(platformName)s पर रायट डेस्कटॉप", "Unknown device": "अज्ञात यन्त्र", "%(appName)s via %(browserName)s on %(osName)s": "%(osName)s पर %(browserName)s के माध्यम से %(appName)s", - "You need to be using HTTPS to place a screen-sharing call.": "स्क्रीन साझा करने के लिए आपको HTTPS का उपयोग करने की आवश्यकता है।", + "You need to be using HTTPS to place a screen-sharing call.": "स्क्रीन साझा की कॉल करने के लिए आपको HTTPS का उपयोग करने की आवश्यकता है।", "Custom Server Options": "कस्टम सर्वर विकल्प", "You can use the custom server options to sign into other Matrix servers by specifying a different Home server URL.
This allows you to use Riot with an existing Matrix account on a different home server.

You can also set a custom identity server but you won't be able to invite users by email address, or be invited by email address yourself.": "आप एक अलग होम सर्वर यूआरएल निर्दिष्ट करके अन्य मैट्रिक्स सर्वरों में साइन इन करने के लिए कस्टम सर्वर विकल्प का उपयोग कर सकते हैं।
यह आपको एक अलग होम सर्वर पर मौजूदा मैट्रिक्स खाते के साथ रायट का उपयोग करने की अनुमति देता है।

आप अपना आइडेंटिटी सर्वर भी सेट कर सकते हैं लेकिन आप ईमेल पते से उपयोगकर्ताओं को आमंत्रित नहीं कर पाएंगे, या ईमेल पते से स्वयं आमंत्रित नहीं हों सकेंगे।", "Dismiss": "खारिज", From 7247e97ff0288550c322e098d104011a23b73e06 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 5 Dec 2018 15:55:20 +0000 Subject: [PATCH 009/379] Update to electron 3.0.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 233b5b86b6..66b1ed84e3 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,7 @@ }, "build": { "appId": "im.riot.app", - "electronVersion": "3.0.5", + "electronVersion": "3.0.10", "files": [ "node_modules/**", "src/**", From 2648fe066e3e09911cf2db7401c757a6288d6c5d Mon Sep 17 00:00:00 2001 From: angelo-martinovic Date: Wed, 5 Dec 2018 16:26:02 +0000 Subject: [PATCH 010/379] Added translation using Weblate (Croatian) --- src/i18n/strings/hr.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/i18n/strings/hr.json diff --git a/src/i18n/strings/hr.json b/src/i18n/strings/hr.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/src/i18n/strings/hr.json @@ -0,0 +1 @@ +{} \ No newline at end of file From d0a35f378bbcdad68a770cac148ead88c7a808e4 Mon Sep 17 00:00:00 2001 From: angelo-martinovic Date: Wed, 5 Dec 2018 17:36:27 +0000 Subject: [PATCH 011/379] Translated using Weblate (Croatian) Currently translated at 100.0% (37 of 37 strings) Translation: Riot Web/riot-web Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/hr/ --- src/i18n/strings/hr.json | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/hr.json b/src/i18n/strings/hr.json index 9e26dfeeb6..c03a82905f 100644 --- a/src/i18n/strings/hr.json +++ b/src/i18n/strings/hr.json @@ -1 +1,39 @@ -{} \ No newline at end of file +{ + "Riot is not supported on mobile web. Install the app?": "Riot nije podržan na mobilnom pregledniku. Instalirati aplikaciju?", + "Riot Desktop on %(platformName)s": "Riot Desktop na %(platformName)s", + "Unknown device": "Nepoznati uređaj", + "%(appName)s via %(browserName)s on %(osName)s": "%(appName)s preko %(browserName)s na %(osName)s", + "You need to be using HTTPS to place a screen-sharing call.": "Morate koristiti HTTPS kako biste pokrenuli poziv s dijeljenjem ekrana.", + "Custom Server Options": "Prilagođene opcije poslužitelja", + "You can use the custom server options to sign into other Matrix servers by specifying a different Home server URL.
This allows you to use Riot with an existing Matrix account on a different home server.

You can also set a custom identity server but you won't be able to invite users by email address, or be invited by email address yourself.": "Možete koristiti prilagođene opcije poslužitelja za prijavu na ostale Matrix poslužitelje, navodeći drugačiji URL za Kućni poslužitelj.
Ovo vam omogućuje da koristite Riot s postojećim Matrix računom na različitom kućnom poslužitelju.

Također možete postaviti prilagođeni poslužitelj identiteta, ali u tom slučaju nećete moći pozivati korisnike preko njihove email adrese, niti sami biti pozvani preko vase email adrese.", + "Dismiss": "Odbaci", + "powered by Matrix": "powered by Matrix", + "Welcome to Riot.im": "Dobrodošli u Riot.im", + "Chat with Riot Bot": "Razgovor s Riot Botom", + "Get started with some tips from Riot Bot!": "Krenite s par savjeta od Riot Bota!", + "General discussion about Matrix and Riot": "Opća rasprava o Matrixu i Riotu", + "Discussion of all things Matrix!": "Rasprava o svemu vezanome za Matrix!", + "Riot/Web & Desktop chat": "Riot/Web & Desktop chat", + "Riot/iOS & matrix-ios-sdk chat": "Riot/iOS & matrix-ios-sdk chat", + "Riot/Android & matrix-android-sdk chat": "Riot/Android & matrix-android-sdk chat", + "Matrix technical discussions": "Tehničke rasprave o Matrixu", + "Running Matrix services": "Pokretanje Matrix usluga", + "Community-run support for Synapse": "Podrška zajednice za Synapse", + "Admin support for Dendrite": "Administratorska podrška za Dendrite", + "Announcements about Synapse releases": "Obavijesti o izdanjima Synapsea", + "Support for those using and running matrix-appservice-irc": "Podrška onima koji koriste i pokreću matrix-appservice-irc", + "Building services on Matrix": "Razvoj usluga na Matrixu", + "Support for those using the Matrix spec": "Podrška onima koji koriste Matrix spec", + "Design and implementation of E2E in Matrix": "Dizajn i implementacija E2E u Matrixu", + "Implementing VR services with Matrix": "Implementiranje VR usluga s Matrixom", + "Implementing VoIP services with Matrix": "Implementiranje VoIP usluga s Matrixom", + "Discussion of the Identity Service API": "Rasprava vezana za Identity Service API", + "Support for those using, running and writing other bridges": "Podrška onima koji koriste, pokreću i pišu ostale mostove", + "Contributing code to Matrix and Riot": "Doprinos kodu Matrixa i Riota", + "Dev chat for the Riot/Web dev team": "Dev chat za Riot/Web dev tim", + "Dev chat for the Dendrite dev team": "Dev chat za Dendrite dev team", + "Co-ordination for Riot translators": "Koordinacija Riot prevoditelja", + "Decentralised, encrypted chat & collaboration powered by [matrix]": "Decentralizirani, enkriptirani chat & kolaboracija powered by [matrix]", + "Search the room directory": "Pretražite imenik soba", + "Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "Veliki broj soba već postoji na Matrixu, povezanih s postojećim mrežama (Slack, IRC, Gitter itd) ili nezavisnih. Zavirite u imenik!" +} From 5310b4c14baa93b9ca90a2b6cd43dc4cc4038893 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Dec 2018 11:20:00 +0000 Subject: [PATCH 012/379] js-sdk & react-sdk rc.1 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 66b1ed84e3..4344af3514 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,8 @@ "gemini-scrollbar": "github:matrix-org/gemini-scrollbar#b302279", "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", - "matrix-js-sdk": "0.14.1", - "matrix-react-sdk": "0.14.6", + "matrix-js-sdk": "0.14.2-rc.1", + "matrix-react-sdk": "0.14.7-rc.1", "modernizr": "^3.6.0", "prop-types": "^15.6.2", "react": "^15.6.0", From 6ba471421f105956e90fcadf7230ef19902cf84c Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Dec 2018 11:20:33 +0000 Subject: [PATCH 013/379] v0.17.8-rc.1 --- electron_app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/package.json b/electron_app/package.json index 7d32bfccc5..0fd9790654 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "src/electron-main.js", - "version": "0.17.7", + "version": "0.17.8-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From 8d9987a6b5dadf2a90639b5dbac4cb30b1ba3255 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Dec 2018 11:21:42 +0000 Subject: [PATCH 014/379] Prepare changelog for v0.17.8-rc.1 --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9148433bd1..c76fa73645 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +Changes in [0.17.8-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.17.8-rc.1) (2018-12-06) +====================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.7...v0.17.8-rc.1) + + * Update from Weblate. + [\#7784](https://github.com/vector-im/riot-web/pull/7784) + * Add a function to send a rageshake from the console + [\#7755](https://github.com/vector-im/riot-web/pull/7755) + * Re-apply "Run lint on travis builds and use modern node versions" + [\#7738](https://github.com/vector-im/riot-web/pull/7738) + * Revert "Run lint on travis builds and use modern node versions" + [\#7737](https://github.com/vector-im/riot-web/pull/7737) + * Run lint on travis builds and use modern node versions + [\#7490](https://github.com/vector-im/riot-web/pull/7490) + * Fix missing js-sdk logging + [\#7736](https://github.com/vector-im/riot-web/pull/7736) + * Add $accent-color-50pct as a CSS variable to the Status theme + [\#7710](https://github.com/vector-im/riot-web/pull/7710) + Changes in [0.17.7](https://github.com/vector-im/riot-web/releases/tag/v0.17.7) (2018-11-22) ============================================================================================ [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.6...v0.17.7) From 88ff92a65852e13df709ee9f40eb121431e916e5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Dec 2018 11:21:42 +0000 Subject: [PATCH 015/379] v0.17.8-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4344af3514..912a588734 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "0.17.7", + "version": "0.17.8-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 10294ab2403a20524a38324803e060eb8e7a0757 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Dec 2018 12:42:52 +0000 Subject: [PATCH 016/379] react-sdk rc.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 912a588734..0b400a95a6 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", "matrix-js-sdk": "0.14.2-rc.1", - "matrix-react-sdk": "0.14.7-rc.1", + "matrix-react-sdk": "0.14.7-rc.2", "modernizr": "^3.6.0", "prop-types": "^15.6.2", "react": "^15.6.0", From bf2d792d943ce727cafc8dbc61cf2503e39c3bd5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Dec 2018 12:45:38 +0000 Subject: [PATCH 017/379] Revert electron app version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0b400a95a6..c7a5bfe691 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "0.17.8-rc.1", + "version": "0.17.7", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 02eb8a284c982bcf4aeeebe6ee69ab476d017bf5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Dec 2018 12:47:18 +0000 Subject: [PATCH 018/379] Actually revert electron app version bump last one was in fasct the main version file --- electron_app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/package.json b/electron_app/package.json index 0fd9790654..7d32bfccc5 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "src/electron-main.js", - "version": "0.17.8-rc.1", + "version": "0.17.7", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From 74c81d692198d7bbf32fe7dc2add3b9c50cd2d2b Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Dec 2018 12:48:34 +0000 Subject: [PATCH 019/379] v0.17.8-rc.1 --- electron_app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/package.json b/electron_app/package.json index 7d32bfccc5..0fd9790654 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "src/electron-main.js", - "version": "0.17.7", + "version": "0.17.8-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From b6493a2f8233bef283bafd8f66762bd715164a1d Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Dec 2018 12:49:53 +0000 Subject: [PATCH 020/379] v0.17.8-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c7a5bfe691..0b400a95a6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "0.17.7", + "version": "0.17.8-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From a82f9d5266d4078be358e1714ff6922654450b54 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 10 Dec 2018 13:46:35 +0000 Subject: [PATCH 021/379] Released js-sdk & react-sdk --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0b400a95a6..29f21bcdef 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,8 @@ "gemini-scrollbar": "github:matrix-org/gemini-scrollbar#b302279", "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", - "matrix-js-sdk": "0.14.2-rc.1", - "matrix-react-sdk": "0.14.7-rc.2", + "matrix-js-sdk": "0.14.2", + "matrix-react-sdk": "0.14.7", "modernizr": "^3.6.0", "prop-types": "^15.6.2", "react": "^15.6.0", From 7c4f67b1a1ed397d8f4f6af5bda034656bf6d5b0 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 10 Dec 2018 13:46:57 +0000 Subject: [PATCH 022/379] v0.17.8 --- electron_app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/package.json b/electron_app/package.json index 0fd9790654..f9ab11454b 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "src/electron-main.js", - "version": "0.17.8-rc.1", + "version": "0.17.8", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From cb628d0799563dc38e11e4d9207f2ef68ae1b9f8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 10 Dec 2018 13:48:11 +0000 Subject: [PATCH 023/379] Prepare changelog for v0.17.8 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c76fa73645..1d2f8d3434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [0.17.8](https://github.com/vector-im/riot-web/releases/tag/v0.17.8) (2018-12-10) +============================================================================================ +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.8-rc.1...v0.17.8) + + * No changes since rc.1 + Changes in [0.17.8-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.17.8-rc.1) (2018-12-06) ====================================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.7...v0.17.8-rc.1) From c2038a5cccb0b5df3c99d4e9d616dbe609f1c465 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 10 Dec 2018 13:48:11 +0000 Subject: [PATCH 024/379] v0.17.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 29f21bcdef..9a2db53501 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "0.17.8-rc.1", + "version": "0.17.8", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 868ec8299721fde342ffa125acfdf1bc75f3422e Mon Sep 17 00:00:00 2001 From: Akarshan Biswas Date: Thu, 6 Dec 2018 15:04:45 +0000 Subject: [PATCH 025/379] Translated using Weblate (Hindi) Currently translated at 100.0% (37 of 37 strings) Translation: Riot Web/riot-web Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/hi/ --- src/i18n/strings/hi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/hi.json b/src/i18n/strings/hi.json index e6d735db8d..82b716bd00 100644 --- a/src/i18n/strings/hi.json +++ b/src/i18n/strings/hi.json @@ -10,7 +10,7 @@ "powered by Matrix": "मैट्रिक्स द्वारा संचालित", "Welcome to Riot.im": "Riot.im में आपका स्वागत है", "Decentralised, encrypted chat & collaboration powered by [matrix]": "[मैट्रिक्स] द्वारा संचालित विकेंद्रीकृत, एन्क्रिप्टेड चैट और सहयोगिता", - "Search the room directory": "रूम डायरेक्टरी को खोजें", + "Search the room directory": "रूम डायरेक्टरी में खोजें", "Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "मौजूदा नेटवर्क से जुड़े मैट्रिक्स में बहुत से कमरे पहले से मौजूद हैं (स्लैक, आईआरसी, गिटर इत्यादि) या स्वतंत्र। डायरेक्टरी देखें!", "Chat with Riot Bot": "रायट बॉट के साथ चैट करें", "Get started with some tips from Riot Bot!": "रायट बॉट से कुछ सुझावों के साथ शुरू करें!", From 6ca0b3ad038a942deab2c42606e5d4b0923272eb Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 11 Dec 2018 16:13:46 +0000 Subject: [PATCH 026/379] Update the tests to match https://github.com/matrix-org/matrix-react-sdk/pull/2340 See the react-sdk PR for some context. --- test/app-tests/loading.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/test/app-tests/loading.js b/test/app-tests/loading.js index 676475b687..43e72b9355 100644 --- a/test/app-tests/loading.js +++ b/test/app-tests/loading.js @@ -43,6 +43,17 @@ import {parseQs, parseQsFromFragment} from '../../src/vector/url_utils'; const DEFAULT_HS_URL='http://my_server'; const DEFAULT_IS_URL='http://my_is'; +expect.extend({ + toStartWith(prefix) { + expect.assert( + this.actual.startsWith(prefix), + 'expected %s to start with %s', + this.actual, prefix, + ); + return this; + } +}); + describe('loading:', function() { let parentDiv; let httpBackend; @@ -437,10 +448,7 @@ describe('loading:', function() { }).done(done, done); }); - it('uses the last known homeserver to register with', function(done) { - localStorage.setItem("mx_hs_url", "https://homeserver" ); - localStorage.setItem("mx_is_url", "https://idserver" ); - + it('uses the default homeserver to register with', function(done) { loadApp(); Promise.delay(1).then(() => { @@ -449,7 +457,7 @@ describe('loading:', function() { assertAtLoadingSpinner(matrixChat); httpBackend.when('POST', '/register').check(function(req) { - expect(req.path).toMatch(new RegExp("^https://homeserver/")); + expect(req.path).toStartWith(DEFAULT_HS_URL); expect(req.queryParams.kind).toEqual('guest'); }).respond(200, { user_id: "@guest:localhost", @@ -462,15 +470,15 @@ describe('loading:', function() { }).then(() => { return expectAndAwaitSync(); }).then((req) => { - expect(req.path).toMatch(new RegExp("^https://homeserver/")); + expect(req.path).toStartWith(DEFAULT_HS_URL); // once the sync completes, we should have a home page httpBackend.verifyNoOutstandingExpectation(); ReactTestUtils.findRenderedComponentWithType( matrixChat, sdk.getComponent('structures.HomePage')); expect(windowLocation.hash).toEqual("#/home"); - expect(MatrixClientPeg.get().baseUrl).toEqual("https://homeserver"); - expect(MatrixClientPeg.get().idBaseUrl).toEqual("https://idserver"); + expect(MatrixClientPeg.get().baseUrl).toEqual(DEFAULT_HS_URL); + expect(MatrixClientPeg.get().idBaseUrl).toEqual(DEFAULT_IS_URL); }).done(done, done); }); From 17983c47d8e09ed17b7a0065b29061b281c6d3fc Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 18 Dec 2018 00:30:16 +0000 Subject: [PATCH 027/379] Link to CONTRIBUTING from JS SDK The JS SDK's CONTRIBUTING file is a bit simpler to read. The Synapse version previously used includes mentions of Python lint tools that don't apply here. Signed-off-by: J. Ryan Stinnett --- CONTRIBUTING.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 2a9bab5759..f084b474bd 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,4 +1,4 @@ Contributing code to Riot ========================= -Riot follows the same pattern as https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst. +Riot follows the same pattern as https://github.com/matrix-org/matrix-js-sdk/blob/master/CONTRIBUTING.rst. From 0daf7c9af768aea6068338184525f2a0b4d8caad Mon Sep 17 00:00:00 2001 From: random Date: Fri, 14 Dec 2018 11:05:41 +0000 Subject: [PATCH 028/379] Translated using Weblate (Italian) Currently translated at 100.0% (37 of 37 strings) Translation: Riot Web/riot-web Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/it/ --- src/i18n/strings/it.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/it.json b/src/i18n/strings/it.json index f563819e87..6b54fe22b2 100644 --- a/src/i18n/strings/it.json +++ b/src/i18n/strings/it.json @@ -29,7 +29,7 @@ "Support for those using, running and writing other bridges": "Supporto per chi usa, amministra e scrive altri ponti (bridge)", "Contributing code to Matrix and Riot": "Contributi di codice per Matrix e Riot", "%(appName)s via %(browserName)s on %(osName)s": "%(appName)s tramite %(browserName)s su %(osName)s", - "Decentralised, encrypted chat & collaboration powered by [matrix]": "Chat criptate e decentralizzate & collaborazione offerta da [matrix]", + "Decentralised, encrypted chat & collaboration powered by [matrix]": "Chat criptate, decentralizzate e collaborazioni offerte da [matrix]", "Discussion of all things Matrix!": "Discussione su tutto riguardo Matrix!", "Dev chat for the Riot/Web dev team": "Chat per gli sviluppatori di Riot/Web", "Dev chat for the Dendrite dev team": "Chat per gli sviluppatori di Dendrite", From 87c006da2c2a81296af48a9c5787003f89d8e482 Mon Sep 17 00:00:00 2001 From: Tom Lant Date: Tue, 18 Dec 2018 10:44:49 +0000 Subject: [PATCH 029/379] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..6caffdb01b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + + + + + +### Description + +Describe here the problem that you are experiencing, or the feature you are requesting. + +### Steps to reproduce + +- For bugs, list the steps +- that reproduce the bug +- using hyphens as bullet points + +Describe how what happens differs from what you expected. + +Log: sent/not sent? + + + +### Version information + + + +- **Platform**: web (in-browser) or desktop? + +For the web app: + +- **Browser**: Chrome, Safari, Firefox? which version? +- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? +- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web? + +For the desktop app: + +- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? +- **Version**: 0.x.y From e9fa1dd3a91d13e67435d99d5cf290cf45951376 Mon Sep 17 00:00:00 2001 From: Tom Lant Date: Tue, 18 Dec 2018 11:03:55 +0000 Subject: [PATCH 030/379] Update issue templates --- .github/ISSUE_TEMPLATE/test-template.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/test-template.md diff --git a/.github/ISSUE_TEMPLATE/test-template.md b/.github/ISSUE_TEMPLATE/test-template.md new file mode 100644 index 0000000000..2714836e26 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/test-template.md @@ -0,0 +1,10 @@ +--- +name: Test Template +about: Shortlived test template +title: '' +labels: bug +assignees: '' + +--- + + From b406da8755241ddf39b7917119b8388971fcaee7 Mon Sep 17 00:00:00 2001 From: Tom Lant Date: Tue, 18 Dec 2018 11:04:34 +0000 Subject: [PATCH 031/379] Update issue templates --- .github/ISSUE_TEMPLATE/test-template.md | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/test-template.md diff --git a/.github/ISSUE_TEMPLATE/test-template.md b/.github/ISSUE_TEMPLATE/test-template.md deleted file mode 100644 index 2714836e26..0000000000 --- a/.github/ISSUE_TEMPLATE/test-template.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Test Template -about: Shortlived test template -title: '' -labels: bug -assignees: '' - ---- - - From 19f1489c9284171e5ea3e69121864697a4e97e8a Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 18 Dec 2018 17:42:55 +0000 Subject: [PATCH 032/379] Run the Desktop app in a sandbox * Turn off node integration in the electron renderer process * Enable the chromium sandbox to put the renderer into its own process * Expose just the ipc module with a preload script * Introduce a little IPC call wrapper so we can call into the renderer process and await on the result. * Use this in a bunch of places we previously used direct calls to electron modules. * Convert other uses of node, eg. use of process to derive the platform (just look at the user agent) * Strip out the desktopCapturer integration which doesn't appear to have ever worked (probably best to just wait until getDisplayMedia() is available in chrome at this point: https://github.com/vector-im/riot-web/issues/4880). --- electron_app/src/electron-main.js | 106 +++++++---- .../index.js => electron_app/src/preload.js | 16 +- src/vector/index.js | 15 +- src/vector/platform/ElectronPlatform.js | 177 +++++++++--------- src/vector/platform/VectorBasePlatform.js | 19 +- src/vector/platform/WebPlatform.js | 4 + webpack.config.js | 5 - 7 files changed, 198 insertions(+), 144 deletions(-) rename src/vector/platform/index.js => electron_app/src/preload.js (61%) diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index 85955392aa..e11b3233ba 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -2,6 +2,7 @@ Copyright 2016 Aviral Dasgupta Copyright 2016 OpenMarket Ltd Copyright 2017 Michael Telatynski <7t3chguy@gmail.com> +Copyright 2018 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,8 +24,9 @@ const checkSquirrelHooks = require('./squirrelhooks'); if (checkSquirrelHooks()) return; const argv = require('minimist')(process.argv); -const {app, ipcMain, powerSaveBlocker, BrowserWindow, Menu} = require('electron'); +const {app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater} = require('electron'); const AutoLaunch = require('auto-launch'); +const path = require('path'); const tray = require('./tray'); const vectorMenu = require('./vectormenu'); @@ -97,6 +99,61 @@ ipcMain.on('app_onAction', function(ev, payload) { } }); +autoUpdater.on('update-downloaded', (ev, releaseNotes, releaseName, releaseDate, updateURL) => { + if (!mainWindow) return; + // forward to renderer + mainWindow.webContents.send('update-downloaded', { + releaseNotes, + releaseName, + releaseDate, + updateURL, + }); +}); + +ipcMain.on('ipcCall', function(ev, payload) { + if (!mainWindow) return; + + const args = payload.args || []; + let ret; + + switch (payload.name) { + case 'getUpdateFeedUrl': + ret = autoUpdater.getFeedURL(); + break; + case 'getAutoLaunchEnabled': + ret = launcher.isEnabled; + break; + case 'setAutoLaunchEnabled': + if (args[0]) { + launcher.enable(); + } else { + launcher.disable(); + } + break; + case 'getAppVersion': + ret = app.getVersion(); + break; + case 'focusWindow': + if (mainWindow.isMinimized()) { + mainWindow.restore(); + } else if (!mainWindow.isVisible()) { + mainWindow.show(); + } else { + mainWindow.focus(); + } + default: + mainWindow.webContents.send('ipcReply', { + id: payload.id, + error: new Error("Unknown IPC Call: "+payload.name), + }); + return; + } + + mainWindow.webContents.send('ipcReply', { + id: payload.id, + reply: ret, + }); +}); app.commandLine.appendSwitch('--enable-usermedia-screen-capturing'); @@ -126,40 +183,6 @@ const launcher = new AutoLaunch({ }, }); -const settings = { - 'auto-launch': { - get: launcher.isEnabled, - set: function(bool) { - if (bool) { - return launcher.enable(); - } else { - return launcher.disable(); - } - }, - }, -}; - -ipcMain.on('settings_get', async function(ev) { - const data = {}; - - try { - await Promise.all(Object.keys(settings).map(async function (setting) { - data[setting] = await settings[setting].get(); - })); - - ev.sender.send('settings', data); - } catch (e) { - console.error(e); - } -}); - -ipcMain.on('settings_set', function(ev, key, value) { - console.log(key, value); - if (settings[key] && settings[key].set) { - settings[key].set(value); - } -}); - app.on('ready', () => { if (argv['devtools']) { try { @@ -191,6 +214,7 @@ app.on('ready', () => { defaultHeight: 768, }); + const preloadScript = path.normalize(`${__dirname}/preload.js`); mainWindow = global.mainWindow = new BrowserWindow({ icon: iconPath, show: false, @@ -200,6 +224,18 @@ app.on('ready', () => { y: mainWindowState.y, width: mainWindowState.width, height: mainWindowState.height, + webPreferences: { + preload: preloadScript, + nodeIntegration: false, + sandbox: true, + 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, + webgl: false, + }, }); mainWindow.loadURL(`file://${__dirname}/../../webapp/index.html`); Menu.setApplicationMenu(vectorMenu); diff --git a/src/vector/platform/index.js b/electron_app/src/preload.js similarity index 61% rename from src/vector/platform/index.js rename to electron_app/src/preload.js index 9071420015..4c926d2145 100644 --- a/src/vector/platform/index.js +++ b/electron_app/src/preload.js @@ -1,8 +1,5 @@ -// @flow - /* -Copyright 2016 Aviral Dasgupta -Copyright 2016 OpenMarket Ltd +Copyright 2018 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,13 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -let Platform = null; +const { ipcRenderer } = require('electron'); -if (window && window.process && window.process && window.process.type === 'renderer') { - // we're running inside electron - Platform = require('./ElectronPlatform'); -} else { - Platform = require('./WebPlatform'); -} +// expose ipcRenderer to the renderer process +window.ipcRenderer = ipcRenderer; -export default Platform; diff --git a/src/vector/index.js b/src/vector/index.js index 32a88f363d..9d05aa347c 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -47,7 +47,9 @@ import * as languageHandler from 'matrix-react-sdk/lib/languageHandler'; import url from 'url'; import {parseQs, parseQsFromFragment} from './url_utils'; -import Platform from './platform'; + +import ElectronPlatform from './platform/ElectronPlatform'; +import WebPlatform from './platform/WebPlatform'; import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; import SettingsStore from "matrix-react-sdk/lib/settings/SettingsStore"; @@ -219,8 +221,15 @@ async function loadApp() { const fragparts = parseQsFromFragment(window.location); const params = parseQs(window.location); - // set the platform for react sdk (our Platform object automatically picks the right one) - PlatformPeg.set(new Platform()); + // set the platform for react sdk + //if (navigator.userAgent.toLowerCase().indexOf('electron') > 0) { + if (window.ipcRenderer) { + console.log("Using Electron platform"); + PlatformPeg.set(new ElectronPlatform()); + } else { + console.log("Using Web platform"); + PlatformPeg.set(new WebPlatform()); + } // Load the config file. First try to load up a domain-specific config of the // form "config.$domain.json" and if that fails, fall back to config.json. diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 8b384b20d1..b116cd6370 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -3,6 +3,7 @@ /* Copyright 2016 Aviral Dasgupta Copyright 2016 OpenMarket Ltd +Copyright 2018 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,44 +22,24 @@ import VectorBasePlatform, {updateCheckStatusEnum} from './VectorBasePlatform'; import dis from 'matrix-react-sdk/lib/dispatcher'; import { _t } from 'matrix-react-sdk/lib/languageHandler'; import Promise from 'bluebird'; -import {remote, ipcRenderer, desktopCapturer} from 'electron'; import rageshake from 'matrix-react-sdk/lib/rageshake/rageshake'; -remote.autoUpdater.on('update-downloaded', onUpdateDownloaded); - -// try to flush the rageshake logs to indexeddb before quit. -ipcRenderer.on('before-quit', function() { - console.log('riot-desktop closing'); - rageshake.flush(); -}); - -function onUpdateDownloaded(ev: Event, releaseNotes: string, ver: string, date: Date, updateURL: string) { - dis.dispatch({ - action: 'new_version', - currentVersion: remote.app.getVersion(), - newVersion: ver, - releaseNotes: releaseNotes, - }); -} - function platformFriendlyName(): string { - console.log(window.process); - switch (window.process.platform) { - case 'darwin': - return 'macOS'; - case 'freebsd': - return 'FreeBSD'; - case 'openbsd': - return 'OpenBSD'; - case 'sunos': - return 'SunOS'; - case 'win32': - return 'Windows'; - default: - // Sorry, Linux users: you get lumped into here, - // but only because Linux's capitalisation is - // normal. We do care about you. - return window.process.platform[0].toUpperCase() + window.process.platform.slice(1); + // used to use window.process but the same info is available here + if (navigator.userAgent.indexOf('Macintosh')) { + return 'macOS'; + } else if (navigator.userAgent.indexOf('FreeBSD')) { + return 'FreeBSD'; + } else if (navigator.userAgent.indexOf('OpenBSD')) { + return 'OpenBSD'; + } else if (navigator.userAgent.indexOf('SunOS')) { + return 'SunOS'; + } else if (navigator.userAgent.indexOf('Windows')) { + return 'Windows'; + } else if (navigator.userAgent.indexOf('Linux')) { + return 'Linux'; + } else { + return 'Unknown'; } } @@ -85,9 +66,11 @@ function getUpdateCheckStatus(status) { export default class ElectronPlatform extends VectorBasePlatform { constructor() { super(); - dis.register(_onAction); - this.updatable = Boolean(remote.autoUpdater.getFeedURL()); + this._pendingIpcCalls = {}; + this._nextIpcCallId = 0; + + dis.register(_onAction); /* IPC Call `check_updates` returns: true if there is an update available @@ -103,10 +86,28 @@ export default class ElectronPlatform extends VectorBasePlatform { this.showUpdateCheck = false; }); + // try to flush the rageshake logs to indexeddb before quit. + ipcRenderer.on('before-quit', function() { + console.log('riot-desktop closing'); + rageshake.flush(); + }); + + ipcRenderer.on('ipcReply', this._onIpcReply.bind(this)); + ipcRenderer.on('update-downloaded', this.onUpdateDownloaded.bind(this)); + this.startUpdateCheck = this.startUpdateCheck.bind(this); this.stopUpdateCheck = this.stopUpdateCheck.bind(this); } + async onUpdateDownloaded(ev, updateInfo) { + dis.dispatch({ + action: 'new_version', + currentVersion: await this.getAppVersion(), + newVersion: updateInfo, + releaseNotes: updateInfo.releaseNotes, + }); + } + getHumanReadableName(): string { return 'Electron Platform'; // no translation required: only used for analytics } @@ -133,7 +134,7 @@ export default class ElectronPlatform extends VectorBasePlatform { // maybe we should pass basic styling (italics, bold, underline) through from MD // we only have to strip out < and > as the spec doesn't include anything about things like & // so we shouldn't assume that all implementations will treat those properly. Very basic tag parsing is done. - if (window.process.platform === 'linux') { + if (navigator.userAgent.indexOf('Linux')) { msg = msg.replace(//g, '>'); } @@ -147,17 +148,13 @@ export default class ElectronPlatform extends VectorBasePlatform { }, ); - notification.onclick = function() { + notification.onclick = () => { dis.dispatch({ action: 'view_room', room_id: room.roomId, }); global.focus(); - const win = remote.getCurrentWindow(); - - if (win.isMinimized()) win.restore(); - else if (!win.isVisible()) win.show(); - else win.focus(); + this._ipcCall('focusWindow'); }; return notification; @@ -171,8 +168,25 @@ export default class ElectronPlatform extends VectorBasePlatform { notif.close(); } - getAppVersion(): Promise { - return Promise.resolve(remote.app.getVersion()); + async getAppVersion(): Promise { + return await this._ipcCall('getAppVersion'); + } + + supportsAutoLaunch() { + return true; + } + + async getAutoLaunchEnabled() { + return await this._ipcCall('getAutoLaunchEnabled'); + } + + async setAutoLaunchEnabled(enabled) { + return await this._ipcCall('setAutoLaunchEnabled', enabled); + } + + async canSelfUpdate(): boolean { + const feedUrl = await this._ipcCall('getUpdateFeedUrl'); + return Boolean(feedUrl); } startUpdateCheck() { @@ -197,52 +211,43 @@ export default class ElectronPlatform extends VectorBasePlatform { return null; } - isElectron(): boolean { return true; } - requestNotificationPermission(): Promise { return Promise.resolve('granted'); } reload() { - remote.getCurrentWebContents().reload(); + // we used to remote to the main process to get it to + // reload the webcontents, but in practice this is unnecessary: + // the normal way works fine. + window.location.reload(false); } - /* BEGIN copied and slightly-modified code - * setupScreenSharingForIframe function from: - * https://github.com/jitsi/jitsi-meet-electron-utils - * Copied directly here to avoid the need for a native electron module for - * 'just a bit of JavaScript' - * NOTE: Apache v2.0 licensed - */ - setupScreenSharingForIframe(iframe: Object) { - iframe.contentWindow.JitsiMeetElectron = { - /** - * Get sources available for screensharing. The callback is invoked - * with an array of DesktopCapturerSources. - * - * @param {Function} callback - The success callback. - * @param {Function} errorCallback - The callback for errors. - * @param {Object} options - Configuration for getting sources. - * @param {Array} options.types - Specify the desktop source types - * to get, with valid sources being "window" and "screen". - * @param {Object} options.thumbnailSize - Specify how big the - * preview images for the sources should be. The valid keys are - * height and width, e.g. { height: number, width: number}. By - * default electron will return images with height and width of - * 150px. - */ - obtainDesktopStreams(callback, errorCallback, options = {}) { - desktopCapturer.getSources(options, - (error, sources) => { - if (error) { - errorCallback(error); - return; - } - - callback(sources); - }); - }, - }; + async _ipcCall(name, ...args) { + const ipcCallId = ++this._nextIpcCallId; + return new Promise((resolve, reject) => { + this._pendingIpcCalls[ipcCallId] = {resolve, reject}; + window.ipcRenderer.send('ipcCall', {id: ipcCallId, name, args}); + // Maybe add a timeout to these? Probably not necessary. + }); + } + + _onIpcReply(ev, payload) { + if (payload.id === undefined) { + console.warn("Ignoring IPC reply with no ID"); + return; + } + + if (this._pendingIpcCalls[payload.id] === undefined) { + console.warn("Unknown IPC payload ID: " + payload.id); + return; + } + + const callbacks = this._pendingIpcCalls[payload.id]; + delete this._pendingIpcCalls[payload.id]; + if (payload.error) { + callbacks.reject(payload.error); + } else { + callbacks.resolve(payload.reply); + } } - /* END of copied and slightly-modified code */ } diff --git a/src/vector/platform/VectorBasePlatform.js b/src/vector/platform/VectorBasePlatform.js index 16b9d17801..7523462cfc 100644 --- a/src/vector/platform/VectorBasePlatform.js +++ b/src/vector/platform/VectorBasePlatform.js @@ -3,6 +3,7 @@ /* Copyright 2016 Aviral Dasgupta Copyright 2016 OpenMarket Ltd +Copyright 2018 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,7 +46,6 @@ export default class VectorBasePlatform extends BasePlatform { this.favicon = new Favico({animation: 'none'}); this.showUpdateCheck = false; this._updateFavicon(); - this.updatable = true; this.startUpdateCheck = this.startUpdateCheck.bind(this); this.stopUpdateCheck = this.stopUpdateCheck.bind(this); @@ -88,6 +88,19 @@ export default class VectorBasePlatform extends BasePlatform { this._updateFavicon(); } + supportsAutoLaunch() { + return false; + } + + // XXX: Surely this should be a setting like any other? + async getAutoLaunchEnabled() { + return false; + } + + async setAutoLaunchEnabled(enabled) { + throw new Error("Unimplemented"); + } + /** * Begin update polling, if applicable */ @@ -97,8 +110,8 @@ export default class VectorBasePlatform extends BasePlatform { /** * Whether we can call checkForUpdate on this platform build */ - canSelfUpdate(): boolean { - return this.updatable; + async canSelfUpdate(): boolean { + return false; } startUpdateCheck() { diff --git a/src/vector/platform/WebPlatform.js b/src/vector/platform/WebPlatform.js index 2955b84a3b..d850dd6ddd 100644 --- a/src/vector/platform/WebPlatform.js +++ b/src/vector/platform/WebPlatform.js @@ -142,6 +142,10 @@ export default class WebPlatform extends VectorBasePlatform { setInterval(this.pollForUpdate.bind(this), POKE_RATE_MS); } + async canSelfUpdate(): boolean { + return true; + } + pollForUpdate() { return this._getVersion().then((ver) => { if (this.runningVersion === null) { diff --git a/webpack.config.js b/webpack.config.js index f335aa3c1b..82972adf44 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -108,11 +108,6 @@ module.exports = { "matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'), }, }, - externals: { - // Don't try to bundle electron: leave it as a commonjs dependency - // (the 'commonjs' here means it will output a 'require') - "electron": "commonjs electron", - }, plugins: [ new webpack.DefinePlugin({ 'process.env': { From 0c428efea0a6b4e26bcf88b62a59475732e5a1fb Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 18 Dec 2018 18:03:47 +0000 Subject: [PATCH 033/379] lint --- src/vector/platform/ElectronPlatform.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index b116cd6370..0bf0068a43 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -24,6 +24,8 @@ import { _t } from 'matrix-react-sdk/lib/languageHandler'; import Promise from 'bluebird'; import rageshake from 'matrix-react-sdk/lib/rageshake/rageshake'; +const ipcRenderer = window.ipcRenderer; + function platformFriendlyName(): string { // used to use window.process but the same info is available here if (navigator.userAgent.indexOf('Macintosh')) { From 60d307603873b4a6e9630fafea986e3d1589d5f8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 18 Dec 2018 18:10:09 +0000 Subject: [PATCH 034/379] Update to new electron single instance API --- electron_app/src/electron-main.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index 85955392aa..986cc7070f 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -100,24 +100,12 @@ ipcMain.on('app_onAction', function(ev, payload) { app.commandLine.appendSwitch('--enable-usermedia-screen-capturing'); -const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => { - // If other instance launched with --hidden then skip showing window - if (commandLine.includes('--hidden')) return; - - // Someone tried to run a second instance, we should focus our window. - if (mainWindow) { - if (!mainWindow.isVisible()) mainWindow.show(); - if (mainWindow.isMinimized()) mainWindow.restore(); - mainWindow.focus(); - } -}); - -if (shouldQuit) { +const gotLock = app.requestSingleInstanceLock(); +if (!gotLock) { console.log('Other instance detected: exiting'); app.exit(); } - const launcher = new AutoLaunch({ name: vectorConfig.brand || 'Riot', isHidden: true, @@ -268,6 +256,18 @@ app.on('before-quit', () => { } }); +app.on('second-instance', (ev, commandLine, workingDirectory) => { + // If other instance launched with --hidden then skip showing window + if (commandLine.includes('--hidden')) return; + + // Someone tried to run a second instance, we should focus our window. + if (mainWindow) { + if (!mainWindow.isVisible()) mainWindow.show(); + if (mainWindow.isMinimized()) mainWindow.restore(); + mainWindow.focus(); + } +}); + // Set the App User Model ID to match what the squirrel // installer uses for the shortcut icon. // This makes notifications work on windows 8.1 (and is From 0e580635eb6a2ed4b63a626d4e920d61f398e875 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 18 Dec 2018 18:13:51 +0000 Subject: [PATCH 035/379] Update tests for new platform layout --- test/app-tests/joining.js | 4 ++-- test/app-tests/loading.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/app-tests/joining.js b/test/app-tests/joining.js index 60bf3fd3b4..5b4eae4213 100644 --- a/test/app-tests/joining.js +++ b/test/app-tests/joining.js @@ -17,7 +17,7 @@ limitations under the License. /* joining.js: tests for the various paths when joining a room */ import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg'; -import Platform from '../../src/vector/platform'; +import WebPlatform from '../../src/vector/platform/WebPlatform'; require('skin-sdk'); @@ -88,7 +88,7 @@ describe('joining a room', function() { localStorage.setItem("mx_access_token", ACCESS_TOKEN ); localStorage.setItem("mx_user_id", USER_ID); - PlatformPeg.set(new Platform()); + PlatformPeg.set(new WebPlatform()); const mc = ( Date: Wed, 19 Dec 2018 09:29:05 +0000 Subject: [PATCH 036/379] Remove unused commented line --- src/vector/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vector/index.js b/src/vector/index.js index 9d05aa347c..36ae067c63 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -222,7 +222,6 @@ async function loadApp() { const params = parseQs(window.location); // set the platform for react sdk - //if (navigator.userAgent.toLowerCase().indexOf('electron') > 0) { if (window.ipcRenderer) { console.log("Using Electron platform"); PlatformPeg.set(new ElectronPlatform()); From fc4e1485ad745a89e8d43f9d35fb1462484ae357 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 19 Dec 2018 12:04:40 +0000 Subject: [PATCH 037/379] Electron: Load app from custom protocol This puts the app into its own origin so it doesn't have access to the filesystem via file:// URIs. Next step: migrate over localstorage & indexeddb data from the old origin... --- electron_app/src/electron-main.js | 50 +++++++++++++++++++++++++++++-- electron_app/src/preload.js | 8 +++++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index dbd2ff670c..b8201070a0 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -24,7 +24,7 @@ const checkSquirrelHooks = require('./squirrelhooks'); if (checkSquirrelHooks()) return; const argv = require('minimist')(process.argv); -const {app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater} = require('electron'); +const {app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater, protocol} = require('electron'); const AutoLaunch = require('auto-launch'); const path = require('path'); @@ -171,6 +171,13 @@ const launcher = new AutoLaunch({ }, }); +// Register the scheme the app is served from as 'standard' +// which allows things like relative URLs and IndexedDB to +// work. +// Also mark it as secure (ie. accessing resources from this +// protocol and HTTPS won't trigger mixed content warnings). +protocol.registerStandardSchemes(['vector'], {secure: true}); + app.on('ready', () => { if (argv['devtools']) { try { @@ -186,6 +193,45 @@ app.on('ready', () => { } } + protocol.registerFileProtocol('vector', (request, callback) => { + if (request.method !== 'GET') { + 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 + return; + } + if (parsedUrl.host !== 'vector') { + callback({error: -105}); // NAME_NOT_RESOLVED + return; + } + + const target = parsedUrl.pathname.split('/'); + if (target[target.length - 1] == '') { + target[target.length - 1] = 'index.html'; + } + + // Normalise the base dir and the target path separately, then make sure + // the target path isn't trying to back out beyond its root + const appBaseDir = path.normalize(__dirname + "/../../webapp"); + const relTarget = path.normalize(path.join(...target)); + if (relTarget.startsWith('..')) { + callback({error: -6}); // FILE_NOT_FOUND + return; + } + const absTarget = path.join(appBaseDir, relTarget); + + callback({ + path: absTarget, + }); + }, (error) => { + if (error) console.error('Failed to register protocol') + }); + + if (vectorConfig['update_base_url']) { console.log(`Starting auto update with base URL: ${vectorConfig['update_base_url']}`); @@ -225,7 +271,7 @@ app.on('ready', () => { webgl: false, }, }); - mainWindow.loadURL(`file://${__dirname}/../../webapp/index.html`); + mainWindow.loadURL('vector://vector/'); Menu.setApplicationMenu(vectorMenu); // explicitly hide because setApplicationMenu on Linux otherwise shows... diff --git a/electron_app/src/preload.js b/electron_app/src/preload.js index 4c926d2145..bf6e23bbaa 100644 --- a/electron_app/src/preload.js +++ b/electron_app/src/preload.js @@ -19,3 +19,11 @@ const { ipcRenderer } = require('electron'); // expose ipcRenderer to the renderer process window.ipcRenderer = ipcRenderer; +// Allow the fetch API to load resources from this +// protocol: this is necessary to load olm.wasm. +// (Also mark it a secure although we've already +// done this in the main process). +webFrame.registerURLSchemeAsPrivileged('vector', { + secure: true, + supportFetchAPI: true, +}); From b6d70f443419e468251fd27991fb0ba72c15242d Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 19 Dec 2018 12:25:32 +0000 Subject: [PATCH 038/379] Missing include --- electron_app/src/preload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/src/preload.js b/electron_app/src/preload.js index bf6e23bbaa..3a4f7c9a4b 100644 --- a/electron_app/src/preload.js +++ b/electron_app/src/preload.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -const { ipcRenderer } = require('electron'); +const { ipcRenderer, webFrame } = require('electron'); // expose ipcRenderer to the renderer process window.ipcRenderer = ipcRenderer; From 8cd37d28daa6476a2142c164090ca121b029cf8b Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 19 Dec 2018 14:52:17 +0000 Subject: [PATCH 039/379] Clarify line number instructions Signed-off-by: J. Ryan Stinnett --- src/vector/rageshakesetup.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vector/rageshakesetup.js b/src/vector/rageshakesetup.js index 2ea438ef5b..7992df2b47 100644 --- a/src/vector/rageshakesetup.js +++ b/src/vector/rageshakesetup.js @@ -30,7 +30,9 @@ import SdkConfig from "matrix-react-sdk/src/SdkConfig"; function initRageshake() { rageshake.init().then(() => { - console.log("Initialised rageshake: See https://bugs.chromium.org/p/chromium/issues/detail?id=583193 to fix line numbers on Chrome."); + console.log("Initialised rageshake."); + console.log("To fix line numbers in Chrome: " + + "Meatball menu → Settings → Blackboxing → Add /rageshake\\.js$"); window.addEventListener('beforeunload', (e) => { console.log('riot-web closing'); From f7bdc9339c95e66cd1f9bd3a2da42f078200851d Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Wed, 19 Dec 2018 15:50:16 -0500 Subject: [PATCH 040/379] Make clear that the Debian package is for desktop --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 72def22803..a07e48709c 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,8 @@ Note that Chrome does not allow microphone or webcam access for sites served over http (except localhost), so for working VoIP you will need to serve Riot over https. -### Installation Steps for Debian Stretch +### Desktop Installation for Debian Stretch + 1. Add the repository to your sources.list using either of the following two options: - Directly to sources.list: `echo "deb https://riot.im/packages/debian/ stretch main" | sudo tee -a /etc/apt/sources.list` - As a separate entry in sources.list.d: `echo "deb https://riot.im/packages/debian/ stretch main" | sudo tee /etc/apt/sources.list.d/riot.list` From 7527bdd2c7d824fd061778917c5cfa0953e2d33c Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 19 Dec 2018 22:05:04 +0000 Subject: [PATCH 041/379] Fix the IndexedDB worker Looks like this was broken in the webpack 4 upgrade due to the worker script setter and the bundle being re-ordered in index.html. * Remove the loop: we only use two scripts now, so import them explicitly * Remove outdated olm import code. * Stop generating a script import for each theme: we were pulling in 3 js files that did absolutely nothing. * Fix worker 'onmessage' scope (set it as a global rather than trying to make it an ES6 module which it isn't). * Fail hard if the indexeddb worker script isn't set to avoid this happening again. --- src/vector/index.html | 26 ++++---------------------- src/vector/index.js | 7 +++++++ src/vector/indexeddb-worker.js | 2 +- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/vector/index.html b/src/vector/index.html index 4ba65c3e06..a5f3af9b81 100644 --- a/src/vector/index.html +++ b/src/vector/index.html @@ -36,28 +36,10 @@
- <% for (var i=0; i < htmlWebpackPlugin.files.js.length; i++) { - if (_.endsWith(htmlWebpackPlugin.files.js[i], 'olm.js')) { - var array = htmlWebpackPlugin.files.js; - htmlWebpackPlugin.files.js.unshift(htmlWebpackPlugin.files.js[i]); - htmlWebpackPlugin.files.js.splice(i, 1); - } - } - - for (var i=0; i < htmlWebpackPlugin.files.js.length; i++) { - // Not a particularly graceful way of not putting the indexeddb worker script - // into the main page - if (_.endsWith(htmlWebpackPlugin.files.js[i], 'indexeddb-worker.js')) { - %> - - <% - continue; - } - %> - - <% } %> + +