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

This commit is contained in:
Jamal Jackson 2016-09-15 09:37:36 -04:00
commit be58b7983d
38 changed files with 393 additions and 75 deletions

View file

@ -212,4 +212,14 @@ angular.module('copayApp.controllers').controller('backupController',
$scope.selectComplete = false;
};
$scope.backupGoBack = function() {
if ($stateParams.fromOnboarding) $state.go('onboarding.backupWarning', {
walletId: $stateParams.walletId,
fromOnboarding: true
});
else $state.go('tabs.preferences.main', {
walletId: $stateParams.walletId
});
};
});

View file

@ -27,6 +27,14 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
});
};
this.confirm = function() {
var title = gettextCatalog.getString('Confirm Amazon.com Gift Card purchase for ${{amount}} USD', {amount: $scope.fiat});
var ok = gettextCatalog.getString('Buy');
popupService.showConfirm(title, null, ok, null, function(res) {
if (res) self.createTx();
});
};
this.createTx = function() {
self.errorInfo = null;

View file

@ -1,8 +1,9 @@
'use strict';
angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, profileService) {
angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, profileService, uxLanguage, externalLinkService) {
$scope.init = function() {
$scope.lang = uxLanguage.currentLanguage;
$scope.terms = {};
$scope.accept1 = $scope.accept2 = $scope.accept3 = false;
$timeout(function() {
@ -19,6 +20,10 @@ angular.module('copayApp.controllers').controller('disclaimerController', functi
});
};
$scope.openExternalLink = function(url, target) {
externalLinkService.open(url, target);
};
$scope.openTermsModal = function() {
$ionicModal.fromTemplateUrl('views/modals/terms.html', {
scope: $scope

View file

@ -13,10 +13,10 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
if (!$scope.isCordova) $scope.checkTips();
}
$scope.checkTips = function() {
$scope.checkTips = function(force) {
storageService.getReceiveTipsAccepted(function(err, accepted) {
if (err) $log.warn(err);
if (accepted) return;
if (accepted && !force) return;
$timeout(function() {
$ionicModal.fromTemplateUrl('views/modals/receive-tips.html', {
@ -25,7 +25,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.receiveTipsModal = modal;
$scope.receiveTipsModal.show();
});
}, 1000);
}, force ? 1 : 1000);
});
};

View file

@ -789,6 +789,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
$ionicPlatform.registerBackButtonAction(function(e) {
//from root tabs view
var fromWelcome = $ionicHistory.currentStateName().match(/welcome/) ? true : false;
var matchHome = $ionicHistory.currentStateName().match(/home/) ? true : false;
var matchReceive = $ionicHistory.currentStateName().match(/receive/) ? true : false;
@ -796,9 +797,23 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
var matchSettings = $ionicHistory.currentStateName().match(/settings/) ? true : false;
var fromTabs = matchHome | matchReceive | matchSend | matchSettings;
//onboarding with no back views
var matchCollectEmail = $ionicHistory.currentStateName().match(/collectEmail/) ? true : false;
var matchBackupRequest = $ionicHistory.currentStateName().match(/backupRequest/) ? true : false;
var matchDisclaimer = $ionicHistory.currentStateName().match(/disclaimer/) ? true : false;
var matchNotifications = $ionicHistory.currentStateName().match(/notifications/) ? true : false;
var fromOnboarding = matchCollectEmail | matchBackupRequest | matchDisclaimer | matchNotifications;
if (fromOnboarding) {
e.preventDefault();
return;
}
if ($ionicHistory.backView() && !fromTabs) {
$ionicHistory.goBack();
} else if ($rootScope.backButtonPressedOnceToExit || fromWelcome) {
} else
if ($rootScope.backButtonPressedOnceToExit || fromWelcome) {
ionic.Platform.exitApp();
} else {
$rootScope.backButtonPressedOnceToExit = true;