From dc565e0a68c3195017d47f191d544bcf7b9281b9 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 31 Jul 2014 16:34:21 -0300 Subject: [PATCH 1/3] Integrating ZeroClipboard in Copay as directive --- bower.json | 3 ++- img/icons/copy.png | Bin 0 -> 148 bytes index.html | 1 + js/directives.js | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 img/icons/copy.png diff --git a/bower.json b/bower.json index cf1a4f301..ba78d8346 100644 --- a/bower.json +++ b/bower.json @@ -21,6 +21,7 @@ "bitcore": "0.1.34", "angular-moment": "~0.7.1", "socket.io-client": ">=1.0.0", - "mousetrap": "1.4.6" + "mousetrap": "1.4.6", + "zeroclipboard": "~2.1.6" } } diff --git a/img/icons/copy.png b/img/icons/copy.png new file mode 100644 index 0000000000000000000000000000000000000000..b43ca063492c22a1436ae1d2ce852d638df9e38c GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`(Vi}jAr-fhQyQAu+S>l}xG*h< za+8=Xc(dWxud1e5($dl|6Bs-MH!>_|JhH3p8(YF>zD;*LiWzq;yi(3+R-bgag-2qe w=Ar3p64y1WW^UqXSe1C>HB(KU`#B$mX;bUjd88Ho0j**1boFyt=akR{0FnYUOaK4? literal 0 HcmV?d00001 diff --git a/index.html b/index.html index acc29b64d..69fd2321f 100644 --- a/index.html +++ b/index.html @@ -74,6 +74,7 @@ + diff --git a/js/directives.js b/js/directives.js index b1d6c3b35..8601249b3 100644 --- a/js/directives.js +++ b/js/directives.js @@ -232,4 +232,38 @@ angular.module('copayApp.directives') } }; }) + .directive('clipCopy', function() { + ZeroClipboard.config({ + moviePath: '/lib/zeroclipboard/dist/ZeroClipboard.swf', + trustedDomains: ['*'], + allowScriptAccess: 'always', + forceHandCursor: true + }); + + return { + restric: 'A', + scope: { clipCopy: '=clipCopy' }, + link: function(scope, elm) { + var client = new ZeroClipboard(elm); + + client.on( 'ready', function(event) { + client.on( 'copy', function(event) { + event.clipboardData.setData('text/plain', scope.clipCopy); + }); + + client.on( 'aftercopy', function(event) { + elm.removeClass('btn-copy').addClass('btn-copied').html('Copied!'); + setTimeout(function() { + elm.addClass('btn-copy').removeClass('btn-copied').html(''); + }, 1000); + }); + }); + + client.on( 'error', function(event) { + console.log( 'ZeroClipboard error of type "' + event.name + '": ' + event.message ); + ZeroClipboard.destroy(); + }); + } + }; + }) ; From 87f196ebf454435a8d1fb3863a026e068d7809e6 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 31 Jul 2014 16:40:26 -0300 Subject: [PATCH 2/3] Implemented icon for copy to clipboard in join, address book, transactions and addresses. --- css/main.css | 24 ++++++++++++++++ css/mobile.css | 5 ++++ views/copayers.html | 5 +++- views/modals/qr-address.html | 3 +- views/send.html | 54 ++++++++++++++++++------------------ views/transactions.html | 11 ++++---- 6 files changed, 68 insertions(+), 34 deletions(-) diff --git a/css/main.css b/css/main.css index b63ab76fd..62c46be8c 100644 --- a/css/main.css +++ b/css/main.css @@ -1026,4 +1026,28 @@ a.text-white:hover {color: #ccc;} text-align: left; } +/**** Copy to clipboard ****/ + +.btn-copy { + color: #9b9b9b; + display: inline-block; + height: 16px; + width: 16px; + outline: none; + vertical-align: sub; + background: transparent url('../img/icons/copy.png') center center no-repeat; +} + +.btn-copied { + display: inline-block; + width: auto; + color: #16A085; + font-weight: bold; + font-size: 11px; +} + +.btn-copy.zeroclipboard-is-hover { color: #000; } +.btn-copy.zeroclipboard-is-active { opacity: 1; } + + /*-----------------------------------------------------------------*/ diff --git a/css/mobile.css b/css/mobile.css index e57ce9e7d..12e34e065 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -115,5 +115,10 @@ float: none; margin: 0 auto; } + + .btn-copy { + display: none; + } + } diff --git a/views/copayers.html b/views/copayers.html index de32be126..e71e2d6c0 100644 --- a/views/copayers.html +++ b/views/copayers.html @@ -11,7 +11,10 @@

Share this secret with your other copayers

-
{{$root.wallet.getSecret()}}
+
+ {{$root.wallet.getSecret()}} + +
diff --git a/views/modals/qr-address.html b/views/modals/qr-address.html index ca80055e5..feb228ee2 100644 --- a/views/modals/qr-address.html +++ b/views/modals/qr-address.html @@ -1,6 +1,7 @@
-

{{address.address}}

+

{{address.address}}

+
diff --git a/views/send.html b/views/send.html index 3be526cf3..e80ccda0e 100644 --- a/views/send.html +++ b/views/send.html @@ -123,34 +123,34 @@
-
-

Address Book

-

Empty. Create an alias for your addresses

- - - - - - - - - - - - - - - - - +
+

Address Book

+

Empty. Create an alias for your addresses

+
LabelAddressCreatorDate 
{{info.label}}{{addr}}{{$root.wallet.publicKeyRing.nicknameForCopayer(info.copayerId)}}{{info.hidden ? - 'Enable' : 'Disable'}}
+ + + + + + + - -
LabelAddressCreatorDate 
- -
+ + + + {{info.label}} + {{addr}} + {{$root.wallet.publicKeyRing.nicknameForCopayer(info.copayerId)}} + + {{info.hidden ? + 'Enable' : 'Disable'}} + + + + + diff --git a/views/transactions.html b/views/transactions.html index ddc18977f..0f38eef05 100644 --- a/views/transactions.html +++ b/views/transactions.html @@ -123,12 +123,13 @@
-
- - {{btx.txid}} - + -
+
first seen at From 8b2ae3cb8fe41af3b9297aa344e002fa83193a78 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 31 Jul 2014 17:54:33 -0300 Subject: [PATCH 3/3] Fixes: tooltips position. copy peerId from sidebar --- css/main.css | 7 +++++-- views/includes/peer-list.html | 9 ++++----- views/includes/sidebar.html | 4 ++++ views/join.html | 3 ++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/css/main.css b/css/main.css index 62c46be8c..9844bb977 100644 --- a/css/main.css +++ b/css/main.css @@ -671,8 +671,6 @@ ul.pagination li.current a:hover, ul.pagination li.current a:focus { -moz-border-radius: 3px; border-radius: 3px; border: 1px solid #16A085; - text-overflow: ellipsis; - overflow-y: hidden; } .tooltip>.nub { @@ -688,6 +686,11 @@ ul.pagination li.current a:hover, ul.pagination li.current a:focus { border-color:transparent transparent transparent #16A085; } +.has-tip { + color: #7A8C9E; + border-color: #7A8C9E; +} + .logo { background: transparent url('../img/logo-negative-beta.svg') no-repeat; background-size: 130px 51px; diff --git a/views/includes/peer-list.html b/views/includes/peer-list.html index 4adcce3bf..cdccb5a91 100644 --- a/views/includes/peer-list.html +++ b/views/includes/peer-list.html @@ -11,7 +11,7 @@
    -
  • +
diff --git a/views/includes/sidebar.html b/views/includes/sidebar.html index ae82b4c46..706c63d0e 100644 --- a/views/includes/sidebar.html +++ b/views/includes/sidebar.html @@ -25,7 +25,9 @@ {{totalBalance || 0 @@ -37,7 +39,9 @@ {{availableBalance || 0|noFractionNumber}} {{$root.unitName}} diff --git a/views/join.html b/views/join.html index 8a7d140c0..9cbf4293a 100644 --- a/views/join.html +++ b/views/join.html @@ -46,7 +46,8 @@ check-strength="passwordStrength" tooltip-html-unsafe="Password strength: {{passwordStrength}}
Tip: Use lower and uppercase, - numbers and symbols" tooltip-trigger="focus" required> + numbers and symbols
" tooltip-trigger="focus" + tooltip-placement="left" required>