]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - src/js/index.js
Make CSS and JS path relative
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / src / js / index.js
index 866ad2460c3378d203749024368c8346f8193af4..9dabe9534677e37c56985a6bfc43366f2c289695 100644 (file)
 
     function bip44Changed() {
         setBip44DerivationPath();
-        derivationPath = DOM.bip44path.val();
         derivationChanged();
     }
 
             return;
         }
         var numWords = parseInt(DOM.strength.val());
-        // Check strength is an integer
-        if (isNaN(numWords)) {
-            DOM.strength.val("12");
-            numWords = 12;
-        }
-        // Check strength is a multiple of 32, if not round it down
-        if (numWords % 3 != 0) {
-            numWords = Math.floor(numWords / 3) * 3;
-            DOM.strength.val(numWords);
-        }
-        // Check strength is at least 32
-        if (numWords == 0) {
-            numWords = 3;
-            DOM.strength.val(numWords);
-        }
         var strength = numWords / 3 * 32;
         var words = mnemonic.generate(strength);
         DOM.phrase.val(words);
         var addressCell = row.find(".address span");
         var privkeyCell = row.find(".privkey span");
         // Content
-        indexCell.text(index);
+        var indexText = derivationPath + "/" + index;
+        indexCell.text(indexText);
         addressCell.text(address);
         privkeyCell.text(privkey);
         // Visibility
             addressCell.addClass("invisible");
         }
         if (!showPrivKey) {
-            privkeCell.addClass("invisible");
+            privkeyCell.addClass("invisible");
         }
         DOM.addresses.append(row);
     }
         path += account + "'/";
         path += change;
         DOM.bip44path.val(path);
+        derivationPath = DOM.bip44path.val();
     }
 
     function parseIntNoNaN(val, defaultVal) {
                 DOM.bip44coin.val(1);
             },
         },
+        {
+            name: "Viacoin",
+            onSelect: function() {
+                network = bitcoin.networks.viacoin;
+                DOM.bip44coin.val(14);
+            },
+        },
+        {
+            name: "Viacoin Testnet",
+            onSelect: function() {
+                network = bitcoin.networks.viacointestnet;
+                DOM.bip44coin.val(1);
+            },
+        },
+        {
+            name: "Jumbucks",
+            onSelect: function() {
+                network = bitcoin.networks.jumbucks;
+                DOM.bip44coin.val(26);
+            },
+        },
+        {
+            name: "CLAM",
+            onSelect: function() {
+                network = bitcoin.networks.clam;
+                DOM.bip44coin.val(23);
+            },
+        },
     ]
 
     init();