Merge pull request #133 from cmgustavo/ref/design-36

Ref/design 36
This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-19 09:30:24 -03:00 committed by GitHub
commit 041052d440
18 changed files with 177 additions and 173 deletions

View file

@ -1,31 +1,29 @@
<ion-view id="view-add"> <ion-view id="view-add">
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-title>{{'Add wallet' | translate}}</ion-nav-title> <ion-nav-title>{{'Add wallet' | translate}}</ion-nav-title>
<ion-nav-buttons side="primary"> <ion-nav-back-button>
<button class="button back-button" ui-sref="tabs.home"> <i class="icon ion-ios-arrow-thin-left"></i>
<i class="icon ion-ios-arrow-thin-left"></i> </ion-nav-back-button>
</button>
</ion-nav-buttons>
</ion-nav-bar> </ion-nav-bar>
<ion-content> <ion-content>
<ion-list> <ion-list>
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.create-personal"> <a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.add.create-personal">
<h2 translate>New Personal Wallet</h2> <h2 translate>New Personal Wallet</h2>
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>
</a> </a>
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.create-shared"> <a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.add.create-shared">
<h2 translate>Create Shared Wallet</h2> <h2 translate>Create Shared Wallet</h2>
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>
</a> </a>
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.join"> <a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.add.join">
<h2 translate>Join shared wallet</h2> <h2 translate>Join shared wallet</h2>
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>
</a> </a>
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.import"> <a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.add.import">
<h2 translate>Import wallet</h2> <h2 translate>Import wallet</h2>
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>
</a> </a>

View file

@ -1,10 +1,8 @@
<ion-view> <ion-view>
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary"> <ion-nav-back-button>
<button class="button button-clear" ui-sref="tabs.addressbook"> <i class="icon ion-ios-arrow-thin-left"></i>
<i class="icon ion-ios-arrow-thin-left"></i> </ion-nav-back-button>
</button>
</ion-nav-buttons>
<ion-nav-title> <ion-nav-title>
<span translate>Add entry</span> <span translate>Add entry</span>
</ion-nav-title> </ion-nav-title>

View file

@ -1,15 +1,13 @@
<ion-view> <ion-view>
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary"> <ion-nav-back-button>
<button class="button button-clear" ui-sref="tabs.settings"> <i class="icon ion-ios-arrow-thin-left"></i>
<i class="icon ion-ios-arrow-thin-left"></i> </ion-nav-back-button>
</button>
</ion-nav-buttons>
<ion-nav-title> <ion-nav-title>
<span translate>Addressbook</span> <span translate>Addressbook</span>
</ion-nav-title> </ion-nav-title>
<ion-nav-buttons side="secondary"> <ion-nav-buttons side="secondary">
<button class="button button-clear" ui-sref="tabs.addressbook.add"> <button class="button button-back button-clear" ui-sref="tabs.addressbook.add">
<i class="icon ion-ios-plus-empty"></i> <i class="icon ion-ios-plus-empty"></i>
</button> </button>
</ion-nav-buttons> </ion-nav-buttons>

View file

@ -1,10 +1,8 @@
<ion-view> <ion-view>
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary"> <ion-nav-back-button>
<button class="button button-clear" ui-sref="tabs.addressbook"> <i class="icon ion-ios-arrow-thin-left"></i>
<i class="icon ion-ios-arrow-thin-left"></i> </ion-nav-back-button>
</button>
</ion-nav-buttons>
<ion-nav-title> <ion-nav-title>
<span translate>Addressbook</span> <span translate>Addressbook</span>
</ion-nav-title> </ion-nav-title>

View file

@ -1,10 +1,8 @@
<ion-view id="view-amount"> <ion-view id="view-amount">
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary"> <ion-nav-back-button>
<button class="button back-button" ng-click="$ionicGoBack()"> <i class="icon ion-ios-arrow-thin-left"></i>
<i class="icon ion-ios-arrow-thin-left"></i> </ion-nav-back-button>
</button>
</ion-nav-buttons>
</ion-nav-bar> </ion-nav-bar>
<ion-content scroll="false" class="amount" ng-controller="amountController" ng-init="init()"> <ion-content scroll="false" class="amount" ng-controller="amountController" ng-init="init()">

View file

@ -7,7 +7,7 @@
<ion-content scroll="false" ng-controller="confirmController" ng-init="init()"> <ion-content scroll="false" ng-controller="confirmController" ng-init="init()">
<div class="card"> <div class="list card">
<div class="item item-text-wrap"> <div class="item item-text-wrap">
<i class="icon ion-arrow-up-c"></i> <span class="text-bold size-16">Sending</span> <i class="icon ion-arrow-up-c"></i> <span class="text-bold size-16">Sending</span>
<div class="text-bold size-28 m15t">{{amountStr}} </div> <div class="text-bold size-28 m15t">{{amountStr}} </div>
@ -24,7 +24,7 @@
<div class="item item-icon-left"> <div class="item item-icon-left">
<gravatar class="send-gravatar" name="{{toName}}" width="30" email="{{toEmail}}"></gravatar> <gravatar class="send-gravatar" name="{{toName}}" width="30" email="{{toEmail}}"></gravatar>
<label translate>To</label> {{toAddress}} <span translate>To</span>: {{toAddress}}
<p ng-show="toName">{{toName}}</p> <p ng-show="toName">{{toName}}</p>
<div ng-show="_paypro" ng-click="openPPModal(_paypro)"> <div ng-show="_paypro" ng-click="openPPModal(_paypro)">
@ -33,23 +33,24 @@
{{_paypro.domain}} {{_paypro.domain}}
</div> </div>
</div> </div>
</div>
<div class="item"> <div class="text-center" ng-show="notAvailable">
<label translate>From</label> <span class="badge badge-assertive" translate>No wallet with enough funds</span>
<span class="badge badge-assertive" ng-show="notAvailable" translate>No wallet with enough funds</span> </div>
</div>
<wallets ng-if="wallets[0]" wallets="wallets"></wallets> <wallets ng-if="wallets[0]" wallets="wallets"></wallets>
<div class="list card">
<div class="item item-icon-left item-icon-right" ng-click="showDescriptionPopup()"> <div class="item item-icon-left item-icon-right" ng-click="showDescriptionPopup()">
<span ng-show="!description" translate>Add Description</span>
<span ng-show="description">{{description}}</span>
<i class="icon ion-ios-chatbubble-outline size-21"></i> <i class="icon ion-ios-chatbubble-outline size-21"></i>
<i class="icon ion-ios-plus-empty size-21"></i> <span ng-show="!description" translate>Add description</span>
<span ng-show="description">{{description}}</span>
<i ng-show="!description" class="icon ion-ios-plus-empty size-21"></i>
</div> </div>
</div> </div>
<button class="item button button-block button-balanced" ng-click="approve()"> <button class="item button button-block button-positive" ng-click="approve()">
<span translate>Send</span> <span translate>Send</span>
</button> </button>
</ion-content> </ion-content>

View file

@ -1,10 +1,8 @@
<ion-view> <ion-view>
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary"> <ion-nav-back-button>
<button class="button back-button" ui-sref="tabs.add"> <i class="icon ion-ios-arrow-thin-left"></i>
<i class="icon ion-ios-arrow-thin-left"></i> </ion-nav-back-button>
</button>
</ion-nav-buttons>
<ion-nav-title>{{'Join shared wallet' | translate}}</ion-nav-title> <ion-nav-title>{{'Join shared wallet' | translate}}</ion-nav-title>
</ion-nav-bar> </ion-nav-bar>
@ -15,37 +13,33 @@
<div class="card list"> <div class="card list">
<div class="row"> <label class="item item-input item-stacked-label no-border">
<div class="col"> <span class="input-label" translate>Your nickname</span>
<label class="item item-input item-stacked-label no-border"> <input type="text"
<span class="input-label" translate>Your nickname</span> placeholder="{{'John'|translate}}"
<input type="text" name="myName"
placeholder="{{'John'|translate}}" ng-model="myName"
name="myName" ng-required="true">
ng-model="myName" </label>
ng-required="true">
</label>
</div>
</div>
<div class="row"> <label class="item item-input item-stacked-label no-border">
<div class="col col-90"> <span class="input-label" translate>Wallet Invitation</span>
<label class="item item-input item-stacked-label no-border"> <div class="input-notification">
<span class="input-label" translate>Wallet Invitation</span> <i class="icon ion-checkmark-circled balanced"
<i class="icon ion-checkmark-circled balanced" ng-show="joinForm.secret.$valid && !joinForm.secret.$pristine && secret"></i> ng-show="!joinForm.secret.$invalid"></i>
<i class="icon ion-close-circled assertive" ng-show="joinForm.secret.$invalid && !joinForm.secret.$pristine && secret"></i> <i class="icon ion-close-circled assertive"
<input id="secret" ng-show="joinForm.secret.$invalid && secret"></i>
type="text"
placeholder="{{'Paste invitation here'|translate}}"
name="secret"
ng-model="secret"
wallet-secret required>
</label>
</div> </div>
<div class="col text-center"> <div class="qr-scan-icon">
<qr-scanner class="qr-icon size-24" on-scan="join.onQrCodeScanned(data)"></qr-scanner> <qr-scanner class="qr-icon size-24" on-scan="join.onQrCodeScanned(data)"></qr-scanner>
<input id="secret"
type="text"
placeholder="{{'Paste invitation here'|translate}}"
name="secret"
ng-model="secret"
wallet-secret required>
</div> </div>
</div> </label>
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable"> <ion-toggle ng-model="showAdv" toggle-class="toggle-stable">
<span translate ng-show="!showAdv">Show advanced options</span> <span translate ng-show="!showAdv">Show advanced options</span>

View file

@ -1,6 +1,6 @@
<ion-modal-view ng-controller="scannerController" ng-init="init()"> <ion-modal-view ng-controller="scannerController" ng-init="init()">
<ion-header-bar align-title="center" class="bar-royal"> <ion-header-bar align-title="center" class="bar-royal">
<button ng-click="cancel()" class="button button-clear button-positive" translate> <button ng-click="cancel()" class="button button-back button-clear" translate>
Close Close
</button> </button>
<h1 class="title ellipsis" translate>QR-Scanner</h1> <h1 class="title ellipsis" translate>QR-Scanner</h1>

View file

@ -1,10 +1,8 @@
<ion-view> <ion-view>
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary"> <ion-nav-back-button>
<button class="button back-button" ui-sref="tabs.settings"> <i class="icon ion-ios-arrow-thin-left"></i>
<i class="icon ion-ios-arrow-thin-left"></i> </ion-nav-back-button>
</button>
</ion-nav-buttons>
</ion-nav-bar> </ion-nav-bar>
<ion-content ng-controller="preferencesAbout"> <ion-content ng-controller="preferencesAbout">
<div class="list"> <div class="list">
@ -27,17 +25,17 @@
</div> </div>
<div class="item item-divider"> <div class="item item-divider">
</div> </div>
<a class="item item-icon-left item-icon-right" ui-sref="tabs.termsOfUse"> <a class="item item-icon-left item-icon-right" ui-sref="tabs.about.termsOfUse">
<i class="icon ion-ios-list-outline"></i> <i class="icon ion-ios-list-outline"></i>
<span translate>Terms of Use</span> <span translate>Terms of Use</span>
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>
</a> </a>
<a class="item item-icon-left item-icon-right" ui-sref="tabs.translators"> <a class="item item-icon-left item-icon-right" ui-sref="tabs.about.translators">
<i class="icon ion-ios-people-outline"></i> <i class="icon ion-ios-people-outline"></i>
<span translate>Translators</span> <span translate>Translators</span>
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>
</a> </a>
<a class="item item-icon-left item-icon-right" ui-sref="tabs.logs"> <a class="item item-icon-left item-icon-right" ui-sref="tabs.about.logs">
<i class="icon ion-ios-copy-outline"></i> <i class="icon ion-ios-copy-outline"></i>
<span translate>Session log</span> <span translate>Session log</span>
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>

View file

@ -51,14 +51,14 @@
</span> </span>
</h2> </h2>
<span class="badge badge-assertive" ng-show="!wallet.isComplete()" translate> <p>
<span ng-show="!wallet.isComplete()" class="assertive" translate>
Incomplete Incomplete
</span> </span>
<p ng-show="wallet.isComplete() && !wallet.balanceHidden"> <div ng-show="wallet.isComplete()">
{{wallet.status.availableBalanceStr}} <span ng-show="!wallet.balanceHidden">{{wallet.status.availableBalanceStr}}</span>
</p> <span ng-show="wallet.balanceHidden" translate>[Balance Hidden]</span>
<p ng-show="wallet.isComplete() && wallet.balanceHidden"> </div>
<strong class="size-12" translate>[Balance Hidden]</strong>
</p> </p>
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>
</a> </a>

View file

@ -17,9 +17,8 @@
</div> </div>
<div class="card" ng-if="list[0]"> <div class="card" ng-if="list[0]">
<div class="item item-heading item-icon-right" ui-sref="tabs.addressbook"> <div class="item item-heading">
<span translate>Contacts & Wallets</span> <span translate>Contacts &amp; Wallets</span>
<i class="icon nav-item-arrow-right"></i>
</div> </div>
<div class="item text-center" ng-show="!list[0]" translate>No Wallet - Contact</div> <div class="item text-center" ng-show="!list[0]" translate>No Wallet - Contact</div>
<a class="item item-icon-left" ng-repeat="item in list" ng-click="goToAmount(item)"> <a class="item item-icon-left" ng-repeat="item in list" ng-click="goToAmount(item)">

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('addressbookViewController', function($scope, $state, $timeout, $stateParams, lodash, addressbookService, popupService) { angular.module('copayApp.controllers').controller('addressbookViewController', function($scope, $state, $timeout, $stateParams, lodash, addressbookService, popupService, $ionicHistory) {
var address = $stateParams.address; var address = $stateParams.address;
@ -26,10 +26,13 @@ angular.module('copayApp.controllers').controller('addressbookViewController', f
}); });
$scope.sendTo = function() { $scope.sendTo = function() {
$ionicHistory.clearHistory();
$state.go('tabs.send');
$timeout(function() { $timeout(function() {
$state.transitionTo('send.amount', { $state.transitionTo('tabs.send.amount', {
toAddress: $scope.addressbookEntry.address, toAddress: $scope.addressbookEntry.address,
toName: $scope.addressbookEntry.name toName: $scope.addressbookEntry.name,
toEmail: $scope.addressbookEntry.email
}); });
}, 100); }, 100);
}; };

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicHistory, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService) { angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService) {
$ionicNavBarDelegate.title(gettextCatalog.getString('Enter Amount')); $ionicNavBarDelegate.title(gettextCatalog.getString('Enter Amount'));
var unitToSatoshi; var unitToSatoshi;
@ -188,7 +188,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
var _amount = evaluate(format($scope.amount)); var _amount = evaluate(format($scope.amount));
var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals); var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals);
$state.transitionTo('send.confirm', { $state.transitionTo('tabs.send.confirm', {
toAmount: amount * unitToSatoshi, toAmount: amount * unitToSatoshi,
toAddress: $scope.toAddress, toAddress: $scope.toAddress,
toName: $scope.toName, toName: $scope.toName,

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, gettext, txFormatService, ongoingProcess, $ionicModal, popupService) { angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, gettext, txFormatService, ongoingProcess, $ionicModal, $ionicHistory, popupService) {
$ionicNavBarDelegate.title(gettextCatalog.getString('Confirm')); $ionicNavBarDelegate.title(gettextCatalog.getString('Confirm'));
var cachedTxp = {}; var cachedTxp = {};
var isChromeApp = platformInfo.isChromeApp; var isChromeApp = platformInfo.isChromeApp;
@ -17,24 +17,14 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.showDescriptionPopup = function() { $scope.showDescriptionPopup = function() {
var title = gettextCatalog.getString('Add description');
$scope.data = { var opts = {
comment: null defaultText: $scope.description
}; };
var commentPopup = $ionicPopup.show({ popupService.showPrompt(title, null, opts, function(res) {
templateUrl: "views/includes/note.html", if (res) $scope.description = res;
title: gettextCatalog.getString('Set description'),
scope: $scope,
}); });
$scope.commentPopupClose = function() {
commentPopup.close();
};
$scope.commentPopupSave = function() {
$log.debug('Saving description: ' + $scope.data.comment);
$scope.description = $scope.data.comment;
commentPopup.close();
};
}; };
var setFromPayPro = function(uri, cb) { var setFromPayPro = function(uri, cb) {
@ -87,6 +77,13 @@ angular.module('copayApp.controllers').controller('confirmController', function(
}; };
$scope.init = function() { $scope.init = function() {
if ($stateParams.paypro) {
return setFromPayPro($stateParams.paypro, function(err) {
if (err && !isChromeApp) {
showAlert(gettext('Could not fetch payment'));
}
});
}
// TODO (URL , etc) // TODO (URL , etc)
if (!$stateParams.toAddress || !$stateParams.toAmount) { if (!$stateParams.toAddress || !$stateParams.toAmount) {
$log.error('Bad params at amount') $log.error('Bad params at amount')
@ -271,7 +268,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
if (err) return; if (err) return;
walletService.publishAndSign(wallet, txp, function(err, txp) { walletService.publishAndSign(wallet, txp, function(err, txp) {
if (err) return setSendError(err); if (err) return setSendError(err);
$state.transitionTo('tabs.home'); $ionicHistory.clearHistory();
$state.go('tabs.home');
}); });
}); });
}; };

View file

@ -75,7 +75,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
return; return;
} }
$log.debug('Got toAddress:' + addr + ' | ' + item.name); $log.debug('Got toAddress:' + addr + ' | ' + item.name);
return $state.transitionTo('send.amount', { return $state.transitionTo('tabs.send.amount', {
toAddress: addr, toAddress: addr,
toName: item.name, toName: item.name,
toEmail: item.email toEmail: item.email

View file

@ -218,29 +218,24 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
}) })
/* /*
* *
* Send * Send
* *
*/ */
.state('send', { .state('tabs.send.amount', {
url: '/send',
abstract: true,
template: '<ion-nav-view name="send"></ion-nav-view>'
})
.state('send.amount', {
url: '/amount/:toAddress/:toName/:toEmail', url: '/amount/:toAddress/:toName/:toEmail',
views: { views: {
'send': { 'tab-send@tabs': {
templateUrl: 'views/amount.html' templateUrl: 'views/amount.html'
} }
} }
}) })
.state('send.confirm', { .state('tabs.send.confirm', {
url: '/confirm/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro', url: '/confirm/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro',
views: { views: {
'send': { 'tab-send@tabs': {
templateUrl: 'views/confirm.html' templateUrl: 'views/confirm.html'
} }
} }
@ -256,39 +251,39 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.add', { .state('tabs.add', {
url: '/add', url: '/add',
views: { views: {
'tab-home': { 'tab-home@tabs': {
templateUrl: 'views/add.html' templateUrl: 'views/add.html'
} }
} }
}) })
.state('tabs.join', { .state('tabs.add.join', {
url: '/join/:url', url: '/join/:url',
views: { views: {
'tab-home': { 'tab-home@tabs': {
templateUrl: 'views/join.html' templateUrl: 'views/join.html'
}, },
} }
}) })
.state('tabs.import', { .state('tabs.add.import', {
url: '/import', url: '/import',
views: { views: {
'tab-home': { 'tab-home@tabs': {
templateUrl: 'views/import.html' templateUrl: 'views/import.html'
}, },
}, },
}) })
.state('tabs.create-personal', { .state('tabs.add.create-personal', {
url: '/create-personal', url: '/create-personal',
views: { views: {
'tab-home': { 'tab-home@tabs': {
templateUrl: 'views/tab-create-personal.html' templateUrl: 'views/tab-create-personal.html'
}, },
} }
}) })
.state('tabs.create-shared', { .state('tabs.add.create-shared', {
url: '/create-shared', url: '/create-shared',
views: { views: {
'tab-home': { 'tab-home@tabs': {
templateUrl: 'views/tab-create-shared.html' templateUrl: 'views/tab-create-shared.html'
}, },
} }
@ -303,7 +298,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.language', { .state('tabs.language', {
url: '/language', url: '/language',
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
templateUrl: 'views/preferencesLanguage.html' templateUrl: 'views/preferencesLanguage.html'
} }
} }
@ -311,7 +306,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.unit', { .state('tabs.unit', {
url: '/unit', url: '/unit',
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
templateUrl: 'views/preferencesUnit.html' templateUrl: 'views/preferencesUnit.html'
} }
} }
@ -319,7 +314,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.fee', { .state('tabs.fee', {
url: '/fee', url: '/fee',
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
templateUrl: 'views/preferencesFee.html' templateUrl: 'views/preferencesFee.html'
} }
} }
@ -327,7 +322,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.altCurrency', { .state('tabs.altCurrency', {
url: '/altCurrency', url: '/altCurrency',
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
templateUrl: 'views/preferencesAltCurrency.html' templateUrl: 'views/preferencesAltCurrency.html'
} }
} }
@ -335,31 +330,31 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.about', { .state('tabs.about', {
url: '/about', url: '/about',
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
templateUrl: 'views/preferencesAbout.html' templateUrl: 'views/preferencesAbout.html'
} }
} }
}) })
.state('tabs.logs', { .state('tabs.about.logs', {
url: '/logs', url: '/logs',
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
templateUrl: 'views/preferencesLogs.html' templateUrl: 'views/preferencesLogs.html'
} }
} }
}) })
.state('tabs.termsOfUse', { .state('tabs.about.termsOfUse', {
url: '/termsOfUse', url: '/termsOfUse',
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
templateUrl: 'views/termsOfUse.html', templateUrl: 'views/termsOfUse.html',
} }
} }
}) })
.state('tabs.translators', { .state('tabs.about.translators', {
url: '/translators', url: '/translators',
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
templateUrl: 'views/translators.html' templateUrl: 'views/translators.html'
} }
} }
@ -375,7 +370,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
url: '/preferences/:walletId', url: '/preferences/:walletId',
abstract: true, abstract: true,
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
template: '<ion-nav-view name="preferences"></ion-nav-view>' template: '<ion-nav-view name="preferences"></ion-nav-view>'
}, },
} }
@ -495,7 +490,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.addressbook', { .state('tabs.addressbook', {
url: '/addressbook', url: '/addressbook',
views: { views: {
'tab-settings': { 'tab-settings@tabs': {
templateUrl: 'views/addressbook.html', templateUrl: 'views/addressbook.html',
controller: 'addressbookListController' controller: 'addressbookListController'
} }

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $state, $window, bitcore) { angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $state, $window, $timeout, bitcore) {
var root = {}; var root = {};
@ -26,7 +26,11 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
// data extensions for Payment Protocol with non-backwards-compatible request // data extensions for Payment Protocol with non-backwards-compatible request
if ((/^bitcoin:\?r=[\w+]/).exec(data)) { if ((/^bitcoin:\?r=[\w+]/).exec(data)) {
data = decodeURIComponent(data.replace('bitcoin:?r=', '')); data = decodeURIComponent(data.replace('bitcoin:?r=', ''));
$state.go('send.confirm', {paypro: data}) $state.go('tabs.send');
$timeout(function() {
$state.transitionTo('tabs.send.confirm', {paypro: data});
}, 100);
return true;
} }
@ -41,44 +45,65 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
var amount = parsed.amount ? parsed.amount : ''; var amount = parsed.amount ? parsed.amount : '';
if (parsed.r) { $state.go('tabs.send');
$state.go('send.confirm', {paypro: parsed.r}); $timeout(function() {
} else { if (parsed.r) {
if (amount) { $state.transitionTo('tabs.send.confirm', {paypro: parsed.r});
$state.go('send.confirm', {toAmount: amount, toAddress: addr, description:message})
} else { } else {
$state.go('send.amount', {toAddress: addr}) if (amount) {
$state.transitionTo('tabs.send.confirm', {toAmount: amount, toAddress: addr, description:message});
} else {
$state.transitionTo('tabs.send.amount', {toAddress: addr});
}
} }
} }, 100);
return true; return true;
// Plain URL // Plain URL
} else if (/^https?:\/\//.test(data)) { } else if (/^https?:\/\//.test(data)) {
return $state.go('send.confirm', {paypro: data}) $state.go('tabs.send');
$timeout(function() {
$state.transitionTo('tabs.send.confirm', {paypro: data});
}, 100);
return true;
// Plain Address // Plain Address
} else if (bitcore.Address.isValid(data, 'livenet')) { } else if (bitcore.Address.isValid(data, 'livenet')) {
return $state.go('send.amount', {toAddress: data}) $state.go('tabs.send');
$timeout(function() {
$state.transitionTo('tabs.send.amount', {toAddress: data});
}, 100);
return true;
} else if (bitcore.Address.isValid(data, 'testnet')) { } else if (bitcore.Address.isValid(data, 'testnet')) {
return $state.go('send.amount', {toAddress: data}) $state.go('tabs.send');
$timeout(function() {
$state.transitionTo('tabs.send.amount', {toAddress: data});
}, 100);
return true;
// Protocol // Protocol
} else if (data.indexOf($window.appConfig.name + '://glidera')==0) { } else if (data.indexOf($window.appConfig.name + '://glidera')==0) {
return $state.go('uriglidera', {url: data}) return $state.go('uriglidera', {url: data});
} else if (data.indexOf($window.appConfig.name + '://coinbase')==0) { } else if (data.indexOf($window.appConfig.name + '://coinbase')==0) {
return $state.go('uricoinbase', {url: data}) return $state.go('uricoinbase', {url: data});
// Join // Join
} else if (data.match(/^copay:[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { } else if (data.match(/^copay:[0-9A-HJ-NP-Za-km-z]{70,80}$/)) {
return $state.go('add.join', {url: data}) $state.go('tabs.home');
$timeout(function() {
$state.transitionTo('tabs.add.join', {url: data});
}, 100);
return true;
// Old join // Old join
} else if (data.match(/^[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { } else if (data.match(/^[0-9A-HJ-NP-Za-km-z]{70,80}$/)) {
return $state.go('add.join', {url: data}) $state.go('tabs.home');
$timeout(function() {
$state.transitionTo('tabs.add.join', {url: data});
}, 100);
return true;
} }
return false; return false;
}; };

View file

@ -32,9 +32,10 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
opts = opts || {}; opts = opts || {};
$ionicPopup.prompt({ $ionicPopup.prompt({
title: title, title: title,
template: message, subTitle: message,
inputType: opts.inputType || 'password', inputType: opts.inputType,
inputPlaceholder: opts.inputPlaceholder || 'Your password' inputPlaceholder: opts.inputPlaceholder,
defaultText: opts.defaultText
}).then(function(res) { }).then(function(res) {
return cb(res) return cb(res)
}); });
@ -106,7 +107,7 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
* *
* @param {String} Title * @param {String} Title
* @param {String} Message * @param {String} Message
* @param {Object} Object{ inputType, inputPlaceholder } (optional) * @param {Object} Object{ inputType, inputPlaceholder, defaultText } (optional)
* @param {Callback} Function * @param {Callback} Function
* @returns {Callback} Return the value of the input if user presses OK * @returns {Callback} Return the value of the input if user presses OK
*/ */