From 8cf286c4986d29f6b73583ff6b43444f1ef39207 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 15 Jul 2010 13:21:56 +0200 Subject: Give getPassword possibility of having different prompt --- lib/util.js | 9 ++++++--- 1 file 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 +}; -- cgit