many optimizations in addresses pulling

This commit is contained in:
Matias Alejo Garcia 2014-05-16 18:33:06 -03:00
commit 398daf3f05
9 changed files with 183 additions and 130 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.footer').controller('FooterController', function($scope, $http) {
angular.module('copay.footer').controller('FooterController', function($rootScope, $sce, $scope, $http) {
if (config.themes && Array.isArray(config.themes) && config.themes[0]) {
$scope.themes = config.themes;
@ -15,4 +15,23 @@ angular.module('copay.footer').controller('FooterController', function($scope, $
$scope.theme = 'css/tpl-' + name + '.css';
};
$scope.version = copay.version;
$scope.getVideoURL = function(copayer) {
var vi = $rootScope.videoInfo[copayer]
console.log('[footer.js.21]', vi); //TODO
if (!vi) return;
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);
console.log('[footer.js.31:trusted:]',trusted); //TODO
return trusted;
};
});