Merge branch 'develop' into rav/karma

This commit is contained in:
Richard van der Hoff 2016-04-13 16:16:26 +01:00
commit 438453e61a
9 changed files with 91 additions and 6 deletions

View file

@ -89,7 +89,7 @@ var LeftPanel = React.createClass({
var BottomLeftMenu = sdk.getComponent('structures.BottomLeftMenu'); var BottomLeftMenu = sdk.getComponent('structures.BottomLeftMenu');
var collapseButton; var collapseButton;
var classes = "mx_LeftPanel"; var classes = "mx_LeftPanel mx_fadable";
if (this.props.collapsed) { if (this.props.collapsed) {
classes += " collapsed"; classes += " collapsed";
} }
@ -109,7 +109,7 @@ var LeftPanel = React.createClass({
} }
return ( return (
<aside className={classes}> <aside className={classes} style={{ opacity: this.props.opacity }}>
{ collapseButton } { collapseButton }
{ callPreview } { callPreview }
<RoomList <RoomList

View file

@ -158,13 +158,13 @@ module.exports = React.createClass({
} }
var classes = "mx_RightPanel"; var classes = "mx_RightPanel mx_fadable";
if (this.props.collapsed) { if (this.props.collapsed) {
classes += " collapsed"; classes += " collapsed";
} }
return ( return (
<aside className={classes}> <aside className={classes} style={{ opacity: this.props.opacity }}>
<div className="mx_RightPanel_header"> <div className="mx_RightPanel_header">
{ buttonGroup } { buttonGroup }
</div> </div>

View file

@ -79,6 +79,17 @@ module.exports = React.createClass({
} }
var oob_data = {}; var oob_data = {};
if (room) { if (room) {
if (MatrixClientPeg.get().isGuest()) {
if (!room.world_readable && !room.guest_can_join) {
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
Modal.createDialog(NeedToRegisterDialog, {
title: "Failed to join the room",
description: "This room is inaccessible to guests. You may be able to join if you register."
});
return;
}
}
oob_data = { oob_data = {
avatarUrl: room.avatar_url, avatarUrl: room.avatar_url,
// XXX: This logic is duplicated from the JS SDK which // XXX: This logic is duplicated from the JS SDK which

View file

@ -601,7 +601,7 @@ module.exports = React.createClass({
_refreshFromServer: function() { _refreshFromServer: function() {
var self = this; var self = this;
MatrixClientPeg.get().getPushRules().then(self._portRulesToNewAPI).done(function(rulesets) { var pushRulesPromise = MatrixClientPeg.get().getPushRules().then(self._portRulesToNewAPI).done(function(rulesets) {
MatrixClientPeg.get().pushRules = rulesets; MatrixClientPeg.get().pushRules = rulesets;
// Get homeserver default rules and triage them by categories // Get homeserver default rules and triage them by categories
@ -811,10 +811,20 @@ module.exports = React.createClass({
self.state.externalPushRules.push(rule); self.state.externalPushRules.push(rule);
} }
} }
});
var pushersPromise = MatrixClientPeg.get().getPushers().then(function(resp) {
self.setState({pushers: resp.pushers});
});
q.all([pushRulesPromise, pushersPromise]).done(function() {
self.setState({ self.setState({
phase: self.phases.DISPLAY phase: self.phases.DISPLAY
}); });
}, function(error) {
self.setState({
phase: self.phases.ERROR
});
}); });
}, },
@ -936,6 +946,32 @@ module.exports = React.createClass({
externalRules.push(<li>Notifications on the following keywords follow rules which cant be displayed here: { externalKeyWords }</li>); externalRules.push(<li>Notifications on the following keywords follow rules which cant be displayed here: { externalKeyWords }</li>);
} }
var devicesSection;
if (this.state.pushers === undefined) {
devicesSection = <div className="error">Unable to fetch device list</div>
} else if (this.state.pushers.length == 0) {
devicesSection = <div className="mx_UserSettings_devicesTable_nodevices">
No devices are receiving push notifications
</div>
} else {
// It would be great to be able to delete pushers from here too,
// and this wouldn't be hard to add.
var rows = [];
for (var i = 0; i < this.state.pushers.length; ++i) {
rows.push(<tr>
<td>{this.state.pushers[i].app_display_name}</td>
<td>{this.state.pushers[i].device_display_name}</td>
</tr>);
}
devicesSection = (<table className="mx_UserSettings_devicesTable">
<tr>
<th>Application</th>
<th>Device</th>
</tr>
{rows}
</table>);
}
var advancedSettings; var advancedSettings;
if (externalRules.length) { if (externalRules.length) {
advancedSettings = ( advancedSettings = (
@ -1012,6 +1048,9 @@ module.exports = React.createClass({
{ advancedSettings } { advancedSettings }
<h3>Devices</h3>
{ devicesSection }
</div> </div>
</div> </div>

View file

@ -58,6 +58,15 @@ input[type=text]:focus, textarea:focus {
box-shadow: none; box-shadow: none;
} }
/* applied to side-panels and messagepanel when in RoomSettings */
.mx_fadable {
opacity: 1;
-webkit-transition: opacity 0.2s ease-in-out;
-moz-transition: opacity 0.2s ease-in-out;
-ms-transition: opacity 0.2s ease-in-out;
-o-transition: opacity 0.2s ease-in-out;
}
/* XXX: critical hack to GeminiScrollbar to allow them to work in FF 42 and Chrome 48. /* XXX: critical hack to GeminiScrollbar to allow them to work in FF 42 and Chrome 48.
Stop the scrollbar view from pushing out the container's overall sizing, which causes Stop the scrollbar view from pushing out the container's overall sizing, which causes
flexbox to adapt to the new size and cause the view to keep growing. flexbox to adapt to the new size and cause the view to keep growing.

View file

@ -89,7 +89,7 @@ limitations under the License.
margin: auto; margin: auto;
overflow: auto; overflow: auto;
border-bottom: 1px solid #eee; border-bottom: 1px solid #ccc;
-webkit-flex: 0 0 auto; -webkit-flex: 0 0 auto;
flex: 0 0 auto; flex: 0 0 auto;

View file

@ -158,10 +158,15 @@ limitations under the License.
margin-right: 10px; margin-right: 10px;
} }
.mx_EventTile_msgOption a {
text-decoration: none;
}
.mx_EventTile .mx_MessageTimestamp { .mx_EventTile .mx_MessageTimestamp {
display: block; display: block;
visibility: hidden; visibility: hidden;
text-align: right; text-align: right;
white-space: nowrap;
} }
.mx_EventTile_last .mx_MessageTimestamp { .mx_EventTile_last .mx_MessageTimestamp {

View file

@ -53,6 +53,19 @@ limitations under the License.
flex: 1; flex: 1;
} }
.mx_RoomHeader_spinner {
height: 36px;
-webkit-box-ordinal-group: 2;
-moz-box-ordinal-group: 2;
-ms-flex-order: 2;
-webkit-order: 2;
order: 2;
padding-left: 12px;
padding-right: 12px;
}
.mx_RoomHeader_textButton { .mx_RoomHeader_textButton {
height: 36px; height: 36px;
background-color: #76cfa6; background-color: #76cfa6;

View file

@ -60,3 +60,11 @@ limitations under the License.
cursor: pointer; cursor: pointer;
color: #76cfa6; color: #76cfa6;
} }
.mx_UserSettings_devicesTable td {
padding-left: 20px;
padding-right: 20px;
}
.mx_UserSettings_devicesTable_nodevices {
font-style: italic;
}