diff options
author | Matěj Cepl <mcepl@redhat.com> | 2010-07-15 13:21:56 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2010-07-15 13:21:56 +0200 |
commit | 8cf286c4986d29f6b73583ff6b43444f1ef39207 (patch) | |
tree | 9a97829c4eb2f3a4c6e86157f6dc1984c4ca7fdd /lib | |
parent | 4bc527b9fd39cecafc35d6ec35c833b5ba1ead9a (diff) | |
download | bugzilla-triage-8cf286c4986d29f6b73583ff6b43444f1ef39207.tar.gz |
Give getPassword possibility of having different prompt
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/util.js b/lib/util.js index b72f7f0..f582d1d 100644 --- a/lib/util.js +++ b/lib/util.js @@ -197,7 +197,10 @@ var filterByRegexp = exports.filterByRegexp = * * @return String with the password */ -var getPassword = exports.getPassword = function getPassword() { +var getPassword = exports.getPassword = function getPassword(prompt) { + if (prompt === null) { + prompt = "Enter password:"; + } var prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"] .getService(Ci.nsIPromptService); var password = { @@ -206,7 +209,7 @@ var getPassword = exports.getPassword = function getPassword() { var check = { value : true }; // default the checkbox to true - var result = prompts.promptPassword(null, "Title", "Enter password:", + var result = prompts.promptPassword(null, "Title", prompt, password, null, check); // result is true if OK was pressed, false if cancel was pressed. // password.value is set if OK was pressed. @@ -216,4 +219,4 @@ var getPassword = exports.getPassword = function getPassword() { } else { return undefined; } -};
\ No newline at end of file +}; |