Skip to content

Commit c91b642

Browse files
committed
Merge branch 'develop' into kegan/delete-empty-files
Conflicts: src/skins/vector/views/molecules/EventAsTextTile.js
2 parents a9b093b + ce33c8c commit c91b642

File tree

23 files changed

+353
-143
lines changed

23 files changed

+353
-143
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,27 @@ into the `vector` directory and run your own server.
2222

2323
Development
2424
===========
25-
You can work on any of the source files within Vector with the setup above,
26-
and your changes will cause an instant rebuild. If you also need to make
27-
changes to the react sdk, you can:
2825

29-
1. Link the react sdk package into the example:
26+
For simple tweaks, you can work on any of the source files within Vector with the
27+
setup above, and your changes will cause an instant rebuild.
28+
29+
However, all serious development on Vector happens on the `develop` branch. This typically
30+
depends on the `develop` snapshot versions of `matrix-react-sdk` and `matrix-js-sdk`
31+
too, which isn't expressed in Vector's `package.json`. To do this, check out
32+
the `develop` branches of these libraries and then use `npm link` to tell Vector
33+
about them:
34+
35+
1. `git clone git@github.com:matrix-org/matrix-react-sdk.git`
36+
2. `cd matrix-react-sdk`
37+
3. `git checkout develop`
38+
4. `npm install`
39+
5. `npm start` (to start the dev rebuilder)
40+
6. `cd ../vector-web`
41+
7. Link the react sdk package into the example:
3042
`npm link path/to/your/react/sdk`
31-
2. Start the development rebuilder in your react SDK directory:
32-
`npm start`
43+
44+
Similarly, you may need to `npm link path/to/your/js/sdk` in your `matrix-react-sdk`
45+
directory.
3346

3447
If you add or remove any components from the Vector skin, you will need to rebuild
3548
the skin's index by running, `npm run reskindex`.

src/ContextualMenu.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,25 @@ module.exports = {
4949

5050
var position = {
5151
top: props.top - 20,
52-
right: props.right + 8,
5352
};
5453

54+
var chevron = null;
55+
if (props.left) {
56+
chevron = <img className="mx_ContextualMenu_chevron_left" src="img/chevron-left.png" width="9" height="16" />
57+
position.left = props.left + 8;
58+
} else {
59+
chevron = <img className="mx_ContextualMenu_chevron_right" src="img/chevron-right.png" width="9" height="16" />
60+
position.right = props.right + 8;
61+
}
62+
63+
var className = 'mx_ContextualMenu_wrapper';
64+
5565
// FIXME: If a menu uses getDefaultProps it clobbers the onFinished
5666
// property set here so you can't close the menu from a button click!
5767
var menu = (
58-
<div className="mx_ContextualMenu_wrapper">
68+
<div className={className}>
5969
<div className="mx_ContextualMenu" style={position}>
60-
<img className="mx_ContextualMenu_chevron" src="img/chevron-right.png" width="9" height="16" />
70+
{chevron}
6171
<Element {...props} onFinished={closeMenu}/>
6272
</div>
6373
<div className="mx_ContextualMenu_background" onClick={closeMenu}></div>

src/controllers/organisms/RoomList.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module.exports = {
3333
cli.on("Room", this.onRoom);
3434
cli.on("Room.timeline", this.onRoomTimeline);
3535
cli.on("Room.name", this.onRoomName);
36+
cli.on("RoomState.events", this.onRoomStateEvents);
3637

3738
var rooms = this.getRoomList();
3839
this.setState({
@@ -66,6 +67,7 @@ module.exports = {
6667
MatrixClientPeg.get().removeListener("Room", this.onRoom);
6768
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
6869
MatrixClientPeg.get().removeListener("Room.name", this.onRoomName);
70+
MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvents);
6971
}
7072
},
7173

@@ -110,6 +112,11 @@ module.exports = {
110112
this.refreshRoomList();
111113
},
112114

115+
onRoomStateEvents: function(ev, state) {
116+
setTimeout(this.refreshRoomList, 0);
117+
},
118+
119+
113120
refreshRoomList: function() {
114121
var rooms = this.getRoomList();
115122
this.setState({

src/controllers/organisms/RoomView.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ module.exports = {
6363
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
6464
MatrixClientPeg.get().removeListener("Room.name", this.onRoomName);
6565
MatrixClientPeg.get().removeListener("RoomMember.typing", this.onRoomMemberTyping);
66+
MatrixClientPeg.get().removeListener("RoomState.members", this.onRoomStateMember);
6667
}
6768
},
6869

@@ -356,23 +357,20 @@ module.exports = {
356357
},
357358

358359
getEventTiles: function() {
359-
var tileTypes = {
360-
'm.room.message': sdk.getComponent('molecules.MessageTile'),
361-
'm.room.member' : sdk.getComponent('molecules.EventAsTextTile'),
362-
'm.call.invite' : sdk.getComponent('molecules.EventAsTextTile'),
363-
'm.call.answer' : sdk.getComponent('molecules.EventAsTextTile'),
364-
'm.call.hangup' : sdk.getComponent('molecules.EventAsTextTile'),
365-
'm.room.topic' : sdk.getComponent('molecules.EventAsTextTile'),
366-
};
367-
368360
var DateSeparator = sdk.getComponent('molecules.DateSeparator');
369361

370362
var ret = [];
371363
var count = 0;
372364

365+
var EventTile = sdk.getComponent('molecules.EventTile');
366+
373367
for (var i = this.state.room.timeline.length-1; i >= 0 && count < this.state.messageCap; --i) {
374368
var mxEv = this.state.room.timeline[i];
375-
var TileType = tileTypes[mxEv.getType()];
369+
370+
if (!EventTile.supportsEventType(mxEv.getType())) {
371+
continue;
372+
}
373+
376374
var continuation = false;
377375
var last = false;
378376
var dateSeparator = null;
@@ -401,13 +399,12 @@ module.exports = {
401399

402400
if (i === 1) { // n.b. 1, not 0, as the 0th event is an m.room.create and so doesn't show on the timeline
403401
var ts1 = this.state.room.timeline[i].getTs();
404-
dateSeparator = <DateSeparator key={ts1} ts={ts1}/>;
402+
dateSeparator = <li key={ts1}><DateSeparator ts={ts1}/></li>;
405403
continuation = false;
406404
}
407405

408-
if (!TileType) continue;
409406
ret.unshift(
410-
<li key={mxEv.getId()}><TileType mxEvent={mxEv} continuation={continuation} last={last}/></li>
407+
<li key={mxEv.getId()}><EventTile mxEvent={mxEv} continuation={continuation} last={last}/></li>
411408
);
412409
if (dateSeparator) {
413410
ret.unshift(dateSeparator);

src/skins/vector/css/common.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,20 @@ a:visited {
6767
padding: 6px;
6868
}
6969

70-
.mx_ContextualMenu_chevron {
70+
.mx_ContextualMenu_chevron_right {
7171
padding: 12px;
7272
position: absolute;
7373
right: -21px;
7474
top: 0px;
7575
}
7676

77+
.mx_ContextualMenu_chevron_left {
78+
padding: 12px;
79+
position: absolute;
80+
left: -21px;
81+
top: 0px;
82+
}
83+
7784
.mx_ContextualMenu_field {
7885
padding: 3px 6px 3px 6px;
7986
cursor: pointer;

src/skins/vector/css/molecules/MessageTile.css renamed to src/skins/vector/css/molecules/EventTile.css

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,98 +14,99 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
.mx_MessageTile {
17+
.mx_EventTile {
1818
max-width: 100%;
1919
clear: both;
2020
margin-top: 32px;
2121
margin-left: 56px;
2222
}
2323

24-
.mx_MessageTile_avatar {
24+
.mx_EventTile_avatar {
2525
padding-left: 12px;
2626
padding-right: 12px;
2727
margin-left: -64px;
2828
margin-top: -7px;
2929
float: left;
3030
}
3131

32-
.mx_MessageTile_avatar img {
32+
.mx_EventTile_avatar img {
3333
background-color: #dbdbdb;
3434
border-radius: 20px;
3535
border: 0px;
3636
}
3737

38-
.mx_MessageTile_continuation {
38+
.mx_EventTile_continuation {
3939
margin-top: 8px ! important;
4040
}
4141

42-
.mx_MessageTile .mx_SenderProfile {
42+
.mx_EventTile .mx_SenderProfile {
4343
color: #454545;
4444
opacity: 0.5;
4545
font-size: 14px;
4646
margin-bottom: 4px;
4747
display: block;
4848
}
4949

50-
.mx_MessageTile .mx_MessageTimestamp {
50+
.mx_EventTile .mx_MessageTimestamp {
5151
color: #454545;
5252
opacity: 0.5;
5353
font-size: 14px;
5454
float: right;
5555
}
5656

57-
.mx_MessageTile_content {
57+
.mx_EventTile_content {
5858
padding-right: 100px;
5959
display: block;
6060
}
6161

62-
.mx_MessageTile_notice .mx_MessageTile_content {
62+
.mx_EventTile_notice .mx_MessageTile_content {
6363
opacity: 0.5;
6464
}
6565

66-
.mx_MessageTile_sending {
66+
.mx_EventTile_sending {
6767
color: #ddd;
6868
}
6969

70-
.mx_MessageTile_notSent {
70+
.mx_EventTile_notSent {
7171
color: #f11;
7272
}
7373

74-
.mx_MessageTile_highlight {
74+
.mx_EventTile_highlight {
7575
color: #FF0064;
7676
}
7777

78-
.mx_MessageTile_msgOption {
78+
.mx_EventTile_msgOption {
7979
float: right;
8080
}
8181

8282
.mx_MessageTimestamp {
8383
display: none;
8484
}
8585

86-
.mx_MessageTile_last .mx_MessageTimestamp {
86+
.mx_EventTile_last .mx_MessageTimestamp {
8787
display: block;
8888
}
8989

90-
.mx_MessageTile:hover .mx_MessageTimestamp {
90+
.mx_EventTile:hover .mx_MessageTimestamp {
9191
display: block;
9292
}
9393

94-
.mx_MessageTile_editButton {
94+
.mx_EventTile_editButton {
9595
float: right;
9696
display: none;
9797
border: 0px;
9898
outline: none;
99+
margin-right: 3px;
99100
}
100101

101-
.mx_MessageTile:hover .mx_MessageTile_editButton {
102+
.mx_EventTile:hover .mx_EventTile_editButton {
102103
display: inline-block;
103104
}
104105

105-
.mx_MessageTile.menu .mx_MessageTile_editButton {
106+
.mx_EventTile.menu .mx_EventTile_editButton {
106107
display: inline-block;
107108
}
108109

109-
.mx_MessageTile.menu .mx_MessageTimestamp {
110+
.mx_EventTile.menu .mx_MessageTimestamp {
110111
display: inline-block;
111112
}

src/skins/vector/img/50e2c2.png

146 Bytes
Loading

src/skins/vector/img/80cef4.png

146 Bytes
Loading

src/skins/vector/img/f4c371.png

146 Bytes
Loading

src/skins/vector/skindex.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ skin['molecules.ChangeDisplayName'] = require('./views/molecules/ChangeDisplayNa
4141
skin['molecules.ChangePassword'] = require('./views/molecules/ChangePassword');
4242
skin['molecules.DateSeparator'] = require('./views/molecules/DateSeparator');
4343
skin['molecules.EventAsTextTile'] = require('./views/molecules/EventAsTextTile');
44+
skin['molecules.EventTile'] = require('./views/molecules/EventTile');
4445
skin['molecules.MatrixToolbar'] = require('./views/molecules/MatrixToolbar');
4546
skin['molecules.MemberInfo'] = require('./views/molecules/MemberInfo');
4647
skin['molecules.MemberTile'] = require('./views/molecules/MemberTile');

0 commit comments

Comments
 (0)