brainwallet: don't use Alert() to signal error, it was problematic for resetting page when changing currency

This commit is contained in:
Michael Muré 2014-03-19 22:58:27 +01:00
parent e6dcb2d859
commit 73c19592ac
2 changed files with 6 additions and 3 deletions

View file

@ -261,12 +261,13 @@
<span id="brainalgorithm" class="notes right">Algorithm: SHA256(passphrase)</span>
</div>
<div class="row extra"><span id="brainwarning"></span></div>
<div class="row extra"><span id="brainerror"></span></div>
</div>
<div id="brainkeyarea" class="keyarea">
<div class="public">
<div id="brainqrcodepublic" class="qrcode_public"></div>
<div class="pubaddress">
<span class="label" id="brainlabelbitcoinaddress">Bitcoin Address:</span>
<span class="label" id="brainlabelbitcoinaddress">Public Address:</span>
<span class="output" id="brainbtcaddress"></span>
</div>
</div>

View file

@ -12,6 +12,8 @@ ninja.wallets.brainwallet = {
minPassphraseLength: 15,
view: function () {
document.getElementById("brainerror").innerHTML = "";
var key = document.getElementById("brainpassphrase").value.toString().replace(/^\s+|\s+$/g, ""); // trim white space
document.getElementById("brainpassphrase").value = key;
var keyConfirm = document.getElementById("brainpassphraseconfirm").value.toString().replace(/^\s+|\s+$/g, ""); // trim white space
@ -33,12 +35,12 @@ ninja.wallets.brainwallet = {
document.getElementById("brainkeyarea").style.visibility = "visible";
}
else {
alert(ninja.translator.get("brainalertpassphrasetooshort") + ninja.translator.get("brainalertpassphrasewarning"));
document.getElementById("brainerror").innerHTML = ninja.translator.get("brainalertpassphrasetooshort");
ninja.wallets.brainwallet.clear();
}
}
else {
alert(ninja.translator.get("brainalertpassphrasedoesnotmatch"));
document.getElementById("brainerror").innerHTML = ninja.translator.get("brainalertpassphrasedoesnotmatch");
ninja.wallets.brainwallet.clear();
}
},