From 1a8a4728cd6929657efa9539b7ed007f54546054 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 7 Jan 2016 14:43:12 +0000 Subject: [PATCH 1/8] Enable guest access. Show r/w icons on room directory. --- src/components/structures/RoomDirectory.js | 19 ++++++++++++++++++- src/vector/index.js | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 0f90a0ac..80962af7 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -87,13 +87,30 @@ module.exports = React.createClass({ }); var rows = []; var self = this; + var guestRead, guestJoin; for (var i = 0; i < rooms.length; i++) { var name = rooms[i].name || rooms[i].aliases[0]; + guestRead = null; + guestJoin = null; + + if (rooms[i].world_readable) { + guestRead = ( + World Readable + ); + } + if (rooms[i].guest_can_join) { + guestJoin = ( + Guests can join + ); + } + // rows.unshift( - { name } + { name } {guestRead} {guestJoin} { rooms[i].aliases[0] } { rooms[i].num_joined_members } diff --git a/src/vector/index.js b/src/vector/index.js index 4c79f11d..13fcd4c6 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -154,7 +154,8 @@ function loadApp() { registrationUrl={makeRegistrationUrl()} ConferenceHandler={VectorConferenceHandler} config={configJson} - startingQueryParams={parseQsFromFragment(window.location)} />, + startingQueryParams={parseQsFromFragment(window.location)} + enableGuest={true} />, document.getElementById('matrixchat') ); } From a369c862a06496cd1ea624463161d37e0c40e3ce Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 7 Jan 2016 14:57:26 +0000 Subject: [PATCH 2/8] Hit MatrixClient.peekInRoom on rooms we can only peek into. --- src/components/structures/RoomDirectory.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 80962af7..ea2a7237 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -56,17 +56,27 @@ module.exports = React.createClass({ }); }, - joinRoom: function(roomId) { + joinRoom: function(roomId, shouldPeek) { var self = this; self.setState({ loading: true }); - // XXX: check that JS SDK suppresses duplicate attempts to join the same room - MatrixClientPeg.get().joinRoom(roomId).done(function() { + + var joinOrPeekPromise; + + if (shouldPeek) { + joinOrPeekPromise = MatrixClientPeg.get().peekInRoom(roomId); + } + else { + joinOrPeekPromise = MatrixClientPeg.get().joinRoom(roomId); + } + + joinOrPeekPromise.done(function() { dis.dispatch({ action: 'view_room', room_id: roomId }); }, function(err) { console.error("Failed to join room: %s", JSON.stringify(err)); + console.error(err); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to join room", @@ -92,12 +102,16 @@ module.exports = React.createClass({ var name = rooms[i].name || rooms[i].aliases[0]; guestRead = null; guestJoin = null; + var shouldPeek = false; if (rooms[i].world_readable) { guestRead = ( World Readable ); + if (MatrixClientPeg.get().isGuest() && !rooms[i].guest_can_join) { + shouldPeek = true; + } } if (rooms[i].guest_can_join) { guestJoin = ( @@ -109,7 +123,7 @@ module.exports = React.createClass({ // rows.unshift( - + { name } {guestRead} {guestJoin} { rooms[i].aliases[0] } { rooms[i].num_joined_members } From c02d9890c57edeb3d2634beb059ed668ce5e4ab3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Sat, 9 Jan 2016 00:09:11 +0000 Subject: [PATCH 3/8] New CSS for read markers --- .../css/matrix-react-sdk/structures/RoomView.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css b/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css index db68f441..710d6801 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css +++ b/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css @@ -164,9 +164,19 @@ limitations under the License. margin-bottom: 12px; } +li.mx_RoomView_myReadMarker_container { + height: 0px; + margin: 0px; + padding: 0px; + margin-bottom: -8px; + border: 0px; +} + hr.mx_RoomView_myReadMarker { border-top: solid 1px #76cfa6; border-bottom: none; + margin-top: -1px; + margin-bottom: 0px; } .mx_RoomView_statusArea { From 1e57aa8c783c563df65a356a2d2f90df333a379d Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 11 Jan 2016 10:52:29 +0000 Subject: [PATCH 4/8] Make read up to line 2px and position relative so we can shift it up a little --- .../vector/css/matrix-react-sdk/structures/RoomView.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css b/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css index 710d6801..2d8b3f15 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css +++ b/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css @@ -173,10 +173,12 @@ li.mx_RoomView_myReadMarker_container { } hr.mx_RoomView_myReadMarker { + position: relative; + top: -4px; border-top: solid 1px #76cfa6; - border-bottom: none; + border-bottom: solid 1px #76cfa6; margin-top: -1px; - margin-bottom: 0px; + margin-bottom: -1px; } .mx_RoomView_statusArea { From 6cd0aeb607f9bb96eb309b10af80df3fc1c33129 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 11 Jan 2016 10:56:08 +0000 Subject: [PATCH 5/8] Revert 4px offset: it ends up in the middle of the line above --- src/skins/vector/css/matrix-react-sdk/structures/RoomView.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css b/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css index 2d8b3f15..488f0f15 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css +++ b/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css @@ -173,8 +173,6 @@ li.mx_RoomView_myReadMarker_container { } hr.mx_RoomView_myReadMarker { - position: relative; - top: -4px; border-top: solid 1px #76cfa6; border-bottom: solid 1px #76cfa6; margin-top: -1px; From f706f75a6ea14225132be584b086dc1c3027b7ed Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 12 Jan 2016 14:11:00 +0000 Subject: [PATCH 6/8] Add css for room preview bar. --- .../views/rooms/RoomPreviewBar.css | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/skins/vector/css/matrix-react-sdk/views/rooms/RoomPreviewBar.css diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomPreviewBar.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomPreviewBar.css new file mode 100644 index 00000000..f68d7085 --- /dev/null +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomPreviewBar.css @@ -0,0 +1,32 @@ +/* +Copyright 2015, 2016 OpenMarket Ltd + +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_RoomPreviewBar { + text-align: center; +} + +.mx_RoomPreviewBar_preview_text { + color: #a4a4a4; +} + +.mx_RoomPreviewBar_join_text { + color: #ff0064; +} + +.mx_RoomPreviewBar_join_text a { + text-decoration: underline; + cursor: pointer; +} From 977b2239293e930f2bdf9e280b54a809baddef15 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 12 Jan 2016 14:20:05 +0000 Subject: [PATCH 7/8] Hopefully working CSS that doesn't cause the messages to jump about when a read marker disappears. --- config.json | 2 +- src/skins/vector/css/matrix-react-sdk/structures/RoomView.css | 4 +--- .../vector/css/matrix-react-sdk/views/rooms/EventTile.css | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/config.json b/config.json index 923d23ab..9834209a 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,4 @@ { - "default_hs_url": "https://matrix.org", + "default_hs_url": "http://localhost:8008", "default_is_url": "https://vector.im" } diff --git a/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css b/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css index 488f0f15..b4cd2c0c 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css +++ b/src/skins/vector/css/matrix-react-sdk/structures/RoomView.css @@ -168,15 +168,13 @@ li.mx_RoomView_myReadMarker_container { height: 0px; margin: 0px; padding: 0px; - margin-bottom: -8px; border: 0px; } hr.mx_RoomView_myReadMarker { border-top: solid 1px #76cfa6; border-bottom: solid 1px #76cfa6; - margin-top: -1px; - margin-bottom: -1px; + margin-top: 0px; } .mx_RoomView_statusArea { 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 440fd4ad..8ea76364 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 @@ -135,8 +135,8 @@ limitations under the License. z-index: 1; position: relative; width: 90px; + height: 1px; /* Hack to stop the height of this pushing the messages apart. Replaces marigin-top: -6px. This interacts better with a read marker being in between. Content overflows. */ margin-right: 10px; - margin-top: -6px; } .mx_EventTile .mx_MessageTimestamp { From 2bada93fdc58ee41b05056d3ce5e10d291880967 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 12 Jan 2016 16:39:29 +0000 Subject: [PATCH 8/8] CSS for forgot password link --- .../css/matrix-react-sdk/structures/login/Login.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/login/Login.css b/src/skins/vector/css/matrix-react-sdk/structures/login/Login.css index 80e5171b..5ee58004 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/login/Login.css +++ b/src/skins/vector/css/matrix-react-sdk/structures/login/Login.css @@ -105,6 +105,15 @@ limitations under the License. color: #4a4a4a; } +.mx_Login_forgot { + font-size: 13px; + opacity: 0.8; +} + +.mx_Login_forgot:link { + color: #4a4a4a; +} + .mx_Login_loader { position: absolute; left: 50%;