From 9a7f5388d9efe074ee65136eccd8a9b9208d6cfd Mon Sep 17 00:00:00 2001 From: Aviral Dasgupta Date: Wed, 17 Aug 2016 17:27:01 +0530 Subject: [PATCH 01/31] Update autocomplete design --- .../views/rooms/Autocomplete.css | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/Autocomplete.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/Autocomplete.css index 40a08ee2..2deded9c 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/Autocomplete.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/Autocomplete.css @@ -4,7 +4,7 @@ z-index: 1000; width: 100%; border: 1px solid #e5e5e5; - background: rgba(255, 255, 255, 0.9); + background: white; border-bottom: none; border-radius: 4px 4px 0 0; max-height: 50vh; @@ -12,56 +12,58 @@ } .mx_Autocomplete_ProviderSection { - padding: 12px; border-bottom: 1px solid #e5e5e5; } -.mx_Autocomplete_ProviderSection * { - padding: 2px; - border-radius: 4px; +.mx_Autocomplete_Completion_container_pill { + margin: 12px; + display: flex; } -.mx_Autocomplete_Completion { +/* a "block" completion takes up a whole line */ +.mx_Autocomplete_Completion_block { + height: 34px; + display: flex; + padding: 0 12px; user-select: none; cursor: pointer; - transition: 0.3s all ease; - display: flex; align-items: center; + color: #4a4a4a; } -.mx_Autocomplete_Completion.selected * { - transition: 0.3s all ease; +.mx_Autocomplete_Completion_block * { + margin: 0 3px; +} + +.mx_Autocomplete_Completion_pill { + border-radius: 17px; + height: 34px; + display: flex; + user-select: none; + cursor: pointer; + align-items: center; + color: #4a4a4a; +} + +.mx_Autocomplete_Completion_pill * { + margin: 0 3px; +} + +/* container for pill-style completions */ +.mx_Autocomplete_Completion_container_pill { + margin: 12px; + display: flex; + flex-flow: wrap; } .mx_Autocomplete_Completion.selected { - background: #76cfa6; - color: white; + background: #f6f6f6; outline: none; } -.mx_Autocomplete_Completion.selected * { - color: white !important; -} - .mx_Autocomplete_provider_name { - color: #76cfa6; - font-weight: 600; -} - -.autocomplete-enter { - opacity: 0.01; -} - -.autocomplete-enter.autocomplete-enter-active { - opacity: 1; - transition: opacity 300ms ease-in; -} - -.autocomplete-leave { - opacity: 1; -} - -.autocomplete-leave.autocomplete-leave-active { - opacity: 0.01; - transition: opacity 300ms ease-in; + margin: 12px; + color: #454545; + font-weight: 400; + opacity: 0.4; } From be28a96d8d6bad9fcc113c20d07df63699892892 Mon Sep 17 00:00:00 2001 From: Aviral Dasgupta Date: Tue, 16 Aug 2016 03:30:26 +0530 Subject: [PATCH 02/31] add fancy changelog dialog --- package.json | 3 +- src/component-index.js | 1 + .../views/dialogs/ChangelogDialog.js | 83 +++++++++++++++++++ src/components/views/globals/NewVersionBar.js | 42 +++++++--- .../views/dialogs/ChangelogDialog.css | 20 +++++ 5 files changed, 135 insertions(+), 14 deletions(-) create mode 100644 src/components/views/dialogs/ChangelogDialog.js create mode 100644 src/skins/vector/css/vector-web/views/dialogs/ChangelogDialog.css diff --git a/package.json b/package.json index be87139b..9e3450cd 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,8 @@ "react-gemini-scrollbar": "matrix-org/react-gemini-scrollbar#5e97aef", "sanitize-html": "^1.11.1", "ua-parser-js": "^0.7.10", - "url": "^0.11.0" + "url": "^0.11.0", + "whatwg-fetch": "^1.0.0" }, "devDependencies": { "babel": "^5.8.23", diff --git a/src/component-index.js b/src/component-index.js index b4c73a4b..dfe54993 100644 --- a/src/component-index.js +++ b/src/component-index.js @@ -37,6 +37,7 @@ module.exports.components['structures.ViewSource'] = require('./components/struc module.exports.components['views.context_menus.MessageContextMenu'] = require('./components/views/context_menus/MessageContextMenu'); module.exports.components['views.context_menus.NotificationStateContextMenu'] = require('./components/views/context_menus/NotificationStateContextMenu'); module.exports.components['views.context_menus.RoomTagContextMenu'] = require('./components/views/context_menus/RoomTagContextMenu'); +module.exports.components['views.dialogs.ChangelogDialog'] = require('./components/views/dialogs/ChangelogDialog'); module.exports.components['views.elements.ImageView'] = require('./components/views/elements/ImageView'); module.exports.components['views.elements.Spinner'] = require('./components/views/elements/Spinner'); module.exports.components['views.globals.GuestWarningBar'] = require('./components/views/globals/GuestWarningBar'); diff --git a/src/components/views/dialogs/ChangelogDialog.js b/src/components/views/dialogs/ChangelogDialog.js new file mode 100644 index 00000000..96ae6365 --- /dev/null +++ b/src/components/views/dialogs/ChangelogDialog.js @@ -0,0 +1,83 @@ +/* + Copyright 2016 Aviral Dasgupta + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import React from 'react'; +import sdk from 'matrix-react-sdk'; +import 'whatwg-fetch'; + +const REPOS = ['vector-im/vector-web', 'matrix-org/matrix-react-sdk', 'matrix-org/matrix-js-sdk']; + +export default class ChangelogDialog extends React.Component { + constructor(props) { + super(props); + + this.state = {}; + } + + componentDidMount() { + console.log(this.props); + const version = this.props.newVersion; + const version2 = this.props.version; + if(version == null || version2 == null) return; + for(let i=0; i response.json()) + .then(json => this.setState({[REPOS[i]]: json.commits})); + + } + } + + render() { + const Spinner = sdk.getComponent('views.elements.Spinner'); + const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog'); + + const logs = REPOS.map(repo => { + if (this.state[repo] == null) return ; + return ( +
+

{repo}

+ {this.state[repo].map(commit => + + )} +
+ ) + }); + + const content = ( +
+ {this.props.version == null || this.props.newVersion == null ?

Unavailable

: logs} +
+ ); + + + return ( + + ) + } +} + +ChangelogDialog.propTypes = { + version: React.PropTypes.string.isRequired, + newVersion: React.PropTypes.string.isRequired, + onFinished: React.PropTypes.func.isRequired, +}; diff --git a/src/components/views/globals/NewVersionBar.js b/src/components/views/globals/NewVersionBar.js index 83dccf5d..62d755a6 100644 --- a/src/components/views/globals/NewVersionBar.js +++ b/src/components/views/globals/NewVersionBar.js @@ -17,20 +17,36 @@ limitations under the License. 'use strict'; var React = require('react'); -var sdk = require('matrix-react-sdk') +var sdk = require('matrix-react-sdk'); +import Modal from 'matrix-react-sdk/lib/Modal'; -module.exports = React.createClass({ - displayName: 'NewVersionBar', +export default function NewVersionBar(props) { + const onChangelogClicked = () => { + const ChangelogDialog = sdk.getComponent('dialogs.ChangelogDialog'); + console.log(props); + Modal.createDialog(ChangelogDialog, { + version: props.version, + newVersion: props.newVersion, + onFinished: (update) => { + if(update) { + window.location.reload(); + } + } + }); + }; - render: function() { - return ( -
- /!\ -
- A new version of Vector is available. Refresh your browser. -
+ return ( +
+ /!\ +
+ A new version of Vector is available. Refresh your browser.
- ); - } -}); + +
+ ); +} +NewVersionBar.propTypes = { + version: React.PropTypes.string.isRequired, + newVersion: React.PropTypes.string.isRequired, +}; \ No newline at end of file diff --git a/src/skins/vector/css/vector-web/views/dialogs/ChangelogDialog.css b/src/skins/vector/css/vector-web/views/dialogs/ChangelogDialog.css new file mode 100644 index 00000000..37b865d9 --- /dev/null +++ b/src/skins/vector/css/vector-web/views/dialogs/ChangelogDialog.css @@ -0,0 +1,20 @@ +/* +Copyright 2016 Aviral Dasgupta + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_ChangelogDialog_content { + max-height: 300px; + overflow: auto; +} From 56813eb11ed4fdecf3c676272b75e5824316ff3a Mon Sep 17 00:00:00 2001 From: Aviral Dasgupta Date: Fri, 19 Aug 2016 00:24:00 +0530 Subject: [PATCH 03/31] remove whatwg-fetch and use browser-request --- package.json | 3 +-- src/components/views/dialogs/ChangelogDialog.js | 14 +++++++------- src/components/views/globals/NewVersionBar.js | 6 +++--- .../css/vector-web/views/globals/MatrixToolbar.css | 4 ++++ 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 9e3450cd..be87139b 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,7 @@ "react-gemini-scrollbar": "matrix-org/react-gemini-scrollbar#5e97aef", "sanitize-html": "^1.11.1", "ua-parser-js": "^0.7.10", - "url": "^0.11.0", - "whatwg-fetch": "^1.0.0" + "url": "^0.11.0" }, "devDependencies": { "babel": "^5.8.23", diff --git a/src/components/views/dialogs/ChangelogDialog.js b/src/components/views/dialogs/ChangelogDialog.js index 96ae6365..823c205b 100644 --- a/src/components/views/dialogs/ChangelogDialog.js +++ b/src/components/views/dialogs/ChangelogDialog.js @@ -17,6 +17,7 @@ import React from 'react'; import sdk from 'matrix-react-sdk'; import 'whatwg-fetch'; +import request from 'browser-request'; const REPOS = ['vector-im/vector-web', 'matrix-org/matrix-react-sdk', 'matrix-org/matrix-js-sdk']; @@ -28,17 +29,16 @@ export default class ChangelogDialog extends React.Component { } componentDidMount() { - console.log(this.props); - const version = this.props.newVersion; - const version2 = this.props.version; + const version = this.props.newVersion.split('-'); + const version2 = this.props.version.split('-'); if(version == null || version2 == null) return; for(let i=0; i response.json()) - .then(json => this.setState({[REPOS[i]]: json.commits})); - + request(`https://api.github.com/repos/${REPOS[i]}/compare/${oldVersion}...${newVersion}`, (a, b, body) => { + if(body == null) return; + this.setState({[REPOS[i]]: JSON.parse(body).commits}); + }); } } diff --git a/src/components/views/globals/NewVersionBar.js b/src/components/views/globals/NewVersionBar.js index 62d755a6..8d819323 100644 --- a/src/components/views/globals/NewVersionBar.js +++ b/src/components/views/globals/NewVersionBar.js @@ -23,7 +23,7 @@ import Modal from 'matrix-react-sdk/lib/Modal'; export default function NewVersionBar(props) { const onChangelogClicked = () => { const ChangelogDialog = sdk.getComponent('dialogs.ChangelogDialog'); - console.log(props); + Modal.createDialog(ChangelogDialog, { version: props.version, newVersion: props.newVersion, @@ -38,10 +38,10 @@ export default function NewVersionBar(props) { return (
/!\ -
+
A new version of Vector is available. Refresh your browser.
- +
); } diff --git a/src/skins/vector/css/vector-web/views/globals/MatrixToolbar.css b/src/skins/vector/css/vector-web/views/globals/MatrixToolbar.css index a8297f46..4e214e11 100644 --- a/src/skins/vector/css/vector-web/views/globals/MatrixToolbar.css +++ b/src/skins/vector/css/vector-web/views/globals/MatrixToolbar.css @@ -54,3 +54,7 @@ limitations under the License. float: right; margin-right: 10px; } + +.mx_MatrixToolbar_action { + margin-right: 16px; +} From 554c33a883418fdcc5295351c81e6178e7d2f7d1 Mon Sep 17 00:00:00 2001 From: Aviral Dasgupta Date: Tue, 23 Aug 2016 00:36:01 +0530 Subject: [PATCH 04/31] Extract autocomplete styling to CSS --- .../css/matrix-react-sdk/views/rooms/Autocomplete.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/Autocomplete.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/Autocomplete.css index 2deded9c..6d611b5e 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/Autocomplete.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/Autocomplete.css @@ -67,3 +67,13 @@ font-weight: 400; opacity: 0.4; } + +/* styling for common completion elements */ +.mx_Autocomplete_Completion_subtitle { + font-style: italic; + flex: 1; +} + +.mx_Autocomplete_Completion_description { + color: gray; +} From 3ea62eb73a676d7a512734b9451204a49f729df6 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Tue, 23 Aug 2016 15:57:53 +0100 Subject: [PATCH 05/31] Added event/info message avatars back in --- .../vector/css/matrix-react-sdk/views/rooms/EventTile.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css index 9534d9f5..927a4f0e 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css @@ -34,6 +34,11 @@ limitations under the License. z-index: 2; } +.mx_EventTile.mx_EventTile_info .mx_EventTile_avatar { + top: 8px; + left: 44px; +} + .mx_EventTile_continuation { padding-top: 0px ! important; } From f2936dc15ca78078b1f1fb7258def5f40d541192 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 23 Aug 2016 18:07:07 +0100 Subject: [PATCH 06/31] Update encryption info in README --- README.md | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a940da64..ee60bce7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Getting Started The easiest way to test Vector is to just use the hosted copy at https://vector.im/beta. The develop branch is continuously deployed by Jenkins at https://vector.im/develop for -those who like living dangerously. +those who like living dangerously. To host your own copy of Vector, the quickest bet is to use a pre-built released version of Vector: @@ -55,7 +55,7 @@ You can configure the app by copying `vector/config.sample.json` to for verifying third party identifiers like email addresses). If this is blank, registering with an email address, adding an email address to your account, or inviting users via email address will not work. Matrix identity servers are - very simple web services which map third party identifiers (currently only email + very simple web services which map third party identifiers (currently only email addresses) to matrix IDs: see http://matrix.org/docs/spec/identity_service/unstable.html for more details. Currently the only public matrix identity servers are https://matrix.org and https://vector.im. In future identity servers will be decentralised. @@ -216,20 +216,13 @@ day-to-day use; it is experimental and should be considered only as a proof-of-concept. See https://matrix.org/jira/browse/SPEC-162 for an overview of the current progress. -Vector is built with support for end-to-end encryption by default. - -To enable encryption for a room, type - -``` -/encrypt on -``` - -in the message bar in that room. Vector will then generate a set of keys, and -encrypt all outgoing messages in that room. (Note that other people in that -room will send messages in the clear unless they also `/encrypt on`.) +To enable the (very experimental) support, check the 'End-to-End Encryption' +box in the 'Labs' section of the user settings (note that the labs are disabled +on http://vector.im/beta: you will need to use http://vector.im/develop or your +own deployment of vector). The Room Settings dialog will then show an +'Encryption' setting; rooms for which you are an administrator will offer you +the option of enabling encryption. Any messages sent in that room will then be +encrypted. Note that historical encrypted messages cannot currently be decoded - history is therefore lost when the page is reloaded. - -There is currently no visual indication of whether encryption is enabled for a -room. From 0c99c5563fc336b116ac872ed59e0c5fa9aee1e2 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 25 Aug 2016 11:56:49 +0100 Subject: [PATCH 07/31] Add .travis.yml --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..9d6a1143 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - node # Latest stable version of nodejs. From d87cf6c02b4b1e70cee8f145ca6d100a3078a4ca Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 25 Aug 2016 12:12:20 +0100 Subject: [PATCH 08/31] Transpile the react-sdk before running travis tests --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9d6a1143..fcd07298 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ language: node_js node_js: - node # Latest stable version of nodejs. +install: + - npm install + - (cd node_modules/matrix-react-sdk && npm run build) From 042a6b58c43696f4d0cca4b23cbb74a9fb08729f Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 25 Aug 2016 12:14:49 +0100 Subject: [PATCH 09/31] Remove redundant whatwg import This has been rewritten to use browser-request rather than whatwg, so remove the import, which was causing the build to fail on npm 2. (It worked, for the wrong reasons, on npm 3.) --- src/components/views/dialogs/ChangelogDialog.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/views/dialogs/ChangelogDialog.js b/src/components/views/dialogs/ChangelogDialog.js index 823c205b..ea32a756 100644 --- a/src/components/views/dialogs/ChangelogDialog.js +++ b/src/components/views/dialogs/ChangelogDialog.js @@ -16,7 +16,6 @@ import React from 'react'; import sdk from 'matrix-react-sdk'; -import 'whatwg-fetch'; import request from 'browser-request'; const REPOS = ['vector-im/vector-web', 'matrix-org/matrix-react-sdk', 'matrix-org/matrix-js-sdk']; From df026aede2982ffd6ffa710396d61915551a46f9 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 25 Aug 2016 14:25:05 +0100 Subject: [PATCH 10/31] Switch to node 6 ... because 4 is ooold, and I'd like to use the same version on travis. --- jenkins.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins.sh b/jenkins.sh index f60bec38..2f9d8ce5 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -4,7 +4,7 @@ set -e export NVM_DIR="/home/jenkins/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" -nvm use 4 +nvm use 6 set -x From ebad3da6dd98dc4046687263c8bbdc1893d4aa37 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 25 Aug 2016 14:26:56 +0100 Subject: [PATCH 11/31] Use node v6 for travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fcd07298..1fbc4dcc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - node # Latest stable version of nodejs. + - 6 # node v6, to match jenkins install: - npm install - (cd node_modules/matrix-react-sdk && npm run build) From abca5faf78083e2b4e20c5f8d6cdc0485202882b Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 25 Aug 2016 18:30:27 +0100 Subject: [PATCH 12/31] pin linkifyjs to precisely 2.0.0-beta4, as 2.0.0-beta9 breaks links as per https://github.com/vector-im/vector-web/issues/2010 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be87139b..4ecbbea1 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "gemini-scrollbar": "matrix-org/gemini-scrollbar#b302279", "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", - "linkifyjs": "^2.0.0-beta.4", + "linkifyjs": "2.0.0-beta.4", "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", "matrix-react-sdk": "matrix-org/matrix-react-sdk#develop", "modernizr": "^3.1.0", From c6d4eb7fd3f593a746c9142db0c1cd33e7b58ae0 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 26 Aug 2016 00:40:21 +0100 Subject: [PATCH 13/31] try to make the changelog commit links suck less --- src/components/views/dialogs/ChangelogDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/ChangelogDialog.js b/src/components/views/dialogs/ChangelogDialog.js index ea32a756..d54fe946 100644 --- a/src/components/views/dialogs/ChangelogDialog.js +++ b/src/components/views/dialogs/ChangelogDialog.js @@ -51,7 +51,7 @@ export default class ChangelogDialog extends React.Component {

{repo}

{this.state[repo].map(commit => - + )}
) From 2f375e4f6775239894b44f71c418b78cba4e8144 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 26 Aug 2016 16:08:15 +0100 Subject: [PATCH 14/31] DIE ZALGO --- src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css index 927a4f0e..432bdc28 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css @@ -55,6 +55,7 @@ limitations under the License. color: #454545; opacity: 0.5; font-size: 14px; + display: block; /* anti-zalgo, with overflow hidden */ overflow-y: hidden; cursor: pointer; padding-left: 65px; /* left gutter */ From be9aa44ca8ab359652c2efb0c5331d74feab1ba2 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 26 Aug 2016 23:49:07 +0100 Subject: [PATCH 15/31] fix NPE checking tag order --- src/components/structures/RoomSubList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 74ddb879..45e47131 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -354,7 +354,7 @@ var RoomSubList = React.createClass({ // is run with historical room tag data, after that there should only be undefined // in the list at a time anyway. for (let i = 0; i < list.length; i++) { - if (list[i].tags[self.props.tagName].order === undefined) { + if (list[i].tags[self.props.tagName] && list[i].tags[self.props.tagName].order === undefined) { MatrixClientPeg.get().setRoomTag(list[i].roomId, self.props.tagName, {order: (order + 1.0) / 2.0}).finally(function() { // Do any final stuff here }).fail(function(err) { From 30f774cf9cb2e8af1b512dcab272b4f4659204ff Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 Aug 2016 00:00:09 +0100 Subject: [PATCH 16/31] add whitespace padding to composer RHS --- .../vector/css/matrix-react-sdk/views/rooms/MessageComposer.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/MessageComposer.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/MessageComposer.css index b1fbd294..9dd93b80 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/MessageComposer.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/MessageComposer.css @@ -63,6 +63,7 @@ limitations under the License. align-items: center; overflow: auto; font-size: 14px; + margin-right: 6px; } .mx_MessageComposer_input_rte { border-top: 2px solid #76cfa6; /* placeholder RTE indicator */ From 2199fe5cbf34f975d59e76b68e3efcf898a47d7b Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 Aug 2016 00:06:00 +0100 Subject: [PATCH 17/31] unbreak changelog --- src/components/views/dialogs/ChangelogDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/ChangelogDialog.js b/src/components/views/dialogs/ChangelogDialog.js index d54fe946..ea32a756 100644 --- a/src/components/views/dialogs/ChangelogDialog.js +++ b/src/components/views/dialogs/ChangelogDialog.js @@ -51,7 +51,7 @@ export default class ChangelogDialog extends React.Component {

{repo}

{this.state[repo].map(commit => - + )}
) From efc54621317861964dcc62698657e39cf3718c2d Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 Aug 2016 00:13:20 +0100 Subject: [PATCH 18/31] warn people to put their Matrix HS on a separate domain --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index ee60bce7..85218394 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,19 @@ of Vector: as desired. See below for details. 1. Enter the URL into your browser and log into vector! +Important Security Note +======================= + +We do not recommend running Vector from the same domain name as your Matrix +homeserver. The reason is the risk of XSS (cross-site-scripting) vulnerabilities +that could occur if someone caused Vector to load and render malicious user generated +content from a Matrix API which then had trusted access to Vector due +to sharing the same domain. + +We have put some coarse mitigations into place to try to protect against this situation, +but it's still not good practice to do it in the first place. +See https://github.com/vector-im/vector-web/issues/1977 for more details. + Building From Source ==================== From e06caa9ca12a529460ba3d076c7c8c0cc8dcc8a3 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 Aug 2016 00:13:56 +0100 Subject: [PATCH 19/31] mention not just a problem for Vector --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 85218394..0dc17b90 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Important Security Note We do not recommend running Vector from the same domain name as your Matrix homeserver. The reason is the risk of XSS (cross-site-scripting) vulnerabilities that could occur if someone caused Vector to load and render malicious user generated -content from a Matrix API which then had trusted access to Vector due +content from a Matrix API which then had trusted access to Vector (or other apps) due to sharing the same domain. We have put some coarse mitigations into place to try to protect against this situation, From 881739b478f540bc9bc80127df01a8522e27066a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 Aug 2016 01:54:19 +0100 Subject: [PATCH 20/31] try to unbreak jenkins >:( --- jenkins.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jenkins.sh b/jenkins.sh index 2f9d8ce5..3a4ee0c7 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -10,6 +10,9 @@ set -x npm install +# apparently npm 3.10.3 on node 6.4.0 doesn't upgrade #develop target with npm install unless explicitly asked. +npm install matrix-react-sdk matrix-js-sdk + # we may be using a dev branch of react-sdk, in which case we need to build it (cd node_modules/matrix-react-sdk && npm run build) From 13983900c0e59378e92d9578b247fac76ed93afe Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 Aug 2016 22:21:52 +0100 Subject: [PATCH 21/31] clarify electron instructions --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0dc17b90..aff57eb9 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,9 @@ nativefier https://vector.im/beta/ ``` krisa has a dedicated electron project at https://github.com/krisak/vector-electron-desktop -(although you should swap out the 'vector' folder for the latest vector tarball you want to run) +(although you should swap out the 'vector' folder for the latest vector tarball you want to run. +Get a tarball from https://vector.im/packages or build your own - see Building From Source +above). There's also a (much) older electron distribution at https://github.com/stevenhammerton/vector-desktop From ee1fae8ceda3216e9d00a0a0a286f71f0bcb88f4 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 Aug 2016 23:58:35 +0100 Subject: [PATCH 22/31] fix RoomTagContextMenu so it works on historical rooms --- .../views/context_menus/RoomTagContextMenu.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/components/views/context_menus/RoomTagContextMenu.js b/src/components/views/context_menus/RoomTagContextMenu.js index 776f9522..3637a3a5 100644 --- a/src/components/views/context_menus/RoomTagContextMenu.js +++ b/src/components/views/context_menus/RoomTagContextMenu.js @@ -126,6 +126,25 @@ module.exports = React.createClass({ }; }, + _onClickForget: function() { + // FIXME: duplicated with RoomSettings (and dead code in RoomView) + MatrixClientPeg.get().forget(this.props.room.roomId).done(function() { + dis.dispatch({ action: 'view_next_room' }); + }, function(err) { + var errCode = err.errcode || "unknown error code"; + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + Modal.createDialog(ErrorDialog, { + title: "Error", + description: `Failed to forget room (${errCode})` + }); + }); + + // Close the context menu + if (this.props.onFinished) { + this.props.onFinished(); + }; + }, + render: function() { var myUserId = MatrixClientPeg.get().credentials.userId; var myMember = this.props.room.getMember(myUserId); @@ -148,6 +167,17 @@ module.exports = React.createClass({ 'mx_RoomTagContextMenu_fieldDisabled': false, }); + if (myMember && myMember.membership === "leave") { + return ( +
+
+ + Forget +
+
+ ); + } + return (
From 8d7daf61b96edd1b57431fab905979cb404c74c8 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 Aug 2016 23:59:15 +0100 Subject: [PATCH 23/31] fix CSS namespacing --- src/skins/vector/css/common.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/skins/vector/css/common.css b/src/skins/vector/css/common.css index afca0214..64cf4d6d 100644 --- a/src/skins/vector/css/common.css +++ b/src/skins/vector/css/common.css @@ -251,7 +251,7 @@ input[type=text]:focus, textarea:focus { background-color: #fff; } -.emojione { +.mx_emojione { height: 1em; vertical-align: middle; } @@ -267,7 +267,7 @@ input[type=text]:focus, textarea:focus { } /** green button with rounded corners */ -.textButton { +.mx_textButton { color: #fff; background-color: #76cfa6; border-radius: 17px; From 88dba1bf6c06e842081c4cea0df7af1e88e3eb65 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 Aug 2016 23:59:26 +0100 Subject: [PATCH 24/31] CSS for room settings leave button --- .../matrix-react-sdk/views/rooms/RoomSettings.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomSettings.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomSettings.css index 449b9819..68f02f7c 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomSettings.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomSettings.css @@ -19,6 +19,21 @@ limitations under the License. margin-bottom: 20px; } +.mx_RoomSettings_leaveButton { + height: 36px; + background-color: #76cfa6; + border-radius: 36px; + margin-right: 8px; + color: #fff; + line-height: 34px; + text-align: center; + float: right; + cursor: pointer; + padding-left: 12px; + padding-right: 12px; + margin-right: 32px; +} + .mx_RoomSettings_powerLevels { display: table; } From 9b8e127e23689243dc4f95980fafbe0cfbc9f1ca Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 28 Aug 2016 02:11:57 +0100 Subject: [PATCH 25/31] switch to using matrix.to for permalinks --- src/components/views/context_menus/MessageContextMenu.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 401c0c6c..737b7faa 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -133,12 +133,11 @@ module.exports = React.createClass({ } } - // XXX: this should be https://matrix.to. // XXX: if we use room ID, we should also include a server where the event can be found (other than in the domain of the event ID) permalinkButton = ( ); From 36a608952db512c70a289a731f68034115c39f65 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 28 Aug 2016 14:04:25 +0100 Subject: [PATCH 26/31] make /user URLs work --- src/components/structures/RightPanel.js | 34 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index ca9376e1..4ca3dded 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -17,7 +17,8 @@ limitations under the License. 'use strict'; var React = require('react'); -var sdk = require('matrix-react-sdk') +var sdk = require('matrix-react-sdk'); +var Matrix = require("matrix-js-sdk"); var dis = require('matrix-react-sdk/lib/dispatcher'); var MatrixClientPeg = require("matrix-react-sdk/lib/MatrixClientPeg"); var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc'); @@ -45,8 +46,17 @@ module.exports = React.createClass({ }, getInitialState: function() { - return { - phase : this.Phase.MemberList + if (this.props.userId) { + var member = new Matrix.RoomMember(null, this.props.userId); + return { + phase: this.Phase.MemberInfo, + member: member, + } + } + else { + return { + phase: this.Phase.MemberList + } } }, @@ -97,7 +107,7 @@ module.exports = React.createClass({ }); } } - if (payload.action === "view_room") { + else if (payload.action === "view_room") { if (this.state.phase === this.Phase.MemberInfo) { this.setState({ phase: this.Phase.MemberList @@ -145,15 +155,15 @@ module.exports = React.createClass({ { filesHighlight }
; + } - if (!this.props.collapsed) { - if(this.state.phase == this.Phase.MemberList) { - panel = - } - else if(this.state.phase == this.Phase.MemberInfo) { - var MemberInfo = sdk.getComponent('rooms.MemberInfo'); - panel = - } + if (!this.props.collapsed) { + if(this.props.roomId && this.state.phase == this.Phase.MemberList) { + panel = + } + else if(this.state.phase == this.Phase.MemberInfo) { + var MemberInfo = sdk.getComponent('rooms.MemberInfo'); + panel = } } From ef8f9ecbf3992baa7caf046021634ebc087bf0e6 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 28 Aug 2016 17:36:57 +0100 Subject: [PATCH 27/31] pin matrix-js-sdk and matrix-react-sdk deps for release --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4ecbbea1..070e84a6 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,8 @@ "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", "linkifyjs": "2.0.0-beta.4", - "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", - "matrix-react-sdk": "matrix-org/matrix-react-sdk#develop", + "matrix-js-sdk": "0.5.6", + "matrix-react-sdk": "0.6.5", "modernizr": "^3.1.0", "q": "^1.4.1", "react": "^15.2.1", From 05f8b49eec067d2c93c67391c1695f938c35506c Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 28 Aug 2016 18:07:32 +0100 Subject: [PATCH 28/31] Prepare changelog for v0.7.5 --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2103aad1..d49b77ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,34 @@ +Changes in [0.7.5](https://github.com/vector-im/vector-web/releases/tag/v0.7.5) (2016-08-28) +============================================================================================ +[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.4-r1...v0.7.5) + + * re-add leave button in RoomSettings + * add /user URLs + * recognise matrix.to links and other vector links + * fix linkify dependency + * fix avatar clicking in MemberInfo + * fix RoomTagContextMenu so it works on historical rooms + * warn people to put their Matrix HS on a separate domain to Vector + * fix zalgos again + * Add .travis.yml + [\#2007](https://github.com/vector-im/vector-web/pull/2007) + * add fancy changelog dialog + [\#1972](https://github.com/vector-im/vector-web/pull/1972) + * Update autocomplete design + [\#1978](https://github.com/vector-im/vector-web/pull/1978) + * Update encryption info in README + [\#2001](https://github.com/vector-im/vector-web/pull/2001) + * Added event/info message avatars back in + [\#2000](https://github.com/vector-im/vector-web/pull/2000) + * Wmwragg/chat message presentation + [\#1987](https://github.com/vector-im/vector-web/pull/1987) + * Make the notification slider work + [\#1982](https://github.com/vector-im/vector-web/pull/1982) + * Use cpx to copy olm.js, and add watcher + [\#1966](https://github.com/vector-im/vector-web/pull/1966) + * Make up a device display name + [\#1959](https://github.com/vector-im/vector-web/pull/1959) + Changes in [0.7.4-r1](https://github.com/vector-im/vector-web/releases/tag/v0.7.4-r1) (2016-08-12) ================================================================================================== [Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.4...v0.7.4-r1) From 45c013f2f2eb946c829cfbf98ce5f2cc5a75e302 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 28 Aug 2016 18:07:33 +0100 Subject: [PATCH 29/31] 0.7.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 070e84a6..2597ee58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vector-web", - "version": "0.7.4-r1", + "version": "0.7.5", "description": "Vector webapp", "author": "matrix.org", "repository": { From eb88245fe7984df38b7875102af8d820aa95dd5a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 28 Aug 2016 18:09:20 +0100 Subject: [PATCH 30/31] Prepare changelog for v0.7.5-r1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d49b77ec..83d60f7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [0.7.5-r1](https://github.com/vector-im/vector-web/releases/tag/v0.7.5-r1) (2016-08-28) +================================================================================================== +[Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.5...v0.7.5-r1) + + * Correctly pin deps :( + Changes in [0.7.5](https://github.com/vector-im/vector-web/releases/tag/v0.7.5) (2016-08-28) ============================================================================================ [Full Changelog](https://github.com/vector-im/vector-web/compare/v0.7.4-r1...v0.7.5) From 5f233d75f2c3a62c1df12014bb15123d282dc9f8 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 28 Aug 2016 18:09:20 +0100 Subject: [PATCH 31/31] 0.7.5-r1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2597ee58..7f1e8d92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vector-web", - "version": "0.7.5", + "version": "0.7.5-r1", "description": "Vector webapp", "author": "matrix.org", "repository": {