more flexible
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Jul 2005 18:14:49 +0000 (18:14 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Jul 2005 18:14:49 +0000 (18:14 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1283 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/util/win.js

index c479838..516d762 100644 (file)
@@ -35,13 +35,9 @@ function s_alert(s) {
        return rv;
 }
 
-function yns_alert(s,a,b,c) {
+function yns_alert(s,title,b1,b2,b3,c) {
        // alert() replacement, intended to stop barcode scanners from "scanning through" the dialog
 
-       if (!a) a = "Yes";
-       if (!b) b = "No";
-       if (!c) c = "Maybe";
-
        // get a reference to the prompt service component.
        var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
                .getService(Components.interfaces.nsIPromptService);
@@ -62,16 +58,10 @@ function yns_alert(s,a,b,c) {
        // particular button. The last two arguments are for an optional check box.
        var check = {};
        sdump('D_WIN','yns_alert: ' + s);
-       var rv = promptService.confirmEx(window,"ALERT",
-               s,
-               flags, 
-               a, b, c, 
-               "Check this box to confirm this message", 
-               check
-       );
-       if (!check.value) {
+       var rv = promptService.confirmEx(window,title, s, flags, b1, b2, b3, c, check);
+       if (c && !check.value) {
                snd_bad();
-               return yns_alert(s,a,b,c);
+               return yns_alert(s,title,b1,b2,b3,c);
        }
        return rv;
 }