diff --git a/app/views/includes/foot.jade b/app/views/includes/foot.jade index 4a14f1ae..95786cb0 100755 --- a/app/views/includes/foot.jade +++ b/app/views/includes/foot.jade @@ -4,13 +4,13 @@ //script(type='text/javascript', src='/lib/bootstrap/dist/js/bootstrap.min.js') script(type='text/javascript', src='/socket.io/socket.io.js') script(type='text/javascript', src='/lib/momentjs/moment.js') +script(type='text/javascript', src='/lib/qrcode-generator/js/qrcode.js') +script(type='text/javascript', src='/lib/zeroclipboard/ZeroClipboard.min.js') //AngularJS script(type='text/javascript', src='/lib/angular/angular.js') -script(type='text/javascript', src='/lib/angular-cookies/angular-cookies.js') script(type='text/javascript', src='/lib/angular-resource/angular-resource.js') script(type='text/javascript', src='/lib/angular-route/angular-route.js') -script(type='text/javascript', src='/lib/qrcode-generator/js/qrcode.js') script(type='text/javascript', src='/lib/angular-qrcode/qrcode.js') script(type='text/javascript', src='/lib/angular-animate/angular-animate.js') diff --git a/bower.json b/bower.json index 1212d2b3..0e701fdb 100644 --- a/bower.json +++ b/bower.json @@ -12,6 +12,7 @@ "angular-ui-utils": "0.1.0", "angular-qrcode": "latest", "angular-animate": "latest", - "momentjs": "~2.5.0" + "momentjs": "~2.5.0", + "zeroclipboard": "~1.3.0-beta.1" } } diff --git a/public/css/common.css b/public/css/common.css index 2d05cfff..b6e16a7d 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -391,4 +391,13 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: black; } - +.btn-copy { + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + background: #FFFFFF; + border-radius: 2px; + border: 2px solid #E4E4E4; + color: #9b9b9b; + margin-left: 5px; + padding: 2px 6px; +} diff --git a/public/js/app.js b/public/js/app.js index fd2fffd3..321b7435 100755 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,20 +1,19 @@ 'use strict'; -angular.module('insight', - ['ngAnimate', - 'ngCookies', - 'ngResource', - 'ngRoute', - 'ui.bootstrap', - 'ui.route', - 'insight.system', - 'insight.socket', - 'insight.blocks', - 'insight.transactions', - 'monospaced.qrcode', - 'insight.address', - 'insight.search', - 'insight.status' +angular.module('insight',[ + 'ngAnimate', + 'ngResource', + 'ngRoute', + 'ui.bootstrap', + 'ui.route', + 'monospaced.qrcode', + 'insight.system', + 'insight.socket', + 'insight.blocks', + 'insight.transactions', + 'insight.address', + 'insight.search', + 'insight.status' ]); angular.module('insight.system', []); diff --git a/public/js/directives.js b/public/js/directives.js index d0fe4877..d7c2f8ef 100755 --- a/public/js/directives.js +++ b/public/js/directives.js @@ -1,25 +1,58 @@ 'use strict'; -angular.module('insight.address').directive('whenScrolled', ['$window', function($window) { - return { - link: function(scope, elm, attr) { - var pageHeight, clientHeight, scrollPos; - $window = angular.element($window); +var ZeroClipboard = window.ZeroClipboard; - var handler = function() { - pageHeight = window.document.documentElement.scrollHeight; - clientHeight = window.document.documentElement.clientHeight; - scrollPos = window.pageYOffset; +angular.module('insight') + .directive('whenScrolled', ['$window', function($window) { + return { + restric: 'A', + link: function(scope, elm, attr) { + var pageHeight, clientHeight, scrollPos; + $window = angular.element($window); - if (pageHeight - (scrollPos + clientHeight) === 0) { - scope.$apply(attr.whenScrolled); - } - }; + var handler = function() { + pageHeight = window.document.documentElement.scrollHeight; + clientHeight = window.document.documentElement.clientHeight; + scrollPos = window.pageYOffset; - $window.on('scroll', handler); - scope.$on('$destroy', function() { - return $window.off('scroll', handler); - }); - } - }; -}]); + if (pageHeight - (scrollPos + clientHeight) === 0) { + scope.$apply(attr.whenScrolled); + } + }; + + $window.on('scroll', handler); + scope.$on('$destroy', function() { + return $window.off('scroll', handler); + }); + } + }; + }]) + .directive('clipCopy', [function() { + ZeroClipboard.config({ + moviePath: '../lib/zeroclipboard/ZeroClipboard.swf', + trustedDomains: ['*'], + allowScriptAccess: 'always', + forceHandCursor: true + }); + + return { + restric: 'A', + scope: { clipCopy: '=clipCopy' }, + link: function(scope, elm) { + var clip = new ZeroClipboard(elm); + + clip.on('load', function(client) { + var onMousedown = function(client) { + client.setText(scope.clipCopy); + }; + + client.on('mousedown', onMousedown); + + scope.$on('$destroy', function() { + client.off('mousedown', onMousedown); + client.unglue(elm); + }); + }); + } + }; + }]); diff --git a/public/views/footer.html b/public/views/footer.html index aac69ff5..c4d19bea 100644 --- a/public/views/footer.html +++ b/public/views/footer.html @@ -1,3 +1,3 @@
- Insight + Insight v0.0.1
diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index fd505df3..42cc947d 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -1,7 +1,7 @@
- {{tx.txid}} + {{tx.txid}} - + {{tx.time * 1000 | date:'medium'}}