mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-18 16:32:18 +00:00
Merge pull request #508 from Macha-orange/master
Add "auto compute" check box
This commit is contained in:
@@ -181,6 +181,15 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-2"></div>
|
||||||
|
<div class="col-sm-10 checkbox">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" class="autoCompute" checked>
|
||||||
|
<span>Auto compute</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label">Mnemonic Language</label>
|
<label class="col-sm-2 control-label">Mnemonic Language</label>
|
||||||
<div class="col-sm-10 languages">
|
<div class="col-sm-10 languages">
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
DOM.entropyWeakEntropyOverrideWarning = DOM.entropyContainer.find(".weak-entropy-override-warning");
|
DOM.entropyWeakEntropyOverrideWarning = DOM.entropyContainer.find(".weak-entropy-override-warning");
|
||||||
DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning");
|
DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning");
|
||||||
DOM.phrase = $(".phrase");
|
DOM.phrase = $(".phrase");
|
||||||
|
DOM.autoCompute = $(".autoCompute");
|
||||||
DOM.splitMnemonic = $(".splitMnemonic");
|
DOM.splitMnemonic = $(".splitMnemonic");
|
||||||
DOM.showSplitMnemonic = $(".showSplitMnemonic");
|
DOM.showSplitMnemonic = $(".showSplitMnemonic");
|
||||||
DOM.phraseSplit = $(".phraseSplit");
|
DOM.phraseSplit = $(".phraseSplit");
|
||||||
@@ -143,6 +144,7 @@
|
|||||||
DOM.network.on("change", networkChanged);
|
DOM.network.on("change", networkChanged);
|
||||||
DOM.bip32Client.on("change", bip32ClientChanged);
|
DOM.bip32Client.on("change", bip32ClientChanged);
|
||||||
DOM.useEntropy.on("change", setEntropyVisibility);
|
DOM.useEntropy.on("change", setEntropyVisibility);
|
||||||
|
DOM.autoCompute.on("change", delayedPhraseChanged);
|
||||||
DOM.entropy.on("input", delayedEntropyChanged);
|
DOM.entropy.on("input", delayedEntropyChanged);
|
||||||
DOM.entropyMnemonicLength.on("change", entropyChanged);
|
DOM.entropyMnemonicLength.on("change", entropyChanged);
|
||||||
DOM.entropyTypeInputs.on("change", entropyTypeChanged);
|
DOM.entropyTypeInputs.on("change", entropyTypeChanged);
|
||||||
@@ -234,6 +236,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isUsingAutoCompute() {
|
||||||
|
return DOM.autoCompute.prop("checked");
|
||||||
|
}
|
||||||
|
|
||||||
function setEntropyVisibility() {
|
function setEntropyVisibility() {
|
||||||
if (isUsingOwnEntropy()) {
|
if (isUsingOwnEntropy()) {
|
||||||
DOM.entropyContainer.removeClass("hidden");
|
DOM.entropyContainer.removeClass("hidden");
|
||||||
@@ -251,6 +257,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function delayedPhraseChanged() {
|
function delayedPhraseChanged() {
|
||||||
|
|
||||||
|
if(isUsingAutoCompute()) {
|
||||||
hideValidationError();
|
hideValidationError();
|
||||||
seed = null;
|
seed = null;
|
||||||
bip32RootKey = null;
|
bip32RootKey = null;
|
||||||
@@ -270,6 +278,11 @@
|
|||||||
entropyTypeAutoDetect = false;
|
entropyTypeAutoDetect = false;
|
||||||
}
|
}
|
||||||
}, 400);
|
}, 400);
|
||||||
|
} else {
|
||||||
|
clearDisplay();
|
||||||
|
clearEntropyFeedback();
|
||||||
|
showValidationError("Auto compute is disabled");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function phraseChanged() {
|
function phraseChanged() {
|
||||||
|
|||||||
Reference in New Issue
Block a user