From a78f4e280cb62edf892ad32b3797c657fe527bbc Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Wed, 3 Jan 2018 10:33:22 +1100 Subject: Add csv display of addresses --- src/css/app.css | 8 ++++++ src/index.html | 89 ++++++++++++++++++++++++++++++++++----------------------- src/js/index.js | 25 ++++++++++++++++ 3 files changed, 86 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/css/app.css b/src/css/app.css index 897746b..71109ef 100644 --- a/src/css/app.css +++ b/src/css/app.css @@ -95,3 +95,11 @@ body { top: 5px; right: 5px; } +.csv { + margin-top: 20px; + margin-bottom: 20px; + white-space: pre; + overflow-wrap: normal; + overflow-x: scroll; + font-family: monospace; +} diff --git a/src/index.html b/src/index.html index 0d1a2c6..0f47c38 100644 --- a/src/index.html +++ b/src/index.html @@ -603,42 +603,59 @@ -
- - - - - - - - - - - - - - -
-
- Path   - -
-
-
- Address   - -
-
-
- Public Key   - -
-
-
- Private Key   - -
-
    
    
    
    
    
+ +
+
+
+ + + + + + + + + + + + + + +
+
+ Path   + +
+
+
+ Address   + +
+
+
+ Public Key   + +
+
+
+ Private Key   + +
+
    
    
    
    
    
+
+
+
+
+ +
+
Show diff --git a/src/js/index.js b/src/js/index.js index e63c65f..01543f9 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -91,6 +91,8 @@ DOM.useBitpayAddressesContainer = $(".use-bitpay-addresses-container"); DOM.useBitpayAddresses = $(".use-bitpay-addresses"); DOM.addresses = $(".addresses"); + DOM.csvTab = $("#csv-tab a"); + DOM.csv = $(".csv"); DOM.rowsToAdd = $(".rows-to-add"); DOM.more = $(".more"); DOM.moreRowsStartIndex = $(".more-rows-start-index"); @@ -135,6 +137,7 @@ DOM.addressToggle.on("click", toggleAddresses); DOM.publicKeyToggle.on("click", togglePublicKeys); DOM.privateKeyToggle.on("click", togglePrivateKeys); + DOM.csvTab.on("click", updateCsv); DOM.languages.on("click", languageChanged); DOM.useBitpayAddresses.on("change", useBitpayAddressesChange); setQrEvents(DOM.showQrEls); @@ -831,6 +834,7 @@ addAddressToList(indexText, address, pubkey, privkey); if (isLast) { hidePending(); + updateCsv(); } }, 50) } @@ -871,6 +875,7 @@ function clearAddressesList() { DOM.addresses.empty(); + DOM.csv.val(""); stopGenerating(); } @@ -1426,6 +1431,26 @@ DOM.entropyWordIndexes.text(wordIndexesStr); } + function updateCsv() { + var tableCsv = "path,address,public key,private key\n"; + var rows = DOM.addresses.find("tr"); + for (var i=0; i