From d7478963543a1e717f724c978fe6cd073edda478 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 27 Mar 2019 17:44:30 +0000 Subject: [PATCH 1/9] react-sdk & js-sdk rc.1 --- package.json | 4 ++-- yarn.lock | 31 +++++++++++++++---------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index f3df9b9e37..8cfdf59fca 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": "1.0.2", - "matrix-react-sdk": "1.0.5", + "matrix-js-sdk": "^1.0.3-rc.1", + "matrix-react-sdk": "^1.0.6-rc.1", "modernizr": "^3.6.0", "olm": "https://matrix.org/packages/npm/olm/olm-3.1.0-pre1.tgz", "prop-types": "^15.6.2", diff --git a/yarn.lock b/yarn.lock index 2665a2fcb5..7b37e0d350 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5190,7 +5190,7 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -"jquery@>= 1.4.3", jquery@^3.3.1: +jquery@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca" integrity sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg== @@ -5732,10 +5732,10 @@ math-random@^1.0.1: resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= -matrix-js-sdk@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-1.0.2.tgz#482d8d2076c7565cf7354722e96c9971e372182a" - integrity sha512-4WCBJFSoOLelHi7IUAcVxPQF+gTc/i9NUKZ77qwUfcZVED8VKTIyWZnwpeLgocK5gAOJV9fkAyO5mny9SkZaGg== +matrix-js-sdk@^1.0.3-rc.1: + version "1.0.3-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-1.0.3-rc.1.tgz#61dea7fc2efd6f0a23e709443b4ac6a276890e9a" + integrity sha512-31aFwoAR9AIWhqHgJCYplXVFbaykXydm7GBvM/ffCjzN5OgAQEzUqwX18PfWKHVZHqijtj2VZOqnBVsXLX0w6Q== dependencies: another-json "^0.2.0" babel-runtime "^6.26.0" @@ -5757,10 +5757,10 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -matrix-react-sdk@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-1.0.5.tgz#92ca4f6780f76e183f47d2f96c79ada76492d77a" - integrity sha512-aaBmKQO4KM+U9eMhdJgbO/RZtmqayISk+qrcdcXtxDYjn2RZnziTNQ2289xG+dQb7A09Aev3u9rogrD6QCDI3w== +matrix-react-sdk@^1.0.6-rc.1: + version "1.0.6-rc.1" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-1.0.6-rc.1.tgz#349882288d668258bf04c76fa63a07e8d533bb7b" + integrity sha512-ulbvL7Cp7jJASL5tOMfrJJ95A0oNPQueaA8CDOmsa9Fu7O6sF415hTxQflO4xPYz/7BAs3jrExgMXpY48U5VHg== dependencies: babel-plugin-syntax-dynamic-import "^6.18.0" babel-runtime "^6.26.0" @@ -5786,7 +5786,7 @@ matrix-react-sdk@1.0.5: linkifyjs "^2.1.6" lodash "^4.13.1" lolex "2.3.2" - matrix-js-sdk "1.0.2" + matrix-js-sdk "^1.0.3-rc.1" optimist "^0.6.1" pako "^1.0.5" prop-types "^15.5.8" @@ -5806,7 +5806,7 @@ matrix-react-sdk@1.0.5: slate-react "^0.18.10" text-encoding-utf-8 "^1.0.1" url "^0.11.0" - velocity-vector "github:vector-im/velocity#059e3b2" + velocity-animate "^1.5.2" whatwg-fetch "^1.1.1" zxcvbn "^4.4.2" @@ -8995,11 +8995,10 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= -"velocity-vector@github:vector-im/velocity#059e3b2": - version "1.2.3" - resolved "https://codeload.github.com/vector-im/velocity/tar.gz/059e3b2348f1110888d033974d3109fd5a3af00f" - dependencies: - jquery ">= 1.4.3" +velocity-animate@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/velocity-animate/-/velocity-animate-1.5.2.tgz#5a351d75fca2a92756f5c3867548b873f6c32105" + integrity sha512-m6EXlCAMetKztO1ppBhGU1/1MR3IiEevO6ESq6rcrSQ3Q77xYSW13jkfXW88o4xMrkXJhy/U7j4wFR/twMB0Eg== verror@1.10.0: version "1.10.0" From f392a001381a3e753f5910d28d8561f6d258de9d Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 27 Mar 2019 17:46:32 +0000 Subject: [PATCH 2/9] v1.0.6-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 158783bd40..a12173692a 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": "1.0.5", + "version": "1.0.6-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From c9e70fb0c6336cc495c2cac23382dd2d0f827e37 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 27 Mar 2019 17:47:46 +0000 Subject: [PATCH 3/9] Prepare changelog for v1.0.6-rc.1 --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7308b0fadc..98e861966b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,38 @@ +Changes in [1.0.6-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.6-rc.1) (2019-03-27) +==================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.5...v1.0.6-rc.1) + + * Use `on_logged_in` action in tests + [\#9279](https://github.com/vector-im/riot-web/pull/9279) + * Convert away from `Promise.defer` + [\#9278](https://github.com/vector-im/riot-web/pull/9278) + * update react-sdk version in yarn lockfile + [\#9233](https://github.com/vector-im/riot-web/pull/9233) + * "Render simple counters in room header" details + [\#9154](https://github.com/vector-im/riot-web/pull/9154) + * Use medium agents for the more resource intensive builds + [\#9238](https://github.com/vector-im/riot-web/pull/9238) + * Add log grouping to buildkite + [\#9223](https://github.com/vector-im/riot-web/pull/9223) + * Switch to `git` protocol for CI dependencies + [\#9222](https://github.com/vector-im/riot-web/pull/9222) + * Support CI for matching branches on forks + [\#9212](https://github.com/vector-im/riot-web/pull/9212) + * Update from Weblate + [\#9199](https://github.com/vector-im/riot-web/pull/9199) + * Declare the officially supported browsers in the README + [\#9177](https://github.com/vector-im/riot-web/pull/9177) + * Document some desktop app things + [\#9011](https://github.com/vector-im/riot-web/pull/9011) + * Use Buildkite for CI + [\#9165](https://github.com/vector-im/riot-web/pull/9165) + * Update version number in issue templates + [\#9170](https://github.com/vector-im/riot-web/pull/9170) + * Remove node 8.x from the build matrix + [\#9159](https://github.com/vector-im/riot-web/pull/9159) + * Update Electron help menu link + [\#9157](https://github.com/vector-im/riot-web/pull/9157) + Changes in [1.0.5](https://github.com/vector-im/riot-web/releases/tag/v1.0.5) (2019-03-21) ========================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.4...v1.0.5) From d1a5b79bc316195d61cdd8d9f3ae33483d5767bd Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 27 Mar 2019 17:47:47 +0000 Subject: [PATCH 4/9] v1.0.6-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8cfdf59fca..ade30d9e7c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "1.0.5", + "version": "1.0.6-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 7a9cea4baa0da3d3122fe49e1e95595f26411222 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 29 Mar 2019 14:57:02 -0600 Subject: [PATCH 5/9] Add "Save image as..." button to context menu on images Fixes https://github.com/vector-im/riot-web/issues/9324 Requires https://github.com/matrix-org/matrix-react-sdk/pull/2848 --- electron_app/src/webcontents-handler.js | 38 ++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/electron_app/src/webcontents-handler.js b/electron_app/src/webcontents-handler.js index 152361696e..a437f0fa14 100644 --- a/electron_app/src/webcontents-handler.js +++ b/electron_app/src/webcontents-handler.js @@ -1,5 +1,7 @@ -const {clipboard, nativeImage, Menu, MenuItem, shell} = require('electron'); +const {clipboard, nativeImage, Menu, MenuItem, shell, dialog} = require('electron'); const url = require('url'); +const fs = require('fs'); +const request = require('request'); const MAILTO_PREFIX = "mailto:"; @@ -47,6 +49,7 @@ function onLinkContextMenu(ev, params) { })); } + let addSaveAs = false; if (params.mediaType && params.mediaType === 'image' && !url.startsWith('file://')) { popupMenu.append(new MenuItem({ label: 'Copy image', @@ -58,6 +61,10 @@ function onLinkContextMenu(ev, params) { } }, })); + + // We want the link to be ordered below the copy stuff, but don't want to duplicate + // the `if` statement, so use a flag. + addSaveAs = true; } // No point offering to copy a blob: URL either @@ -79,6 +86,35 @@ function onLinkContextMenu(ev, params) { })); } } + + if (addSaveAs) { + popupMenu.append(new MenuItem({ + label: 'Save image as...', + click() { + const targetFileName = params.titleText || "image.png"; + const filePath = dialog.showSaveDialog({ + defaultPath: targetFileName, + }); + + try { + if (url.startsWith("data:")) { + fs.writeFileSync(filePath, nativeImage.createFromDataURL(url)); + } else { + request.get(url).pipe(fs.createWriteStream(filePath)); + } + + } catch (err) { + console.error(err); + dialog.showMessageBox({ + type: "error", + title: "Failed to save image", + message: "The image failed to save", + }); + } + }, + })); + } + // popup() requires an options object even for no options popupMenu.popup({}); ev.preventDefault(); From 51f6d02cf1fb8d038dc12cc603cd7d98d720d657 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 1 Apr 2019 13:52:11 +0100 Subject: [PATCH 6/9] Released js-sdk & react-sdk, and bump electron version --- package.json | 6 +++--- yarn.lock | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index ade30d9e7c..63fd0919b8 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": "^1.0.3-rc.1", - "matrix-react-sdk": "^1.0.6-rc.1", + "matrix-js-sdk": "1.0.3", + "matrix-react-sdk": "1.0.6", "modernizr": "^3.6.0", "olm": "https://matrix.org/packages/npm/olm/olm-3.1.0-pre1.tgz", "prop-types": "^15.6.2", @@ -150,7 +150,7 @@ }, "build": { "appId": "im.riot.app", - "electronVersion": "4.0.8", + "electronVersion": "4.1.3", "files": [ "node_modules/**", "src/**", diff --git a/yarn.lock b/yarn.lock index 7b37e0d350..3091fb327c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5732,10 +5732,10 @@ math-random@^1.0.1: resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= -matrix-js-sdk@^1.0.3-rc.1: - version "1.0.3-rc.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-1.0.3-rc.1.tgz#61dea7fc2efd6f0a23e709443b4ac6a276890e9a" - integrity sha512-31aFwoAR9AIWhqHgJCYplXVFbaykXydm7GBvM/ffCjzN5OgAQEzUqwX18PfWKHVZHqijtj2VZOqnBVsXLX0w6Q== +matrix-js-sdk@1.0.3, matrix-js-sdk@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-1.0.3.tgz#d4cc46c4dc80278b78f8e0664741b08fcc395c79" + integrity sha512-YpF4NvnG2cttRmTPJ9yqs/KwlBXW15O7+nNMs1FKj1CqdW1Phwb0fcqvahjPgmfXyn5DFzU3Deiv9aNgDIlIog== dependencies: another-json "^0.2.0" babel-runtime "^6.26.0" @@ -5757,10 +5757,10 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -matrix-react-sdk@^1.0.6-rc.1: - version "1.0.6-rc.1" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-1.0.6-rc.1.tgz#349882288d668258bf04c76fa63a07e8d533bb7b" - integrity sha512-ulbvL7Cp7jJASL5tOMfrJJ95A0oNPQueaA8CDOmsa9Fu7O6sF415hTxQflO4xPYz/7BAs3jrExgMXpY48U5VHg== +matrix-react-sdk@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-1.0.6.tgz#5477cb6f20a5968394e46f55cd4345436fba6372" + integrity sha512-qu+BY0I6qu2py8lzOZRPY2xOabXRrU/87dotx6MhyzWFKw+xQav0EggZJeKYtCAvuafS2zpPscTZX0/11Z3MuA== dependencies: babel-plugin-syntax-dynamic-import "^6.18.0" babel-runtime "^6.26.0" @@ -5786,7 +5786,7 @@ matrix-react-sdk@^1.0.6-rc.1: linkifyjs "^2.1.6" lodash "^4.13.1" lolex "2.3.2" - matrix-js-sdk "^1.0.3-rc.1" + matrix-js-sdk "1.0.3" optimist "^0.6.1" pako "^1.0.5" prop-types "^15.5.8" From 2bac72fa3628ed206508ba0b7f1231caaa33de5b Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 1 Apr 2019 13:53:18 +0100 Subject: [PATCH 7/9] v1.0.6 --- 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 a12173692a..c51a7abb71 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": "1.0.6-rc.1", + "version": "1.0.6", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From 3265f84266e35089e3701fd3dc9388c50a9ed21b Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 1 Apr 2019 13:55:12 +0100 Subject: [PATCH 8/9] Prepare changelog for v1.0.6 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98e861966b..90a4cf98b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Changes in [1.0.6](https://github.com/vector-im/riot-web/releases/tag/v1.0.6) (2019-04-01) +========================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.6-rc.1...v1.0.6) + + * Add "Save image as..." button to context menu on images + [\#9327](https://github.com/vector-im/riot-web/pull/9327) + Changes in [1.0.6-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.6-rc.1) (2019-03-27) ==================================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.5...v1.0.6-rc.1) From 164a0e0160b384a43aeed5d61b7a149e669f12f5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 1 Apr 2019 13:55:12 +0100 Subject: [PATCH 9/9] v1.0.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 63fd0919b8..630edfd663 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "1.0.6-rc.1", + "version": "1.0.6", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": {