From 32af48e442a960b8c3f199f5ffad28a34590fcda Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 28 Apr 2011 13:28:55 +0200 Subject: Reformatting to MoFo coding style --- lib/prompts.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'lib/prompts.js') 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; }; -- cgit