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-06-05 14:47:40 +0200
commit55d9a312fbba91f1bcf5e3f3291b7bece8abb178 (patch)
treebb9ef165b425273da47aa000268395f87f26678e /lib/prompts.js
parent34bbe8e7306a0d0ec014db7512788ed92c625d19 (diff)
downloadbugzilla-triage-55d9a312fbba91f1bcf5e3f3291b7bece8abb178.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;
};