Merge pull request #120 from maraoz/feature/ux-fixes

Feature/ux fixes
This commit is contained in:
Ryan X. Charles 2014-04-21 13:16:57 -03:00
commit ace128dfe9
7 changed files with 41 additions and 39 deletions

View File

@ -24,7 +24,7 @@ module.exports = function(grunt) {
tasks: ['markdown']
},
scripts: {
files: ['**/*.js', '**/*.html', '!**/node_modules/**', '!browser/bundle.js', '!browser/testdata.js', '!lib/**js', '!browser/vendor-bundle.js', '!js/copayBundle.js'],
files: ['*.js', '**/*.js', '*.html', '!**/node_modules/**', '!lib/**js', '!browser/vendor-bundle.js', '!js/copayBundle.js'],
tasks: ['shell'],
},
},

View File

@ -245,3 +245,8 @@ button.secondary:hover { background-color: #FFDF00 !important;}
.br100 {border-radius: 100%;}
input.ng-dirty.ng-invalid {
border: 2px red solid;
}

View File

@ -14,7 +14,7 @@
<div class="header">
<div class="header-content">
<figure class="left">
<img src="./img/logo-negative.svg" alt="" width="130">
<a href="#"><img src="./img/logo-negative.svg" alt="Copay" width="130" /></a>
</figure>
<div class="text-right" ng-show="$root.wallet">
<h5 ng-show="$root.wallet.id">Wallet ID: {{$root.wallet.id}}</h5>
@ -82,18 +82,6 @@
Connecting to wallet...
</div>
<div ng-show="!loading">
<div class="row">
<div class="large-6 columns">
<h3>Join Wallet Creation</h3>
<input type="text" class="form-control" placeholder="Paste secret here"
ng-model="connectionId" autofocus>
</div>
<div class="large-3 columns">
<button class="button primary expand round" type="button" ng-click="join(connectionId)">Join</button>
</div>
</div>
<hr>
<div ng-show="!walletIds.length">
<div class="row">
<div class="large-6 columns">
@ -104,29 +92,43 @@
</div>
</div>
<hr>
<div class="row">
<div class="text-center">
<a ng-click="import()">Import from file</a>
</div>
</div>
</div>
<div ng-show="walletIds.length>0">
<div ng-show="walletIds.length">
<div class="row">
<div class="large-6 columns">
<h3>Open Existing Wallet</h3>
<select class="form-control" ng-model="selectedWalletId" ng-options="walletId for walletId in walletIds">
<h3>Open Wallet</h3>
<select class="form-control" ng-model="selectedWalletId"
ng-options="walletId for walletId in walletIds">
</select>
</div>
<div class="large-3 columns">
<button class="button secondary expand round" type="button" ng-click="open(selectedWalletId)">Open</button>
<button class="button secondary expand round" type="button"
ng-click="open(selectedWalletId)">Open</button>
</div>
</div>
<hr>
</div>
<div ng-show="true">
<div class="row">
<div class="large-12 columns">
<a ng-click="create()">Create a new wallet</a>
<a class="right" ng-click="import()">Import from file</a>
<div class="large-6 columns">
<h3>Join a Wallet in Creation</h3>
<input type="text" class="form-control" placeholder="Paste wallet secret here"
ng-model="connectionId" required ng-minlength="32" ng-maxlength="32" autofocus>
</div>
<div class="large-3 columns">
<button class="button primary expand round"
ng-click="join(connectionId)">Join</button>
</div>
</div>
<hr>
</div>
<div class="row">
<div class="large-12 columns">
<div ng-show="walletIds.length">
<a ng-click="create()">Create a new wallet</a>
</div>
<a class="right" ng-click="import()">Import from file</a>
</div>
</div>

View File

@ -19,6 +19,9 @@ console.log('[signin.js.23:walletId:]',walletId); //TODO
};
$scope.join = function(secret) {
if (!secret || !secret.length) {
return;
}
$scope.loading = true;
walletFactory.network.on('joinError', function() {

View File

@ -23,7 +23,8 @@ PrivateKey.prototype.getId = function(prefix) {
if (prefix) {
buf = Buffer.concat([prefix, buf]);
}
return util.ripe160(buf).toString('hex');
var hash = util.sha256(buf).toString('hex');
return hash.substring(0, hash.length/2);
};

View File

@ -82,7 +82,8 @@ PublicKeyRing.prototype.getCopayerId = function(i, prefix) {
if (prefix) {
buf = Buffer.concat([prefix, buf]);
}
return util.ripe160(buf).toString('hex');
var hash = util.sha256(buf).toString('hex');
return hash.substring(0, hash.length/2);
};
PublicKeyRing.prototype.myCopayerId = function(i, prefix) {

View File

@ -144,17 +144,7 @@ Wallet.prototype._optsToObj = function () {
Wallet.prototype.getPeerId = function(index) {
// if (typeof index === 'undefined') {
// // return my own peerId
// var gen = this.privateKey.getId(idBuf);
// return gen;
// }
// return peer number 'index' peerId
//
var idBuf;
// TODO idBuf DISABLED FOR NOW
//idBuf = new Buffer(this.id);
return this.publicKeyRing.getCopayerId(index || 0, idBuf);
return this.publicKeyRing.getCopayerId(index || 0);
};