Merge pull request #231 from gabrielbazan7/feat/onboarding

onboarding
This commit is contained in:
Matias Alejo Garcia 2016-08-25 17:16:33 -03:00 committed by GitHub
commit 6ab8330133
47 changed files with 706 additions and 339 deletions

View File

@ -1,205 +1,83 @@
<ion-view ng-controller="backupController" cache-view="false" ng-init="init()">
<ion-view ng-controller="backupController" ng-init="init()">
<ion-nav-bar class="bar-stable">
<ion-nav-title>Backup Flow</ion-nav-title>
<ion-nav-buttons side="primary">
 <button class="button" href ui-sref="wallet.preferences">
     <i class="ion-arrow-left-c"></i> Back
 <button class="button no-border" ng-click="goBack()">
     <i class="icon ion-chevron-left"></i>Back
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="backupController" cache-view="false" ng-init="init()">
<div class="box-notification" ng-show="error">
<span class="text-warning">
{{error|translate}}
</span>
</div>
<!--
## STEP 1
-->
<div class="text-center">
<div ng-show="step == 1">
<div ng-show="mnemonicWords || (!credentialsEncrypted && !deleted)" class="row">
<h5 class="text-center" translate>Write your wallet recovery phrase</h5>
<div class="size-14 text-gray columns" ng-show="(wallet.n>1 && wallet.m != wallet.n )">
<span translate>
To restore this {{wallet.m}}-{{wallet.n}} <b>shared</b> wallet you will need
</span>:
<div class="m10t columns size-14 text-gray">
<span translate>Your wallet recovery phrase and access to the server that coordinated the initial wallet creation. You still need {{wallet.m}} keys to spend.</span>
<span translate><b>OR</b> the wallet recovery phrase of <b>all</b> copayers in the wallet</span>
<span translate><b>OR</b> 1 wallet export file and the remaining quorum of wallet recovery phrases (e.g. in a 3-5 wallet: 1 wallet export file + 2 wallet recovery phrases of any of the other copayers).</span>
</div>
</span>
</div>
<div class="size-14 text-gray columns" ng-show="(wallet.n>1 && wallet.m == wallet.n )">
<span translate>
To restore this {{wallet.m}}-{{wallet.n}} <b>shared</b> wallet you will need
</span>:
<div class="m10t columns size-14 text-gray">
<span translate>Your wallet recovery phrase and access to the server that coordinated the initial wallet creation. You still need {{wallet.m}} keys to spend.</span>
<span translate><b>OR</b> the wallet recovery phrases of <b>all</b> copayers in the wallet</span>
</div>
</span>
</div>
</div>
<div class="row m20t" ng-show="deleted">
<div class="columns size-14 text-gray text-center" translate>
Wallet recovery phrase not available. You can still export it from Advanced &gt; Export.
</div>
</div>
<div ng-show="mnemonicWords || (!credentialsEncrypted && !deleted)">
<p class="text-center columns text-gray" ng-show="wallet.n==1 && step == 1">
<span translate>
You need the wallet recovery phrase to restore this personal wallet. Write it down and keep them somewhere safe.
</span>
</p>
<div class="row" ng-show="!credentialsEncrypted">
<div class="columns">
<div class="panel" ng-class="{'enable_text_select': wallet.network == 'testnet'}">
<span ng-repeat="word in mnemonicWords track by $index"><span style="white-space:nowrap">{{word}}</span><span ng-show="useIdeograms">&#x3000;</span> </span>
</div>
</div>
</div>
</div>
<div class="columns extra-padding-bottom" ng-show="!credentialsEncrypted">
<div class="line-t p10 size-10 text-gray text-center" ng-show="mnemonicHasPassphrase">
<i class="fi-alert"></i>
<span translate>
This recovery phrase was created with a password. To recover this wallet both the recovery phrase and password are needed.
</span>
</div>
</div>
<div class="button-box">
<button
ng-show="!deleted"
ng-disabled="credentialsEncrypted || error"
class="button button-block button-stable"
ng-click="goToStep(2);"
translate>Continue
</button>
</div>
<ion-content>
<!--
## STEP 1
-->
<div ng-show="step == 1 && (mnemonicWords || (!credentialsEncrypted && !deleted))">
<h5 translate>Backup Phrase</h5>
<div ng-class="{'enable_text_select': wallet.network == 'testnet'}">
<span ng-repeat="word in mnemonicWords track by $index"><span style="white-space:nowrap">{{word}}</span><span ng-show="useIdeograms">&#x3000;</span> </span>
</div>
<span translate>
Please carefully write down this phrase
</span>
<div ng-show="mnemonicHasPassphrase">
<i class="ion-alert-circled"></i>
<span translate>
This recovery phrase was created with a password. To recover this wallet both the recovery phrase and password are needed.
</span>
</div>
<button
ng-show="!deleted"
ng-disabled="credentialsEncrypted || error"
class="button button-block button-positive"
ng-click="goToStep(2);"
translate>I've written it down
</button>
</div>
<!--
## STEP 2
-->
<div ng-show="step == 2">
<div class="columns text-center extra-padding-bottom">
<h5 translate>Confirm your wallet recovery phrase</h5>
<p class="text-gray m0" translate>
Please tap the words in order to confirm your backup phrase is correctly written.
</p>
<div class="panel words text-left">
<span ng-repeat="cword in customWords track by $index" ng-show="customWords[$index]">
<button class="button radius tiny words" ng-click="removeButton($index, cword)">{{cword.word}}</button>
</span>
</div>
<div class="text-left">
<span ng-repeat="shuffledWord in shuffledMnemonicWords track by $index">
<button class="button radius tiny words" ng-click="addButton($index, shuffledWord)"
ng-disabled="shuffledWord.selected">{{shuffledWord.word}}
</button>
</span>
</div>
</div>
<div class="button-box">
<button
ng-disabled="!selectComplete"
class="button button-block button-stable"
ng-click="goToStep(3);"
translate>Continue
<div ng-show="step == 2">
<h5 translate>Let's verify your backup phrase</h5>
<span ng-repeat="cword in customWords track by $index" ng-show="customWords[$index]">
<button class="button" ng-click="removeButton($index, cword)">{{cword.word}}</button>
</span>
<p translate>
Please tap the words in order to confirm your backup phrase is correctly written.
</p>
<span ng-repeat="shuffledWord in shuffledMnemonicWords track by $index">
<button class="button" ng-click="addButton($index, shuffledWord)"
ng-disabled="shuffledWord.selected">{{shuffledWord.word}}
</button>
</div>
</div>
</span>
<button
ng-show="selectComplete"
class="button button-block button-positive"
ng-click="goToStep(3);"
translate>Confirm
</button>
</div>
<!--
## STEP 3
-->
<div ng-show="step == 3">
<h5 translate>Enter your password</h5>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>In order to verify your wallet backup, please type your password:</span>
<input type="text" id="passphrase" ng-model="passphrase" autocapitalize="off" spellcheck="false" autofocus/>
</label>
<div class="button-box">
<button
ng-disabled="!passphrase"
class="button button-block button-stable"
ng-click="goToStep(4);"
translate>Continue
</button>
</div>
</div>
<div ng-show="step == 3">
<h5 translate>Enter your password</h5>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>In order to verify your wallet backup, please type your password:</span>
<input type="text" id="passphrase" ng-model="passphrase" autocapitalize="off" spellcheck="false" autofocus/>
</label>
<button
ng-disabled="!passphrase"
class="button button-block button-positive"
ng-click="goToStep(4);"
translate>Confirm
</button>
</div>
<!--
## STEP 4
-->
<div ng-show="step == 4">
<div class="row m10t m10b text-center" ng-show="!backupError">
<div class="circle-icon">
<i class="fi-like size-48"></i>
</div>
<h5 translate>Congratulations!</h5>
<p class="text-gray columns" translate>
You backed up your wallet. You can now restore this wallet at any time.
</p>
<div class="columns text-center m20t">
<button
class="button round expand"
href ui-sref="tabs.home"
translate>Finish
</button>
<!-- hide this in multisig just to show less text -->
<div class="row m20t" ng-show="n==1">
<div class="columns size-10 text-gray">
<div class="p10t line-t">
<span translate>You can safely install your wallet on another device and use it from multiple devices at the same time.</span>
<a href="#" ng-click="$root.openExternalLink('https://github.com/bitpay/copay/blob/master/README.md#copay-backups-and-recovery')" translate>
Learn more about Copay backups
</a>
</div>
</div>
</div>
</div>
</div>
<div class="row m10t m10b text-center" ng-show="backupError">
<div class="circle-icon">
<i class="fi-dislike size-48"></i>
</div>
<h5 translate>Backup failed</h5>
<p class="text-gray columns" translate>
Failed to verify backup. Please check your information
</p>
<div class="columns size-10 text-gray extra-padding-bottom" ng-show="n==1">
<div class="p10t line-t">
<span translate>You can safely install your wallet on another device and use it from multiple devices at the same time.</span>
<a href="#" ng-click="$root.openExternalLink('https://github.com/bitpay/copay/blob/master/README.md#copay-backups-and-recovery')" translate>
Learn more about Copay backups
</a>
</div>
</div>
<div class="button-box">
<button
class="button button-block button-stable"
ng-click="goToStep(1);"
translate>Try again
</button>
</div>
</div>
</div>
</ion-content>
</ion-view>

View File

@ -1,4 +1,4 @@
<ion-view cache-view="false">
<ion-view >
<ion-tabs class="tabs-striped tabs-color-positive tabs-color-active-positive tabs-top">
<ion-tab title="Personal Wallet" ui-sref="add.create.personal">

View File

@ -1,21 +0,0 @@
<ion-view>
<ion-content class="padding" ng-controller="disclaimerController" ng-init="init()">
<h1 translate>WELCOME TO COPAY</h1>
<h3 translate>A multisignature bitcoin wallet</h3>
<h4 translate>Terms of Use</h4>
<p ng-include="'views/includes/terms.html'"></p>
<div class="padding-vertical" ng-show="lang != 'en'">
<a ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a>
</div>
<p translate>I affirm that I have read, understood, and agree with these terms.</p>
<button ng-click="accept()" class="button button-block button-positive" translate>
I AGREE. GET STARTED
</button>
</ion-content>
</ion-view>

View File

@ -1,4 +1,4 @@
<ion-view cache-view="false">
<ion-view >
<ion-tabs class="tabs-striped tabs-color-positive tabs-color-active-positive tabs-top">
<ion-tab title="File/Text" ui-sref="wallet.export.file">

View File

@ -1,4 +1,4 @@
<ion-view cache-view="false">
<ion-view >
<ion-tabs class="tabs-striped tabs-color-positive tabs-color-active-positive tabs-top">
<ion-tab title="Recovery Phrare" ui-sref="add.import.phrase">

View File

@ -0,0 +1,10 @@
<div>
<h1 translate>Without a backup, you could lose money</h1>
<span translate>If something happens to this device, this app is deleted, or your password forgotten, neither you nor Bitpay can revoer your funds.</span>
<button ng-click="goBack()" class="button button-block button-light">
Go back
</button>
<button ng-click="continue()" class="button button-block button-light">
I understand
</button>
</div>

View File

@ -0,0 +1,7 @@
<div>
<h1 translate>Screenshots are not secure</h1>
<span translate>if you take a screenshot, your backup may be viewed by others apps. You can make a safe backup with paper and a pen.</span>
<button ng-click="close()" class="button button-block button-light">
Got it
</button>
</div>

View File

@ -0,0 +1,19 @@
<div class="text-center" ng-show="!backupError">
<h5 translate>Your bitcoin wallet is backed up!</h5>
<p translate> Be sure to store your recovery phrase in a secure place. If this app is deelted, you money coont be recovered with out it.</p>
<button
class="button round expand"
ng-click="closePopup(true)"
translate>Got it
</button>
</div>
<div class="text-center" ng-show="backupError">
<h5 translate>uh oh...</h5>
<p translate>It's importante that you write your backup phrase down correctly. If something happens to your wallet, you'll need this backup to recover your money
Please review your backup and try again</p>
<button
class="button button-block button-stable"
ng-click="closePopup(false)"
translate>Ok
</button>
</div>

View File

@ -0,0 +1,10 @@
<ion-view>
<ion-content ng-controller="backupRequestController">
<h1 translate>
No backup, no bitcoin.
</h1>
<span translate> Since only you control yout money, you'll need save your backup phrase in case this app is deleted </span>
<button class="button button-block button-positive" href ui-sref="onboarding.backupWarning" translate>Backup wallet</button>
<button class="button button-block button-light" ng-click="openPopup()" translate>I'll backup my wallet later</button>
</ion-content>
</ion-view>

View File

@ -0,0 +1,15 @@
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-buttons side="primary">
<button class="button no-border" href ui-sref="onboarding.backupRequest">
<i class="icon ion-chevron-left"></i> Back
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="backupWarningController">
<span translate>Are you being watched?</span>
<span translate>Now is a perfect time to assess your surroundings. Nearby windows? Hidden cameras? Shoulder-spies?</span>
<span translate>Anyone with your backup phrase can access or spend your bitcoin.</span>
<button class="button button-block button-positive" ng-click="openPopup()" translate>All clear, let's do this</button>
</ion-content>
</ion-view>

View File

@ -0,0 +1,17 @@
<ion-view ng-controller="collectEmailController" ng-init="init()">
<ion-nav-bar class="bar-stable">
<ion-nav-buttons side="secondary">
<button class="button no-border" href ui-sref="onboarding.notifications">
Skip
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content >
Wallet Created
Where would you like to receive email notifications about payments
<form name="emailForm" ng-submit="save(emailForm)" novalidate>
<input type="email" id="email" name="email" ng-model="email" required></input>
<input type="submit" class="button button-block button-positive" value="{{'Save'|translate}}" ng-disabled="emailForm.$invalid">
</form>
</ion-content>
</ion-view>

View File

@ -0,0 +1,20 @@
<ion-view>
<ion-content ng-controller="disclaimerController" ng-init="accept1 = accept2 = accept3 = false">
<h1 translate>Almost done! Let's review</h1>
<span transalate>Bitcoin is different - it cannot be safely held with a bank or web service </span>
<ion-list class="disclaimer">
<ion-checkbox ng-model="accept1"><span translate>I undestand my funds are held securely on this device, not by company.</span></ion-checkbox>
<ion-checkbox ng-model="accept2"><span translate>I understand if this wallet is lost or deleted, my bitcoin can onlt be recovered with the backup phrase</span></ion-checkbox>
<ion-checkbox ng-model="accept3"><span translate>I have read, understood, and agree with the Terms of use.</span></ion-checkbox>
</ion-list>
<div class="text-center">
<a ui-sref="onboarding.terms" translate>Terms of use</a>
</div>
<button
ng-disabled="!accept1 || !accept2 || !accept3"
class="button button-block button-positive"
ng-click="confirm()"
translate>Confirm & Finish
</button>
</ion-content>
</ion-view>

View File

@ -0,0 +1,16 @@
<ion-view>
<ion-content ng-controller="notificationsController" >
<div class="text-center">
<h1 translate>
Push Notifications
</h1>
<span translate>
Would you like to receive push notifications about payments?
</span>
<button class="button button-block button-positive" ng-click="allowNotif()" translate>Allow notifications</button>
<button class="button button-block button-light" href ui-sref="onboarding.requestBackup" translate>Not now</button>
</div>
</ion-content>
</ion-view>

View File

@ -0,0 +1,26 @@
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Terms of Use</ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button no-border" href ui-sref="onboarding.disclaimer">
<i class="icon ion-chevron-left"></i> Back
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="termsController" ng-init="accept = false;">
<p ng-include="'views/includes/terms.html'"></p>
<div class="padding-vertical" ng-show="lang != 'en'">
<a ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a>
</div>
<ion-list class="disclaimer">
<ion-checkbox ng-model="accept"><span translate>I have read, understood, and agree with the Terms of Use</span></ion-checkbox>
</ion-list>
<button
ng-disabled="!accept"
class="button button-block button-positive"
ng-click="confirm()"
translate>Confirm & Finish
</button>
</ion-content>
</ion-view>

View File

@ -0,0 +1,65 @@
<ion-view ng-controller="tourController" ng-init="init()">
<ion-nav-bar class="bar-stable">
<ion-nav-title>Get Started</ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button no-border" ng-click="goBack()">
<i class="icon ion-chevron-left"></i> Back
</button>
</ion-nav-buttons>
<ion-nav-buttons side="secondary">
<button class="button no-border" ng-show="data.index == 0" ng-click="createProfile()">
Skip
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-slides class="slides" options="options" slider="data.slider">
<ion-slide-page>
<ion-content >
<div class="text-center">
<h2 translate>Bitcoin is digital money</h2>
<p translate>
You can spend bitcoin at millions of websites and stores worldwide
</p>
<p translate>
Just scan the code to pay
</p>
<button class="button icon-right ion-chevron-right button-positive" ng-click="slideNext()">
Got it
</button>
</div>
</ion-content>
</ion-slide-page>
<ion-slide-page>
<ion-content >
<div class="text-center">
<h2 translate>Bitcoin is currency</h2>
<p translate>
You can trade it for other currencies like US Dollars, Euros, or Pounds
</p>
<p translate>
The exchange rate changes with the market
</p>
<button class="button icon-right ion-chevron-right button-positive" ng-click="slideNext()">
Makes sense
</button>
</div>
</ion-content>
</ion-slide-page>
<ion-slide-page>
<ion-content >
<div class="text-center">
<h2 translate>You control your bitcoin</h2>
<p translate>
The BitPay wallet stores your bitcoin with cutting-edge security
</p>
<p translate>
Not even BitPay can access it
</p>
<button class="button icon-right button-positive" ng-click="createProfile()">
Create bitcoin wallet
</button>
</div>
</ion-content>
</ion-slide-page>
</ion-slides>
</ion-view>

View File

@ -0,0 +1,13 @@
<ion-view>
<ion-content>
<div class="text-center">
<h2>bitpay</h2>
<span translate>
Take control of your money - get started with bitcoin
</span>
<button class="button button-block button-positive" href ui-sref="onboarding.tour" translate>Get started</button>
<button class="button button-block button-light" translate>Restore</button>
</div>
</ion-content>
</ion-view>

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesController" cache-view="false" ng-init="init()">
<ion-content ng-controller="preferencesController" ng-init="init()">
<div class="list">
<div class="item item-divider">
Preferences

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesAbout" cache-view="false">
<ion-content ng-controller="preferencesAbout" >
<div class="item item-divider">
Release information
</div>
@ -27,7 +27,7 @@
</div>
<div class="item item-divider">
</div>
<div class="item item-icon-left" href ui-sref="settings.termOfUse">
<div class="item item-icon-left" href ui-sref="settings.termsOfUse">
<i class="icon ion-ios-bell-outline"></i>
<span translate>Terms of Use</span>
</div>

View File

@ -1,4 +1,4 @@
<ion-view cache-view="false">
<ion-view >
<ion-nav-bar class="bar-stable">
<ion-nav-title>Advanced Preferences</ion-nav-title>
<ion-nav-buttons side="primary">

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesAliasController" cache-view="false">
<ion-content ng-controller="preferencesAliasController" >
<form name="aliasForm" ng-submit="save(aliasForm)" novalidate>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>Alias for {{walletName}}</span>

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesAltCurrencyController" ng-init="init()" cache-view="false">
<ion-content ng-controller="preferencesAltCurrencyController" ng-init="init()" >
<ion-radio ng-repeat="altCurrency in altCurrencyList" ng-value="altCurrency.isoCode" ng-model="currentCurrency"
ng-click="save(altCurrency)">{{altCurrency.name}}
</ion-radio>

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesBwsUrlController" cache-view="false">
<ion-content ng-controller="preferencesBwsUrlController" >
<form name="settingsBwsUrlForm" ng-submit="save(settingsBwsUrlForm)" novalidate>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>Wallet Service URL</span><a ng-click="resetDefaultUrl()" translate> Set default url</a>

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesColorController" cache-view="false">
<ion-content ng-controller="preferencesColorController" >
<ion-radio ng-repeat="c in colorList" ng-value="c" ng-model="currentColor" ng-click="save(c)">
<span ng-style="{'color': c}">&block;</span>
</ion-radio>

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header" ng-controller="preferencesDeleteWalletController" cache-view="false">
<ion-content class="has-header" ng-controller="preferencesDeleteWalletController" >
<div translate>Warning!</div>
<div translate>Permanently delete this wallet. THIS ACTION CANNOT BE REVERSED</div>
<div class="right" ng-style="{'color':backgroundColor}" ng-show="!isDeletingWallet">

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesDeleteWordsController" cache-view="false">
<ion-content ng-controller="preferencesDeleteWordsController" >
<div ng-show="!deleted">
<div ng-show="error">
{{error|translate}}

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesEmailController" cache-view="false">
<ion-content ng-controller="preferencesEmailController" >
<form name="emailForm" ng-submit="save(emailForm)" novalidate>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>Email for wallet notifications</span>

View File

@ -8,7 +8,7 @@
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesFeeController" cache-view="false" ng-init="init()">
<ion-content ng-controller="preferencesFeeController" ng-init="init()">
<div ng-show="loading">
<ion-spinner class="spinner-dark" icon="lines">Loading...</ion-spinner>
</div>

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesHistory" cache-view="false" ng-init="index.updatingTxHistory ? null : csvHistory()">
<ion-content ng-controller="preferencesHistory" ng-init="index.updatingTxHistory ? null : csvHistory()">
<div class="item item-divider"></div>
<div class="item" ng-show="csvReady && !index.isCordova" ng-csv="csvContent" csv-header="csvHeader" filename="Copay-{{index.alias || index.walletName}}.csv">
<span translate>Export to file</span>

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesInformation" cache-view="false" ng-init="init()">
<ion-content ng-controller="preferencesInformation" ng-init="init()">
<div class="list">
<div class="item item-divider">
Wallet Information

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesLanguageController" ng-init="init()" cache-view="false">
<ion-content ng-controller="preferencesLanguageController" ng-init="init()" >
<ion-radio ng-repeat="lang in availableLanguages" ng-value="lang.isoCode" ng-model="currentLanguage"
ng-click="save(lang.isoCode)">{{lang.name}}
</ion-radio>

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="preferencesLogs" ng-init="init()" cache-view="false">
<ion-content ng-controller="preferencesLogs" ng-init="init()" >
<button ng-show="isCordova" ng-click="logs.sendLogs()"><i class="fi-mail"></i>
<span translate>Send by email</span>
</button>

View File

@ -7,7 +7,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar class="bar-stable">
<ion-content ng-controller="preferencesUnitController" ng-init="init()" cache-view="false">
<ion-content ng-controller="preferencesUnitController" ng-init="init()" >
<ion-radio ng-repeat="unit in unitList" ng-value="unit.code" ng-model="currentUnit"
ng-click="save(unit)">{{unit.shortName}}
</ion-radio>

View File

@ -4,7 +4,7 @@
</ion-nav-bar>
<ion-content ng-controller="tabReceiveController" ng-init="init()" cache-view="false">
<ion-content ng-controller="tabReceiveController" ng-init="init()" >
<div class="text-center m30v" copy-to-clipboard="addr" ng-show="addr" >
<qrcode size="220" data="bitcoin:{{addr}}" ng-show="addr"></qrcode>

View File

@ -2,7 +2,7 @@
<ion-nav-bar class="bar-stable">
<ion-nav-title>Global Settings</ion-nav-title>
</ion-nav-bar>
<ion-content ng-controller="tabSettingsController" cache-view="false" ng-init="init()">
<ion-content ng-controller="tabSettingsController" ng-init="init()">
<div class="item item-divider">
</div>
<div class="list">

View File

@ -1,20 +0,0 @@
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Terms of Use</ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button no-border" ui-sref="settings.about">
<i class="icon ion-chevron-left"></i> Back
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="termOfUseController" cache-view="false">
<p>
<div ng-include="'views/includes/terms.html'"></div>
</p>
<div class="row">
<p ng-show="lang != 'en'">
<a ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a>
</p>
</div>
</ion-content>
</ion-view>

View File

@ -0,0 +1,20 @@
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Terms of Use</ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button no-border" ui-sref="settings.about">
<i class="icon ion-chevron-left"></i> Back
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="termOfUseController" cache-view="false">
<p>
<div ng-include="'views/includes/terms.html'"></div>
</p>
<div class="row">
<p ng-show="lang != 'en'">
<a ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a>
</p>
</div>
</ion-content>
</ion-view>

View File

@ -1,17 +1,32 @@
'use strict';
angular.module('copayApp.controllers').controller('backupController',
function($rootScope, $scope, $timeout, $log, $state, $stateParams, lodash, fingerprintService, platformInfo, configService, profileService, gettext, bwcService, walletService, ongoingProcess) {
function($rootScope, $scope, $timeout, $log, $state, $stateParams, $ionicPopup, uxLanguage, lodash, fingerprintService, platformInfo, configService, profileService, gettext, bwcService, walletService, ongoingProcess) {
var wallet = profileService.getWallet($stateParams.walletId);
$scope.customWords = [];
$scope.walletName = wallet.credentials.walletName;
$scope.n = wallet.n;
$scope.credentialsEncrypted = wallet.isPrivKeyEncrypted;
var isDeletedSeed = function() {
if (lodash.isEmpty(wallet.credentials.mnemonic) && lodash.isEmpty(wallet.credentials.mnemonicEncrypted))
return true;
return false;
};
var handleEncryptedWallet = function(client, cb) {
if (!walletService.isEncrypted(client)) {
return cb();
}
$rootScope.$emit('Local/NeedsPassword', false, function(err, password) {
if (err) return cb(err);
return cb(walletService.unlock(client, password));
});
};
$scope.init = function() {
$scope.step = 1;
$scope.deleted = isDeletedSeed();
if ($scope.deleted) return;
@ -33,7 +48,7 @@ angular.module('copayApp.controllers').controller('backupController',
});
};
function shuffledWords(words) {
var shuffledWords = function(words) {
var sort = lodash.sortBy(words);
return lodash.map(sort, function(w) {
@ -62,70 +77,46 @@ angular.module('copayApp.controllers').controller('backupController',
}, 10);
};
function isDeletedSeed() {
if (lodash.isEmpty(wallet.credentials.mnemonic) && lodash.isEmpty(wallet.credentials.mnemonicEncrypted))
return true;
return false;
};
$scope.$on('$destroy', function() {
walletService.lock(wallet);
});
$scope.goToStep = function(n) {
if (n == 1)
$scope.initFlow();
if (n == 2)
$scope.step = 2;
if (n == 3) {
if (!$scope.mnemonicHasPassphrase)
finalStep();
else
$scope.step = 3;
$scope.goBack = function() {
if ($scope.step == 1) {
if ($stateParams.fromOnboarding) $state.go('onboarding.backupRequest');
else $state.go('wallet.preferences');
}
if (n == 4)
finalStep();
else {
$scope.goToStep($scope.step - 1);
}
};
function finalStep() {
ongoingProcess.set('validatingWords', true);
confirm(function(err) {
ongoingProcess.set('validatingWords', false);
if (err) {
backupError(err);
}
$timeout(function() {
$scope.step = 4;
return;
}, 1);
});
var backupError = function(err) {
ongoingProcess.set('validatingWords', false);
$log.debug('Failed to verify backup: ', err);
$scope.backupError = true;
$timeout(function() {
$scope.$apply();
}, 1);
};
var openPopup = function() {
var confirmBackupPopup = $ionicPopup.show({
templateUrl: "views/includes/confirmBackupPopup.html",
scope: $scope,
});
$scope.closePopup = function(val) {
if (val) {
confirmBackupPopup.close();
if ($stateParams.fromOnboarding) $state.go('onboarding.disclaimer');
else $state.go('tabs.home')
}
else {
confirmBackupPopup.close();
$scope.goToStep(1);
}
};
};
}
$scope.addButton = function(index, item) {
var newWord = {
word: item.word,
prevIndex: index
};
$scope.customWords.push(newWord);
$scope.shuffledMnemonicWords[index].selected = true;
$scope.shouldContinue();
};
$scope.removeButton = function(index, item) {
if ($scope.loading) return;
$scope.customWords.splice(index, 1);
$scope.shuffledMnemonicWords[item.prevIndex].selected = false;
$scope.shouldContinue();
};
$scope.shouldContinue = function() {
if ($scope.customWords.length == $scope.shuffledMnemonicWords.length)
$scope.selectComplete = true;
else
$scope.selectComplete = false;
};
function confirm(cb) {
var confirm = function(cb) {
$scope.backupError = false;
var customWordList = lodash.pluck($scope.customWords, 'word');
@ -161,25 +152,62 @@ angular.module('copayApp.controllers').controller('backupController',
}, 1);
};
function handleEncryptedWallet(client, cb) {
if (!walletService.isEncrypted(client)) {
$scope.credentialsEncrypted = false;
return cb();
}
$rootScope.$emit('Local/NeedsPassword', false, function(err, password) {
if (err) return cb(err);
return cb(walletService.unlock(client, password));
var finalStep = function() {
ongoingProcess.set('validatingWords', true);
confirm(function(err) {
ongoingProcess.set('validatingWords', false);
if (err) {
backupError(err);
}
$timeout(function() {
openPopup();
return;
}, 1);
});
};
function backupError(err) {
ongoingProcess.set('validatingWords', false);
$log.debug('Failed to verify backup: ', err);
$scope.backupError = true;
$timeout(function() {
$scope.$apply();
}, 1);
$scope.goToStep = function(n) {
if (n == 1)
$scope.initFlow();
if (n == 2)
$scope.step = 2;
if (n == 3) {
if (!$scope.mnemonicHasPassphrase)
finalStep();
else
$scope.step = 3;
}
if (n == 4)
finalStep();
};
$scope.addButton = function(index, item) {
var newWord = {
word: item.word,
prevIndex: index
};
$scope.customWords.push(newWord);
$scope.shuffledMnemonicWords[index].selected = true;
$scope.shouldContinue();
};
$scope.removeButton = function(index, item) {
if ($scope.loading) return;
$scope.customWords.splice(index, 1);
$scope.shuffledMnemonicWords[item.prevIndex].selected = false;
$scope.shouldContinue();
};
$scope.shouldContinue = function() {
if ($scope.customWords.length == $scope.shuffledMnemonicWords.length)
$scope.selectComplete = true;
else
$scope.selectComplete = false;
};
$scope.$on('$destroy', function() {
walletService.lock(wallet);
});
});

View File

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

View File

@ -0,0 +1,21 @@
'use strict';
angular.module('copayApp.controllers').controller('backupRequestController', function($rootScope, $scope, $state, $ionicPopup, $stateParams, profileService, walletService) {
$scope.openPopup = function() {
var backupLaterPopup = $ionicPopup.show({
templateUrl: "views/includes/backupLaterPopup.html",
scope: $scope,
});
$scope.goBack = function() {
backupLaterPopup.close();
};
$scope.continue = function() {
backupLaterPopup.close();
$state.go('onboarding.disclaimer');
};
}
});

View File

@ -0,0 +1,21 @@
'use strict';
angular.module('copayApp.controllers').controller('backupWarningController', function($rootScope, $scope, $state, $ionicPopup, $stateParams, profileService, walletService) {
$scope.openPopup = function() {
var backupWarningPopup = $ionicPopup.show({
templateUrl: "views/includes/backupWarningPopup.html",
scope: $scope,
});
$scope.close = function() {
backupWarningPopup.close();
var wallet = profileService.getWallets()[0];
$state.go('wallet.backup', {
walletId: wallet.credentials.walletId,
fromOnboarding: true
})
};
}
});

View File

@ -0,0 +1,17 @@
'use strict';
angular.module('copayApp.controllers').controller('collectEmailController', function($rootScope, $scope, $state, $stateParams, $timeout, $ionicModal, profileService, walletService) {
$scope.save = function(form) {
var wallet = profileService.getWallet($stateParams.walletId);
var email = $scope.email || '';
walletService.updateRemotePreferences(wallet, {
email: email,
}, function(err) {
if (err) $log.warn(err);
$state.go('onboarding.notifications');
});
};
});

View File

@ -0,0 +1,24 @@
'use strict';
angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $state, $log, $ionicModal, profileService) {
$scope.confirm = function() {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
else {
$state.go('tabs.home');
}
});
};
this.openModal = function() {
$ionicModal.fromTemplateUrl('views/modals/addressbook.html', {
scope: $scope
}).then(function(modal) {
$scope.addressbookModal = modal;
$scope.addressbookModal.show();
});
};
});

View File

@ -0,0 +1,12 @@
'use strict';
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, platformInfo) {
if (!platformInfo.isCordova) $state.go('onboarding.backupRequest');
$scope.allowNotif = function() {
// T O D O
$state.go('onboarding.backupRequest');
}
});

View File

@ -0,0 +1,15 @@
'use strict';
angular.module('copayApp.controllers').controller('termsController', function($scope, $log, $state, uxLanguage, profileService) {
$scope.lang = uxLanguage.currentLanguage;
$scope.confirm = function() {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
else {
$state.go('tabs.home');
}
});
};
});

View File

@ -0,0 +1,71 @@
'use strict';
angular.module('copayApp.controllers').controller('tourController',
function($scope, $stateParams, $state, $log, $timeout, ongoingProcess, storageService, profileService) {
$scope.init = function() {
$scope.data = {
index: 0
};
$scope.options = {
loop: false,
effect: 'flip',
speed: 500,
spaceBetween: 100
}
};
$scope.createProfile = function(opts) {
var tries = 0;
opts = opts || {};
$log.debug('Creating profile');
ongoingProcess.set('creatingWallet', true);
profileService.create(opts, function(err) {
if (err) {
$log.warn(err);
$scope.error = err;
$scope.$apply();
return $timeout(function() {
$log.warn('Retrying to create profile......');
if (tries == 3) {
tries == 0;
return $scope.createProfile({
noWallet: true
});
} else {
tries += 1;
return $scope.createProfile();
}
}, 3000);
};
$scope.error = "";
ongoingProcess.set('creatingWallet', false);
var wallet = profileService.getWallets()[0];
$state.go('onboarding.collectEmail', {
walletId: wallet.credentials.walletId
});
});
};
$scope.goBack = function() {
if ($scope.data.index != 0) $scope.slider.slidePrev();
else $state.go('onboarding.welcome');
}
$scope.slideNext = function() {
if ($scope.data.index != 2) $scope.slider.slideNext();
else $state.go('onboarding.welcome');
}
$scope.$on("$ionicSlides.sliderInitialized", function(event, data) {
$scope.slider = data.slider;
});
$scope.$on("$ionicSlides.slideChangeStart", function(event, data) {
$scope.data.index = data.slider.activeIndex;
});
$scope.$on("$ionicSlides.slideChangeEnd", function(event, data) {});
});

View File

@ -127,7 +127,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
url: $stateParams.url
});
})
}
}
})
.state('uripayment', {
url: '/uri-payment/:url',
@ -146,6 +146,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
templateUrl: 'views/activity.html'
})
/*
*
* Wallet
@ -153,7 +154,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
*/
.state('wallet', {
url: '/wallet/{walletId}',
url: '/wallet/{walletId}/{fromOnboarding}',
abstract: true,
template: '<ion-nav-view name="wallet"></ion-nav-view>'
})
@ -528,11 +529,11 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
}
})
.state('settings.termOfUse', {
url: '/termOfUse',
.state('settings.termsOfUse', {
url: '/termsOfUse',
views: {
'settings': {
templateUrl: 'views/termOfUse.html',
templateUrl: 'views/termsOfUse.html',
}
}
})
@ -545,6 +546,82 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
})
/*
*
* Onboarding
*
*/
.state('onboarding', {
url: '/onboarding',
abstract: true,
template: '<ion-nav-view name="onboarding"></ion-nav-view>'
})
.state('onboarding.welcome', {
url: '/welcome',
views: {
'onboarding': {
templateUrl: 'views/onboarding/welcome.html'
}
}
})
.state('onboarding.tour', {
url: '/tour',
views: {
'onboarding': {
templateUrl: 'views/onboarding/tour.html'
}
}
})
.state('onboarding.collectEmail', {
url: '/collectEmail',
views: {
'onboarding': {
templateUrl: 'views/onboarding/collectEmail.html'
}
}
})
.state('onboarding.notifications', {
url: '/notifications',
views: {
'onboarding': {
templateUrl: 'views/onboarding/notifications.html'
}
}
})
.state('onboarding.backupRequest', {
url: '/backupRequest',
views: {
'onboarding': {
templateUrl: 'views/onboarding/backupRequest.html'
}
}
})
.state('onboarding.backupWarning', {
url: '/backupWarning',
views: {
'onboarding': {
templateUrl: 'views/onboarding/backupWarning.html'
}
}
})
.state('onboarding.disclaimer', {
url: '/disclaimer',
views: {
'onboarding': {
templateUrl: 'views/onboarding/disclaimer.html'
}
}
})
.state('onboarding.terms', {
url: '/terms',
views: {
'onboarding': {
templateUrl: 'views/onboarding/terms.html'
}
}
})
/*
*
* Glidera
@ -765,10 +842,10 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
if (err) {
if (err.message && err.message.match('NOPROFILE')) {
$log.debug('No profile... redirecting');
$state.transitionTo('disclaimer');
$state.transitionTo('onboarding.welcome');
} else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) {
$log.debug('Display disclaimer... redirecting');
$state.transitionTo('disclaimer');
$state.transitionTo('onboarding.disclaimer');
} else {
throw new Error(err); // TODO
}
@ -778,7 +855,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
$state.transitionTo('tabs.home');
}
});
});
});
if (platformInfo.isNW) {
var gui = require('nw.gui');

View File

@ -953,4 +953,10 @@ input[type=number] {
height: 24px;
}
.disclaimer {
.item, .item-content{
overflow: auto;
text-overflow: initial;
white-space: initial;
}
}