From 8976643f5f0363c8d2d2845d819a03c57577b0ff Mon Sep 17 00:00:00 2001 From: pines Date: Sat, 30 Sep 2006 03:36:08 +0000 Subject: [PATCH] less annoying alert dialog.. no more confirmation box, but still safe from accidental scan-thru git-svn-id: svn://svn.open-ils.org/ILS/trunk@6279 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/chrome/content/util/error.js | 53 +++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/error.js b/Open-ILS/xul/staff_client/chrome/content/util/error.js index 1ad5c5cf85..3ec977055d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/error.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/error.js @@ -300,9 +300,60 @@ util.error.prototype = { } }, - 'yns_alert' : function (s,title,b1,b2,b3,c) { + /* The original purpose of yns_alert was to prevent errors from being scanned through accidentally with a barcode scanner. + However, this can be done in a less annoying manner by rolling our own dialog and not having any of the options in focus */ + + /* + s = Message to display + title = Text in Title Bar + b1 = Text for button 1 + b2 = Text for button 2 + b3 = Text for button 3 + c = Text for confirmation checkbox. null for no confirm + */ + + dump('yns_alert:\n\ts = ' + s + '\n\ttitle = ' + title + '\n\tb1 = ' + b1 + '\n\tb2 = ' + b2 + '\n\tb3 = ' + b3 + '\n\tc = ' + c + '\n'); + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite"); + + this.sound.bad(); + + + //FIXME - need to escape these values before embedding them into xml.. but window.escape was weird.. + + var xml = '' + + '' + (s) + + ''; + var b1_key = b1 ? b1[0] : ''; + var b2_key = b2 ? b2[0] : ''; + var b3_key = b3 ? b3[0] : ''; /* FIXME - need to check for collisions */ + if (b1) xml += '