Use plugin paste from clipboard on mobile

This commit is contained in:
Gustavo Maximiliano Cortez 2016-02-02 17:07:39 -03:00
parent a1e4f5dce5
commit 3532a8a95e
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
5 changed files with 26 additions and 10 deletions

View File

@ -1,4 +1,4 @@
<div ng-init="wallets[0] ? selectedWalletsOpt = true : selectedWalletsOpts = false"> <div ng-init="wallets[0] ? selectedWalletsOpt = true : selectedWalletsOpts = false; checkClipboard()">
<nav class="tab-bar" ng-style="{'background-color':color}"> <nav class="tab-bar" ng-style="{'background-color':color}">
<section class="left-small"> <section class="left-small">
<a ng-show="!editAddressbook && !addAddressbookEntry" ng-click="cancel()" class="p10"> <a ng-show="!editAddressbook && !addAddressbookEntry" ng-click="cancel()" class="p10">
@ -63,7 +63,7 @@
<a ng-click="selectWallet(w.id, w.name)" class="db oh"> <a ng-click="selectWallet(w.id, w.name)" class="db oh">
<div class="avatar-wallet" <div class="avatar-wallet"
ng-style="{'background-color':w.color}"> ng-style="{'background-color':w.color}">
<i class="icon-wallet size-21 vt"></i> <i class="icon-wallet size-21"></i>
</div> </div>
<div class="ellipsis name-wallet text-bold">{{w.name || w.id}}</div> <div class="ellipsis name-wallet text-bold">{{w.name || w.id}}</div>
<div class="size-12">{{w.m}} of {{w.n}} <div class="size-12">{{w.m}} of {{w.n}}
@ -98,7 +98,7 @@
<a ng-click="toggleAddAddressbookEntry()" class="p0i"> <a ng-click="toggleAddAddressbookEntry()" class="p0i">
<i class="fi-plus size-24 m20r lh icon"></i> <i class="fi-plus size-24 m20r lh icon"></i>
<span class="size-12 tu text-bold" translate>Add a new entry</span> <span class="size-12 tu text-bold" translate>Add a new entry</span>
<span ng-show="!list[newAddress] && newAddress">({{newAddress}})</span> <span class="size-10" ng-show="!list[newAddress] && newAddress">({{newAddress}})</span>
</a> </a>
</li> </li>
</ul> </ul>

View File

@ -387,7 +387,8 @@
<available-balance></available-balance> <available-balance></available-balance>
<a <a
ng-show="!home.lockedCurrentFeePerKb && index.feeToSendMaxStr && index.availableBalanceSat > 0 && !home.blockUx && !home.lockAmount" ng-show="!home.lockedCurrentFeePerKb && index.feeToSendMaxStr && index.availableBalanceSat > 0 && !home.blockUx && !home.lockAmount"
ng-click="home.sendAll()" ng-click="home.sendAll()"
class="p10"
translate> Send All translate> Send All
</a> </a>
</h4> </h4>

View File

@ -957,17 +957,17 @@ ul.wallet-selection.wallets {
} }
label.postfix, a.postfix { label.postfix, a.postfix {
height: 100%; height: 34px;
border: none; border: none;
font-weight: 700; font-weight: 700;
font-size: 14px; font-size: 14px;
color: #7A8C9E; color: #7A8C9E;
text-transform: uppercase; text-transform: uppercase;
border-radius: 0 2px 2px 0;
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
width: 40px; width: 50px;
padding-top: 7px;
} }
a.button.postfix { a.button.postfix {
@ -1000,7 +1000,6 @@ a.button.postfix {
.icon-wallet { .icon-wallet {
display: block; display: block;
margin-top: 7px;
} }
.walletHome .icon-wallet { .walletHome .icon-wallet {

View File

@ -348,8 +348,9 @@ a.missing-copayers {
text-align: center; text-align: center;
float: left; float: left;
width: 35px; width: 35px;
height: 35px; height: 30px;
border-radius: 3px; border-radius: 3px;
padding-top: 5px;
} }
.sidebar header { .sidebar header {

View File

@ -120,6 +120,18 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
'label': '' 'label': ''
}; };
$scope.checkClipboard = function() {
if (!isCordova || isMobile.Windows()) return;
window.cordova.plugins.clipboard.paste(function(value) {
var Address = bitcore.Address;
var networkName = fc.credentials.network;
if (Address.isValid(value, networkName) && !$scope.newAddress) {
$scope.newAddress = value;
}
});
};
$scope.beforeQrCodeScann = function() { $scope.beforeQrCodeScann = function() {
$scope.error = null; $scope.error = null;
$scope.addAddressbookEntry = true; $scope.addAddressbookEntry = true;
@ -250,6 +262,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
if (addr) { if (addr) {
self.setForm(addr); self.setForm(addr);
} }
}, function() {
// onRejected
self.resetForm();
}); });
}; };
@ -916,7 +931,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
$timeout(function() { $timeout(function() {
$rootScope.$digest(); $rootScope.$digest();
}, 1); }, 1);
}; };
this.openPPModal = function(paypro) { this.openPPModal = function(paypro) {
$rootScope.modalOpened = true; $rootScope.modalOpened = true;