From 443f5aff2ead5454056cea4bfaf4c63e8b02ca08 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 Dec 2014 17:49:33 -0300 Subject: [PATCH 01/10] remove fastclick --- bower.json | 1 - 1 file changed, 1 deletion(-) diff --git a/bower.json b/bower.json index b3065ef29..719abb2ff 100644 --- a/bower.json +++ b/bower.json @@ -24,7 +24,6 @@ "angular-load": "0.2.0", "lodash": "~2.4.1", "angular-gravatar": "*", - "fastclick": "*", "angular-touch": "~1.3.0" }, "resolutions": { From c87f8a19111b60f1096786eeb842d3eed6be0164 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 Dec 2014 17:50:04 -0300 Subject: [PATCH 02/10] wallet sidebar for mobile --- css/src/mobile.css | 45 ++++++--- index.html | 17 ++-- js/controllers/sidebar.js | 2 +- views/homeWallet.html | 10 +- views/includes/sidebar-mobile.html | 145 +++++++-------------------- views/includes/walletbar-mobile.html | 36 +++++++ views/receive.html | 26 ++--- 7 files changed, 129 insertions(+), 152 deletions(-) create mode 100644 views/includes/walletbar-mobile.html diff --git a/css/src/mobile.css b/css/src/mobile.css index c39611451..181094d5b 100644 --- a/css/src/mobile.css +++ b/css/src/mobile.css @@ -25,9 +25,9 @@ .main { height: 92%; - margin-top: 40px; + margin-top: 30px; margin-left: 0; - margin-bottom: -40px; + margin-bottom: -30px; padding: 20px 0 80px 0; } @@ -53,6 +53,17 @@ line-height: 110%; } + header h1 { + color: #fff; + text-align: center; + } + + header h1.left-sidebar { + margin: 5px 10px; + text-align: left; + font-size: 16px; + } + .col3 a { height: 45px; padding: 12px 5px; @@ -63,6 +74,10 @@ left: 0; } + .right-off-canvas-menu { + background-color: #213140 ; + } + .left-off-canvas-menu { background: #E4E8EC; line-height: 24px; @@ -177,11 +192,6 @@ margin-left: 0; font-size: 14px; } - - .top-balance { - width: auto; - padding: 0 5px; - } a.missing-copayers { bottom: -34px; @@ -204,14 +214,7 @@ .footer-setup { margin-bottom: 50px; - } - - .side-nav.wallets { - padding: 0; - height: 100%; - left: 0; - top: 45px; - } + } ul.off-canvas-list li a:hover { background: transparent; @@ -222,6 +225,18 @@ padding: 0.15rem 0.2rem; } + .side-nav.wallets { + z-index: 100; + overflow-y: inherit; + position: inherit; + height: auto; + border-bottom: none; + } + + .photo-container { + margin-right: 5px; + } + } @media (max-width: 640px) { diff --git a/index.html b/index.html index 6e180ceda..5e34a1c52 100644 --- a/index.html +++ b/index.html @@ -60,18 +60,13 @@
-
- - - - - {{$root.wallet.balanceInfo.totalBalance || 0}} {{$root.wallet.settings.unitName}} - +
+
-

- {{$root.wallet.getName()}} +

+ Copay

@@ -80,6 +75,10 @@
+ +
-
-
{{$root.wallet.getName() | limitTo: 1}}
-

{{$root.wallet.getName()}}

+
+
+
{{$root.wallet.getName() | limitTo: 1}}
+

{{$root.wallet.getName()}}

+
-
+
diff --git a/views/includes/sidebar-mobile.html b/views/includes/sidebar-mobile.html index afafd2577..2a65761ea 100644 --- a/views/includes/sidebar-mobile.html +++ b/views/includes/sidebar-mobile.html @@ -1,115 +1,44 @@ -
+
-
-
-
{{$root.wallet.getName() | limitTo: 1}}
-
-
-
-
[ {{$root.wallet.requiredCopayers}} of {{$root.wallet.totalCopayers}} ]
-
-
{{$root.wallet.getName()}}
-
-
-
- Waiting for copayers... -
- -
- {{$root.wallet.balanceInfo.totalBalance || 0}} {{$root.wallet.settings.unitName}} - {{$root.wallet.balanceInfo.totalBalanceAlternative}} {{$root.wallet.balanceInfo.alternativeIsoCode}} - N/A -
-
-
-
- -
- -
- - diff --git a/views/includes/walletbar-mobile.html b/views/includes/walletbar-mobile.html new file mode 100644 index 000000000..3bb309283 --- /dev/null +++ b/views/includes/walletbar-mobile.html @@ -0,0 +1,36 @@ + diff --git a/views/receive.html b/views/receive.html index 02abb6cd3..67a8ee907 100644 --- a/views/receive.html +++ b/views/receive.html @@ -8,23 +8,19 @@
-
-
-

My Bitcoin address:

-
- -
-

{{addr}}

-
-
-
- Generating new address... +
+

My Bitcoin address:

+
+ +
+

{{addr}}

-
-
- Share this with anyone to have them send you payments. To protect your privacy, new addresses are generated automatically once you use them. -
+
+ Generating new address... +
+
+ Share this with anyone to have them send you payments. To protect your privacy, new addresses are generated automatically once you use them.
From ea3b14c48944d422275ddea767794027c85c45eb Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 Dec 2014 17:59:10 -0300 Subject: [PATCH 03/10] Fix filter for lockedBalance --- js/services/balanceService.js | 2 +- views/includes/sidebar.html | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/services/balanceService.js b/js/services/balanceService.js index c2be78dcb..0ea7b295f 100644 --- a/js/services/balanceService.js +++ b/js/services/balanceService.js @@ -24,7 +24,7 @@ angular.module('copayApp.services') r.availableBalanceBTC = (safeBalanceSat / COIN); r.safeUnspentCount = safeUnspentCount; - r.lockedBalance = (balanceSat - safeBalanceSat) * satToUnit; + r.lockedBalance = $filter('noFractionNumber')((balanceSat - safeBalanceSat) * satToUnit); r.lockedBalanceBTC = (balanceSat - safeBalanceSat) / COIN; diff --git a/views/includes/sidebar.html b/views/includes/sidebar.html index ec744603f..3b6951da0 100644 --- a/views/includes/sidebar.html +++ b/views/includes/sidebar.html @@ -39,7 +39,9 @@ {{'Locked'|translate}}   - {{$root.wallet.balanceInfo.lockedBalance || 0}} {{$root.wallet.settings.unitName}} - {{$root.wallet.balanceInfo.lockedBalanceAlternative}} {{$root.wallet.balanceInfo.alternativeIsoCode}} + + {{$root.wallet.balanceInfo.lockedBalance}} {{$root.wallet.settings.unitName}} + - {{$root.wallet.balanceInfo.lockedBalanceAlternative}} {{$root.wallet.balanceInfo.alternativeIsoCode}} Date: Thu, 4 Dec 2014 20:38:21 -0300 Subject: [PATCH 04/10] new icon (clock) for session timeout. Reuse sidebar controller, avoid double call. --- index.html | 65 +++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/index.html b/index.html index 5e34a1c52..953f81515 100644 --- a/index.html +++ b/index.html @@ -38,7 +38,7 @@
- +

Your session is about to expire due to inactivity in {{countdown}} seconds

@@ -56,36 +56,40 @@ - - + - + + +
+
+
+
-
- - +
-
- -
-
-
+
From 2af28f0f1dde8513ecf676296170df48092642e0 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 Dec 2014 20:40:33 -0300 Subject: [PATCH 05/10] remove auto-focus directive. Replaced by show-focus --- js/directives.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/js/directives.js b/js/directives.js index 993357694..ca4f76b2d 100644 --- a/js/directives.js +++ b/js/directives.js @@ -280,16 +280,6 @@ angular.module('copayApp.directives') } } ]) - .directive('autoFocus', function($timeout) { - return { - restrict: 'AC', - link: function(_scope, _element) { - $timeout(function() { - _element[0].focus(); - }); - } - }; - }) .directive('showFocus', function($timeout) { return function(scope, element, attrs) { scope.$watch(attrs.showFocus, From ec99639323010375605e3f1ee8fb3a872159a4f1 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 Dec 2014 20:42:08 -0300 Subject: [PATCH 06/10] fix auto-focus and isMobile variable --- js/controllers/createProfile.js | 5 +++-- js/controllers/home.js | 4 +++- views/create.html | 2 +- views/createProfile.html | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/js/controllers/createProfile.js b/js/controllers/createProfile.js index 3ee1f0a22..92c3569f8 100644 --- a/js/controllers/createProfile.js +++ b/js/controllers/createProfile.js @@ -1,11 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, $timeout, notification, pluginManager, identityService, pinService) { +angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, $timeout, notification, pluginManager, identityService, pinService, isMobile) { var _credentials, _firstpin; $scope.init = function() { identityService.goWalletHome(); + $scope.isMobile = isMobile.any(); pinService.makePinInput($scope, 'newpin', function(newValue) { _firstpin = newValue; @@ -88,7 +89,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun } else { $scope.error = null; // mobile - if (isMobile.any()) { + if ($scope.isMobile) { _credentials = { email: form.email.$modelValue, password: form.password.$modelValue, diff --git a/js/controllers/home.js b/js/controllers/home.js index 8752fc501..1c08e4514 100644 --- a/js/controllers/home.js +++ b/js/controllers/home.js @@ -6,6 +6,8 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc var _credentials, _firstpin; $scope.init = function() { + $scope.isMobile = isMobile.any(); + // This is only for backwards compat, insight api should link to #!/confirmed directly if (getParam('confirmed')) { var hashIndex = window.location.href.indexOf('/?'); @@ -158,7 +160,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc $scope.confirmedEmail = false; // mobile - if (isMobile.any() && !$rootScope.hasPin) { + if ($scope.isMobile && !$rootScope.hasPin) { $scope.done(); _credentials = { email: email, diff --git a/views/create.html b/views/create.html index bed518cc8..011ff3ccd 100644 --- a/views/create.html +++ b/views/create.html @@ -32,7 +32,7 @@
diff --git a/views/createProfile.html b/views/createProfile.html index dd87c2cef..7d04e7bdd 100644 --- a/views/createProfile.html +++ b/views/createProfile.html @@ -46,7 +46,8 @@ !profileForm.email.$pristine">
- +
From e7e376801db537ab8920e7a1dc9982ba3f4e1049 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 Dec 2014 20:42:31 -0300 Subject: [PATCH 07/10] autofocus --- views/home.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/home.html b/views/home.html index 6a9bb97c3..5cd897e3e 100644 --- a/views/home.html +++ b/views/home.html @@ -110,7 +110,7 @@ + placeholder="Pin number" name="pin" required>
@@ -142,7 +142,7 @@

+ name="email" placeholder="Email" required show-focus="!isMobile">
From 5be9fbc47cca2285805adc301df4056a2509fe57 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 Dec 2014 20:42:45 -0300 Subject: [PATCH 08/10] fix locked balance --- js/services/balanceService.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/services/balanceService.js b/js/services/balanceService.js index 0ea7b295f..31c91ef26 100644 --- a/js/services/balanceService.js +++ b/js/services/balanceService.js @@ -24,7 +24,8 @@ angular.module('copayApp.services') r.availableBalanceBTC = (safeBalanceSat / COIN); r.safeUnspentCount = safeUnspentCount; - r.lockedBalance = $filter('noFractionNumber')((balanceSat - safeBalanceSat) * satToUnit); + var lockedBalance = (balanceSat - safeBalanceSat) * satToUnit; + r.lockedBalance = lockedBalance ? $filter('noFractionNumber')(lockedBalance) : null; r.lockedBalanceBTC = (balanceSat - safeBalanceSat) / COIN; From 244ea456c6ed8a38c92294c6ca2271d52a203173 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 Dec 2014 20:43:27 -0300 Subject: [PATCH 09/10] wallet-bar for small devices --- css/src/mobile.css | 10 ++-------- js/controllers/homeWallet.js | 11 ++++++++--- js/controllers/sidebar.js | 9 +++++---- views/includes/bottombar-mobile.html | 2 +- views/includes/sidebar-mobile.html | 22 ++++++++++------------ views/includes/sidebar.html | 8 ++++++-- views/includes/walletbar-mobile.html | 13 +++++++------ 7 files changed, 39 insertions(+), 36 deletions(-) diff --git a/css/src/mobile.css b/css/src/mobile.css index 181094d5b..d63300341 100644 --- a/css/src/mobile.css +++ b/css/src/mobile.css @@ -58,12 +58,6 @@ text-align: center; } - header h1.left-sidebar { - margin: 5px 10px; - text-align: left; - font-size: 16px; - } - .col3 a { height: 45px; padding: 12px 5px; @@ -233,8 +227,8 @@ border-bottom: none; } - .photo-container { - margin-right: 5px; + .side-nav li.nav-item.selected { + background-color: #3C4E60; } } diff --git a/js/controllers/homeWallet.js b/js/controllers/homeWallet.js index 8d3ec05a1..400cc5329 100644 --- a/js/controllers/homeWallet.js +++ b/js/controllers/homeWallet.js @@ -1,9 +1,16 @@ 'use strict'; -angular.module('copayApp.controllers').controller('HomeWalletController', function($scope, $rootScope, $timeout, $filter, rateService, notification) { +angular.module('copayApp.controllers').controller('HomeWalletController', function($scope, $rootScope, $timeout, $filter, $location, rateService, notification, identityService) { $scope.init = function() { $rootScope.title = 'Home'; + // fix for Safari and mobile devices + var walletId = $location.hash(); + if (walletId) { + $location.hash(''); + identityService.setFocusedWallet(walletId); + } + $scope.rateService = rateService; $scope.isRateAvailable = false; @@ -100,8 +107,6 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi },1) }, 100); - - $scope.sign = function(ntxid) { var w = $rootScope.wallet; $scope.loading = true; diff --git a/js/controllers/sidebar.js b/js/controllers/sidebar.js index 721c1bc4d..e5319c54e 100644 --- a/js/controllers/sidebar.js +++ b/js/controllers/sidebar.js @@ -1,6 +1,8 @@ 'use strict'; -angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $location, $timeout, identityService) { +angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $location, $timeout, identityService, isMobile) { + + $scope.isMobile = isMobile.any() $scope.menu = [{ 'title': 'Home', @@ -49,7 +51,6 @@ angular.module('copayApp.controllers').controller('SidebarController', function( $scope.setWallets(); }; - $scope.init = function() { // This should be called only once. @@ -90,8 +91,8 @@ angular.module('copayApp.controllers').controller('SidebarController', function( $scope.setWallets = function() { if (!$rootScope.iden) return; var ret = _.filter($rootScope.iden.listWallets(), function(w) { - return !identityService.isFocused(w.getId()); + return w; }); - $scope.wallets = ret; + $scope.wallets = _.sortBy(ret, 'name'); }; }); diff --git a/views/includes/bottombar-mobile.html b/views/includes/bottombar-mobile.html index 70ea38c4a..5f7f5d2d7 100644 --- a/views/includes/bottombar-mobile.html +++ b/views/includes/bottombar-mobile.html @@ -1,4 +1,4 @@ -
+
diff --git a/views/includes/sidebar-mobile.html b/views/includes/sidebar-mobile.html index 2a65761ea..f5b59a4f6 100644 --- a/views/includes/sidebar-mobile.html +++ b/views/includes/sidebar-mobile.html @@ -1,18 +1,16 @@ -