diff --git a/bower.json b/bower.json index ed357189c..d96cd64d8 100644 --- a/bower.json +++ b/bower.json @@ -22,6 +22,7 @@ "angular-moment": "~0.7.1", "socket.io-client": ">=1.0.0", "mousetrap": "1.4.6", + "zeroclipboard": "~2.1.6", "ng-idle": "*" } } diff --git a/css/main.css b/css/main.css index 9841917df..8b8e10278 100644 --- a/css/main.css +++ b/css/main.css @@ -682,9 +682,7 @@ ul.pagination li.current a:hover, ul.pagination li.current a:focus { -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; - border: 1px solid #1ABC9C; - text-overflow: ellipsis; - overflow-y: hidden; + border: 1px solid #16A085; } .tooltip>.nub { @@ -700,6 +698,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; @@ -1090,6 +1093,29 @@ 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; } + @media only screen and (min-width: 40.063em) { dialog.tiny, .reveal-modal.tiny { width: 50%; @@ -1097,5 +1123,4 @@ a.text-white:hover {color: #ccc;} } } - /*-----------------------------------------------------------------*/ diff --git a/css/mobile.css b/css/mobile.css index 1b2265124..9049147ea 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -122,5 +122,10 @@ width: 200px; height: 200px; } + + .btn-copy { + display: none; + } + } diff --git a/img/icons/copy.png b/img/icons/copy.png new file mode 100644 index 000000000..b43ca0634 Binary files /dev/null and b/img/icons/copy.png differ diff --git a/index.html b/index.html index e77e29869..f09603637 100644 --- a/index.html +++ b/index.html @@ -75,6 +75,7 @@ + diff --git a/js/directives.js b/js/directives.js index 3fac18f34..03681d02b 100644 --- a/js/directives.js +++ b/js/directives.js @@ -238,4 +238,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(); + }); + } + }; }); 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 @@
Empty. Create an alias for your addresses
-| Label | -Address | -Creator | -Date | -- | |||||
|---|---|---|---|---|---|---|---|---|---|
| {{info.label}} | -{{addr}} | -{{$root.wallet.publicKeyRing.nicknameForCopayer(info.copayerId)}} | -- | {{info.hidden ? - 'Enable' : 'Disable'}} | +
| Label | +Address | +Creator | +Date | +
|---|