From 032ae804b15f630ee48055dfe46dea83d04b307f Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Thu, 8 May 2014 15:48:00 -0300 Subject: [PATCH 1/3] general avatar polishing --- index.html | 16 ++++++---------- js/directives.js | 12 ++++++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index f86ddb2a5..b4160f35a 100644 --- a/index.html +++ b/index.html @@ -123,19 +123,15 @@
- + > + /> {{c.nick}}
@@ -240,7 +236,7 @@
-
Select required number of signatures
+
Select required signatures
diff --git a/js/directives.js b/js/directives.js index 1df4026d4..bbda156d6 100644 --- a/js/directives.js +++ b/js/directives.js @@ -89,12 +89,16 @@ angular.module('copay.directives') }); } } - }).directive('confvideo', function($rootScope) { + }).directive('avatar', function($rootScope) { return { link: function(scope, element, attrs) { - var peer = attrs.peer; - element.addClass(($rootScope.wallet.getOnlinePeerIDs().indexOf(peer) != -1) ? 'online' : 'offline'); - var muted = $rootScope.getVideoMutedStatus(peer); + var peer = JSON.parse(attrs.peer) + var peerId = peer.peerId; + var nick = peer.nick; + element.addClass(($rootScope.wallet.getOnlinePeerIDs().indexOf(peerId) != -1) ? 'online' : 'offline'); + element.addClass('video-small'); + element.attr('title', peerId + (peerId == $rootScope.wallet.network.peerId?' (You)':'')); + var muted = $rootScope.getVideoMutedStatus(peerId); if (muted) { element.attr("muted", true); } From 55d1a2f671ce17c0379e3f96ac20ae0cfb88ff0b Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Thu, 8 May 2014 16:31:08 -0300 Subject: [PATCH 2/3] fix avatar directive bug --- index.html | 2 ++ js/directives.js | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index b4160f35a..8dd57c46d 100644 --- a/index.html +++ b/index.html @@ -126,10 +126,12 @@ {{c.nick}} diff --git a/js/directives.js b/js/directives.js index bbda156d6..78124f461 100644 --- a/js/directives.js +++ b/js/directives.js @@ -95,9 +95,8 @@ angular.module('copay.directives') var peer = JSON.parse(attrs.peer) var peerId = peer.peerId; var nick = peer.nick; - element.addClass(($rootScope.wallet.getOnlinePeerIDs().indexOf(peerId) != -1) ? 'online' : 'offline'); element.addClass('video-small'); - element.attr('title', peerId + (peerId == $rootScope.wallet.network.peerId?' (You)':'')); + element.attr('title', peerId + (peerId == $rootScope.wallet.network.peerId ? ' (You)' : '')); var muted = $rootScope.getVideoMutedStatus(peerId); if (muted) { element.attr("muted", true); From f29ff47e447364cbf7b99a6b865054c9fcc464a9 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Thu, 8 May 2014 16:58:36 -0300 Subject: [PATCH 3/3] remove offline peers --- js/services/controllerUtils.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index 3638bdbf8..d3244c176 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -9,6 +9,15 @@ angular.module('copay.controllerUtils') $rootScope.getVideoURL = function(copayer) { var vi = $rootScope.videoInfo[copayer] if (!vi) return; + + //alert($rootScope.wallet.getOnlinePeerIDs()); + //alert(copayer); + if ($rootScope.wallet.getOnlinePeerIDs().indexOf(copayer) === -1) { + // peer disconnected, remove his video + delete $rootScope.videoInfo[copayer] + return; + } + var encoded = vi.url; var url = decodeURI(encoded); var trusted = $sce.trustAsResourceUrl(url);