Bug 600560 - Sync UI: Strength meter does not disappear when sync key field is cleared. r=mconnor a=blocking-beta8

This commit is contained in:
Philipp von Weitershausen 2010-10-14 11:12:15 +02:00
parent 010b1c03cb
commit 1b2169c2a4
2 changed files with 8 additions and 5 deletions

View File

@ -341,7 +341,7 @@ var gSyncSetup = {
// xxxmpc - hack, sigh
if (el1.value == document.getElementById("weavePassword").value) {
valid = false;
str = Weave.Utils.getErrorString("change.passphrase.ppSameAsPassword");
str = Weave.Utils.getErrorString("change.synckey.sameAsPassword");
}
else {
[valid, str] = gSyncUtils.validatePassphrase(el1);
@ -349,8 +349,11 @@ var gSyncSetup = {
let feedback = document.getElementById("passphraseFeedbackRow");
this._setFeedback(feedback, valid, str);
if (!valid)
if (!valid) {
// Hide strength meter if we're displaying an error.
document.getElementById("passphraseStrengthRow").hidden = true;
return valid;
}
// No passphrase strength meter for the generated key.
if (!this._haveCustomSyncKey)

View File

@ -299,7 +299,9 @@ let gSyncUtils = {
let val = el.value;
let error = "";
if (val == Weave.Service.username)
if (val.length < Weave.MIN_PP_LENGTH)
error = "change.synckey.tooShort";
else if (val == Weave.Service.username)
error = "change.synckey.sameAsUsername";
else if (val == Weave.Service.account)
error = "change.synckey.sameAsEmail";
@ -307,8 +309,6 @@ let gSyncUtils = {
error = "change.synckey.sameAsPassword";
else if (change && val == Weave.Service.passphrase)
error = "change.synckey.sameAsSyncKey";
else if (val.length < Weave.MIN_PP_LENGTH)
error = "change.synckey.tooShort";
else
valid = true;