From 7a153b5c94bbd4f1778a2d32ee5c090967c5cb83 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Wed, 10 Sep 2014 18:29:52 +0200 Subject: Show echoed emote with transparency --- webclient/room/room.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'webclient/room/room.html') diff --git a/webclient/room/room.html b/webclient/room/room.html index 5debeaba7c..054b876f81 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -93,7 +93,10 @@ - + + -- cgit 1.5.1 From 7e7eb0efc14733b576942af4590683c8b749e94e Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 11:31:24 +0200 Subject: Show room topic change in the chat history and in the recents --- .../components/matrix/event-handler-service.js | 25 ++++++++++++++++++---- webclient/recents/recents-controller.js | 5 +++++ webclient/recents/recents.html | 4 ++++ webclient/room/room.html | 5 +++++ 4 files changed, 35 insertions(+), 4 deletions(-) (limited to 'webclient/room/room.html') diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index b19ec27a9d..002a9fbd5d 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -35,6 +35,7 @@ angular.module('eventHandlerService', []) var POWERLEVEL_EVENT = "POWERLEVEL_EVENT"; var CALL_EVENT = "CALL_EVENT"; var NAME_EVENT = "NAME_EVENT"; + var TOPIC_EVENT = "TOPIC_EVENT"; var initialSyncDeferred = $q.defer(); @@ -170,24 +171,39 @@ angular.module('eventHandlerService', []) }; // TODO: Can this just be a generic "I am a room state event, can haz store?" - var handleRoomTopic = function(event, isLiveEvent) { + var handleRoomTopic = function(event, isLiveEvent, isStateEvent) { console.log("handleRoomTopic live="+isLiveEvent); initRoom(event.room_id); + // Add topic changes as if they were a room message + if (!isStateEvent) { + if (isLiveEvent) { + $rootScope.events.rooms[event.room_id].messages.push(event); + } + else { + $rootScope.events.rooms[event.room_id].messages.unshift(event); + } + } + // live events always update, but non-live events only update if the // ts is later. + var latestData = true; if (!isLiveEvent) { var eventTs = event.ts; var storedEvent = $rootScope.events.rooms[event.room_id][event.type]; if (storedEvent) { if (storedEvent.ts > eventTs) { // ignore it, we have a newer one already. - return; + latestData = false; } } } - $rootScope.events.rooms[event.room_id][event.type] = event; + if (latestData) { + $rootScope.events.rooms[event.room_id][event.type] = event; + } + + $rootScope.$broadcast(TOPIC_EVENT, event, isLiveEvent); }; var handleCallEvent = function(event, isLiveEvent) { @@ -229,6 +245,7 @@ angular.module('eventHandlerService', []) POWERLEVEL_EVENT: POWERLEVEL_EVENT, CALL_EVENT: CALL_EVENT, NAME_EVENT: NAME_EVENT, + TOPIC_EVENT: TOPIC_EVENT, handleEvent: function(event, isLiveEvent, isStateEvent) { // Avoid duplicated events @@ -279,7 +296,7 @@ angular.module('eventHandlerService', []) handleRoomName(event, isLiveEvent); break; case 'm.room.topic': - handleRoomTopic(event, isLiveEvent); + handleRoomTopic(event, isLiveEvent, isStateEvent); break; default: console.log("Unable to handle event type " + event.type); diff --git a/webclient/recents/recents-controller.js b/webclient/recents/recents-controller.js index 5cf74cad4e..8ce0969164 100644 --- a/webclient/recents/recents-controller.js +++ b/webclient/recents/recents-controller.js @@ -68,6 +68,11 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand $rootScope.rooms[event.room_id] = event; } }); + $rootScope.$on(eventHandlerService.TOPIC_EVENT, function(ngEvent, event, isLive) { + if (isLive) { + $rootScope.rooms[event.room_id].lastMsg = event; + } + }); }; /** diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html index d6bea52cbe..6976bab879 100644 --- a/webclient/recents/recents.html +++ b/webclient/recents/recents.html @@ -76,6 +76,10 @@ +
+ {{ room.lastMsg.user_id | mUserDisplayName: room.room_id }} changed the topic to: {{ room.lastMsg.content.topic }} +
+
Call diff --git a/webclient/room/room.html b/webclient/room/room.html index 054b876f81..dba6586e00 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -113,6 +113,11 @@ ng-click="$parent.fullScreenImageURL = msg.content.url"/>
+ + + {{ members[msg.user_id].displayname || msg.user_id }} changed the topic to: {{ msg.content.topic }} + + -- cgit 1.5.1 From af44e9556d7f2aab93b96f11eef02d23cb65ac8e Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 11:49:59 +0200 Subject: BF: made input autofocus work when opening the room topic input --- webclient/room/room-controller.js | 5 +++++ webclient/room/room.html | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'webclient/room/room.html') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 0000fcfc61..94c7688907 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -58,6 +58,11 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) $scope.topic.newTopicText = ""; } + // Force focus to the input + $timeout(function() { + angular.element('.roomTopicInput').focus(); + }, 0); + $scope.topic.isEditing = true; }, updateTopic: function() { diff --git a/webclient/room/room.html b/webclient/room/room.html index dba6586e00..587b0057a6 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -16,8 +16,7 @@ {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}}
- +
-- cgit 1.5.1 From cc049851d0cd76ea5cb92ca2c6f7b6a6c45e217e Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 12:01:44 +0200 Subject: On member avatar mouseover, show user_id and power level --- webclient/room/room.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webclient/room/room.html') diff --git a/webclient/room/room.html b/webclient/room/room.html index 587b0057a6..98423ae40b 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -37,7 +37,7 @@ {{ member.displayname || member.id.substr(0, member.id.indexOf(':')) }}
-- cgit 1.5.1 From c92740e8a905b3f19a27290410823cff9b35b945 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 13:43:55 +0200 Subject: Enable enter key in the invite input --- webclient/room/room.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webclient/room/room.html') diff --git a/webclient/room/room.html b/webclient/room/room.html index 98423ae40b..2225cc7646 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -150,7 +150,7 @@
Invite a user: - + -- cgit 1.5.1 From 6b20fef52af078e6fa7343f2e9c23fcbbf6fef48 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 13:52:07 +0200 Subject: Invite: reset the input when the invitation has been done --- webclient/room/room-controller.js | 7 ++++--- webclient/room/room.html | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'webclient/room/room.html') diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index fe3821eb45..da77864017 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -694,12 +694,13 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) ); }; - $scope.inviteUser = function(user_id) { + $scope.inviteUser = function() { - matrixService.invite($scope.room_id, user_id).then( + matrixService.invite($scope.room_id, $scope.userIDToInvite).then( function() { console.log("Invited."); - $scope.feedback = "Invite sent successfully"; + $scope.feedback = "Invite successfully sent to " + $scope.userIDToInvite; + $scope.userIDToInvite = ""; }, function(reason) { $scope.feedback = "Failure: " + reason; diff --git a/webclient/room/room.html b/webclient/room/room.html index 2225cc7646..b00d632292 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -150,8 +150,8 @@
Invite a user: - - + + -- cgit 1.5.1 From 806c49a690b5db15030bb5e8d14c5f9983e875d4 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 15:46:24 +0200 Subject: Added support of copy/paste of multi lines content --- webclient/app.css | 5 +++++ webclient/room/room.html | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'webclient/room/room.html') diff --git a/webclient/app.css b/webclient/app.css index 2564ce3286..71af550679 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -257,6 +257,7 @@ a:active { color: #000; } #mainInput { width: 100%; + resize: none; } .blink { @@ -514,6 +515,10 @@ a:active { color: #000; } text-align: left ! important; } +.bubble .message { + /* Break lines when encountering CR+LF */ + white-space: pre; +} .bubble .messagePending { opacity: 0.3 } diff --git a/webclient/room/room.html b/webclient/room/room.html index b00d632292..530545da53 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -97,6 +97,7 @@ ng-bind-html="'* ' + (members[msg.user_id].displayname || msg.user_id) + ' ' + msg.content.body | linky:'_blank'"/> @@ -138,7 +139,7 @@ {{ state.user_id }} - +