diff --git a/css/main.css b/css/main.css index 219088bd8..6b4926b15 100644 --- a/css/main.css +++ b/css/main.css @@ -152,6 +152,12 @@ h3 { border-right: 2px dashed #E3E3E3; } +@media (max-width: 1025px) { + .line-dashed-v { + border: none; + } +} + .line-dashed-h { margin: 1rem 0; border-bottom: 2px dashed #E3E3E3; @@ -234,6 +240,7 @@ hr { margin: 2.25rem 0;} .size-60 { font-size: 60px; } .size-72 { font-size: 72px; } .m10t {margin-top: 10px;} +.m10b {margin-bottom: 10px;} .m10r {margin-right: 10px;} .m10 {margin: 10px !important;} .m15 {margin: 15px !important;} @@ -311,6 +318,63 @@ hr { margin: 2.25rem 0;} padding: 2.7px; } +.box-setup { + padding: 20px 30px; + border: 1px solid #eee; + background: #fff; + overflow: hidden; + margin-bottom: 10px; +} + +.box-setup-copayers { + position: relative; + background: #ffffff; + border: 2px solid #eee; +} + +.box-setup-copayers:after, .box-setup-copayers:before { + bottom: 100%; + left: 50%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; +} + +.box-setup-copayers:after { + border-color: rgba(255, 255, 255, 0); + border-bottom-color: #ffffff; + border-width: 30px; + margin-left: -30px; +} + +.box-setup-copayers:before { + border-color: rgba(238, 238, 238, 0); + border-bottom-color: #eee; + border-width: 33px; + margin-left: -33px; +} + +.box-setup-copayers-fix { + overflow: hidden; + padding: 10px 10px 0 10px; +} + +.box-setup-copay { + width: 60px; + height: 60px; + float: left; + margin-right: 10px; + margin-bottom: 10px; + border: 3px solid #eee; +} + +.box-setup-copay-required { + border: 3px solid green; +} + .tx-copayers { background: #F8F8F8; -moz-box-shadow: inset 0px 0px 4px 0px rgba(0,0,0,0.05), inset 0px 1px 1px 0px rgba(0,0,0,0.05); @@ -352,3 +416,7 @@ hr { margin: 2.25rem 0;} width: 200px; } +a.loading { + background: #fff; +} + diff --git a/index.html b/index.html index 17f60421d..16a2b19bd 100644 --- a/index.html +++ b/index.html @@ -18,11 +18,15 @@
-
+
Balance: {{totalBalance || 0}}
@@ -196,36 +200,44 @@
-
-

Create new multisig wallet

-
+
+
Select total number of copayers
-
-
-
+
Select required number of signatures
-
-
Wallet name (optional)
-
- -
-
+
+
+
+
+
+ Copayer {{$index+1}}-{{totalCopayers}} +
+
+
+
+
+
+
Wallet name (optional)
+ +
+
+ +
+
-
- Go back -
+ Go back
@@ -237,21 +249,34 @@
-
-

Addresses (available to spend)

+ -
+

Create a New Address

- +
diff --git a/js/app.js b/js/app.js index 6f64a9b30..aa9cdfde1 100644 --- a/js/app.js +++ b/js/app.js @@ -1,5 +1,8 @@ 'use strict'; + +var copay = require('copay'); + var copayApp = window.copayApp = angular.module('copay',[ 'ngRoute', 'mm.foundation', diff --git a/js/controllers/addresses.js b/js/controllers/addresses.js index 6b2ee0e3c..0a5470ea5 100644 --- a/js/controllers/addresses.js +++ b/js/controllers/addresses.js @@ -2,36 +2,21 @@ angular.module('copay.addresses').controller('AddressesController', function($scope, $rootScope, controllerUtils) { - $scope.title = 'Home'; - $scope.oneAtATime = true; - $scope.addrBalance = {}; var w = $rootScope.wallet; - - var _updateBalance = function () { - controllerUtils.setSocketHandlers(); - w.getBalance(true, function (balance, balanceByAddr, isMain) { - if (balanceByAddr && Object.keys(balanceByAddr).length) { - $rootScope.balanceByAddr = balanceByAddr; - $scope.isMain = isMain; - $scope.addrs = Object.keys(balanceByAddr); - $scope.selectedAddr = $scope.addrs[0]; - $scope.loading = false; - $rootScope.$digest(); - } - }); - }; + $scope.loading = false; $scope.newAddr = function() { $scope.loading = true; w.generateAddress(); - _updateBalance(); + controllerUtils.updateBalance(function() { + $scope.loading = false; + $rootScope.$digest(); + }); }; $scope.selectAddr = function(addr) { $scope.selectedAddr = addr; }; - _updateBalance(); - w.on('refresh', _updateBalance); }); diff --git a/js/controllers/header.js b/js/controllers/header.js index f9cf9e1a6..e8a25141e 100644 --- a/js/controllers/header.js +++ b/js/controllers/header.js @@ -40,7 +40,13 @@ angular.module('copay.header').controller('HeaderController', w.disconnect(); controllerUtils.logout(); } - $rootScope.flashMessage = {}; + $scope.clearFlashMessage(); + }; + + $scope.refresh = function() { + controllerUtils.updateBalance(function() { + $rootScope.$digest(); + }); }; $scope.clearFlashMessage = function() { diff --git a/js/controllers/setup.js b/js/controllers/setup.js index e867af9f0..adab10310 100644 --- a/js/controllers/setup.js +++ b/js/controllers/setup.js @@ -5,6 +5,11 @@ angular.module('copay.setup').controller('SetupController', $scope.loading = false; + // ng-repeat defined number of times instead of repeating over array? + $scope.getNumber = function(num) { + return new Array(num); + } + $scope.totalCopayers = config.wallet.totalCopayers; $scope.TCValues = []; for (var n = 1; n <= config.limits.totalCopayers; n++) diff --git a/js/init.js b/js/init.js index d9e3481d8..4c8f29b30 100644 --- a/js/init.js +++ b/js/init.js @@ -1,5 +1,5 @@ 'use strict'; -var copay = require('copay'); + angular.element(document).ready(function() { // Init the app angular.bootstrap(document, ['copay']); diff --git a/js/models/core/PublicKeyRing.js b/js/models/core/PublicKeyRing.js index fc73e784c..a99f2c8cc 100644 --- a/js/models/core/PublicKeyRing.js +++ b/js/models/core/PublicKeyRing.js @@ -143,7 +143,6 @@ PublicKeyRing.prototype.addCopayer = function (newEpk) { return newEpk; }; - PublicKeyRing.prototype.getPubKeys = function (index, isChange) { this._checkKeys(); @@ -159,6 +158,7 @@ PublicKeyRing.prototype.getPubKeys = function (index, isChange) { this.publicKeysCache[path] = pubKeys.map(function(pk){return pk.toString('hex');}); } else { pubKeys = pubKeys.map(function(s){return new Buffer(s,'hex')}); + //console.log('public keys cache HIT'); } return pubKeys; @@ -183,21 +183,12 @@ PublicKeyRing.prototype.getRedeemScript = function (index, isChange) { // TODO this could be cached PublicKeyRing.prototype.getAddress = function (index, isChange) { - this._checkIndexRange(index, isChange); var script = this.getRedeemScript(index,isChange); return Address.fromScript(script, this.network.name); }; -// TODO this could be cached -PublicKeyRing.prototype._addScriptMap = function (map, index, isChange) { - this._checkIndexRange(index, isChange); - var script = this.getRedeemScript(index,isChange); - map[Address.fromScript(script, this.network.name).toString()] = script.getBuffer().toString('hex'); -}; - // TODO this could be cached PublicKeyRing.prototype.getScriptPubKeyHex = function (index, isChange) { - this._checkIndexRange(index, isChange); var addr = this.getAddress(index,isChange); return Script.createP2SH(addr.payload()).getBuffer().toString('hex'); }; @@ -218,21 +209,39 @@ PublicKeyRing.prototype.generateAddress = function(isChange) { }; -PublicKeyRing.prototype.getAddresses = function(onlyMain) { +PublicKeyRing.prototype.getAddresses = function(excludeChange) { + return this.getAddressesInfo(excludeChange).map(function(info) { + return info.address; + }); +}; + +PublicKeyRing.prototype.getAddressesInfo = function(excludeChange) { var ret = []; - - for (var i=0; i