mirror of https://github.com/BTCPrivate/copay.git
Remove peerjs
This commit is contained in:
parent
e73a3f8160
commit
ac78e2d1e7
|
@ -83,7 +83,6 @@ module.exports = function(grunt) {
|
||||||
'js/shell.js', // shell must be loaded before moment due to the way moment loads in a commonjs env
|
'js/shell.js', // shell must be loaded before moment due to the way moment loads in a commonjs env
|
||||||
'lib/moment/min/moment.min.js',
|
'lib/moment/min/moment.min.js',
|
||||||
'lib/qrcode-generator/js/qrcode.js',
|
'lib/qrcode-generator/js/qrcode.js',
|
||||||
'lib/peer.js',
|
|
||||||
'lib/bitcore.js',
|
'lib/bitcore.js',
|
||||||
'lib/crypto-js/rollups/sha256.js',
|
'lib/crypto-js/rollups/sha256.js',
|
||||||
'lib/crypto-js/rollups/pbkdf2.js',
|
'lib/crypto-js/rollups/pbkdf2.js',
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
"angular-foundation": "*",
|
"angular-foundation": "*",
|
||||||
"angular-route": "~1.2.14",
|
"angular-route": "~1.2.14",
|
||||||
"angular-qrcode": "~3.1.0",
|
"angular-qrcode": "~3.1.0",
|
||||||
"peerjs": "=0.3.8",
|
|
||||||
"angular-mocks": "~1.2.14",
|
"angular-mocks": "~1.2.14",
|
||||||
"mocha": "~1.18.2",
|
"mocha": "~1.18.2",
|
||||||
"chai": "~1.9.1",
|
"chai": "~1.9.1",
|
||||||
|
|
|
@ -205,23 +205,6 @@ a:hover {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar ul.copayer-list {
|
|
||||||
list-style-type: none;
|
|
||||||
padding:0; margin:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar ul.copayer-list li {
|
|
||||||
margin-top: 15px;
|
|
||||||
font-weight: 100;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #C9C9C9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar ul.copayer-list img {
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button.small.side-bar {
|
.button.small.side-bar {
|
||||||
padding: 0rem 0.4rem;
|
padding: 0rem 0.4rem;
|
||||||
}
|
}
|
||||||
|
@ -954,7 +937,15 @@ button, .button, p {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-box {
|
.copay-box-small {
|
||||||
|
width: 40px;
|
||||||
|
text-align: center;
|
||||||
|
margin-right: 10px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copay-box {
|
||||||
width: 70px;
|
width: 70px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
|
@ -962,11 +953,6 @@ button, .button, p {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-small {
|
|
||||||
width: 50px;
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-input {
|
.icon-input {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 11px;
|
top: 11px;
|
||||||
|
|
|
@ -26,4 +26,15 @@ angular.module('copayApp.controllers').controller('CopayersController',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Cached list of copayers
|
||||||
|
$scope.copayers = $rootScope.wallet.getRegisteredPeerIds();
|
||||||
|
|
||||||
|
$scope.copayersList = function() {
|
||||||
|
return $rootScope.wallet.getRegisteredPeerIds();
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.isBackupReady = function(copayer) {
|
||||||
|
return $rootScope.wallet.publicKeyRing.isBackupReady(copayer.copayerId);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,7 +37,6 @@ angular.module('copayApp.controllers').controller('CreateController',
|
||||||
controllerUtils.redirIfLogged();
|
controllerUtils.redirIfLogged();
|
||||||
|
|
||||||
$rootScope.fromSetup = true;
|
$rootScope.fromSetup = true;
|
||||||
$rootScope.videoInfo = {};
|
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
$scope.walletPassword = $rootScope.walletPassword;
|
$scope.walletPassword = $rootScope.walletPassword;
|
||||||
$scope.isMobile = !!window.cordova;
|
$scope.isMobile = !!window.cordova;
|
||||||
|
|
|
@ -108,20 +108,6 @@ angular.module('copayApp.directives')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.directive('avatar', function($rootScope, controllerUtils) {
|
|
||||||
return {
|
|
||||||
link: function(scope, element, attrs) {
|
|
||||||
var peer = JSON.parse(attrs.peer)
|
|
||||||
var peerId = peer.peerId;
|
|
||||||
var nick = peer.nick;
|
|
||||||
element.addClass('video-small');
|
|
||||||
var muted = controllerUtils.getVideoMutedStatus(peerId);
|
|
||||||
if (true || muted) { // mute everyone for now
|
|
||||||
element.attr("muted", true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.directive('contact', function() {
|
.directive('contact', function() {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
|
|
|
@ -460,28 +460,12 @@ Wallet.prototype.netStart = function(callback) {
|
||||||
self.emit('ready', net.getPeer());
|
self.emit('ready', net.getPeer());
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
self.emit('publicKeyRingUpdated', true);
|
self.emit('publicKeyRingUpdated', true);
|
||||||
//self.scheduleConnect();
|
|
||||||
// no connection logic for now
|
// no connection logic for now
|
||||||
self.emit('txProposalsUpdated');
|
self.emit('txProposalsUpdated');
|
||||||
}, 10);
|
}, 10);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// not being used now
|
|
||||||
Wallet.prototype.scheduleConnect = function() {
|
|
||||||
var self = this;
|
|
||||||
if (self.network.isOnline()) {
|
|
||||||
self.connectToAll();
|
|
||||||
self.currentDelay = self.currentDelay * 2 || self.reconnectDelay;
|
|
||||||
setTimeout(self.scheduleConnect.bind(self), self.currentDelay);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Wallet.prototype.getOnlinePeerIDs = function() {
|
|
||||||
return this.network.getOnlinePeerIDs();
|
|
||||||
};
|
|
||||||
|
|
||||||
Wallet.prototype.getRegisteredCopayerIds = function() {
|
Wallet.prototype.getRegisteredCopayerIds = function() {
|
||||||
var l = this.publicKeyRing.registeredCopayers();
|
var l = this.publicKeyRing.registeredCopayers();
|
||||||
var copayers = [];
|
var copayers = [];
|
||||||
|
|
|
@ -2,17 +2,8 @@
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore');
|
||||||
|
|
||||||
angular.module('copayApp.services')
|
angular.module('copayApp.services')
|
||||||
.factory('controllerUtils', function($rootScope, $sce, $location, notification, $timeout, video, uriHandler, rateService) {
|
.factory('controllerUtils', function($rootScope, $sce, $location, notification, $timeout, uriHandler, rateService) {
|
||||||
var root = {};
|
var root = {};
|
||||||
root.getVideoMutedStatus = function(copayer) {
|
|
||||||
if (!$rootScope.videoInfo) return;
|
|
||||||
|
|
||||||
var vi = $rootScope.videoInfo[copayer]
|
|
||||||
if (!vi) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return vi.muted;
|
|
||||||
};
|
|
||||||
|
|
||||||
root.redirIfLogged = function() {
|
root.redirIfLogged = function() {
|
||||||
if ($rootScope.wallet) {
|
if ($rootScope.wallet) {
|
||||||
|
@ -27,7 +18,6 @@ angular.module('copayApp.services')
|
||||||
$rootScope.wallet = null;
|
$rootScope.wallet = null;
|
||||||
delete $rootScope['wallet'];
|
delete $rootScope['wallet'];
|
||||||
|
|
||||||
video.close();
|
|
||||||
// Clear rootScope
|
// Clear rootScope
|
||||||
for (var i in $rootScope) {
|
for (var i in $rootScope) {
|
||||||
if (i.charAt(0) != '$') {
|
if (i.charAt(0) != '$') {
|
||||||
|
@ -102,18 +92,6 @@ angular.module('copayApp.services')
|
||||||
root.installStartupHandlers(w, $scope);
|
root.installStartupHandlers(w, $scope);
|
||||||
root.updateGlobalAddresses();
|
root.updateGlobalAddresses();
|
||||||
|
|
||||||
var handlePeerVideo = function(err, peerID, url) {
|
|
||||||
if (err) {
|
|
||||||
delete $rootScope.videoInfo[peerID];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$rootScope.videoInfo[peerID] = {
|
|
||||||
url: encodeURI(url),
|
|
||||||
muted: peerID === w.network.peerId
|
|
||||||
};
|
|
||||||
$rootScope.$digest();
|
|
||||||
};
|
|
||||||
|
|
||||||
notification.enableHtml5Mode(); // for chrome: if support, enable it
|
notification.enableHtml5Mode(); // for chrome: if support, enable it
|
||||||
|
|
||||||
w.on('corrupt', function(peerId) {
|
w.on('corrupt', function(peerId) {
|
||||||
|
@ -128,8 +106,6 @@ angular.module('copayApp.services')
|
||||||
} else {
|
} else {
|
||||||
$location.path('receive');
|
$location.path('receive');
|
||||||
}
|
}
|
||||||
if (!config.disableVideo)
|
|
||||||
video.setOwnPeer(myPeerID, w, handlePeerVideo);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
w.on('publicKeyRingUpdated', function(dontDigest) {
|
w.on('publicKeyRingUpdated', function(dontDigest) {
|
||||||
|
@ -172,9 +148,6 @@ angular.module('copayApp.services')
|
||||||
root.onErrorDigest(null, msg);
|
root.onErrorDigest(null, msg);
|
||||||
});
|
});
|
||||||
w.on('connect', function(peerID) {
|
w.on('connect', function(peerID) {
|
||||||
if (peerID && !config.disableVideo) {
|
|
||||||
video.callPeer(peerID, handlePeerVideo);
|
|
||||||
}
|
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
});
|
});
|
||||||
w.on('close', root.onErrorDigest);
|
w.on('close', root.onErrorDigest);
|
||||||
|
|
Loading…
Reference in New Issue