import now working with ledger

Signed-off-by: Matias Alejo Garcia <ematiu@gmail.com>
This commit is contained in:
Matias Alejo Garcia 2015-09-04 21:18:20 -03:00
commit 4d9a477ae5
10 changed files with 148 additions and 47 deletions

View file

@ -102,27 +102,27 @@
</div>
<div ng-hide="hideAdv" class="row">
<div class="large-12 columns">
<label ng-show="create.isChromeApp()" for="hw-ledger" class="line-b oh">
<label ng-show="create.isChromeApp()" for="hw-ledger" class="oh">
<span translate>Use Ledger hardware wallet</span>
<switch id="hw-ledger" name="hwLedger" ng-model="hwLedger" ng-change="isTestnet=false" class="green right m5t m10b"></switch>
</label>
<div ng-hide="!hwLedger">
<label class="line-b oh"><span translate>Select slot number for Ledger key</span>
<div ng-show="hwLedger">
<label class="oh line-b "><span translate>Select slot number for Ledger key</span>
<select class="m10t" ng-model="externalIndex" ng-options="externalIndex as externalIndex for externalIndex in create.externalIndexValues">
</select>
</label>
</div>
<label for="network-name" class="oh">
<label for="network-name" class="oh" ng-show="!hwLedger">
<span translate>Testnet</span>
<switch id="network-name" name="isTestnet" ng-model="isTestnet" class="green right m5t m10b"></switch>
</label>
<label ng-hide="hwLedger" for="seed" class="oh">
<label ng-show="!hwLedger" for="seed" class="oh">
<span translate>Specify your wallet seed</span>
<switch id="seed" name="setSeed" ng-model="setSeed" class="green right m5t m10b"></switch>
</label>
<label for="createPassphrase" class="line-b oh" ng-show="!setSeed" ><span translate>Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
<label for="createPassphrase" class="line-b oh" ng-show="!setSeed && !hwLedger" ><span translate>Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
<div class="input">
<input type="text" class="form-control"
name="createPassphrase" ng-model="createPassphrase">
@ -136,11 +136,11 @@
type="text"
name="privateKey" ng-model="privateKey">
</label>
<label for="passphrase" class="line-b oh" ng-show="setSeed && !hwLedger"><span translate>Seed Passphrase</span> <small translate>The seed could require a passphrase to be imported</small>
<div class="input">
<input type="text" class="form-control" name="passphrase" ng-model="passphrase">
</div>
</label>
<label for="passphrase" class="line-b oh" ng-show="setSeed && !hwLedger"><span translate>Seed Passphrase</span> <small translate>The seed could require a passphrase to be imported</small>
<div class="input">
<input type="text" class="form-control" name="passphrase" ng-model="passphrase">
</div>
</label>
</div>
</div>

View file

@ -5,7 +5,7 @@
</div>
<div class="content p20v" ng-controller="importController as import" ng-init="type='12'">
<div class="onGoingProcess" ng-show="import.loading">
<div class="onGoingProcess" ng-show="import.loading && !import.ledger">
<div class="onGoingProcess-content" ng-style="{'background-color':'#222'}">
<div class="spinner">
<div class="rect1"></div>
@ -17,9 +17,23 @@
<span translate>Importing wallet...</span>
</div>
</div>
<div class="onGoingProcess" ng-show="import.ledger">
<div class="onGoingProcess-content" ng-style="{'background-color':'#222'}">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<span translate>Connecting to Ledger Wallet...</span>
</div>
</div>
<div class="create-tab small-only-text-center" ng-hide="create.hideTabs">
<div class="row">
<div class="row" ng-show="!index.isChromeApp">
<div class="tab-container small-6 medium-6 large-6">
<a href
ng-class="{'selected': type =='12'}"
@ -30,14 +44,27 @@
ng-class="{'selected': type=='file'}"
ng-click="import.setType('file')" translate>File/Text Backup</a>
</div>
<!-- <div class="tab&#45;container small&#45;4 medium&#45;4 large&#45;4"> -->
<!-- <a href -->
<!-- ng&#45;class="{'selected': type=='qr'}" -->
<!-- ng&#45;click="import.setType('qr')" translate>QR Code</a> -->
<!-- </div> -->
</div>
<div class="row" ng-show="index.isChromeApp">
<div class="tab-container small-4 medium-4 large-4">
<a href
ng-class="{'selected': type =='12'}"
ng-click="import.setType('12')" translate>Walled Seed</a>
</div>
<div class="tab-container small-4 medium-4 large-4">
<a href
ng-class="{'selected': type=='file'}"
ng-click="import.setType('file')" translate>File/Text Backup</a>
</div>
<div class="tab-container small-4 medium-4 large-4">
<a href
ng-class="{'selected': type=='ledger'}"
ng-click="import.setType('ledger')" translate>Ledger</a>
</div>
</div>
</div>
@ -139,9 +166,29 @@
</div>
</div>
<div class="row" ng-show="type == 'qr'">
<div class="row" ng-show="type == 'ledger'">
<div class="large-12 columns">
TODO
<form name="importForm3" ng-submit="import.importLedger(importForm3)" novalidate>
<div class="box-notification" ng-show="import.error">
<span class="text-warning size-14">
{{import.error|translate}}
</span>
</div>
<div class="large-12 columns">
<label class="line-b oh">
<span translate>Select slot number for Ledger key</span>
<select class="m10t" ng-model="externalIndex" ng-options="externalIndex as externalIndex for externalIndex in import.externalIndexValues">
</select>
</label>
<button translate type="submit" class="button round expand black"
ng-disabled="import.loading || import.ledger">
Import backup
</button>
</div>
</form>
</div>
</div>

View file

@ -86,7 +86,7 @@
</a>
<div ng-show="join.hideAdv" class="row">
<div class="large-12 columns" ng-show="join.isChromeApp()">
<label for="hw-ledger" class="line-b oh">
<label for="hw-ledger" class="oh">
<span translate>Use Ledger hardware wallet</span>
<switch id="hw-ledger" name="hwLedger" ng-model="hwLedger" class="green right m5t m10b"></switch>
</label>
@ -100,26 +100,26 @@
</div>
<div class="large-12 columns">
<label for="seed" class="oh">
<label ng-show="!hwLedger" for="seed" class="oh">
<span translate>Specify your wallet seed</span>
<switch id="seed" name="setSeed" ng-model="setSeed" class="green right m5t m10b"></switch>
</label>
<label for="createPassphrase" class="line-b oh" ng-show="!setSeed" ><span translate>Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
<label for="createPassphrase" class="line-b oh" ng-show="!setSeed && !hwLedger" ><span translate>Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
<div class="input">
<input type="text" class="form-control"
name="createPassphrase" ng-model="createPassphrase">
</div>
</label>
<label for="ext-master" class="m10t" ng-show="setSeed">
<label for="ext-master" class="m10t" ng-show="setSeed && !hwLedger">
<span translate>Wallet Seed</span>
<small translate>Enter the 12 words seed (BIP39)</small>
<input id="ext-master"
type="text"
name="privateKey" ng-model="privateKey">
</label>
<label for="passphrase" class="line-b oh" ng-show="setSeed"><span translate>Seed Passphrase</span> <small translate>The seed could require a passphrase to be imported</small>
<label for="passphrase" class="line-b oh" ng-show="setSeed && !hwLedger"><span translate>Seed Passphrase</span> <small translate>The seed could require a passphrase to be imported</small>
<div class="input">
<input type="text" class="form-control" name="passphrase" ng-model="passphrase">
</div>
@ -136,10 +136,6 @@
</span>
</div>
<button translate type="submit" class="button expand black m0 round"
ng-disabled="joinForm.$invalid || join.loading">Join</button>
</form>