From 8e8bbb00f5a0524873b5a76c833c8a9d553c0327 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 30 Oct 2014 11:22:47 +0000 Subject: [PATCH 1/9] SYWEB-12: Store unknown state events so they are displayed in the Room Info dialog. --- webclient/components/matrix/event-handler-service.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 3b1354cdef..6f251eec56 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -564,6 +564,13 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) { handleRedaction(event, isLiveEvent); break; default: + // if it is a state event, then just add it in so it + // displays on the Room Info screen. + if (typeof(event.state_key) === "string") { // incls. 0-len strings + if (event.room_id) { + handleRoomDateEvent(event, isLiveEvent, false); + } + } console.log("Unable to handle event type " + event.type); console.log(JSON.stringify(event, undefined, 4)); break; From 40342af4597c5f52815629836bc37b4798c1d232 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 30 Oct 2014 11:53:28 +0000 Subject: [PATCH 2/9] SYWEB-12: Format room info dialog better. --- webclient/app.css | 25 +++++++++++++++++++++++++ webclient/room/room.html | 30 +++++++++++++----------------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/webclient/app.css b/webclient/app.css index 20a13aad81..2dc6e8caed 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -418,6 +418,31 @@ textarea, input { margin-top: 15px; } +/*** Room Info Dialog ***/ + +.room-info { + border-collapse: collapse; + width: 100%; +} + +.room-info-event { + border-bottom: 1pt solid black; +} + +.room-info-event-meta { + padding-top: 1em; + padding-bottom: 1em; +} + +.room-info-event-content { + padding-top: 1em; + padding-bottom: 1em; +} + +.monospace { + font-family: monospace; +} + /*** Participant list ***/ #usersTableWrapper { diff --git a/webclient/room/room.html b/webclient/room/room.html index 3458e97039..65b959fe94 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -15,23 +15,19 @@ + diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index fcbcd75364..ce513990f2 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -1018,6 +1018,13 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) }; $scope.openRoomInfo = function() { + var stateFilter = $filter("stateEventsFilter"); + var stateEvents = stateFilter($scope.events.rooms[$scope.room_id]); + // The modal dialog will 2-way bind this field, so we MUST make a deep + // copy of the state events else we will be *actually adjusing our view + // of the world* when fiddling with the JSON!! Apparently parse/stringify + // is faster than jQuery's extend when doing deep copies. + $scope.roomInfoStateEvents = JSON.parse(JSON.stringify(stateEvents)); var modalInstance = $modal.open({ templateUrl: 'roomInfoTemplate.html', controller: 'RoomInfoController', @@ -1040,7 +1047,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) console.log("Displaying room info."); $scope.submit = function(event) { - console.error("submit >>> " + JSON.stringify(event)); + if (event.content) { + console.error("submit >>> " + JSON.stringify(event)); + } }; $scope.dismiss = $modalInstance.dismiss; diff --git a/webclient/room/room.html b/webclient/room/room.html index cc79d6b778..627918223a 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -16,7 +16,7 @@