From 69745bbd40069439b6765aff0e2219ac6566e455 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 4 Sep 2020 21:55:50 -0600 Subject: [PATCH 01/70] Switch to using the Widget API SDK for Jitsi widgets --- src/vector/jitsi/index.ts | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 081246c0a9..3ebbc7d3b4 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -18,7 +18,12 @@ limitations under the License. require("./index.scss"); import * as qs from 'querystring'; -import { Capability, WidgetApi } from "matrix-react-sdk/src/widgets/WidgetApi"; +import { + IWidgetApiRequest, + IWidgetApiRequestEmptyData, + VideoConferenceCapabilities, + WidgetApi +} from "matrix-widget-api"; // Dev note: we use raw JS without many dependencies to reduce bundle size. // We do not need all of React to render a Jitsi conference. @@ -56,11 +61,19 @@ let widgetApi: WidgetApi; const widgetId = qsParam('widgetId', true); // Set this up as early as possible because Element will be hitting it almost immediately. + let readyPromise: Promise<[void, void]>; if (parentUrl && widgetId) { - widgetApi = new WidgetApi(qsParam('parentUrl'), qsParam('widgetId'), [ - Capability.AlwaysOnScreen, + const parentOrigin = new URL(qsParam('parentUrl')).origin; + widgetApi = new WidgetApi(qsParam("widgetId"), parentOrigin); + widgetApi.requestCapabilities(VideoConferenceCapabilities); + readyPromise = Promise.all([ + widgetApi.waitFor>("im.vector.ready") + .then(ev => widgetApi.transport.reply(ev.detail, {})), + widgetApi.waitFor("ready"), ]); - widgetApi.expectingExplicitReady = true; + widgetApi.start(); + } else { + throw new Error("No parent URL or no widget ID"); } // Populate the Jitsi params now @@ -70,10 +83,8 @@ let widgetApi: WidgetApi; avatarUrl = qsParam('avatarUrl', true); // http not mxc userId = qsParam('userId'); - if (widgetApi) { - await widgetApi.waitReady(); - await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen - } + await readyPromise; + await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen // TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795) From 2fa8b0f8b2bfe616f6348ef88166a5e3c08e169a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 4 Sep 2020 22:02:18 -0600 Subject: [PATCH 02/70] Make the types happy --- src/vector/jitsi/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 3ebbc7d3b4..f31bf46baa 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -69,7 +69,7 @@ let widgetApi: WidgetApi; readyPromise = Promise.all([ widgetApi.waitFor>("im.vector.ready") .then(ev => widgetApi.transport.reply(ev.detail, {})), - widgetApi.waitFor("ready"), + widgetApi.waitFor("ready").then(), ]); widgetApi.start(); } else { From c88ba8e2126662abdf93c3b0fd559fa59ce48d70 Mon Sep 17 00:00:00 2001 From: Salih Emin Date: Wed, 9 Sep 2020 15:21:26 +0000 Subject: [PATCH 03/70] Translated using Weblate (Greek) Currently translated at 51.5% (17 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/el/ --- src/i18n/strings/el.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/el.json b/src/i18n/strings/el.json index b4c9b28192..fd08e4705a 100644 --- a/src/i18n/strings/el.json +++ b/src/i18n/strings/el.json @@ -10,7 +10,11 @@ "The message from the parser is: %(message)s": "Το μήνυμα από τον αναλυτή είναι: %(message)s", "Invalid JSON": "Μη έγκυρο JSON", "Unexpected error preparing the app. See console for details.": "Απρόοπτο σφάλμα κατά την προετοιμασία της εφαρμογής. Δείτε το τερματικό για λεπτομέρειες.", - "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Μη έγκυρη ρύθμιση παραμέτρων: δυνατότητα ορισμού μόνο ένα από τα default_server_config, default_server_name, ή default_hs_url.", + "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Μη έγκυρη ρύθμιση: δυνατότητα ορισμού μόνο ένα από τα default_server_config, default_server_name, ή default_hs_url.", "Invalid configuration: no default server specified.": "Μη έγκυρη ρύθμιση παραμέτρων: δεν έχει οριστεί προκαθορισμένος διακομιστής.", - "Explore rooms": "Εξερευνήστε δωμάτια" + "Explore rooms": "Εξερευνήστε δωμάτια", + "Open": "Άνοιγμα", + "Go to your browser to complete Sign In": "Επισκεφτείτε τον browser σας για να ολοκληρωθεί η είσοδος", + "Powered by Matrix": "Παρέχεται από το Matrix", + "Please install Chrome, Firefox, or Safari for the best experience.": "Παρακαλούμε εγκαταστήστε Chrome, Firefox, ή Safari για καλύτερη εμπειρία χρήσης." } From 4cd9560d21bc200ead5149769e5b3379c7765d2c Mon Sep 17 00:00:00 2001 From: yuuki-san Date: Thu, 10 Sep 2020 11:39:52 +0000 Subject: [PATCH 04/70] Translated using Weblate (Slovak) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/sk/ --- src/i18n/strings/sk.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/sk.json b/src/i18n/strings/sk.json index a70dac93af..c6128e6596 100644 --- a/src/i18n/strings/sk.json +++ b/src/i18n/strings/sk.json @@ -29,7 +29,8 @@ "Download Completed": "Preberanie dokončené", "Open": "Otvoriť", "Your Element is misconfigured": "Váš Element je nesprávne nastavený", - "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Vaša konfigurácia Elementu obsahuje nesprávne JSON. Prosím, opravte chybu a obnovte stránku.", + "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Vaša konfigurácia Elementu obsahuje nesprávny údaj JSON. Prosím, opravte chybu a obnovte stránku.", "Your browser can't run %(brand)s": "Váš prehliadač nerozbehne %(brand)s", - "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s používa pokročilé funkcie prehliadača, ktoré nie sú podporované vaším aktuálnym prehliadačom." + "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s používa pokročilé funkcie prehliadača, ktoré nie sú podporované vaším aktuálnym prehliadačom.", + "Powered by Matrix": "používa protokol Matrix" } From 9f15bc2bbf33452fa3804bf337bf297064b7e665 Mon Sep 17 00:00:00 2001 From: Safa Alfulaij Date: Sat, 12 Sep 2020 10:26:08 +0000 Subject: [PATCH 05/70] Translated using Weblate (Arabic) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/ar/ --- src/i18n/strings/ar.json | 63 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/src/i18n/strings/ar.json b/src/i18n/strings/ar.json index 09dbc0f425..44758f656e 100644 --- a/src/i18n/strings/ar.json +++ b/src/i18n/strings/ar.json @@ -1,35 +1,36 @@ { - "Dismiss": "تجاهل", + "Dismiss": "أهمِل", "Unknown device": "جهاز مجهول", - "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 للاتصال بمشاركة الشاشة.", "powered by Matrix": "مشغل بواسطة Matrix", - "Welcome to Element": "مرحبا بك في Element", - "Decentralised, encrypted chat & collaboration powered by [matrix]": "دردشة مشفرة غير مركزية &تطبيق تعاوني مدعوم بواسطة [matrix]", - "Create Account": "انشاء حساب", - "Explore rooms": "استكشف غرف المحادثات", - "Sign In": "الدخول", - "Missing indexeddb worker script!": "منفذ السكريبت الخاص ب Indexeddb غير موجود!", - "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "خطأ في الاعدادات: يمكنك فقط تحديد واحد فقط من: default_server_config، default_server_name، أو default_hs_url.", - "Invalid configuration: no default server specified.": "اعدادات خاطئة: لم يتم تحديد السيرفر الافتراضي.", - "Your Element is misconfigured": "تطبيقك معد بطريقة خاطئة", - "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "اعداداتك تحتوى على بنية JSON غير صحيحة. يرجى تصحيح المشكلة واعادة تحديث الصفحة.", - "The message from the parser is: %(message)s": "الرسالة من المدقق هي:%(message)s", - "Invalid JSON": "JSON خاطئ", - "Unable to load config file: please refresh the page to try again.": "لم نستطع تحميل ملف الاعداد: يرجى تحديث الصفحة للمحاولة مرة اخرى.", - "Unexpected error preparing the app. See console for details.": "حدث خطأ غير متوقع عند تجهيز التطبيق. انظر الى منصة التحكم للمزيد من التفاصيل.", - "Download Completed": "تم اكتمال التحميل", - "Open": "فتح", - "Open user settings": "فتح اعدادات المستخدم", - "Previous/next recently visited room or community": "السابقة/اللاحقة الغرفة او المجتمع الذي تمت زيارته مؤخرا", - "%(brand)s Desktop (%(platformName)s)": "%(brand)s سطح المكتب (%(platformName)s)", - "Go to your browser to complete Sign In": "اذهب الى المتصفح لاكمال تسجيل الدخول", - "%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)", - "Unsupported browser": "متصفح غير متوافق", - "Your browser can't run %(brand)s": "متصفحك لايمكنه تشغيل %(brand)s", - "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s يستخدم مزايا المتصفح المتقدمة والتي لا يدعمها متصفحك الحالي.", - "Please install Chrome, Firefox, or Safari for the best experience.": "يرجى تثبيت Chrome, Firefox, or Safari for the best experience.", - "You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "يمكنك الاستمرار في استخدام متصفحك الحالي، ولكن بعض او كل المزايا ربما لا تعمل ويكون شكل التطبيق وشعورك تجاهه غير صحيح.", - "I understand the risks and wish to continue": "ادرك المخاطر وارغب في الاستمرار", - "Go to element.io": "اذهب الى Element.io", - "Failed to start": "فشل الاقلاع" + "Welcome to Element": "مرحبًا بك في Element", + "Decentralised, encrypted chat & collaboration powered by [matrix]": "دردشة وتعاون غير مركزي معمّى، تدعمه [matrix]", + "Create Account": "أنشِئ حسابًا", + "Explore rooms": "استكشِف الغرف", + "Sign In": "لِج", + "Missing indexeddb worker script!": "سكربت عامل indexeddb ناقص!", + "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "الضبط غير صالح: يمكنك تحديد واحدًا من الآتي فقط: default_server_config أو default_server_name أو default_hs_url.", + "Invalid configuration: no default server specified.": "الضبط غير صالح: لم تحدّد خادومًا مبدئيًا.", + "Your Element is misconfigured": "لم يُضبط تطبيق Element كما ينبغي", + "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "يحتوي ضبط تطبيق Element على تنسيق JSON غير صالح. من فضلك صحّح المشكلة وأعِد تحميل الصفحة.", + "The message from the parser is: %(message)s": "الرسالة القادمة من المحلّل: %(message)s", + "Invalid JSON": "تنسيق JSON غير صالح", + "Unable to load config file: please refresh the page to try again.": "تعذّر تحميل ملف الضبط: من فضلك أنعِش الصفحة لمعاودة المحاولة.", + "Unexpected error preparing the app. See console for details.": "حدث عُطل غير متوقع أثناء تجهيز التطبيق. طالِع المِعراض للتفاصيل.", + "Download Completed": "اكتمل التنزيل", + "Open": "افتح", + "Open user settings": "افتح إعدادات المستخدم", + "Previous/next recently visited room or community": "الغرفة أو المجتمع التالي/السابق الذي زرته حديثًا", + "%(brand)s Desktop (%(platformName)s)": "‏‏%(brand)s لسطح المكتب (%(platformName)s)", + "Go to your browser to complete Sign In": "افتح المتصفح لإكمال الولوج", + "%(appName)s (%(browserName)s, %(osName)s)": "‏‏%(appName)s (‏‏%(browserName)s، ‏‏%(osName)s)", + "Unsupported browser": "متصفح غير مدعوم", + "Your browser can't run %(brand)s": "لا يمكن لمتصفحك تشغيل %(brand)s", + "%(brand)s uses advanced browser features which aren't supported by your current browser.": "يستعمل %(brand)s ميزات متقدمة في المتصفحات لا يدعمها متصفحك الحالي.", + "Please install Chrome, Firefox, or Safari for the best experience.": "من فضلك ثبّت كروم أو فَيَرفُكس أو سفاري لأفضل تجربة.", + "You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "يمكنك مواصل استعمال متصفحك الحالي ولكن قد لا تعمل بعض المزايا (أو كلها) وقد لا يظهر التطبيق كما ينبغي له أن يظهر.", + "I understand the risks and wish to continue": "أفهم المخاطرة وأود المواصلة", + "Go to element.io": "انتقل إلى element.io", + "Failed to start": "فشل البدء", + "Powered by Matrix": "تدعمه «ماترِكس»" } From c76a5f2c52fa1e94faf867d8884c47ca251b1060 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 15 Sep 2020 13:19:47 +0100 Subject: [PATCH 06/70] Attempt to fix tests some more --- package.json | 3 +- res/sw.js | 1 - scripts/copy-res.js | 1 - src/vector/index.html | 10 - src/vector/index.ts | 2 +- webpack.config.js | 20 +- yarn.lock | 1207 ++++++++++++++++++++++++++++++++++++++++- 7 files changed, 1220 insertions(+), 24 deletions(-) delete mode 100644 res/sw.js diff --git a/package.json b/package.json index 0a151e0e28..5835edba39 100644 --- a/package.json +++ b/package.json @@ -142,7 +142,8 @@ "typescript": "^3.7.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10", - "webpack-dev-server": "^3.9.0" + "webpack-dev-server": "^3.9.0", + "workbox-webpack-plugin": "^5.1.4" }, "jest": { "testEnvironment": "jest-environment-jsdom-fourteen", diff --git a/res/sw.js b/res/sw.js deleted file mode 100644 index 038b82c9b4..0000000000 --- a/res/sw.js +++ /dev/null @@ -1 +0,0 @@ -self.addEventListener('fetch',() => {}); diff --git a/scripts/copy-res.js b/scripts/copy-res.js index ebe1c625ea..6c55f3d5dd 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -61,7 +61,6 @@ const INCLUDE_LANGS = [ // "dest/b/...". const COPY_LIST = [ ["res/manifest.json", "webapp"], - ["res/sw.js", "webapp"], ["res/welcome.html", "webapp"], ["res/welcome/**", "webapp/welcome"], ["res/themes/**", "webapp/themes"], diff --git a/src/vector/index.html b/src/vector/index.html index 4cda4b37a5..3ddc8482fb 100644 --- a/src/vector/index.html +++ b/src/vector/index.html @@ -55,16 +55,6 @@
- - - - - - - - - -