From 5d273a0c76e12e3125dbf06a8f0caa03de01d4a9 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 17 Nov 2014 12:55:24 +0000 Subject: Remove syweb directory. pull in syweb as a dependency from github --- syweb/webclient/recents/recents-controller.js | 53 ------------- syweb/webclient/recents/recents-filter.js | 74 ----------------- syweb/webclient/recents/recents.html | 110 -------------------------- 3 files changed, 237 deletions(-) delete mode 100644 syweb/webclient/recents/recents-controller.js delete mode 100644 syweb/webclient/recents/recents-filter.js delete mode 100644 syweb/webclient/recents/recents.html (limited to 'syweb/webclient/recents') diff --git a/syweb/webclient/recents/recents-controller.js b/syweb/webclient/recents/recents-controller.js deleted file mode 100644 index 6b2915d03b..0000000000 --- a/syweb/webclient/recents/recents-controller.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2014 OpenMarket Ltd - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -'use strict'; - -angular.module('RecentsController', ['matrixService', 'matrixFilter']) -.controller('RecentsController', ['$rootScope', '$scope', 'modelService', 'recentsService', - function($rootScope, $scope, modelService, recentsService) { - - // Expose the service to the view - $scope.modelService = modelService; - - // retrieve all rooms and expose them - $scope.rooms = modelService.getRooms(); - - // track the selected room ID: the html will use this - $scope.recentsSelectedRoomID = recentsService.getSelectedRoomId(); - $scope.$on(recentsService.BROADCAST_SELECTED_ROOM_ID, function(ngEvent, room_id) { - $scope.recentsSelectedRoomID = room_id; - }); - - // track the list of unread messages: the html will use this - $scope.unreadMessages = recentsService.getUnreadMessages(); - $scope.$on(recentsService.BROADCAST_UNREAD_MESSAGES, function(ngEvent, room_id, unreadCount) { - $scope.unreadMessages = recentsService.getUnreadMessages(); - }); - - // track the list of unread BING messages: the html will use this - $scope.unreadBings = recentsService.getUnreadBingMessages(); - $scope.$on(recentsService.BROADCAST_UNREAD_BING_MESSAGES, function(ngEvent, room_id, event) { - $scope.unreadBings = recentsService.getUnreadBingMessages(); - }); - - $scope.selectRoom = function(room) { - recentsService.markAsRead(room.room_id); - $rootScope.goToPage('room/' + (room.room_alias ? room.room_alias : room.room_id) ); - }; - -}]); - diff --git a/syweb/webclient/recents/recents-filter.js b/syweb/webclient/recents/recents-filter.js deleted file mode 100644 index 31859b1c7f..0000000000 --- a/syweb/webclient/recents/recents-filter.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright 2014 OpenMarket Ltd - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -'use strict'; - -angular.module('RecentsController') -.filter('orderRecents', ["matrixService", "modelService", function(matrixService, modelService) { - return function(rooms) { - var user_id = matrixService.config().user_id; - - // Transform the dict into an array - // The key, room_id, is already in value objects - var filtered = []; - angular.forEach(rooms, function(room, room_id) { - room.recent = {}; - var meEvent = room.current_room_state.state("m.room.member", user_id); - // Show the room only if the user has joined it or has been invited - // (ie, do not show it if he has been banned) - var member = modelService.getMember(room_id, user_id); - if (member) { - member = member.event; - } - room.recent.me = member; - if (member && ("invite" === member.content.membership || "join" === member.content.membership)) { - if ("invite" === member.content.membership) { - room.recent.inviter = member.user_id; - } - // Count users here - // TODO: Compute it directly in modelService - room.recent.numUsersInRoom = modelService.getUserCountInRoom(room_id); - - filtered.push(room); - } - else if (meEvent && "invite" === meEvent.content.membership) { - // The only information we have about the room is that the user has been invited - filtered.push(room); - } - }); - - // And time sort them - // The room with the latest message at first - filtered.sort(function (roomA, roomB) { - - var lastMsgRoomA = modelService.getLastMessage(roomA.room_id, true); - var lastMsgRoomB = modelService.getLastMessage(roomB.room_id, true); - - // Invite message does not have a body message nor ts - // Puth them at the top of the list - if (undefined === lastMsgRoomA) { - return -1; - } - else if (undefined === lastMsgRoomB) { - return 1; - } - else { - return lastMsgRoomB.origin_server_ts - lastMsgRoomA.origin_server_ts; - } - }); - return filtered; - }; -}]); diff --git a/syweb/webclient/recents/recents.html b/syweb/webclient/recents/recents.html deleted file mode 100644 index 2596b094f7..0000000000 --- a/syweb/webclient/recents/recents.html +++ /dev/null @@ -1,110 +0,0 @@ -
- - - - - - - - - - - - -
- {{ room.room_id | mRoomName }} - - - {{ room.recent.numUsersInRoom || '1' }} {{ room.recent.numUsersInRoom == 1 ? 'user' : 'users' }} - - - - {{ lastMsg = modelService.getLastMessage(room.room_id, true);"" }} - - {{ (lastMsg.origin_server_ts) | date:'MMM d HH:mm' }} - - close -
- -
- {{ room.recent.inviter | mUserDisplayName: room.room_id }} invited you -
- -
-
- - - - {{ lastMsg.state_key | mUserDisplayName: room.room_id }} joined - - - - {{lastMsg.state_key | mUserDisplayName: room.room_id }} left - - - {{ lastMsg.user_id | mUserDisplayName: room.room_id }} - {{ {"invite": "kicked", "join": "kicked", "ban": "unbanned"}[lastMsg.prev_content.membership] }} - {{ lastMsg.state_key | mUserDisplayName: room.room_id }} - - - : {{ lastMsg.content.reason }} - - - - {{ lastMsg.user_id | mUserDisplayName: room.room_id }} - {{ {"invite": "invited", "ban": "banned"}[lastMsg.content.membership] }} - {{ lastMsg.state_key | mUserDisplayName: room.room_id }} - - : {{ lastMsg.content.reason }} - - - - - {{ lastMsg.user_id }} changed their display name from {{ lastMsg.prev_content.displayname }} to {{ lastMsg.content.displayname }} - - -
- -
-
-
- {{ lastMsg.user_id | mUserDisplayName: room.room_id }} : - - -
- -
- {{ lastMsg.user_id | mUserDisplayName: room.room_id }} sent an image -
- -
- - -
- -
- {{ lastMsg.content.body | linky:'_blank' }} -
-
-
- -
- {{ lastMsg.user_id | mUserDisplayName: room.room_id }} changed the topic to: {{ lastMsg.content.topic }} -
- -
- {{ lastMsg.user_id | mUserDisplayName: room.room_id }} changed the room name to: {{ lastMsg.content.name }} -
- -
-
- Call -
-
-
-
-
-- cgit 1.5.1