Skip to content

Commit ae02d8d

Browse files
committed
Merge branch 'develop' into matthew/settings
2 parents a7b9e54 + 85db381 commit ae02d8d

9 files changed

Lines changed: 65 additions & 31 deletions

File tree

‎src/components/structures/LeftPanel.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var LeftPanel = React.createClass({
6262
// audio/video not crap out
6363
var activeCall = CallHandler.getAnyActiveCall();
6464
var callForRoom = CallHandler.getCallForRoom(selectedRoomId);
65-
var showCall = (activeCall && !callForRoom);
65+
var showCall = (activeCall && activeCall.call_state === 'connected' && !callForRoom);
6666
this.setState({
6767
showCallElement: showCall
6868
});
@@ -87,7 +87,6 @@ var LeftPanel = React.createClass({
8787
render: function() {
8888
var RoomList = sdk.getComponent('rooms.RoomList');
8989
var BottomLeftMenu = sdk.getComponent('structures.BottomLeftMenu');
90-
var IncomingCallBox = sdk.getComponent('voip.IncomingCallBox');
9190

9291
var collapseButton;
9392
var classes = "mx_LeftPanel";
@@ -100,7 +99,7 @@ var LeftPanel = React.createClass({
10099
}
101100

102101
var callPreview;
103-
if (this.state.showCallElement) {
102+
if (this.state.showCallElement && !this.props.collapsed) {
104103
var CallView = sdk.getComponent('voip.CallView');
105104
callPreview = (
106105
<CallView
@@ -112,7 +111,6 @@ var LeftPanel = React.createClass({
112111
return (
113112
<aside className={classes}>
114113
{ collapseButton }
115-
<IncomingCallBox />
116114
{ callPreview }
117115
<RoomList
118116
selectedRoom={this.props.selectedRoom}

‎src/components/structures/RoomSubList.js‎

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,34 @@ var RoomSubList = React.createClass({
6161
tagName: React.PropTypes.string,
6262
editable: React.PropTypes.bool,
6363
order: React.PropTypes.string.isRequired,
64-
bottommost: React.PropTypes.bool,
6564
selectedRoom: React.PropTypes.string.isRequired,
6665
activityMap: React.PropTypes.object.isRequired,
67-
collapsed: React.PropTypes.bool.isRequired
66+
startAsHidden: React.PropTypes.bool,
67+
showSpinner: React.PropTypes.bool, // true to show a spinner if 0 elements when expanded
68+
69+
// TODO: Fix the name of this. This is too easily confused with the
70+
// "hidden" state which is the expanded (or not) view of the list of rooms.
71+
// What this prop *really* does is control whether the room name is displayed
72+
// so it should be named as such.
73+
collapsed: React.PropTypes.bool.isRequired,
74+
onHeaderClick: React.PropTypes.func,
75+
alwaysShowHeader: React.PropTypes.bool,
76+
incomingCall: React.PropTypes.object
6877
},
6978

7079
getInitialState: function() {
7180
return {
72-
hidden: false,
81+
hidden: this.props.startAsHidden || false,
7382
sortedList: [],
7483
};
7584
},
7685

86+
getDefaultProps: function() {
87+
return {
88+
onHeaderClick: function() {} // NOP
89+
};
90+
},
91+
7792
componentWillMount: function() {
7893
this.sortList(this.props.list, this.props.order);
7994
},
@@ -85,7 +100,9 @@ var RoomSubList = React.createClass({
85100
},
86101

87102
onClick: function(ev) {
88-
this.setState({ hidden : !this.state.hidden });
103+
var isHidden = !this.state.hidden;
104+
this.setState({ hidden : isHidden });
105+
this.props.onHeaderClick(isHidden);
89106
},
90107

91108
tsOfNewestEvent: function(room) {
@@ -239,11 +256,24 @@ var RoomSubList = React.createClass({
239256
selected={ selected }
240257
unread={ self.props.activityMap[room.roomId] === 1 }
241258
highlight={ self.props.activityMap[room.roomId] === 2 }
242-
isInvite={ self.props.label === 'Invites' } />
259+
isInvite={ self.props.label === 'Invites' }
260+
incomingCall={ self.props.incomingCall && (self.props.incomingCall.roomId === room.roomId) ? self.props.incomingCall : null }
261+
/>
243262
);
244263
});
245264
},
246265

266+
_getHeaderJsx: function() {
267+
return (
268+
<h2 onClick={ this.onClick } className="mx_RoomSubList_label">
269+
{ this.props.collapsed ? '' : this.props.label }
270+
<img className="mx_RoomSubList_chevron"
271+
src={ this.state.hidden ? "img/list-close.svg" : "img/list-open.svg" }
272+
width="10" height="10" />
273+
</h2>
274+
);
275+
},
276+
247277
render: function() {
248278
var connectDropTarget = this.props.connectDropTarget;
249279
var RoomDropTarget = sdk.getComponent('rooms.RoomDropTarget');
@@ -259,8 +289,7 @@ var RoomSubList = React.createClass({
259289

260290
if (this.state.sortedList.length > 0 || this.props.editable) {
261291
var subList;
262-
var classes = "mx_RoomSubList" +
263-
(this.props.bottommost ? " mx_RoomSubList_bottommost" : "");
292+
var classes = "mx_RoomSubList";
264293

265294
if (!this.state.hidden) {
266295
subList = <div className={ classes }>
@@ -275,16 +304,17 @@ var RoomSubList = React.createClass({
275304

276305
return connectDropTarget(
277306
<div>
278-
<h2 onClick={ this.onClick } className="mx_RoomSubList_label">{ this.props.collapsed ? '' : this.props.label }
279-
<img className="mx_RoomSubList_chevron" src={ this.state.hidden ? "img/list-open.svg" : "img/list-close.svg" } width="10" height="10"/>
280-
</h2>
307+
{ this._getHeaderJsx() }
281308
{ subList }
282309
</div>
283310
);
284311
}
285312
else {
313+
var Loader = sdk.getComponent("elements.Spinner");
286314
return (
287315
<div className="mx_RoomSubList">
316+
{ this.props.alwaysShowHeader ? this._getHeaderJsx() : undefined }
317+
{ (this.props.showSpinner && !this.state.hidden) ? <Loader /> : undefined }
288318
</div>
289319
);
290320
}

‎src/skins/vector/css/molecules/EventTile.css‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ limitations under the License.
106106
padding: 4px;
107107
}
108108

109+
.mx_MessageTile_searchHighlight a {
110+
background-color: #76cfa6;
111+
color: #fff;
112+
}
113+
109114
.mx_EventTile_sending {
110115
color: #ddd;
111116
}

‎src/skins/vector/css/molecules/RoomHeader.css‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ limitations under the License.
127127
.mx_RoomHeader_searchStatus {
128128
display: inline-block;
129129
font-weight: normal;
130-
overflow-y: hidden;
131130
opacity: 0.6;
132131
}
133132

‎src/skins/vector/css/molecules/voip/IncomingCallbox.css‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ limitations under the License.
1919
border: 1px solid #a4a4a4;
2020
border-radius: 8px;
2121
background-color: #fff;
22-
position: absolute;
22+
position: fixed;
2323
z-index: 1000;
24-
left: 235px;
25-
top: 155px;
2624
padding: 6px;
25+
margin-top: -3px;
26+
margin-left: -20px;
27+
width: 200px;
2728
}
2829

2930
.mx_IncomingCallBox_chevron {
@@ -39,14 +40,13 @@ limitations under the License.
3940
}
4041

4142
.mx_IncomingCallBox_buttons {
42-
display: table-row;
43+
display: flex;
4344
}
4445

4546
.mx_IncomingCallBox_buttons_cell {
4647
vertical-align: middle;
47-
display: table-cell;
4848
padding: 6px;
49-
width: 50%;
49+
flex: 1;
5050
}
5151

5252
.mx_IncomingCallBox_buttons_decline,
@@ -57,6 +57,7 @@ limitations under the License.
5757
line-height: 36px;
5858
border-radius: 36px;
5959
color: #fff;
60+
margin: auto;
6061
}
6162

6263
.mx_IncomingCallBox_buttons_decline {

‎src/skins/vector/css/organisms/RoomList.css‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
.mx_RoomList {
1818
padding-top: 24px;
1919
padding-bottom: 12px;
20+
min-height: 400px;
2021
}
2122

2223
.mx_RoomList_expandButton {

‎src/skins/vector/css/organisms/RoomSubList.css‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ limitations under the License.
2020
width: 100%;
2121
}
2222

23-
.mx_RoomSubList_bottommost {
24-
/* XXX: this should really be 100% of the RoomList height, but can't seem to get at it */
25-
min-height: 400px;
26-
}
27-
2823
.mx_RoomSubList_label {
2924
text-transform: uppercase;
3025
color: #3d3b39;

‎src/vector/index.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ function loadApp() {
153153
onNewScreen={onNewScreen}
154154
registrationUrl={makeRegistrationUrl()}
155155
ConferenceHandler={VectorConferenceHandler}
156-
config={configJson} />,
156+
config={configJson}
157+
startingQueryParams={parseQsFromFragment(window.location)} />,
157158
document.getElementById('matrixchat')
158159
);
159160
}

‎vector/index.html‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
<meta name="theme-color" content="#ffffff">
2828
</head>
2929
<body style="height: 100%;">
30+
<section id="matrixchat" style="height: 100%;"></section>
31+
<script src="bundle.js"></script>
32+
<link rel="stylesheet" href="bundle.css">
33+
<img src="img/warning.svg" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
34+
<audio id="ringAudio" loop>
35+
<source src="media/ring.ogg" type="audio/ogg" />
36+
<source src="media/ring.mp3" type="audio/mpeg" />
37+
</audio>
3038
<audio id="ringbackAudio" loop>
3139
<source src="media/ringback.ogg" type="audio/ogg" />
3240
<source src="media/ringback.mp3" type="audio/mpeg" />
@@ -39,9 +47,5 @@
3947
<source src="media/busy.ogg" type="audio/ogg" />
4048
<source src="media/busy.mp3" type="audio/mpeg" />
4149
</audio>
42-
<section id="matrixchat" style="height: 100%;"></section>
43-
<script src="bundle.js"></script>
44-
<link rel="stylesheet" href="bundle.css">
45-
<img src="img/warning.svg" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
4650
</body>
4751
</html>

0 commit comments

Comments
 (0)