]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Add BIP38 interface elements
authorIan Coleman <ian@iancoleman.io>
Mon, 5 Feb 2018 22:50:29 +0000 (09:50 +1100)
committerIan Coleman <ian@iancoleman.io>
Mon, 5 Feb 2018 22:57:23 +0000 (09:57 +1100)
src/index.html
src/js/index.js

index 4fd9765ce512daf3bdf45546353eb43209b87b74..133a15075978129ff9db4c4543abfe5ab523eedf 100644 (file)
                         </label>
                     </div>
                 </div>
+                <div class="col-md-12">
+                    <div class="checkbox">
+                        <label>
+                            <input type="checkbox" class="use-bip38">
+                            <span>Encrypt private keys using BIP38 and this password:</span>
+                        </label>
+                        <input class="bip38-password">
+                        <span>Enabling BIP38 means each key will take take several minutes to generate.</span>
+                    </div>
+                </div>
                 <ul class="addresses-type nav nav-tabs" role="tablist">
                     <li id="table-tab" class="active">
                         <a href="#table" role="tab" data-toggle="tab">Table</a>
index 6aee5dc8852d9c5d58c7fb33281cd1b57d1c1fa9..3543e53935aed8cb3ec0c289234e8e013a9b1baa 100644 (file)
@@ -90,6 +90,8 @@
     DOM.hardenedAddresses = $(".hardened-addresses");
     DOM.useBitpayAddressesContainer = $(".use-bitpay-addresses-container");
     DOM.useBitpayAddresses = $(".use-bitpay-addresses");
+    DOM.useBip38 = $(".use-bip38");
+    DOM.bip38Password = $(".bip38-password");
     DOM.addresses = $(".addresses");
     DOM.csvTab = $("#csv-tab a");
     DOM.csv = $(".csv");
         DOM.bip141semantics.on("change", tabChanged);
         DOM.tab.on("shown.bs.tab", tabChanged);
         DOM.hardenedAddresses.on("change", calcForDerivationPath);
+        DOM.useBip38.on("change", calcForDerivationPath);
+        DOM.bip38Password.on("change", calcForDerivationPath);
         DOM.indexToggle.on("click", toggleIndexes);
         DOM.addressToggle.on("click", toggleAddresses);
         DOM.publicKeyToggle.on("click", togglePublicKeys);
         var self = this;
         this.shouldGenerate = true;
         var useHardenedAddresses = DOM.hardenedAddresses.prop("checked");
-        var useBip38 = false; // TODO get from DOM
-        var bip38password = "bip38password"; // TODO get from DOM
+        var useBip38 = DOM.useBip38.prop("checked");
+        var bip38password = DOM.bip38Password.val();
         var isSegwit = segwitSelected();
         var segwitAvailable = networkHasSegwit();
         var isP2wpkh = p2wpkhSelected();