Merge branch 'ref/design' of https://github.com/bitpay/bitpay-wallet into feature/home_views_polish

# Conflicts:
#	public/views/tab-home.html
This commit is contained in:
Jamal Jackson 2016-09-27 13:43:36 -04:00
commit 28b6e312a7
19 changed files with 191 additions and 137 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, gettext, txFormatService, ongoingProcess, $ionicModal, $ionicHistory, popupService) {
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, gettext, txFormatService, ongoingProcess, $ionicModal, popupService) {
var cachedTxp = {};
var isChromeApp = platformInfo.isChromeApp;

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('importController',
function($scope, $timeout, $log, $state, $stateParams, profileService, configService, sjcl, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog) {
function($scope, $timeout, $log, $state, $stateParams, $ionicHistory, profileService, configService, sjcl, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog) {
var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel;

View file

@ -126,6 +126,9 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
$scope.rateDate = res.fetchedOn;
$scope.rateStr = res.rate + ' ' + $scope.alternativeIsoCode;
$scope.alternativeAmountStr = $filter('formatFiatAmount')(alternativeAmountBtc * res.rate) + ' ' + $scope.alternativeIsoCode;
$timeout(function() {
$scope.$apply();
});
}
});
};

View file

@ -3,7 +3,7 @@
angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout, $state, $ionicHistory, $log, addressbookService) {
if ($scope.cb) $timeout($scope.cb, 100);
$scope.fromSendTab = $ionicHistory.viewHistory().backView.stateName === "tabs.send.amount" || "tabs.send";
$scope.fromSendTab = $ionicHistory.viewHistory().backView && $ionicHistory.viewHistory().backView.stateName === "tabs.send.amount" ||  "tabs.send";
$scope.cancel = function() {
$scope.txStatusModal.hide();

View file

@ -7,6 +7,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
var isGlidera = $scope.isGlidera;
var GLIDERA_LOCK_TIME = 6 * 60 * 60;
var now = Math.floor(Date.now() / 1000);
var countDown;
$scope.init = function() {
$scope.loading = null;
@ -18,6 +19,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.data = {};
initActionList();
checkPaypro();
}
function initActionList() {
@ -53,8 +55,6 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.sign();
});
checkPaypro();
// ToDo: use tx.customData instead of tx.message
if (tx.message === 'Glidera transaction' && isGlidera) {
tx.isGlidera = true;
@ -154,7 +154,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.paymentExpired = false;
setExpirationTime();
self.countDown = $interval(function() {
countDown = $interval(function() {
setExpirationTime();
}, 1000);
@ -162,7 +162,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
var now = Math.floor(Date.now() / 1000);
if (now > expirationTime) {
$scope.paymentExpired = true;
if (self.countDown) $interval.cancel(self.countDown);
if (countDown) $interval.cancel(countDown);
return;
}
var totalSecs = expirationTime - now;

View file

@ -33,12 +33,16 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.addr = null;
$scope.generatingAddress = true;
$timeout(function() {
walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
$scope.generatingAddress = false;
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
$scope.addr = addr;
if ($scope.wallet.showBackupNeededModal) $scope.openBackupNeededModal();
$scope.$apply();
});
}, 100);
walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
$scope.generatingAddress = false;
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
$scope.addr = addr;
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
@ -49,13 +53,9 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$log.debug('No wallet provided');
return;
}
$timeout(function() {
$scope.wallet = wallet;
$log.debug('Wallet changed: ' + wallet.name);
$scope.setAddress();
if ($scope.wallet.showBackupNeededModal) $scope.openBackupNeededModal();
$scope.$apply();
});
$scope.wallet = wallet;
$log.debug('Wallet changed: ' + wallet.name);
$scope.setAddress();
});
});

View file

@ -1,8 +1,10 @@
'use strict';
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $log, $timeout, addressbookService, profileService, lodash, $state, walletService, incomingData) {
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData) {
var originalList;
var CONTACTS_SHOW_LIMIT = 10;
var currentContactsPage = 0;
var updateList = function() {
originalList = [];
@ -11,6 +13,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
onlyComplete: true
});
$scope.hasWallets = lodash.isEmpty(wallets) ? false : true;
$scope.oneWallet = wallets.length == 1;
lodash.each(wallets, function(v) {
originalList.push({
@ -27,9 +30,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
if (err) $log.error(err);
$scope.hasContacts = lodash.isEmpty(ab) ? false : true;
var contacts = [];
var completeContacts = [];
lodash.each(ab, function(v, k) {
contacts.push({
completeContacts.push({
name: lodash.isObject(v) ? v.name : v,
address: k,
email: lodash.isObject(v) ? v.email : null,
@ -39,15 +42,23 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
});
});
var contacts = completeContacts.slice(0, (currentContactsPage + 1) * CONTACTS_SHOW_LIMIT);
$scope.contactsShowMore = completeContacts.length > contacts.length;
originalList = originalList.concat(contacts);
$scope.list = lodash.clone(originalList);
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 1);
}, 10);
});
};
$scope.showMore = function() {
currentContactsPage++;
updateList();
};
$scope.findContact = function(search) {
if (incomingData.redir(search)) {

View file

@ -31,6 +31,10 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
'tabs.addressbook',
'tabs.addressbook.add',
'tabs.addressbook.view',
'tabs.preferences.backupWarning',
'tabs.preferences.backup',
'tabs.receive.backupWarning',
'tabs.receive.backup',
];
$rootScope.$on('$ionicView.beforeEnter', function() {

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services')
.factory('profileService', function profileServiceFactory($rootScope, $timeout, $filter, $log, sjcl, lodash, storageService, bwcService, configService, pushNotificationsService, gettext, gettextCatalog, bwcError, uxLanguage, platformInfo, $ionicHistory, txFormatService, $state) {
.factory('profileService', function profileServiceFactory($rootScope, $timeout, $filter, $log, sjcl, lodash, storageService, bwcService, configService, pushNotificationsService, gettext, gettextCatalog, bwcError, uxLanguage, platformInfo, txFormatService, $state) {
var isChromeApp = platformInfo.isChromeApp;
@ -118,7 +118,8 @@ angular.module('copayApp.services')
});
_showBackupNeededModal(wallet, function(val) {
wallet.showBackupNeededModal = val;
if (wallet.needsBackup) wallet.showBackupNeededModal = val;
else wallet.showBackupNeededModal = false;
});
wallet.removeAllListeners();

View file

@ -594,6 +594,10 @@ ul.wallet-selection.wallets {
margin-right: 40px;
}
.m55r {
margin-right: 55px;
}
.m25r {
margin-right: 25px;
}

View file

@ -3,7 +3,7 @@
bottom: 100px;
}
.head {
padding-bottom: 55px;
padding-bottom: 30px;
.sending-label{
line-height: 70px;
font-size: 25px;

View file

@ -15,9 +15,14 @@
position: absolute;
bottom: 0;
}
@media (min-width: 400px){
.warning{
height:16rem;
}
}
}
@media (max-width: 400px){
@media (max-width: 399px){
#onboarding-backup-request{
.warning{
margin: 2rem auto 1rem;
@ -52,7 +57,7 @@
@media (min-height: 980px){
#onboarding-backup-request{
#arrow-down{
margin-top: 15rem;
margin-top: 7rem;
}
}
}

View file

@ -80,6 +80,19 @@
font-size:.8rem;
}
}
@media (min-width: 400px){
&{
max-width: 400px;
label{
.checkbox{
left:1rem;
}
.item-content{
font-size: 1rem;
}
}
}
}
}
}
}

View file

@ -16,4 +16,11 @@
position: absolute;
top: 10px;
}
.show-more {
text-align: center;
padding: 20px;
font-size: 16px;
color: #387ef5;
font-weight: bold;
}
}