From c128e75f5d587479c7abd4a140f2e842cd2b8f69 Mon Sep 17 00:00:00 2001 From: Danny Colin Date: Fri, 10 Apr 2020 14:08:21 -0400 Subject: [PATCH 1/4] fix build:jitsi scripts crash caused by a missing folder On a freshly install of the developer environment, the build:jitsi try to create a file in ./webapp with the cURL command. However, ./webapp folder doesn't exist and the build script crash. This patch makes sure the appropriate folder is created if it doesn't already exist Signed-off-by: Danny Colin --- package.json | 2 +- scripts/build-jitsi.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 scripts/build-jitsi.sh diff --git a/package.json b/package.json index d924ed746..45f99265c 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "clean": "rimraf lib webapp electron_app/dist", "build": "yarn clean && yarn build:genfiles && yarn build:compile && yarn build:types && yarn build:bundle", "build-stats": "yarn clean && yarn build:genfiles && yarn build:compile && yarn build:types && yarn build:bundle-stats", - "build:jitsi": "curl -s https://jitsi.riot.im/libs/external_api.min.js > ./webapp/jitsi_external_api.min.js", + "build:jitsi": "scripts/build-jitsi.sh", "build:res": "node scripts/copy-res.js", "build:genfiles": "yarn reskindex && yarn build:res && yarn build:jitsi", "build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js", diff --git a/scripts/build-jitsi.sh b/scripts/build-jitsi.sh new file mode 100755 index 000000000..5d4bdafe1 --- /dev/null +++ b/scripts/build-jitsi.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [[ ! -f "./webapp" ]]; then + mkdir "./webapp" +fi + +curl -s https://jitsi.riot.im/libs/external_api.min.js > ./webapp/jitsi_external_api.min.js From 2514a33892d52e08486cff1723aa208cd0d7d94e Mon Sep 17 00:00:00 2001 From: "C. Yang" Date: Fri, 10 Apr 2020 17:43:54 -0400 Subject: [PATCH 2/4] Fix broken yarn install link in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53c86dec3..b506948c8 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Riot is a modular webapp built with modern ES6 and uses a Node.js build system. Ensure you have the latest LTS version of Node.js installed. Using `yarn` instead of `npm` is recommended. Please see the Yarn [install -guide](https://yarnpkg.com/docs/install/) if you do not have it already. +guide](https://classic.yarnpkg.com/en/docs/install) if you do not have it already. 1. Install or update `node.js` so that your `node` is at least v10.x. 1. Install `yarn` if not present already. From 2346829055336c33abbc47bcc9972677a511a061 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 11 Apr 2020 18:58:00 +0100 Subject: [PATCH 3/4] Add riot-desktop shortcuts for forward/back matching browsers&slack Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/electron-main.js | 10 +++++ src/i18n/strings/en_EN.json | 1 + src/vector/platform/ElectronPlatform.js | 52 ++++++++++++++++++++++++- 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index 91258c6cf..f9619285c 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -233,6 +233,16 @@ ipcMain.on('ipcCall', async function(ev, payload) { case 'getConfig': ret = vectorConfig; break; + case 'navigateBack': + if (mainWindow.webContents.canGoBack()) { + mainWindow.webContents.goBack(); + } + break; + case 'navigateForward': + if (mainWindow.webContents.canGoForward()) { + mainWindow.webContents.goForward(); + } + break; default: mainWindow.webContents.send('ipcReply', { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index a7f2f40cc..a10e48ac1 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -9,6 +9,7 @@ "Unable to load config file: please refresh the page to try again.": "Unable to load config file: please refresh the page to try again.", "Unexpected error preparing the app. See console for details.": "Unexpected error preparing the app. See console for details.", "Open user settings": "Open user settings", + "Previous/next recently visited room or community": "Previous/next recently visited room or community", "Riot Desktop on %(platformName)s": "Riot Desktop on %(platformName)s", "Go to your browser to complete Sign In": "Go to your browser to complete Sign In", "Unknown device": "Unknown device", diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 6b75c1eea..172718c82 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -218,7 +218,7 @@ export default class ElectronPlatform extends VectorBasePlatform { this.startUpdateCheck = this.startUpdateCheck.bind(this); this.stopUpdateCheck = this.stopUpdateCheck.bind(this); - // register Mac specific shortcuts + // register OS-specific shortcuts if (isMac) { registerShortcut(Categories.NAVIGATION, { keybinds: [{ @@ -227,6 +227,28 @@ export default class ElectronPlatform extends VectorBasePlatform { }], description: _td("Open user settings"), }); + + registerShortcut(Categories.NAVIGATION, { + keybinds: [{ + modifiers: [Modifiers.COMMAND], + key: Key.SQUARE_BRACKET_LEFT, + }, { + modifiers: [Modifiers.COMMAND], + key: Key.SQUARE_BRACKET_RIGHT, + }], + description: _td("Previous/next recently visited room or community"), + }); + } else { + registerShortcut(Categories.NAVIGATION, { + keybinds: [{ + modifiers: [Modifiers.ALT], + key: Key.ARROW_LEFT, + }, { + modifiers: [Modifiers.ALT], + key: Key.ARROW_RIGHT, + }], + description: _td("Previous/next recently visited room or community"), + }); } } @@ -434,4 +456,32 @@ export default class ElectronPlatform extends VectorBasePlatform { description: , }); } + + _navigateForwardBack(back: boolean) { + this._ipcCall(back ? "navigateBack" : "navigateForward"); + } + + onKeyDown(ev: KeyboardEvent): boolean { + let handled = false; + + switch (ev.key) { + case Key.SQUARE_BRACKET_LEFT: + case Key.SQUARE_BRACKET_RIGHT: + if (isMac && ev.metaKey && !ev.altKey && !ev.ctrlKey && !ev.shiftKey) { + this._navigateForwardBack(ev.key === Key.SQUARE_BRACKET_LEFT); + handled = true; + } + break; + + case Key.ARROW_LEFT: + case Key.ARROW_RIGHT: + if (!isMac && ev.altKey && !ev.metaKey && !ev.ctrlKey && !ev.shiftKey) { + this._navigateForwardBack(ev.key === Key.ARROW_LEFT); + handled = true; + } + break; + } + + return handled; + } } From 36f55c163086384755a4f8144a4e4ae7f8a7dd8b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 14 Apr 2020 14:44:12 +0100 Subject: [PATCH 4/4] Allow rageshake to fail in init Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vector/index.ts b/src/vector/index.ts index a4f494bdb..c82058738 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -109,7 +109,8 @@ async function start() { "./init"); try { - await settled(rageshakePromise); // give rageshake a chance to load/fail + // give rageshake a chance to load/fail, we don't actually assert rageshake loads, we allow it to fail if no IDB + await settled(rageshakePromise); const fragparts = parseQsFromFragment(window.location); @@ -182,7 +183,6 @@ async function start() { // app load critical path starts here // assert things started successfully // ################################## - await rageshakePromise; await loadOlmPromise; await loadSkinPromise; await loadThemePromise;