From 0ecb43200626e87babc0a1e2fb5027ce690b12a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 5 Feb 2016 13:00:40 -0300 Subject: [PATCH 01/29] search box --- public/views/walletHome.html | 4 ++-- src/js/controllers/index.js | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index d62f1c9df..1f2c3f697 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -195,9 +195,9 @@ -
+ class="row collapse last-transactions-content">
sync diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 3d301b4b5..05e7b4980 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -916,6 +916,17 @@ angular.module('copayApp.controllers').controller('indexController', function($r }, 100); }; + self.filter = function(search) { + if (lodash.isEmpty(search)) return self.txHistory; + var result = lodash.filter(self.txHistory, function(tx) { + return lodash.includes(tx.amountStr, search) || + lodash.includes(tx.message, search) || + lodash.includes(self.addressbook[tx.addressTo], search) || + lodash.includes(tx.addressTo, search); + }); + return result; + } + self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) { var res = []; From 276c3fa9ab4504cde47eb882bd2a129765a0a65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 5 Feb 2016 15:25:49 -0300 Subject: [PATCH 02/29] searching from date --- src/js/controllers/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 05e7b4980..db329f552 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -922,11 +922,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r return lodash.includes(tx.amountStr, search) || lodash.includes(tx.message, search) || lodash.includes(self.addressbook[tx.addressTo], search) || - lodash.includes(tx.addressTo, search); + lodash.includes(tx.addressTo, search) || + lodash.isEqual(formatDate(new Date(tx.time * 1000)), search); }); return result; } + function formatDate(date) { + var day = ('0' + date.getDate()).slice(-2).toString(); + var month = ('0' + (date.getMonth() + 1)).slice(-2).toString(); + var year = date.getFullYear(); + return [month, day, year].join('/'); + }; + self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) { var res = []; From c66a389994afe5419c3faedbd71ddff602697086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 5 Feb 2016 16:55:09 -0300 Subject: [PATCH 03/29] style to search input --- public/views/walletHome.html | 7 +++++++ src/css/main.css | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 1f2c3f697..a1029895f 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -195,6 +195,13 @@
+
+ + +
diff --git a/src/css/main.css b/src/css/main.css index df67974ac..2f50ce6de 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -613,6 +613,18 @@ ul.manage li { visibility: hidden; } +.left-inner-addon { + position: relative; +} +.left-inner-addon input { + padding-left: 30px !important; + margin-bottom: 0rem !important; +} +.left-inner-addon i { + position: absolute; + padding: 5px; + padding-left: 2%; +} /* Turn Off Number Input Spinners */ input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { From fe775c442e79faf888f549ebd6302ae3377859e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 5 Feb 2016 17:19:11 -0300 Subject: [PATCH 04/29] hide menu bar when search input is focus --- public/views/walletHome.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index a1029895f..00852c09d 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -197,10 +197,12 @@
- + placeholder="Amount, address, mm/dd/yyyy" + ng-model="search">
Date: Fri, 5 Feb 2016 17:56:50 -0300 Subject: [PATCH 05/29] scroll up when input is focused --- public/views/walletHome.html | 5 +++-- src/js/controllers/walletHome.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 00852c09d..cf7f1d216 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -195,9 +195,10 @@
-
+
- Date: Tue, 9 Feb 2016 09:49:32 -0300 Subject: [PATCH 06/29] remove console log --- src/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/main.css b/src/css/main.css index 2f50ce6de..ca20b21f0 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -623,7 +623,7 @@ ul.manage li { .left-inner-addon i { position: absolute; padding: 5px; - padding-left: 2%; + padding-left: 20px; } /* Turn Off Number Input Spinners */ input[type=number]::-webkit-inner-spin-button, From c74e547ad26b736e97eaefd965927ef47756a6d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 10 Feb 2016 15:25:31 -0300 Subject: [PATCH 07/29] remove important and add translate to placeholder --- public/views/walletHome.html | 3 +-- src/css/main.css | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index cf7f1d216..b45ac6ce2 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -201,8 +201,7 @@ ng-focus="home.formFocus(true)" ng-blur="home.formFocus(false)" type="text" - class="form-control" - placeholder="Amount, address, mm/dd/yyyy" + placeholder="{{'Amount, address, mm/dd/yyyy' | translate}}" ng-model="search">
Date: Wed, 10 Feb 2016 16:53:34 -0300 Subject: [PATCH 08/29] refactor --- public/views/walletHome.html | 5 +++-- src/js/controllers/index.js | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index b45ac6ce2..0da0c906b 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -197,8 +197,9 @@
- Date: Mon, 15 Feb 2016 11:49:08 -0300 Subject: [PATCH 09/29] refactor --- public/views/walletHome.html | 13 +++++-------- src/css/main.css | 5 +++++ src/js/controllers/index.js | 12 ++++++++++++ src/js/controllers/walletHome.js | 1 + 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 0da0c906b..a1029895f 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -195,15 +195,12 @@
-
+
- +
Date: Mon, 15 Feb 2016 12:50:21 -0300 Subject: [PATCH 10/29] refactor --- public/views/walletHome.html | 44 ++++++++++++++++++++++---------- src/css/main.css | 4 ++- src/js/controllers/index.js | 44 +++++++++++++++++++++++++++++--- src/js/controllers/walletHome.js | 1 - 4 files changed, 73 insertions(+), 20 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index a1029895f..59de85ad7 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -134,7 +134,7 @@
-
+

Payment Proposals

Unsent transactions

@@ -159,9 +159,13 @@
-

- Activity -

+
    +
  • +

    Activity + +

    +
  • +
@@ -195,16 +199,28 @@
-
- - +
+
    +
  • + Cancel + +
    + +
    +
  • +
  • +

    + {{index.result.length}} matches +

    +
  • +
-
+
sync @@ -251,7 +267,7 @@
-
+
diff --git a/src/css/main.css b/src/css/main.css index 9a61a84c2..6daa324e7 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -790,6 +790,8 @@ table tbody tr:last-child td { .left-inner-addon input { padding-left: 40px; margin-bottom: auto; + max-width: 85%; + border: 0px solid; } .left-inner-addon i { position: absolute; @@ -799,7 +801,7 @@ table tbody tr:last-child td { .left-inner-addon a { position: absolute; padding: 5px; - right: 0px; + right: 0.5px; } /*//////////////////////////// BUTTON OUTLINE ////////////////////////////*/ diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 129722e60..57ca08d35 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r var self = this; var SOFT_CONFIRMATION_LIMIT = 12; var errors = bwcService.getErrors(); +<<<<<<< 0b48a2e2f3178bc3dd4062c7c17fe59e89554285 var historyUpdateInProgress = {}; var ret = {}; @@ -18,6 +19,28 @@ angular.module('copayApp.controllers').controller('indexController', function($r ret.prevState = 'walletHome'; ret.menu = [{ +======= + self.isCordova = isCordova; + self.isChromeApp = isChromeApp; + self.isSafari = isMobile.Safari(); + self.isWindowsPhoneApp = isMobile.Windows() && isCordova; + self.usePushNotifications = self.isCordova && !isMobile.Windows(); + self.onGoingProcess = {}; + self.historyShowLimit = 10; + self.updatingTxHistory = {}; + self.prevState = 'walletHome'; + self.isSearching = false; + + function strip(number) { + return (parseFloat(number.toPrecision(12))); + }; + + self.goHome = function() { + go.walletHome(); + }; + + self.menu = [{ +>>>>>>> refactor 'title': gettext('Receive'), 'icon': { false: 'icon-receive', @@ -923,7 +946,15 @@ angular.module('copayApp.controllers').controller('indexController', function($r } }; + self.txHistoryToShow = function() { + if (!self.isSearching) { + self.result = []; + return self.txHistory; + } else return self.result; + } + self.filter = function(search) { + self.matches = false; function formatDate(date) { var day = ('0' + date.getDate()).slice(-2).toString(); @@ -932,16 +963,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r return [month, day, year].join('/'); }; - if (lodash.isEmpty(search)) return self.txHistory; - var result = lodash.filter(self.txHistory, function(tx) { + if (lodash.isEmpty(search)) return; + self.result = lodash.filter(self.txHistory, function(tx) { return lodash.includes(tx.amountStr, search) || lodash.includes(tx.message, search) || lodash.includes(self.addressbook[tx.addressTo], search) || lodash.includes(tx.addressTo, search) || lodash.isEqual(formatDate(new Date(tx.time * 1000)), search); }); - return result; - } + if (isCordova) + window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.result.length)); + else + self.matches = true; + }; self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) { var res = []; @@ -1202,6 +1236,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r $rootScope.$on('Local/Searching', function(event, val) { if (val) self.showAllHistory(); else self.hideHistory(); + self.isSearching = val; + self.matches = false; }); // UX event handlers diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index bf54bc800..90ee94fc1 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -55,7 +55,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi self.setAddress(); self.setSendFormInputs(); } - $log.debug('Cleaning WalletHome Instance'); lodash.each(self, function(v, k) { if (lodash.isFunction(v)) return; From 284c47bf4984a760d2d61b58d1387c0498a47e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 15 Feb 2016 12:50:21 -0300 Subject: [PATCH 11/29] changes in ui and ux --- public/views/walletHome.html | 35 ++++++++++++++++++++++++----------- src/css/main.css | 18 +++++++++--------- src/js/controllers/index.js | 20 +++++++++++--------- 3 files changed, 44 insertions(+), 29 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 59de85ad7..d9ac01328 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -160,9 +160,11 @@
    -
  • +
  • Activity - + + +

@@ -201,22 +203,33 @@
    -
  • - Cancel - +
  • + +
  • +
  • +
  • -
  • -

    - {{index.result.length}} matches -

    -
+
+
+

Indexes you can use to search transactions:

+
+
+

Transaction amount

+
+
+

Wallet address or address book alias

+
+
+

Date in format mm/dd/yyyy

+
+
Date: Thu, 18 Feb 2016 16:26:02 -0300 Subject: [PATCH 12/29] ux and ui modifications --- public/views/walletHome.html | 47 +++++++++---------------- src/css/main.css | 60 ++++++++++++++++++++++---------- src/js/controllers/index.js | 17 ++------- src/js/controllers/walletHome.js | 3 ++ 4 files changed, 62 insertions(+), 65 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index d9ac01328..ffaca7930 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -72,7 +72,7 @@ -->
-
+
@@ -134,7 +134,7 @@
-
+

Payment Proposals

Unsent transactions

@@ -160,11 +160,9 @@
    -
  • +
  • Activity - - - +

@@ -201,35 +199,22 @@
-
-
    -
  • - -
  • -
  • +
  • -
-
-
-

Indexes you can use to search transactions:

-
-
-

Transaction amount

-
-
-

Wallet address or address book alias

-
-
-

Date in format mm/dd/yyyy

+
+ Cancel +
-
+
diff --git a/src/css/main.css b/src/css/main.css index a87283a7c..8439348e5 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -784,26 +784,48 @@ table tbody tr:last-child td { /*//////////////////////////// SEARCH INPUT ////////////////////////////*/ -.left-inner-addon1 { - position: relative; +.searchBar { + display: table; } -.left-inner-addon1 input{ - padding-left: 40px; - margin-bottom: auto; - border: 0px solid; -} -.left-inner-addon1 i{ - padding: 6px; - padding-left: 20px; -} -.left-inner-addon2 i{ - padding: 2px; - padding-left: 5px; -} -.fi-magnifying-glass { - position: absolute; +.searchBar .columns { + display: table-cell; + vertical-align: middle; } +.searchBar .columns, +.searchBar [class*="column"] + [class*="column"]:last-child { + float: none; +} + +.searchBar form{ + margin-left: 20px; +} + +.searchBar input{ + margin-bottom: auto; + border-bottom: 0px solid #E9EDF0; +} +.searchBar i{ + position: absolute; + padding: 8px; +} + +.searchBar .small-11{ + padding-right: 5px; + padding-left: 5px; +} + +.searchBar .small-1{ + padding-left: 2px; + padding-right: 8px; +} + +.searchLabel { + margin-top: 10px; + margin-bottom: 10px; + background-color: rgba(0, 0, 0, 0.02); + border-radius: 10px; +} /*//////////////////////////// BUTTON OUTLINE ////////////////////////////*/ .button.outline, @@ -1498,8 +1520,8 @@ input.ng-invalid-match, input.ng-invalid-match:focus { #history .spinner > div, #receive .spinner > div, -.copayers .spinner > div, -.preferences-fee .spinner > div +.copayers .spinner > div, +.preferences-fee .spinner > div { background-color: #7A8C9E; } diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 02b8250ae..1358221b0 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -30,7 +30,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.updatingTxHistory = {}; self.prevState = 'walletHome'; self.isSearching = false; - self.showOptions = true; function strip(number) { return (parseFloat(number.toPrecision(12))); @@ -940,24 +939,16 @@ angular.module('copayApp.controllers').controller('indexController', function($r }, 100); }; - self.hideHistory = function() { - if (!self.historyShowShowAll) { - self.txHistory = self.txHistory.slice(0, 10); - self.historyShowShowAll = true; - } - }; - self.txHistoryToShow = function() { if (!self.isSearching) { self.result = []; return self.txHistory; - } else return self.result; + } else return self.result; } self.filter = function(search) { - self.showOptions = true; self.result = []; - + function formatDate(date) { var day = ('0' + date.getDate()).slice(-2).toString(); var month = ('0' + (date.getMonth() + 1)).slice(-2).toString(); @@ -976,7 +967,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); if (isCordova) window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.result.length)); - self.showOptions = (self.result.length == 0) ? true : false; }; self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) { @@ -1236,10 +1226,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); $rootScope.$on('Local/Searching', function(event, val) { - if (val) self.showAllHistory(); - else self.hideHistory(); self.isSearching = val; - self.showOptions = true; }); // UX event handlers diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index 90ee94fc1..ea598e5ff 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -51,10 +51,13 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi var disableFocusListener = $rootScope.$on('Local/NewFocusedWallet', function() { self.addr = null; self.resetForm(); + $rootScope.$emit('Local/Searching', false); + if (profileService.focusedClient) { self.setAddress(); self.setSendFormInputs(); } + $log.debug('Cleaning WalletHome Instance'); lodash.each(self, function(v, k) { if (lodash.isFunction(v)) return; From 5ca10f777dbc50358df98712f7c9fc629aa00d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Thu, 18 Feb 2016 17:55:57 -0300 Subject: [PATCH 13/29] instantly search --- public/views/walletHome.html | 6 ++-- src/js/controllers/index.js | 53 +++++++++++++++++--------------- src/js/controllers/walletHome.js | 1 + 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index ffaca7930..660348178 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -203,7 +203,7 @@
-
+
-
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 1358221b0..57bdbf1aa 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -939,35 +939,38 @@ angular.module('copayApp.controllers').controller('indexController', function($r }, 100); }; - self.txHistoryToShow = function() { - if (!self.isSearching) { - self.result = []; - return self.txHistory; - } else return self.result; - } + self.txHistoryToShow = function(search) { - self.filter = function(search) { - self.result = []; + function filter(search) { + var result = []; - function formatDate(date) { - var day = ('0' + date.getDate()).slice(-2).toString(); - var month = ('0' + (date.getMonth() + 1)).slice(-2).toString(); - var year = date.getFullYear(); - return [month, day, year].join('/'); + function formatDate(date) { + var day = ('0' + date.getDate()).slice(-2).toString(); + var month = ('0' + (date.getMonth() + 1)).slice(-2).toString(); + var year = date.getFullYear(); + return [month, day, year].join('/'); + }; + + if (lodash.isEmpty(search)) return; + + result = lodash.filter(self.txHistory, function(tx) { + return lodash.includes(tx.amountStr, search) || + lodash.includes(tx.message, search) || + lodash.includes(self.addressbook ? self.addressbook[tx.addressTo] : null, search) || + lodash.includes(tx.addressTo, search) || + lodash.isEqual(formatDate(new Date(tx.time * 1000)), search); + }); + if (isCordova) + window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + result.length)); + return result; }; - if (lodash.isEmpty(search)) return; - - self.result = lodash.filter(self.txHistory, function(tx) { - return lodash.includes(tx.amountStr, search) || - lodash.includes(tx.message, search) || - lodash.includes(self.addressbook[tx.addressTo], search) || - lodash.includes(tx.addressTo, search) || - lodash.isEqual(formatDate(new Date(tx.time * 1000)), search); - }); - if (isCordova) - window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.result.length)); - }; + if (!self.isSearching) { + return self.txHistory; + } else { + return filter(search);; + } + } self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) { var res = []; diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index ea598e5ff..c7e0b9ba2 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -51,6 +51,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi var disableFocusListener = $rootScope.$on('Local/NewFocusedWallet', function() { self.addr = null; self.resetForm(); + $scope.search = ''; $rootScope.$emit('Local/Searching', false); if (profileService.focusedClient) { From 71fd35f7c17941192d7902172765a01e4d4a695e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 19 Feb 2016 12:26:12 -0300 Subject: [PATCH 14/29] throttle search function --- public/views/walletHome.html | 7 +++-- src/js/controllers/index.js | 59 +++++++++++++++++------------------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 660348178..497c10f45 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -160,7 +160,7 @@
    -
  • +
  • Activity

    @@ -206,6 +206,7 @@ @@ -213,10 +214,10 @@
-
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 57bdbf1aa..cc937fbe2 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -4,7 +4,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r var self = this; var SOFT_CONFIRMATION_LIMIT = 12; var errors = bwcService.getErrors(); -<<<<<<< 0b48a2e2f3178bc3dd4062c7c17fe59e89554285 var historyUpdateInProgress = {}; var ret = {}; @@ -19,28 +18,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r ret.prevState = 'walletHome'; ret.menu = [{ -======= - self.isCordova = isCordova; - self.isChromeApp = isChromeApp; - self.isSafari = isMobile.Safari(); - self.isWindowsPhoneApp = isMobile.Windows() && isCordova; - self.usePushNotifications = self.isCordova && !isMobile.Windows(); - self.onGoingProcess = {}; - self.historyShowLimit = 10; - self.updatingTxHistory = {}; - self.prevState = 'walletHome'; - self.isSearching = false; - - function strip(number) { - return (parseFloat(number.toPrecision(12))); - }; - - self.goHome = function() { - go.walletHome(); - }; - - self.menu = [{ ->>>>>>> refactor 'title': gettext('Receive'), 'icon': { false: 'icon-receive', @@ -396,7 +373,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.setSpendUnconfirmed = function(spendUnconfirmed) { self.spendUnconfirmed = spendUnconfirmed || configService.getSync().wallet.spendUnconfirmed; - }; + }; self.updateBalance = function() { var fc = profileService.focusedClient; @@ -918,6 +895,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r if (walletId == profileService.focusedClient.credentials.walletId) { self.completeHistory = newHistory; self.setCompactTxHistory(); + self.txHistory = newHistory.slice(0, self.historyShowLimit); + self.historyShowMore = newHistory.length > self.historyShowLimit; + self.txHistoryToList = self.txHistory; } return storageService.setTxHistory(JSON.stringify(newHistory), walletId, function() { @@ -932,6 +912,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.showMore = function() { $timeout(function() { self.txHistory = self.completeHistory.slice(0, self.nextTxHistory); + self.txHistoryToList = self.txHistory; $log.debug('Total txs: ', self.txHistory.length + '/' + self.completeHistory.length); self.nextTxHistory += self.historyShowMoreLimit; if (self.txHistory.length >= self.completeHistory.length) @@ -939,11 +920,25 @@ angular.module('copayApp.controllers').controller('indexController', function($r }, 100); }; - self.txHistoryToShow = function(search) { + self.startSearch = function(){ + self.isSearching = true; + self.txHistoryToList = []; + } + + self.cancelSearch = function(){ + self.isSearching = false + self.txHistoryToList = self.txHistory; + } + + self.updateSearchInput = function(search){ + self.search = search; + self.throttleSearch(); + } + + self.throttleSearch = lodash.throttle(function() { function filter(search) { var result = []; - function formatDate(date) { var day = ('0' + date.getDate()).slice(-2).toString(); var month = ('0' + (date.getMonth() + 1)).slice(-2).toString(); @@ -965,12 +960,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r return result; }; - if (!self.isSearching) { - return self.txHistory; - } else { - return filter(search);; - } - } + self.txHistoryToList = filter(self.search); + $timeout(function() { + $rootScope.$apply(); + }); + + },1000); self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) { var res = []; From 9e439e85438f9725c4c77e87a129eeb2797dd634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 19 Feb 2016 13:19:19 -0300 Subject: [PATCH 15/29] show complete history and optimize toast message --- src/js/controllers/index.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index cc937fbe2..146027147 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -923,15 +923,20 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.startSearch = function(){ self.isSearching = true; self.txHistoryToList = []; + if(self.historyShowShowAll) self.txHistory = self.completeHistory; } self.cancelSearch = function(){ - self.isSearching = false - self.txHistoryToList = self.txHistory; + self.isSearching = false; + if(self.txHistory.length > self.historyShowLimit) + self.txHistoryToList = self.txHistory.slice(0, self.historyShowLimit); + else self.txHistoryToList = self.txHistory; } self.updateSearchInput = function(search){ self.search = search; + if (isCordova) + window.plugins.toast.hide(); self.throttleSearch(); } @@ -955,15 +960,17 @@ angular.module('copayApp.controllers').controller('indexController', function($r lodash.includes(tx.addressTo, search) || lodash.isEqual(formatDate(new Date(tx.time * 1000)), search); }); - if (isCordova) - window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + result.length)); + return result; }; - self.txHistoryToList = filter(self.search); - $timeout(function() { - $rootScope.$apply(); - }); + self.txHistoryToList = filter(self.search); + if (isCordova) + window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.txHistoryToList.length)); + + $timeout(function() { + $rootScope.$apply(); + }); },1000); From aa71a34decda700398656c2b1b58bf2d122a0d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 22 Feb 2016 11:29:27 -0300 Subject: [PATCH 16/29] show more in search box --- public/views/walletHome.html | 16 +++++++++---- src/js/controllers/index.js | 46 +++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 497c10f45..64f8f257d 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -280,11 +280,17 @@
- Show more ({{index.completeHistory.length - index.txHistory.length}}) - - + ng-show="index.historyShowMore && !index.isSearching" + ng-click="index.showMore()" > + {{index.completeHistory.length - index.txHistory.length}}more + + + + {{index.result.length - index.txHistoryToList.length}} more + +
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 146027147..3f1a19420 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -896,8 +896,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.completeHistory = newHistory; self.setCompactTxHistory(); self.txHistory = newHistory.slice(0, self.historyShowLimit); - self.historyShowMore = newHistory.length > self.historyShowLimit; self.txHistoryToList = self.txHistory; + self.historyShowMore = newHistory.length > self.historyShowLimit; } return storageService.setTxHistory(JSON.stringify(newHistory), walletId, function() { @@ -910,27 +910,36 @@ angular.module('copayApp.controllers').controller('indexController', function($r } self.showMore = function() { - $timeout(function() { - self.txHistory = self.completeHistory.slice(0, self.nextTxHistory); - self.txHistoryToList = self.txHistory; - $log.debug('Total txs: ', self.txHistory.length + '/' + self.completeHistory.length); - self.nextTxHistory += self.historyShowMoreLimit; - if (self.txHistory.length >= self.completeHistory.length) - self.historyShowMore = false; - }, 100); + if (self.isSearching) { + $timeout(function() { + self.txHistoryToList = self.result.slice(0, self.nextTxHistory); + $log.debug('Total txs: ', self.txHistoryToList.length + '/' + self.result.length); + self.nextTxHistory += self.historyShowMoreLimit; + if (self.txHistoryToList.length >= self.result.length) + self.historyShowMore = false; + }, 100); + } else { + $timeout(function() { + self.txHistory = self.completeHistory.slice(0, self.nextTxHistory); + self.txHistoryToList = self.txHistory; + $log.debug('Total txs: ', self.txHistory.length + '/' + self.completeHistory.length); + self.nextTxHistory += self.historyShowMoreLimit; + if (self.txHistory.length >= self.completeHistory.length) + self.historyShowMore = false; + }, 100); + } }; self.startSearch = function(){ self.isSearching = true; self.txHistoryToList = []; - if(self.historyShowShowAll) self.txHistory = self.completeHistory; + self.historyShowMore = false; } self.cancelSearch = function(){ self.isSearching = false; - if(self.txHistory.length > self.historyShowLimit) - self.txHistoryToList = self.txHistory.slice(0, self.historyShowLimit); - else self.txHistoryToList = self.txHistory; + self.txHistoryToList = self.completeHistory.slice(0, self.historyShowLimit); + self.historyShowMore = self.completeHistory.length > self.historyShowLimit; } self.updateSearchInput = function(search){ @@ -943,7 +952,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.throttleSearch = lodash.throttle(function() { function filter(search) { - var result = []; + self.result = []; function formatDate(date) { var day = ('0' + date.getDate()).slice(-2).toString(); var month = ('0' + (date.getMonth() + 1)).slice(-2).toString(); @@ -953,7 +962,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r if (lodash.isEmpty(search)) return; - result = lodash.filter(self.txHistory, function(tx) { + self.result = lodash.filter(self.completeHistory, function(tx) { return lodash.includes(tx.amountStr, search) || lodash.includes(tx.message, search) || lodash.includes(self.addressbook ? self.addressbook[tx.addressTo] : null, search) || @@ -961,10 +970,13 @@ angular.module('copayApp.controllers').controller('indexController', function($r lodash.isEqual(formatDate(new Date(tx.time * 1000)), search); }); - return result; + if (self.result.length > self.historyShowLimit) self.historyShowMore = true; + else self.historyShowMore = false; + + return self.result; }; - self.txHistoryToList = filter(self.search); + self.txHistoryToList = filter(self.search).slice(0, self.historyShowLimit); if (isCordova) window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.txHistoryToList.length)); From a69f5ca34d79ae00c33cbbd8dd710d2c5ea961f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 22 Feb 2016 11:37:31 -0300 Subject: [PATCH 17/29] refactor --- src/js/controllers/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 3f1a19420..9c473edc7 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -1039,6 +1039,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.setCompactTxHistory = function() { self.nextTxHistory = self.historyShowMoreLimit; self.txHistory = self.completeHistory.slice(0, self.historyShowLimit); + self.txHistoryToList = self.txHistory; self.historyShowMore = self.completeHistory.length > self.historyShowLimit; }; From 062c0ba9946bd42c2909a68ffe3f9023bf0bdc20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 10:52:20 -0300 Subject: [PATCH 18/29] conflicts solved --- src/js/controllers/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 9c473edc7..4fe06a985 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -15,6 +15,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r ret.onGoingProcess = {}; ret.historyShowLimit = 10; ret.historyShowMoreLimit = 100; + ret.isSearching = false; ret.prevState = 'walletHome'; ret.menu = [{ @@ -895,9 +896,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r if (walletId == profileService.focusedClient.credentials.walletId) { self.completeHistory = newHistory; self.setCompactTxHistory(); - self.txHistory = newHistory.slice(0, self.historyShowLimit); - self.txHistoryToList = self.txHistory; - self.historyShowMore = newHistory.length > self.historyShowLimit; } return storageService.setTxHistory(JSON.stringify(newHistory), walletId, function() { From aed24f97b9fdb11d470973577a45ecec15de5f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 11:29:11 -0300 Subject: [PATCH 19/29] more conflicts solved --- src/js/controllers/index.js | 40 +++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 4fe06a985..0be944473 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -908,36 +908,32 @@ angular.module('copayApp.controllers').controller('indexController', function($r } self.showMore = function() { - if (self.isSearching) { - $timeout(function() { - self.txHistoryToList = self.result.slice(0, self.nextTxHistory); - $log.debug('Total txs: ', self.txHistoryToList.length + '/' + self.result.length); - self.nextTxHistory += self.historyShowMoreLimit; - if (self.txHistoryToList.length >= self.result.length) - self.historyShowMore = false; - }, 100); - } else { - $timeout(function() { - self.txHistory = self.completeHistory.slice(0, self.nextTxHistory); - self.txHistoryToList = self.txHistory; - $log.debug('Total txs: ', self.txHistory.length + '/' + self.completeHistory.length); - self.nextTxHistory += self.historyShowMoreLimit; - if (self.txHistory.length >= self.completeHistory.length) - self.historyShowMore = false; - }, 100); - } + $timeout(function() { + if (self.isSearching) { + self.txHistoryToList = self.result.slice(0, self.nextTxHistory); + } else { + self.txHistory = self.completeHistory.slice(0, self.nextTxHistory); + self.txHistoryToList = self.txHistory; + } + $log.debug('Total txs: ', self.txHistoryToList.length + '/' + self.result.length); + self.nextTxHistory += self.historyShowMoreLimit; + if (self.txHistoryToList.length >= self.result.length) + self.historyShowMore = false; + }, 100); }; self.startSearch = function(){ self.isSearching = true; self.txHistoryToList = []; + self.result = []; self.historyShowMore = false; + self.nextTxHistory = self.historyShowMoreLimit; } self.cancelSearch = function(){ self.isSearching = false; - self.txHistoryToList = self.completeHistory.slice(0, self.historyShowLimit); - self.historyShowMore = self.completeHistory.length > self.historyShowLimit; + self.result = []; + self.setCompactTxHistory(); } self.updateSearchInput = function(search){ @@ -1233,7 +1229,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r $rootScope.$on('Local/ClearHistory', function(event) { $log.debug('The wallet transaction history has been deleted'); - self.txHistory = self.completeHistory = []; + self.txHistory = self.completeHistory = self.txHistoryToList = []; self.debounceUpdateHistory(); }); @@ -1378,7 +1374,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r $log.debug('Backup done stored'); addressService.expireAddress(walletId, function(err) { $timeout(function() { - self.txHistory = self.completeHistory = []; + self.txHistory = self.completeHistory = self.txHistoryToList = []; storageService.removeTxHistory(walletId, function() { self.startScan(walletId); }); From f0e08e94c68560c5c037dffbbbe451fb529ee01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 12:00:46 -0300 Subject: [PATCH 20/29] close search view when going to preferences --- src/js/controllers/index.js | 8 ++------ src/js/controllers/walletHome.js | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 0be944473..496a88e4d 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -846,9 +846,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.setCompactTxHistory(); } - if (historyUpdateInProgress[walletId]) + if (historyUpdateInProgress[walletId]) return; - + historyUpdateInProgress[walletId] = true; function getNewTxs(newTxs, skip, i_cb) { @@ -1237,10 +1237,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.setAddressbook(ab); }); - $rootScope.$on('Local/Searching', function(event, val) { - self.isSearching = val; - }); - // UX event handlers $rootScope.$on('Local/ColorUpdated', function(event) { self.updateColor(); diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index c7e0b9ba2..be8dcab34 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -24,7 +24,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi ret.isMobile = isMobile.any(); ret.isWindowsPhoneApp = isMobile.Windows() && isCordova; var vanillaScope = ret; - this.isSearching = false; + + $rootScope.$emit('Local/Searching', false); var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) { self.setForm(data); @@ -52,7 +53,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi self.addr = null; self.resetForm(); $scope.search = ''; - $rootScope.$emit('Local/Searching', false); if (profileService.focusedClient) { self.setAddress(); From 34d35929f4b4f4395151fe3c65047c4794f2fafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 12:12:36 -0300 Subject: [PATCH 21/29] return empty array when search is empty --- src/js/controllers/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 496a88e4d..2a25d126e 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -954,7 +954,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r return [month, day, year].join('/'); }; - if (lodash.isEmpty(search)) return; + if (lodash.isEmpty(search)) { + self.historyShowMore = false; + return []; + } self.result = lodash.filter(self.completeHistory, function(tx) { return lodash.includes(tx.amountStr, search) || From 5809de20c9faf171c3213e3440d863a46e46855e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 12:20:21 -0300 Subject: [PATCH 22/29] clean search variable when starting search --- public/views/walletHome.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 64f8f257d..dbc10fc16 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -160,7 +160,7 @@
    -
  • +
  • Activity

    From 6f1987f5df8a322437aab8f37ffcbd1a70a6be20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 12:23:58 -0300 Subject: [PATCH 23/29] fix toast message --- src/js/controllers/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 2a25d126e..07611f666 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -975,7 +975,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.txHistoryToList = filter(self.search).slice(0, self.historyShowLimit); if (isCordova) - window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.txHistoryToList.length)); + window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.result.length)); $timeout(function() { $rootScope.$apply(); From 39b40125319aa60ddeeeb689bf8fb81bb6025b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 12:34:16 -0300 Subject: [PATCH 24/29] refactor --- src/js/controllers/index.js | 1 + src/js/controllers/walletHome.js | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 07611f666..d75096611 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -1034,6 +1034,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r }; self.setCompactTxHistory = function() { + self.isSearching = false; self.nextTxHistory = self.historyShowMoreLimit; self.txHistory = self.completeHistory.slice(0, self.historyShowLimit); self.txHistoryToList = self.txHistory; diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index be8dcab34..a9fca34ff 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -25,8 +25,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi ret.isWindowsPhoneApp = isMobile.Windows() && isCordova; var vanillaScope = ret; - $rootScope.$emit('Local/Searching', false); - var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) { self.setForm(data); $rootScope.$emit('Local/SetTab', 'send'); From 1d097de0f4623f4f7c3be06e9932d6649bfa5b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 15:50:46 -0300 Subject: [PATCH 25/29] change variable name and fix more error --- public/views/walletHome.html | 4 ++-- src/js/controllers/index.js | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index dbc10fc16..169ff7cfe 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -217,7 +217,7 @@ Cancel
-
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index d75096611..b329bbc2e 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -910,21 +910,24 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.showMore = function() { $timeout(function() { if (self.isSearching) { - self.txHistoryToList = self.result.slice(0, self.nextTxHistory); + self.txHistorySearchResults = self.result.slice(0, self.nextTxHistory); + $log.debug('Total txs: ', self.txHistorySearchResults.length + '/' + self.result.length); + if (self.txHistorySearchResults.length >= self.result.length) + self.historyShowMore = false; } else { self.txHistory = self.completeHistory.slice(0, self.nextTxHistory); - self.txHistoryToList = self.txHistory; + self.txHistorySearchResults = self.txHistory; + $log.debug('Total txs: ', self.txHistorySearchResults.length + '/' + self.completeHistory.length); + if (self.txHistorySearchResults.length >= self.completeHistory.length) + self.historyShowMore = false; } - $log.debug('Total txs: ', self.txHistoryToList.length + '/' + self.result.length); self.nextTxHistory += self.historyShowMoreLimit; - if (self.txHistoryToList.length >= self.result.length) - self.historyShowMore = false; }, 100); }; self.startSearch = function(){ self.isSearching = true; - self.txHistoryToList = []; + self.txHistorySearchResults = []; self.result = []; self.historyShowMore = false; self.nextTxHistory = self.historyShowMoreLimit; @@ -973,7 +976,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r return self.result; }; - self.txHistoryToList = filter(self.search).slice(0, self.historyShowLimit); + self.txHistorySearchResults = filter(self.search).slice(0, self.historyShowLimit); if (isCordova) window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.result.length)); @@ -1037,7 +1040,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.isSearching = false; self.nextTxHistory = self.historyShowMoreLimit; self.txHistory = self.completeHistory.slice(0, self.historyShowLimit); - self.txHistoryToList = self.txHistory; + self.txHistorySearchResults = self.txHistory; self.historyShowMore = self.completeHistory.length > self.historyShowLimit; }; @@ -1233,7 +1236,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r $rootScope.$on('Local/ClearHistory', function(event) { $log.debug('The wallet transaction history has been deleted'); - self.txHistory = self.completeHistory = self.txHistoryToList = []; + self.txHistory = self.completeHistory = self.txHistorySearchResults = []; self.debounceUpdateHistory(); }); @@ -1374,7 +1377,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r $log.debug('Backup done stored'); addressService.expireAddress(walletId, function(err) { $timeout(function() { - self.txHistory = self.completeHistory = self.txHistoryToList = []; + self.txHistory = self.completeHistory = self.txHistorySearchResults = []; storageService.removeTxHistory(walletId, function() { self.startScan(walletId); }); From 2675966760e744f425626311eef89ce8a0bb2b6b Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 23 Feb 2016 16:16:48 -0300 Subject: [PATCH 26/29] Fix activity title, input padding and show more link --- public/views/walletHome.html | 34 +++++++++++++++------------------- src/css/main.css | 11 ++++++++--- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 169ff7cfe..70944aee9 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -159,13 +159,9 @@
-
    -
  • -

    Activity - -

    -
  • -
+

Activity + +

@@ -218,7 +214,7 @@
@@ -280,17 +276,17 @@
- {{index.completeHistory.length - index.txHistory.length}}more - - - - {{index.result.length - index.txHistorySearchResults.length}} more - - + ng-show="index.historyShowMore" + ng-click="index.showMore()"> + Show more + + ({{index.completeHistory.length - index.txHistory.length}}) + + + {{index.result.length - index.txHistorySearchResults.length}} + + +
diff --git a/src/css/main.css b/src/css/main.css index 8439348e5..455cac320 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -83,8 +83,10 @@ h4.title a { margin:0; } -.walletHome h4 { - padding: 15px 0px 5px 10px; +.walletHome h4.title { + padding: 0 0 10px 15px; + margin: 5px 0 5px 0; + font-size: 16px; } @@ -525,6 +527,7 @@ ul.manage li { .m40b {margin-bottom: 40px;} .m50b {margin-bottom: 50px;} .m10r {margin-right: 10px;} +.m5l {margin-left: 5px;} .m15l {margin-left: 15px;} .m15t {margin-top: 15px;} .m20r {margin-right: 20px;} @@ -804,10 +807,11 @@ table tbody tr:last-child td { .searchBar input{ margin-bottom: auto; border-bottom: 0px solid #E9EDF0; + padding-left: 8px; } .searchBar i{ position: absolute; - padding: 8px; + padding: 8px 0 8px 8px; } .searchBar .small-11{ @@ -825,6 +829,7 @@ table tbody tr:last-child td { margin-bottom: 10px; background-color: rgba(0, 0, 0, 0.02); border-radius: 10px; + position: relative; } /*//////////////////////////// BUTTON OUTLINE ////////////////////////////*/ From 8a110a6b22f6d7852820c7f397b5e6eec5ed622f Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 23 Feb 2016 16:21:09 -0300 Subject: [PATCH 27/29] Fix show more --- public/views/walletHome.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 70944aee9..2f72dece5 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -283,7 +283,7 @@ ({{index.completeHistory.length - index.txHistory.length}}) - {{index.result.length - index.txHistorySearchResults.length}} + ({{index.result.length - index.txHistorySearchResults.length}}) From 25760870f1dc8f7ab69e93bc4e5264ec8480a557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 16:43:17 -0300 Subject: [PATCH 28/29] save coincidences --- src/js/controllers/index.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index b329bbc2e..609fdc603 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -950,7 +950,17 @@ angular.module('copayApp.controllers').controller('indexController', function($r function filter(search) { self.result = []; - function formatDate(date) { + + function computeSearchableString(tx){ + var addrbook = ''; + if(self.addressbook[tx.addressTo]!= 'undefined') addrbook = self.addressbook[tx.addressTo] || ''; + var searchableDate = computeSearchableDate(new Date(tx.time * 1000)); + var message = tx.message ? tx.message : ''; + var addressTo = tx.addressTo ? tx.addressTo : ''; + return ((tx.amountStr+message+addressTo+addrbook+searchableDate).toString()).toLowerCase(); + } + + function computeSearchableDate(date) { var day = ('0' + date.getDate()).slice(-2).toString(); var month = ('0' + (date.getMonth() + 1)).slice(-2).toString(); var year = date.getFullYear(); @@ -961,13 +971,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.historyShowMore = false; return []; } - self.result = lodash.filter(self.completeHistory, function(tx) { - return lodash.includes(tx.amountStr, search) || - lodash.includes(tx.message, search) || - lodash.includes(self.addressbook ? self.addressbook[tx.addressTo] : null, search) || - lodash.includes(tx.addressTo, search) || - lodash.isEqual(formatDate(new Date(tx.time * 1000)), search); + if (!tx.searcheableString) tx.searcheableString = computeSearchableString(tx); + return lodash.includes(tx.searcheableString, search.toLowerCase()); }); if (self.result.length > self.historyShowLimit) self.historyShowMore = true; From 816b60b77642675b0ccc03e9b637bd553d7ba334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 23 Feb 2016 17:33:41 -0300 Subject: [PATCH 29/29] fix no addressTo in txs --- src/js/controllers/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 609fdc603..34f09aa6e 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -953,7 +953,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r function computeSearchableString(tx){ var addrbook = ''; - if(self.addressbook[tx.addressTo]!= 'undefined') addrbook = self.addressbook[tx.addressTo] || ''; + if(tx.addressTo && self.addressbook[tx.addressTo]!= 'undefined') addrbook = self.addressbook[tx.addressTo] || ''; var searchableDate = computeSearchableDate(new Date(tx.time * 1000)); var message = tx.message ? tx.message : ''; var addressTo = tx.addressTo ? tx.addressTo : '';