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