Closed
Bug 562183
Opened 14 years ago
Closed 14 years ago
unify passphrase matching/validation code
Categories
(Firefox :: Sync, defect)
Firefox
Sync
Tracking
()
RESOLVED
FIXED
1.3b3
People
(Reporter: mconnor, Assigned: mconnor)
References
Details
Attachments
(1 file, 1 obsolete file)
16.92 KB,
patch
|
Mardak
:
review+
|
Details | Diff | Splinter Review |
This is inconsistent, and duplicates code, and also led to duplicates for a number of strings.
Flags: blocking-weave1.3+
Attachment #441946 -
Flags: review?(edilee)
Comment 1•14 years ago
|
||
Missing fx-prefs-common.js ?
Assignee | ||
Comment 2•14 years ago
|
||
oops
Attachment #441946 -
Attachment is obsolete: true
Attachment #441972 -
Flags: review?(edilee)
Attachment #441946 -
Flags: review?(edilee)
Comment 3•14 years ago
|
||
Comment on attachment 441972 [details] [diff] [review] v1 >+++ b/source/chrome/content/generic-change.js > validate: function (event) { > if (this._dialogType == "ChangePassword") { > if (this._currentPasswordInvalid) >+ [valid, errorString] = gWeaveCommon.validatePassword(this._firstBox); >+ else >+ [valid, errorString] = gWeaveCommon.validatePassword(this._firstBox, this._secondBox); > } > else { > if (this._updatingPassphrase) >+ [valid, errorString] = gWeaveCommon.validatePassphrase(this._firstBox); >+ else >+ [valid, errorString] = gWeaveCommon.validatePassphrase(this._firstBox, this._secondBox); You could make the interface do.. let {valid, errorString} = gWeaveCommon.validatePassword(..) Unrelated, not sure if it would be any better to do .. = gWeaveCommon[validate].apply(gWeaveCommon, boxes) where validate = dialogType == "Change" ? .. : .. and boxes = [first]; if (!invalid && !updating) boxes.push(second) Mm.. maybe not :p >+++ b/source/chrome/content/preferences/fx-prefs-common.js >+var gWeaveCommon = { var let? >+ _validate: function (el1, el2, isPassword) { >+ let errorString = error ? Weave.Utils.getErrorString(error) : ""; >+ dump("valid: " + valid + " error: " + errorString + "\n"); >+ return [valid, errorString]; And this would be: return { errorString: errorString, valid: valid }; >+++ b/source/chrome/content/preferences/fx-setup.js > onPasswordChange: function () { > let valid = false; >+ let errorString = ""; >+ [valid, errorString] = gWeaveCommon.validatePassword(password, pwconfirm); No need to separately declare/initialize and assign. >+ _setFeedbackMessage: function (element, success, string) { >- label.className = classname; No more error/success classes?
Attachment #441972 -
Flags: review?(edilee) → review+
Assignee | ||
Comment 4•14 years ago
|
||
http://hg.mozilla.org/labs/weave/rev/6e4b48a00d01
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.3b3
Updated•6 years ago
|
Component: Firefox Sync: UI → Sync
Product: Cloud Services → Firefox
You need to log in
before you can comment on or make changes to this bug.
Description
•