fix conflict
This commit is contained in:
commit
2d3fdbe6fb
14 changed files with 57 additions and 12 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
"bitcore": "0.1.34",
|
"bitcore": "0.1.34",
|
||||||
"angular-moment": "~0.7.1",
|
"angular-moment": "~0.7.1",
|
||||||
"socket.io-client": ">=1.0.0",
|
"socket.io-client": ">=1.0.0",
|
||||||
"mousetrap": "1.4.6"
|
"mousetrap": "1.4.6",
|
||||||
|
"ng-idle": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,11 @@ a:hover {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.box-setup label small.has-error {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #FFA59B;
|
||||||
|
}
|
||||||
|
|
||||||
.last-transactions {
|
.last-transactions {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
background-color: #E8EAEF;
|
background-color: #E8EAEF;
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@
|
||||||
<script src="lib/angular-moment/angular-moment.js"></script>
|
<script src="lib/angular-moment/angular-moment.js"></script>
|
||||||
<script src="lib/qrcode-generator/js/qrcode.js"></script>
|
<script src="lib/qrcode-generator/js/qrcode.js"></script>
|
||||||
<script src="lib/angular-qrcode/qrcode.js"></script>
|
<script src="lib/angular-qrcode/qrcode.js"></script>
|
||||||
|
<script src="lib/ng-idle/angular-idle.min.js"></script>
|
||||||
<script src="lib/angular-foundation/mm-foundation.min.js"></script>
|
<script src="lib/angular-foundation/mm-foundation.min.js"></script>
|
||||||
<script src="lib/angular-foundation/mm-foundation-tpls.min.js"></script>
|
<script src="lib/angular-foundation/mm-foundation-tpls.min.js"></script>
|
||||||
<script src="lib/peer.js"></script> <!-- TODO Change this on PeerJS version 0.3.9 -->
|
<script src="lib/peer.js"></script> <!-- TODO Change this on PeerJS version 0.3.9 -->
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ var copayApp = window.copayApp = angular.module('copayApp', [
|
||||||
'angularMoment',
|
'angularMoment',
|
||||||
'mm.foundation',
|
'mm.foundation',
|
||||||
'monospaced.qrcode',
|
'monospaced.qrcode',
|
||||||
|
'ngIdle',
|
||||||
'copayApp.filters',
|
'copayApp.filters',
|
||||||
'copayApp.services',
|
'copayApp.services',
|
||||||
'copayApp.controllers',
|
'copayApp.controllers',
|
||||||
|
|
@ -40,6 +41,7 @@ copayApp.config(function($sceDelegateProvider) {
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
angular.module('copayApp.filters', []);
|
angular.module('copayApp.filters', []);
|
||||||
angular.module('copayApp.services', []);
|
angular.module('copayApp.services', []);
|
||||||
angular.module('copayApp.controllers', []);
|
angular.module('copayApp.controllers', []);
|
||||||
|
|
|
||||||
|
|
@ -82,4 +82,15 @@ angular.module('copayApp.controllers').controller('SidebarController',
|
||||||
// Init socket handlers (with no wallet yet)
|
// Init socket handlers (with no wallet yet)
|
||||||
controllerUtils.setSocketHandlers();
|
controllerUtils.setSocketHandlers();
|
||||||
|
|
||||||
|
if ($rootScope.wallet) {
|
||||||
|
$scope.$on('$idleStart', function(a) {
|
||||||
|
notification.warning('Session will be closed', 'Your session is about to expire due to inactivity');
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.$on('$idleTimeout', function() {
|
||||||
|
$scope.signout();
|
||||||
|
notification.warning('Session closed', 'Session closed because a long time of inactivity');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ function HDParams(opts) {
|
||||||
|
|
||||||
HDParams.init = function(totalCopayers) {
|
HDParams.init = function(totalCopayers) {
|
||||||
preconditions.shouldBeNumber(totalCopayers);
|
preconditions.shouldBeNumber(totalCopayers);
|
||||||
var ret = [new HDParams()];
|
var ret = [new HDParams({receiveIndex: 1})];
|
||||||
for (var i = 0 ; i < totalCopayers ; i++) {
|
for (var i = 0 ; i < totalCopayers ; i++) {
|
||||||
ret.push(new HDParams({copayerIndex: i}));
|
ret.push(new HDParams({copayerIndex: i}));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,17 +65,22 @@ angular
|
||||||
//Setting HTML5 Location Mode
|
//Setting HTML5 Location Mode
|
||||||
angular
|
angular
|
||||||
.module('copayApp')
|
.module('copayApp')
|
||||||
.config(function($locationProvider) {
|
.config(function($locationProvider, $idleProvider) {
|
||||||
$locationProvider
|
$locationProvider
|
||||||
.html5Mode(false)
|
.html5Mode(false)
|
||||||
.hashPrefix('!');
|
.hashPrefix('!');
|
||||||
|
// IDLE timeout
|
||||||
|
$idleProvider.idleDuration(15 * 60); // in seconds
|
||||||
|
$idleProvider.warningDuration(10); // in seconds
|
||||||
})
|
})
|
||||||
.run(function($rootScope, $location) {
|
.run(function($rootScope, $location, $idle) {
|
||||||
|
$idle.watch();
|
||||||
$rootScope.$on('$routeChangeStart', function(event, next, current) {
|
$rootScope.$on('$routeChangeStart', function(event, next, current) {
|
||||||
if (!util.supports.data) {
|
if (!util.supports.data) {
|
||||||
$location.path('unsupported');
|
$location.path('unsupported');
|
||||||
} else {
|
} else {
|
||||||
if ((!$rootScope.wallet || !$rootScope.wallet.id) && next.validate) {
|
if ((!$rootScope.wallet || !$rootScope.wallet.id) && next.validate) {
|
||||||
|
$idle.unwatch();
|
||||||
$location.path('/');
|
$location.path('/');
|
||||||
}
|
}
|
||||||
if ($rootScope.wallet && !$rootScope.wallet.isReady()) {
|
if ($rootScope.wallet && !$rootScope.wallet.isReady()) {
|
||||||
|
|
|
||||||
|
|
@ -185,13 +185,14 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
root.updateAddressList = function() {
|
root.updateAddressList = function() {
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
if (w)
|
if (w && w.isReady())
|
||||||
$rootScope.addrInfos = w.getAddressesInfo();
|
$rootScope.addrInfos = w.getAddressesInfo();
|
||||||
};
|
};
|
||||||
|
|
||||||
root.updateBalance = function(cb) {
|
root.updateBalance = function(cb) {
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
if (!w) return root.onErrorDigest();
|
if (!w) return root.onErrorDigest();
|
||||||
|
if (!w.isReady()) return;
|
||||||
|
|
||||||
$rootScope.balanceByAddr = {};
|
$rootScope.balanceByAddr = {};
|
||||||
$rootScope.updatingBalance = true;
|
$rootScope.updatingBalance = true;
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ module.exports = function(config) {
|
||||||
'lib/angular/angular.min.js',
|
'lib/angular/angular.min.js',
|
||||||
'lib/angular-mocks/angular-mocks.js',
|
'lib/angular-mocks/angular-mocks.js',
|
||||||
'lib/moment/moment.js',
|
'lib/moment/moment.js',
|
||||||
|
'lib/ng-idle/angular-idle.min.js',
|
||||||
'lib/angular-moment/angular-moment.js',
|
'lib/angular-moment/angular-moment.js',
|
||||||
'lib/qrcode-generator/js/qrcode.js',
|
'lib/qrcode-generator/js/qrcode.js',
|
||||||
'lib/angular-qrcode/qrcode.js',
|
'lib/angular-qrcode/qrcode.js',
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@ FakeWallet.prototype.getAddressesInfo = function() {
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FakeWallet.prototype.isReady = function() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FakeWallet.prototype.getBalance = function(cb) {
|
FakeWallet.prototype.getBalance = function(cb) {
|
||||||
return cb(null, this.balance, this.balanceByAddr, this.safeBalance);
|
return cb(null, this.balance, this.balanceByAddr, this.safeBalance);
|
||||||
|
|
|
||||||
|
|
@ -145,9 +145,8 @@ describe('PublicKeyRing model', function() {
|
||||||
var k = createW();
|
var k = createW();
|
||||||
var w = k.w;
|
var w = k.w;
|
||||||
|
|
||||||
|
|
||||||
var a = w.getAddresses();
|
var a = w.getAddresses();
|
||||||
a.length.should.equal(0);
|
a.length.should.equal(1);
|
||||||
|
|
||||||
[true, false].forEach(function(isChange){
|
[true, false].forEach(function(isChange){
|
||||||
for (var i = 0; i < 2; i++) {
|
for (var i = 0; i < 2; i++) {
|
||||||
|
|
@ -156,15 +155,22 @@ describe('PublicKeyRing model', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
var as = w.getAddressesInfo();
|
var as = w.getAddressesInfo();
|
||||||
as.length.should.equal(4);
|
as.length.should.equal(5); // include pre-generated shared one
|
||||||
for (var j in as) {
|
for (var j in as) {
|
||||||
var a = as[j];
|
var a = as[j];
|
||||||
a.address.isValid().should.equal(true);
|
a.address.isValid().should.equal(true);
|
||||||
a.addressStr.should.equal(a.address.toString());
|
a.addressStr.should.equal(a.address.toString());
|
||||||
a.isChange.should.equal([false, false, true, true][j]);
|
a.isChange.should.equal([false, false, false, true, true][j]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
it('should start with one shared address', function() {
|
||||||
|
var k = createW();
|
||||||
|
var a = k.w.getAddresses();
|
||||||
|
a.length.should.equal(1);
|
||||||
|
});
|
||||||
|
|
||||||
it('should count generation indexes', function() {
|
it('should count generation indexes', function() {
|
||||||
var k = createW();
|
var k = createW();
|
||||||
var w = k.w;
|
var w = k.w;
|
||||||
|
|
|
||||||
|
|
@ -594,7 +594,7 @@ describe('Wallet model', function() {
|
||||||
|
|
||||||
|
|
||||||
it('should get balance', function(done) {
|
it('should get balance', function(done) {
|
||||||
var w = createW();
|
var w = createW2();
|
||||||
var spy = sinon.spy(w.blockchain, 'getUnspent');
|
var spy = sinon.spy(w.blockchain, 'getUnspent');
|
||||||
w.blockchain.fixUnspent([]);
|
w.blockchain.fixUnspent([]);
|
||||||
w.getBalance(function(err, balance, balanceByAddr, safeBalance) {
|
w.getBalance(function(err, balance, balanceByAddr, safeBalance) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,15 @@
|
||||||
<div class="box-setup">
|
<div class="box-setup">
|
||||||
<h1 class="text-primary line-sidebar-b">Join a Wallet in Creation</h1>
|
<h1 class="text-primary line-sidebar-b">Join a Wallet in Creation</h1>
|
||||||
<form name="joinForm" ng-submit="join(joinForm)" novalidate>
|
<form name="joinForm" ng-submit="join(joinForm)" novalidate>
|
||||||
<label for="connectionId"> Wallet Setting </label>
|
|
||||||
|
<label for="connectionId"> Wallet Setting
|
||||||
|
<small class="has-error" ng-show="joinForm.connectionId.$invalid
|
||||||
|
&& !joinForm.connectionId.$pristine">Wallet Secret is not valid!</small>
|
||||||
|
<small data-options="disable_for_touch:true"
|
||||||
|
ng-show="joinForm.connectionId.$pristine" class="has-tip
|
||||||
|
text-gray" tooltip="Paste wallet secret here" >Required</small>
|
||||||
|
</label>
|
||||||
|
|
||||||
<input id="connectionId" type="text" class="small-9 columns" placeholder="Paste wallet secret here" name="connectionId" ng-model="connectionId" wallet-secret required style="width:85%;">
|
<input id="connectionId" type="text" class="small-9 columns" placeholder="Paste wallet secret here" name="connectionId" ng-model="connectionId" wallet-secret required style="width:85%;">
|
||||||
<div class="small-2 columns" style="padding:0px;width:15%;" ng-hide="showScanner">
|
<div class="small-2 columns" style="padding:0px;width:15%;" ng-hide="showScanner">
|
||||||
<a class="postfix button primary" ng-click="openScanner()"><i class="fi-camera"> </i></a>
|
<a class="postfix button primary" ng-click="openScanner()"><i class="fi-camera"> </i></a>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<qrcode size="250" data="{{address.address}}"></qrcode>
|
<qrcode size="250" data="{{address.address}}"></qrcode>
|
||||||
|
|
||||||
<div class="m10t">
|
<div class="m10t">
|
||||||
<h4>{{address.address}}</h4>
|
<h4>{{address.address}}</h4>
|
||||||
<span ng-if="$root.updatingBalance">
|
<span ng-if="$root.updatingBalance">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue