aboutsummaryrefslogtreecommitdiffstats
path: root/lib/prompts.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-04-28 13:28:55 +0200
committerMatěj Cepl <mcepl@redhat.com>2011-04-28 18:26:14 +0200
commit32af48e442a960b8c3f199f5ffad28a34590fcda (patch)
treec291cb97627bd2cfb65167347261d5ef8f521bfd /lib/prompts.js
parent2382ba19afc84e9b747a7981ebf72aaa704f08b6 (diff)
downloadbugzilla-triage-32af48e442a960b8c3f199f5ffad28a34590fcda.tar.gz
Reformatting to MoFo coding style
Diffstat (limited to 'lib/prompts.js')
-rw-r--r--lib/prompts.js31
1 files changed, 16 insertions, 15 deletions
diff --git a/lib/prompts.js b/lib/prompts.js
index 7cfd3d1..3f34e0d 100644
--- a/lib/prompts.js
+++ b/lib/prompts.js
@@ -11,23 +11,23 @@ var promptTitle = "Bugzilla Triage Script";
/**
* shows the text in a simple window
- *
+ *
* @return none
*/
exports.alert = function alert(msg) {
var prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Ci.nsIPromptService);
+ .getService(Ci.nsIPromptService);
prompts.alert(null, promptTitle, msg);
};
/**
* general prompts for a string method
- *
+ *
* @return String with the password
*/
exports.prompt = function prompt(prompt, defaultValue) {
var stringValue = {
- value: defaultValue ? defaultValue : ""
+ value : defaultValue ? defaultValue : ""
};
var prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"]
@@ -44,7 +44,7 @@ exports.prompt = function prompt(prompt, defaultValue) {
/**
* returns password with a special password
- *
+ *
* @return String with the password
*/
exports.promptPassword = function promptPassword(prompt) {
@@ -59,8 +59,8 @@ exports.promptPassword = function promptPassword(prompt) {
var check = {
value : true
}; // default the checkbox to true
- var result = prompts.promptPassword(null, "Bugzilla Triage Script", prompt,
- password, null, check);
+ var result = prompts.promptPassword(null,
+ "Bugzilla Triage Script", prompt, password, null, check);
// result is true if OK was pressed, false if cancel was pressed.
// password.value is set if OK was pressed.
// The checkbox is not displayed.
@@ -83,8 +83,9 @@ exports.promptYesNoCancel = function promptOKNoCancel(prompt) {
var prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService);
- var result = prompts.confirmEx(null, "Bugzilla Triage Script", prompt,
- prompts.STD_YES_NO_BUTTONS, null, null, null, null, {});
+ var result = prompts.confirmEx(null, "Bugzilla Triage Script",
+ prompt, prompts.STD_YES_NO_BUTTONS, null, null, null,
+ null, {});
if (result === 0) {
return true;
}
@@ -97,22 +98,22 @@ exports.promptYesNoCancel = function promptOKNoCancel(prompt) {
};
/**
- *
+ *
* documentation is https://developer.mozilla.org/en/NsIFilePicker
*/
-exports.promptFileOpenPicker = function promptFilePicker (win) {
+exports.promptFileOpenPicker = function promptFilePicker(win) {
var window = require("window-utils").activeWindow;
var fp = Cc["@mozilla.org/filepicker;1"]
- .createInstance(Ci.nsIFilePicker);
+ .createInstance(Ci.nsIFilePicker);
fp.init(window, "JSON File Open", Ci.nsIFilePicker.modeOpen);
fp.appendFilter("JSON files", "*.json");
fp.appendFilters(Ci.nsIFilePicker.filterAll);
fp.filterIndex = 0;
var res = fp.show();
- if (res === Ci.nsIFilePicker.returnOK ||
- res === Ci.nsIFilePicker.returnReplace ) {
- return fp.file.path;
+ if (res === Ci.nsIFilePicker.returnOK
+ || res === Ci.nsIFilePicker.returnReplace) {
+ return fp.file.path;
}
return null;
};