Merge pull request #186 from cmgustavo/feature/01-spinners-buttons
Feature/01 spinners buttons
This commit is contained in:
commit
660285f924
9 changed files with 54 additions and 20 deletions
|
|
@ -248,6 +248,10 @@ button.secondary { background-color: #FAE448 !important; }
|
||||||
button.primary:hover { background-color: #333;}
|
button.primary:hover { background-color: #333;}
|
||||||
button.secondary:hover { background-color: #FFDF00 !important;}
|
button.secondary:hover { background-color: #FFDF00 !important;}
|
||||||
|
|
||||||
|
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.dn {display: none;}
|
||||||
.text-gray { color: #999 !important;}
|
.text-gray { color: #999 !important;}
|
||||||
.pr {position: relative;}
|
.pr {position: relative;}
|
||||||
.m0 {margin: 0;}
|
.m0 {margin: 0;}
|
||||||
|
|
|
||||||
BIN
img/loading.gif
Normal file
BIN
img/loading.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 529 B |
22
index.html
22
index.html
|
|
@ -93,7 +93,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row" ng-cloak class="ng-cloak">
|
||||||
<div class="large-12 columns" ng-view></div>
|
<div class="large-12 columns" ng-view></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
<h3>Create a New Wallet</h3>
|
<h3>Create a New Wallet</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-3 columns">
|
<div class="large-3 columns">
|
||||||
<button class="button secondary expand round" ng-click="create()">Create</button>
|
<button class="button secondary expand round" ng-click="create()" ng-disabled="loading" loading="Creating">Create</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
@ -125,7 +125,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="large-3 columns">
|
<div class="large-3 columns">
|
||||||
<button class="button secondary expand round" type="button"
|
<button class="button secondary expand round" type="button"
|
||||||
ng-click="open(selectedWalletId)">Open</button>
|
ng-click="open(selectedWalletId)" ng-disabled="loading" loading="Opening">Open</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
@ -139,7 +139,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="large-3 columns">
|
<div class="large-3 columns">
|
||||||
<button class="button primary expand round"
|
<button class="button primary expand round"
|
||||||
ng-click="join(connectionId)">Join</button>
|
ng-click="join(connectionId)" ng-disabled="loading" loading="Joining">Join</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
@ -148,7 +148,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
<div ng-show="wallets.length">
|
<div ng-show="wallets.length">
|
||||||
<a ng-click="create()">Create a new wallet</a>
|
<a ng-click="create()" ng-disabled="loading" loading="Creating">Create a new wallet</a>
|
||||||
</div>
|
</div>
|
||||||
<a class="right" ng-click="import()">Import from file</a>
|
<a class="right" ng-click="import()">Import from file</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -253,7 +253,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="large-3 columns text-center">
|
<div class="large-3 columns text-center">
|
||||||
<p> Create a New <strong> Address </strong> </p>
|
<p> Create a New <strong> Address </strong> </p>
|
||||||
<button class="secondary round expand" ng-click="newAddr()"> Create </button>
|
<button class="secondary round expand" ng-click="newAddr()" ng-disabled="loading" loading="Creating"> Create </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -324,10 +324,10 @@
|
||||||
<i class="fi-check size-40"></i> Signed by you already
|
<i class="fi-check size-40"></i> Signed by you already
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="!tx.signedByUs && !tx.rejectedByUs && !tx.finallyRejected && tx.missingSignatures">
|
<div ng-show="!tx.signedByUs && !tx.rejectedByUs && !tx.finallyRejected && tx.missingSignatures">
|
||||||
<button class="secondary round" ng-click="sign(tx.ntxid)">
|
<button class="secondary round" ng-click="sign(tx.ntxid)" ng-disabled="loading" loading="Signing">
|
||||||
<i class="fi-check"></i> Sign
|
<i class="fi-check"></i> Sign
|
||||||
</button>
|
</button>
|
||||||
<button class="primary round" ng-click="reject(tx.ntxid)">
|
<button class="primary round" ng-click="reject(tx.ntxid)" ng-disabled="loading" loading>
|
||||||
<i class="fi-x" ></i> Reject
|
<i class="fi-x" ></i> Reject
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -339,7 +339,7 @@
|
||||||
|
|
||||||
<span ng-show="!tx.missingSignatures && !tx.sentTs">
|
<span ng-show="!tx.missingSignatures && !tx.sentTs">
|
||||||
Transaction ready.
|
Transaction ready.
|
||||||
<button class="secondary round" ng-click="send(tx.ntxid)">
|
<button class="secondary round" ng-click="send(tx.ntxid)" ng-disabled="loading" loading="Broadcasting">
|
||||||
Broadcast Transaction
|
Broadcast Transaction
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -451,8 +451,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-4 columns">
|
<div class="large-5 columns">
|
||||||
<button type="submit" class="button secondary round text-center" ng-disabled="sendForm.$invalid">
|
<button type="submit" class="button secondary round text-center" ng-disabled="sendForm.$invalid || loading" loading="Sending">
|
||||||
Send
|
Send
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,14 @@ angular.module('copay.addresses').controller('AddressesController',
|
||||||
$scope.isMain = isMain;
|
$scope.isMain = isMain;
|
||||||
$scope.addrs = Object.keys(balanceByAddr);
|
$scope.addrs = Object.keys(balanceByAddr);
|
||||||
$scope.selectedAddr = $scope.addrs[0];
|
$scope.selectedAddr = $scope.addrs[0];
|
||||||
|
$scope.loading = false;
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.newAddr = function() {
|
$scope.newAddr = function() {
|
||||||
|
$scope.loading = true;
|
||||||
w.generateAddress();
|
w.generateAddress();
|
||||||
_updateBalance();
|
_updateBalance();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
angular.module('copay.send').controller('SendController',
|
angular.module('copay.send').controller('SendController',
|
||||||
function($scope, $rootScope, $location) {
|
function($scope, $rootScope, $location) {
|
||||||
$scope.title = 'Send';
|
$scope.title = 'Send';
|
||||||
|
$scope.loading = false;
|
||||||
|
|
||||||
$scope.unitIds = ['BTC','mBTC'];
|
$scope.unitIds = ['BTC','mBTC'];
|
||||||
$scope.selectedUnit = $scope.unitIds[0];
|
$scope.selectedUnit = $scope.unitIds[0];
|
||||||
|
|
@ -13,20 +14,24 @@ angular.module('copay.send').controller('SendController',
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.loading = true;
|
||||||
|
|
||||||
var address = form.address.$modelValue;
|
var address = form.address.$modelValue;
|
||||||
var amount = (form.amount.$modelValue * 100000000).toString(); // satoshi to string
|
var amount = (form.amount.$modelValue * 100000000).toString(); // satoshi to string
|
||||||
|
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
w.createTx( address, amount,function() {
|
w.createTx( address, amount,function() {
|
||||||
|
|
||||||
// reset fields
|
$scope.loading = false;
|
||||||
$scope.address = null;
|
|
||||||
$scope.amount = null;
|
|
||||||
form.address.$pristine = true;
|
|
||||||
form.amount.$pristine = true;
|
|
||||||
$rootScope.flashMessage = { message: 'The transaction proposal has been created', type: 'success'};
|
$rootScope.flashMessage = { message: 'The transaction proposal has been created', type: 'success'};
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
// reset fields
|
||||||
|
$scope.address = null;
|
||||||
|
$scope.amount = null;
|
||||||
|
form.address.$pristine = true;
|
||||||
|
form.amount.$pristine = true;
|
||||||
|
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ angular.module('copay.signin').controller('SigninController',
|
||||||
$scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null;
|
$scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null;
|
||||||
|
|
||||||
$scope.create = function() {
|
$scope.create = function() {
|
||||||
|
$scope.loading = true;
|
||||||
$location.path('setup');
|
$location.path('setup');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ angular.module('copay.transactions').controller('TransactionsController',
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore');
|
||||||
|
|
||||||
$scope.title = 'Transactions';
|
$scope.title = 'Transactions';
|
||||||
|
$scope.loading = false;
|
||||||
var _updateTxs = function() {
|
var _updateTxs = function() {
|
||||||
var w =$rootScope.wallet;
|
var w =$rootScope.wallet;
|
||||||
if (!w) return;
|
if (!w) return;
|
||||||
|
|
@ -34,9 +35,11 @@ angular.module('copay.transactions').controller('TransactionsController',
|
||||||
$scope.txs = txs;
|
$scope.txs = txs;
|
||||||
w.removeListener('txProposalsUpdated',_updateTxs)
|
w.removeListener('txProposalsUpdated',_updateTxs)
|
||||||
w.once('txProposalsUpdated',_updateTxs);
|
w.once('txProposalsUpdated',_updateTxs);
|
||||||
|
$scope.loading = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.send = function (ntxid) {
|
$scope.send = function (ntxid) {
|
||||||
|
$scope.loading = true;
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
w.sendTx(ntxid, function(txid) {
|
w.sendTx(ntxid, function(txid) {
|
||||||
console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO
|
console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO
|
||||||
|
|
@ -50,6 +53,7 @@ angular.module('copay.transactions').controller('TransactionsController',
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.sign = function (ntxid) {
|
$scope.sign = function (ntxid) {
|
||||||
|
$scope.loading = true;
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
var ret = w.sign(ntxid);
|
var ret = w.sign(ntxid);
|
||||||
|
|
||||||
|
|
@ -84,6 +88,7 @@ angular.module('copay.transactions').controller('TransactionsController',
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.reject = function (ntxid) {
|
$scope.reject = function (ntxid) {
|
||||||
|
$scope.loading = true;
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
w.reject(ntxid);
|
w.reject(ntxid);
|
||||||
$rootScope.flashMessage = {type:'warning', message: 'Transaction rejected by you'};
|
$rootScope.flashMessage = {type:'warning', message: 'Transaction rejected by you'};
|
||||||
|
|
|
||||||
|
|
@ -58,5 +58,22 @@ angular.module('copay.directives')
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}])
|
}])
|
||||||
|
.directive('loading', function () {
|
||||||
|
return {
|
||||||
|
restrict: 'A',
|
||||||
|
link: function (scope, element, attr) {
|
||||||
|
var a = element.html();
|
||||||
|
var text = attr.loading;
|
||||||
|
scope.$watch('loading', function (val) {
|
||||||
|
if (val) {
|
||||||
|
element.html('<img src="img/loading.gif"> ' + text + '...' );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
element.html(a);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,12 +214,12 @@ PublicKeyRing.prototype.getAddresses = function(onlyMain) {
|
||||||
var ret = [];
|
var ret = [];
|
||||||
|
|
||||||
for (var i=0; i<this.addressIndex; i++) {
|
for (var i=0; i<this.addressIndex; i++) {
|
||||||
ret.push(this.getAddress(i,false));
|
ret.unshift(this.getAddress(i,false));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!onlyMain) {
|
if (!onlyMain) {
|
||||||
for (var i=0; i<this.changeAddressIndex; i++) {
|
for (var i=0; i<this.changeAddressIndex; i++) {
|
||||||
ret.push(this.getAddress(i,true));
|
ret.unshift(this.getAddress(i,true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue