From 324020d5fe212badfbd38137adc8dcecfdc15980 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 15:36:52 -0700 Subject: [PATCH] Display the room topic in the room, underneath the name of the room. --- webclient/app.css | 21 +++++++++++++------ .../matrix/event-handler-service.js | 11 ++++++++++ webclient/room/room.html | 9 ++++++-- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/webclient/app.css b/webclient/app.css index 19fae632ff..7c367df421 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -220,12 +220,6 @@ a:active { color: #000; } height: 100%; } -#roomName { - float: right; - font-size: 16px; - margin-top: 15px; -} - #roomHeader { margin: auto; padding-left: 20px; @@ -282,6 +276,21 @@ a:active { color: #000; } float: right; } +#roomName { + font-size: 16px; + text-align: right; +} + +#roomTopic { + text-align: right; + font-size: 13px; +} + +.roomHeaderInfo { + float: right; + margin-top: 15px; +} + /*** Participant list ***/ #usersTableWrapper { diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 173055a61b..a14e515999 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -148,6 +148,14 @@ angular.module('eventHandlerService', []) $rootScope.events.rooms[event.room_id][event.type] = event; $rootScope.$broadcast(NAME_EVENT, event, isLiveEvent); }; + + var handleRoomTopic = function(event, isLiveEvent) { + console.log("handleRoomTopic " + isLiveEvent); + + initRoom(event.room_id); + + $rootScope.events.rooms[event.room_id][event.type] = event; + }; var handleCallEvent = function(event, isLiveEvent) { $rootScope.$broadcast(CALL_EVENT, event, isLiveEvent); @@ -204,6 +212,9 @@ angular.module('eventHandlerService', []) case 'm.room.name': handleRoomName(event, isLiveEvent); break; + case 'm.room.topic': + handleRoomTopic(event, isLiveEvent); + break; default: console.log("Unable to handle event type " + event.type); console.log(JSON.stringify(event, undefined, 4)); diff --git a/webclient/room/room.html b/webclient/room/room.html index 5bd2cc92d5..4be2482f96 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -2,8 +2,13 @@
[matrix] -
- {{ room_id | mRoomName }} +
+
+ {{ room_id | mRoomName }} +
+
+ {{ events.rooms[room_id]['m.room.topic'].content.topic }} +