Adds qrcode scanner and uses a copy-pasted address
This commit is contained in:
parent
5c42f54e96
commit
b2d933527f
3 changed files with 38 additions and 11 deletions
|
|
@ -1,13 +1,13 @@
|
||||||
<div ng-init="wallets[0] ? selectedWalletsOpt = true : selectedWalletsOpts = false">
|
<div ng-init="wallets[0] ? selectedWalletsOpt = true : selectedWalletsOpts = false">
|
||||||
<nav class="tab-bar">
|
<nav class="tab-bar">
|
||||||
<section class="left-small">
|
<section class="left-small">
|
||||||
<a ng-show="!editAddressbook" ng-click="cancel()" class="p10">
|
<a ng-show="!editAddressbook && !addAddressbookEntry" ng-click="cancel()" class="p10">
|
||||||
<span class="text-close" translate>Close</span>
|
<span class="text-close" translate>Close</span>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="middle tab-bar-section">
|
<section class="middle tab-bar-section">
|
||||||
<ul class="button-group round even-2" ng-show="!editAddressbook && wallets[0]">
|
<ul class="button-group round even-2" ng-show="!editAddressbook && wallets[0] && !addAddressbookEntry">
|
||||||
<li ng-class="{'selected':selectedWalletsOpt}" ng-click="selectedWalletsOpt = true"
|
<li ng-class="{'selected':selectedWalletsOpt}" ng-click="selectedWalletsOpt = true"
|
||||||
translate>
|
translate>
|
||||||
Wallets
|
Wallets
|
||||||
|
|
@ -16,18 +16,21 @@
|
||||||
Addressbook
|
Addressbook
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h1 ng-show="editAddressbook || !wallets[0]" class="title ellipsis" ng-style="{'color':color}" translate>
|
<h1 ng-show="(editAddressbook || !wallets[0]) && !addAddressbookEntry" class="title ellipsis" ng-style="{'color':color}" translate>
|
||||||
Addressbook
|
Addressbook
|
||||||
</h1>
|
</h1>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="right-small" ng-show="!selectedWalletsOpt" ng-click="toggleEditAddressbook()">
|
<section class="right-small" ng-show="!selectedWalletsOpt" ng-click="toggleEditAddressbook()">
|
||||||
<a ng-show="!editAddressbook" href class="p10">
|
<a ng-show="!editAddressbook && !addAddressbookEntry" href class="p10">
|
||||||
<span class="text-close" translate>Edit</span>
|
<span class="text-close" translate>Edit</span>
|
||||||
</a>
|
</a>
|
||||||
<a ng-show="editAddressbook && !addAddressbookEntry" href class="p10">
|
<a ng-show="editAddressbook && !addAddressbookEntry" href class="p10">
|
||||||
<span class="text-close" translate>Done</span>
|
<span class="text-close" translate>Done</span>
|
||||||
</a>
|
</a>
|
||||||
|
<qr-scanner ng-show="addAddressbookEntry"
|
||||||
|
on-scan="onQrCodeScanned(data, addressbookForm)"
|
||||||
|
before-scan="beforeQrCodeScann()"></qr-scanner>
|
||||||
</section>
|
</section>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
@ -82,11 +85,12 @@
|
||||||
<a ng-click="toggleAddAddressbookEntry()" class="p10">
|
<a ng-click="toggleAddAddressbookEntry()" class="p10">
|
||||||
<i class="fi-plus size-18 m10r"></i>
|
<i class="fi-plus size-18 m10r"></i>
|
||||||
<span class="text-close size-12" translate>Add a new entry</span>
|
<span class="text-close size-12" translate>Add a new entry</span>
|
||||||
|
<span ng-show="!list[newAddress]">({{newAddress}})</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div ng-if="addAddressbookEntry" ng-init="addressbook.address = ''; addressbook.label = ''">
|
<div ng-show="addAddressbookEntry">
|
||||||
<h4 class="title m0" translate>Add a new entry</h4>
|
<h4 class="title m0" translate>Add a new entry</h4>
|
||||||
<form name="addressbookForm" class="p10" no-validate>
|
<form name="addressbookForm" class="p10" no-validate>
|
||||||
<div class="text-warning size-12 m10b" ng-show="error">{{error|translate}}</div>
|
<div class="text-warning size-12 m10b" ng-show="error">{{error|translate}}</div>
|
||||||
|
|
@ -107,7 +111,7 @@
|
||||||
<div class="columns large-6 medium-6 small-6">
|
<div class="columns large-6 medium-6 small-6">
|
||||||
<input type="button"
|
<input type="button"
|
||||||
class="button expand round"
|
class="button expand round"
|
||||||
ng-click="toggleAddAddressbookEntry()"
|
ng-click="newAddress = ''; toggleAddAddressbookEntry()"
|
||||||
value="{{'Cancel'|translate}}">
|
value="{{'Cancel'|translate}}">
|
||||||
</div>
|
</div>
|
||||||
<div class="columns large-6 medium-6 small-6">
|
<div class="columns large-6 medium-6 small-6">
|
||||||
|
|
@ -116,7 +120,7 @@
|
||||||
value="{{'Save'|translate}}"
|
value="{{'Save'|translate}}"
|
||||||
ng-disabled="!addressbookForm.$valid"
|
ng-disabled="!addressbookForm.$valid"
|
||||||
ng-style="{'background-color':color}"
|
ng-style="{'background-color':color}"
|
||||||
ng-click="add(addressbook)">
|
ng-click="newAddress = ''; add(addressbook)">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -322,7 +322,8 @@
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input ng-show="sendForm.address.$invalid" class="m0" type="text" id="address" name="address" ng-disabled="home.blockUx || home.lockAddress" ng-attr-placeholder="{{'Bitcoin address'|translate}}" ng-model="_address" valid-address required ng-focus="home.formFocus('address')" ng-blur="home.formFocus(false)">
|
<input ng-show="sendForm.address.$invalid" class="m0" type="text" id="address" name="address" ng-disabled="home.blockUx || home.lockAddress" ng-attr-placeholder="{{'Bitcoin address'|translate}}" ng-model="_address" valid-address required ng-focus="home.formFocus('address')" ng-blur="home.formFocus(false)">
|
||||||
<contact class="addressbook-input" ng-if="!sendForm.address.$invalid && _address" address="{{_address}}"></contact>
|
<contact class="addressbook-input" ng-if="!sendForm.address.$invalid && _address" address="{{_address}}"></contact>
|
||||||
<a class="postfix size-12 m0 text-gray" ng-click="openDestinationAddressModal(index.otherWallets)">
|
<a class="postfix size-12 m0 text-gray"
|
||||||
|
ng-click="openDestinationAddressModal(index.otherWallets, _address)">
|
||||||
<i class="icon-wallet size-18"></i>
|
<i class="icon-wallet size-18"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.openDestinationAddressModal = function(wallets, address, label) {
|
$scope.openDestinationAddressModal = function(wallets, address) {
|
||||||
$rootScope.modalOpened = true;
|
$rootScope.modalOpened = true;
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
self.resetForm();
|
self.resetForm();
|
||||||
|
|
@ -146,9 +146,29 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
$scope.editAddressbook = false;
|
$scope.editAddressbook = false;
|
||||||
$scope.addAddressbookEntry = false;
|
$scope.addAddressbookEntry = false;
|
||||||
$scope.selectedAddressbook = {};
|
$scope.selectedAddressbook = {};
|
||||||
$scope.addressbook = { 'address' : address, 'label' : label};
|
$scope.newAddress = address;
|
||||||
|
$scope.addressbook = { 'address' : ($scope.newAddress || '') , 'label' : ''};
|
||||||
$scope.color = fc.backgroundColor;
|
$scope.color = fc.backgroundColor;
|
||||||
|
|
||||||
|
$scope.beforeQrCodeScann = function() {
|
||||||
|
$scope.error = null;
|
||||||
|
$scope.addAddressbookEntry = true;
|
||||||
|
$scope.editAddressbook = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.onQrCodeScanned = function(data, addressbookForm) {
|
||||||
|
$timeout(function() {
|
||||||
|
var form = addressbookForm;
|
||||||
|
if (data && form) {
|
||||||
|
data = data.replace('bitcoin:', '');
|
||||||
|
form.address.$setViewValue(data);
|
||||||
|
form.address.$isValid = true;
|
||||||
|
form.address.$render();
|
||||||
|
}
|
||||||
|
$scope.$digest();
|
||||||
|
}, 100);
|
||||||
|
};
|
||||||
|
|
||||||
$scope.selectAddressbook = function(addr) {
|
$scope.selectAddressbook = function(addr) {
|
||||||
$modalInstance.close(addr);
|
$modalInstance.close(addr);
|
||||||
};
|
};
|
||||||
|
|
@ -164,6 +184,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.toggleAddAddressbookEntry = function() {
|
$scope.toggleAddAddressbookEntry = function() {
|
||||||
|
$scope.error = null;
|
||||||
|
$scope.addressbook = { 'address' : ($scope.newAddress || '') , 'label' : ''};
|
||||||
$scope.addAddressbookEntry = !$scope.addAddressbookEntry;
|
$scope.addAddressbookEntry = !$scope.addAddressbookEntry;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue