From ef454048c8072a696093009d8d77daf90b689ac5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 8 Sep 2017 17:36:06 +0200 Subject: [PATCH] copy to clipboard --- src/app/execution/txLogger.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/app/execution/txLogger.js b/src/app/execution/txLogger.js index e847b10d7d..215302cb09 100644 --- a/src/app/execution/txLogger.js +++ b/src/app/execution/txLogger.js @@ -1,5 +1,6 @@ 'use strict' var yo = require('yo-yo') +const copy = require('clipboard-copy') // -------------- styling ---------------------- var csjs = require('csjs-inject') @@ -58,7 +59,10 @@ var css = csjs` .details { background-color: ${styles.colors.lightGrey}; } -` + .clipboardCopy { + margin-right: 0.5em; + cursor: pointer; + }` /** * This just export a function that register to `newTransaction` and forward them to the logger. * Emit debugRequested @@ -253,7 +257,7 @@ function createTable (opts) { var contractAddress = yo` contractAddress - ${opts.contractAddress} + ${opts.contractAddress} ` if (opts.contractAddress) table.appendChild(contractAddress) @@ -261,7 +265,7 @@ function createTable (opts) { var from = yo` from - ${opts.from} + ${opts.from} ` if (opts.from) table.appendChild(from) @@ -276,7 +280,7 @@ function createTable (opts) { var to = yo` to - ${toHash} + ${toHash} ` if (opts.to) table.appendChild(to) @@ -284,7 +288,7 @@ function createTable (opts) { var gas = yo` gas - ${opts.gas} + ${opts.gas} ` if (opts.gas) table.appendChild(gas) @@ -292,7 +296,7 @@ function createTable (opts) { var hash = yo` hash - ${opts.hash} + ${opts.hash} ` if (opts.hash) table.appendChild(hash) @@ -300,7 +304,7 @@ function createTable (opts) { var input = yo` input - ${opts.input} + ${opts.input} ` if (opts.input) table.appendChild(input) @@ -309,7 +313,7 @@ function createTable (opts) { var inputDecoded = yo` decoded input - ${opts['decoded input']} + ${opts['decoded input']} ` table.appendChild(inputDecoded) } @@ -317,7 +321,7 @@ function createTable (opts) { var logs = yo` logs - ${opts.logs || '0'} + ${opts.logs || '0'} ` if (opts.logs) table.appendChild(logs) @@ -326,7 +330,7 @@ function createTable (opts) { val = yo` value - ${val} wei + ${val} wei ` if (opts.val) table.appendChild(val)