mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-18 08:22:16 +00:00
Client select has 'custom derivation path' option
* Specific clients cause derivation path input to be readonly * Rename ambiguous variable client-phrase to bip32-client
This commit is contained in:
@@ -368,9 +368,10 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="client-phrase" class="col-sm-2 control-label" data-translate>Client</label>
|
<label for="bip32-client" class="col-sm-2 control-label" data-translate>Client</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="client-phrase" class="client form-control">
|
<select id="bip32-client" class="client form-control">
|
||||||
|
<option value="custom">Custom derivation path</option>
|
||||||
<!-- populated by javascript -->
|
<!-- populated by javascript -->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -23,9 +23,8 @@
|
|||||||
|
|
||||||
var DOM = {};
|
var DOM = {};
|
||||||
DOM.network = $(".network");
|
DOM.network = $(".network");
|
||||||
DOM.client = $(".client");
|
DOM.bip32Client = $("#bip32-client");
|
||||||
DOM.phraseNetwork = $("#network-phrase");
|
DOM.phraseNetwork = $("#network-phrase");
|
||||||
DOM.phraseClient = $("#client-phrase");
|
|
||||||
DOM.useEntropy = $(".use-entropy");
|
DOM.useEntropy = $(".use-entropy");
|
||||||
DOM.entropyContainer = $(".entropy-container");
|
DOM.entropyContainer = $(".entropy-container");
|
||||||
DOM.entropy = $(".entropy");
|
DOM.entropy = $(".entropy");
|
||||||
@@ -79,7 +78,7 @@
|
|||||||
function init() {
|
function init() {
|
||||||
// Events
|
// Events
|
||||||
DOM.network.on("change", networkChanged);
|
DOM.network.on("change", networkChanged);
|
||||||
DOM.client.on("change", clientChanged);
|
DOM.bip32Client.on("change", bip32ClientChanged);
|
||||||
DOM.useEntropy.on("change", setEntropyVisibility);
|
DOM.useEntropy.on("change", setEntropyVisibility);
|
||||||
DOM.entropy.on("input", delayedEntropyChanged);
|
DOM.entropy.on("input", delayedEntropyChanged);
|
||||||
DOM.entropyMnemonicLength.on("change", entropyChanged);
|
DOM.entropyMnemonicLength.on("change", entropyChanged);
|
||||||
@@ -120,15 +119,21 @@
|
|||||||
rootKeyChanged();
|
rootKeyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clientChanged(e) {
|
function bip32ClientChanged(e) {
|
||||||
var clientIndex = e.target.value;
|
var clientIndex = DOM.bip32Client.val();
|
||||||
clients[clientIndex].onSelect();
|
if (clientIndex == "custom") {
|
||||||
if (seed != null) {
|
DOM.bip32path.prop("readonly", false);
|
||||||
phraseChanged();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rootKeyChanged();
|
DOM.bip32path.prop("readonly", true);
|
||||||
|
clients[clientIndex].onSelect();
|
||||||
|
if (seed != null) {
|
||||||
|
phraseChanged();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rootKeyChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -725,14 +730,14 @@
|
|||||||
DOM.phraseNetwork.append(option);
|
DOM.phraseNetwork.append(option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function populateClientSelect() {
|
function populateClientSelect() {
|
||||||
for (var i=0; i<clients.length; i++) {
|
for (var i=0; i<clients.length; i++) {
|
||||||
var client = clients[i];
|
var client = clients[i];
|
||||||
var option = $("<option>");
|
var option = $("<option>");
|
||||||
option.attr("value", i);
|
option.attr("value", i);
|
||||||
option.text(client.name);
|
option.text(client.name);
|
||||||
DOM.phraseClient.append(option);
|
DOM.bip32Client.append(option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user