Merge branch 'develop' into matthew/roomsettings2

This commit is contained in:
Matthew Hodgson 2016-01-13 17:33:32 +00:00
commit 68f846e129
7 changed files with 90 additions and 9 deletions

View File

@ -1,4 +1,4 @@
{ {
"default_hs_url": "https://matrix.org", "default_hs_url": "http://localhost:8008",
"default_is_url": "https://vector.im" "default_is_url": "https://vector.im"
} }

View File

@ -56,17 +56,27 @@ module.exports = React.createClass({
}); });
}, },
joinRoom: function(roomId) { joinRoom: function(roomId, shouldPeek) {
var self = this; var self = this;
self.setState({ loading: true }); 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({ dis.dispatch({
action: 'view_room', action: 'view_room',
room_id: roomId room_id: roomId
}); });
}, function(err) { }, function(err) {
console.error("Failed to join room: %s", JSON.stringify(err)); console.error("Failed to join room: %s", JSON.stringify(err));
console.error(err);
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Failed to join room", title: "Failed to join room",
@ -87,13 +97,34 @@ module.exports = React.createClass({
}); });
var rows = []; var rows = [];
var self = this; var self = this;
var guestRead, guestJoin;
for (var i = 0; i < rooms.length; i++) { for (var i = 0; i < rooms.length; i++) {
var name = rooms[i].name || rooms[i].aliases[0]; var name = rooms[i].name || rooms[i].aliases[0];
guestRead = null;
guestJoin = null;
var shouldPeek = false;
if (rooms[i].world_readable) {
guestRead = (
<img src="img/members.svg"
alt="World Readable" title="World Readable" width="12" height="12" />
);
if (MatrixClientPeg.get().isGuest() && !rooms[i].guest_can_join) {
shouldPeek = true;
}
}
if (rooms[i].guest_can_join) {
guestJoin = (
<img src="img/leave.svg"
alt="Guests can join" title="Guests can join" width="12" height="12" />
);
}
// <img src={ MatrixClientPeg.get().getAvatarUrlForRoom(rooms[i].room_id, 40, 40, "crop") } width="40" height="40" alt=""/> // <img src={ MatrixClientPeg.get().getAvatarUrlForRoom(rooms[i].room_id, 40, 40, "crop") } width="40" height="40" alt=""/>
rows.unshift( rows.unshift(
<tbody key={ rooms[i].room_id }> <tbody key={ rooms[i].room_id }>
<tr onClick={self.joinRoom.bind(null, rooms[i].room_id)}> <tr onClick={self.joinRoom.bind(null, rooms[i].room_id, shouldPeek)}>
<td className="mx_RoomDirectory_name">{ name }</td> <td className="mx_RoomDirectory_name">{ name } {guestRead} {guestJoin}</td>
<td>{ rooms[i].aliases[0] }</td> <td>{ rooms[i].aliases[0] }</td>
<td>{ rooms[i].num_joined_members }</td> <td>{ rooms[i].num_joined_members }</td>
</tr> </tr>

View File

@ -164,9 +164,17 @@ limitations under the License.
margin-bottom: 12px; margin-bottom: 12px;
} }
li.mx_RoomView_myReadMarker_container {
height: 0px;
margin: 0px;
padding: 0px;
border: 0px;
}
hr.mx_RoomView_myReadMarker { hr.mx_RoomView_myReadMarker {
border-top: solid 1px #76cfa6; border-top: solid 1px #76cfa6;
border-bottom: none; border-bottom: solid 1px #76cfa6;
margin-top: 0px;
} }
.mx_RoomView_statusArea { .mx_RoomView_statusArea {

View File

@ -105,6 +105,15 @@ limitations under the License.
color: #4a4a4a; color: #4a4a4a;
} }
.mx_Login_forgot {
font-size: 13px;
opacity: 0.8;
}
.mx_Login_forgot:link {
color: #4a4a4a;
}
.mx_Login_loader { .mx_Login_loader {
position: absolute; position: absolute;
left: 50%; left: 50%;

View File

@ -135,8 +135,8 @@ limitations under the License.
z-index: 1; z-index: 1;
position: relative; position: relative;
width: 90px; 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-right: 10px;
margin-top: -6px;
} }
.mx_EventTile .mx_MessageTimestamp { .mx_EventTile .mx_MessageTimestamp {

View File

@ -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;
}

View File

@ -155,7 +155,8 @@ function loadApp() {
registrationUrl={makeRegistrationUrl()} registrationUrl={makeRegistrationUrl()}
ConferenceHandler={VectorConferenceHandler} ConferenceHandler={VectorConferenceHandler}
config={configJson} config={configJson}
startingQueryParams={parseQsFromFragment(window.location)} />, startingQueryParams={parseQsFromFragment(window.location)}
enableGuest={true} />,
document.getElementById('matrixchat') document.getElementById('matrixchat')
); );
} }