aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bzpage.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-07-16 17:45:14 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-07-16 17:45:14 +0200
commitd53b9140d0768522eeb6a024a17fc41dc73b4966 (patch)
treeb34cd2e97df964d3f7012bb110b70d0cf8025422 /lib/bzpage.js
parent641d7c3743be440112952140ca799b6748b261c7 (diff)
downloadbugzilla-triage-d53b9140d0768522eeb6a024a17fc41dc73b4966.tar.gz
Create a special library prompts, add prompts.prompt, and switch bzpage
and logger to use it.
Diffstat (limited to 'lib/bzpage.js')
-rw-r--r--lib/bzpage.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js
index 3f0f81b..3735328 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -7,6 +7,7 @@ var passUtils = require("passwords");
var apiUtils = require("api-utils");
var simpleStorage = require("simple-storage");
var preferences = require("preferences-service");
+var prompts = require("prompts");
var Color = require("color").Color;
var TriagedDistro = 13;
@@ -448,8 +449,7 @@ BZPage.prototype.setConfigurationButton = function setConfigurationButton () {
var prfNm = BTSPrefNS+"JSONURL";
var url = preferences.get(prfNm,"");
- // FIXME don't use window.prompt, but create util.prompt instead
- var reply = that.win.prompt("New location of JSON configuration file",url);
+ var reply = prompts.prompt("New location of JSON configuration file",url);
if (reply) {
preferences.set(prfNm,reply.trim());
that.win.alert("For now, you should really restart Firefox!");
@@ -712,13 +712,13 @@ BZPage.prototype.getPassword = function getPassword (login) {
var pass = passUtils.getPassword(login, domain, BTSPassRealm);
// pass === null means no appropriate password in the storage
if (!preferences.get(prefName,false) && (pass === null)) {
- var passwordText = util.getPassword(passPrompt);
+ var passwordText = prompts.promptPassword(passPrompt);
if (passwordText && passwordText.length > 0) {
passUtils.setLogin(login, passwordText, domain,
BTSPassRealm);
return passwordText;
} else {
- var switchOff = util.promptOKNoCancel(switchPrompt);
+ var switchOff = prompts.promptYesNoCancel(switchPrompt);
if (switchOff) {
preferences.set(prefName,true);
}