From: pines Date: Mon, 2 Oct 2006 21:47:18 +0000 (+0000) Subject: image and html:pre support for dialogs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a1ac3b1949a3dc57b4c4c8a47a8d10023319e977;p=evergreen%2Fpines.git image and html:pre support for dialogs git-svn-id: svn://svn.open-ils.org/ILS/trunk@6360 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- 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 393fe83f44..2cf8e87d1d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/error.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/error.js @@ -280,17 +280,18 @@ util.error.prototype = { } } if (!msg) msg = ''; - var alert_msg = 'FIXME: If you encounter this alert, please inform your IT/ILS helpdesk staff or your friendly Evergreen developers.\n\n' + msg + '\n\n' + (typeof E.ilsevent != 'undefined' ? E.textcode + '\n' + (E.desc ? E.desc + '\n' : '') : '') + ( typeof E.status != 'undefined' ? 'Status: ' + E.status + '\n': '' ); + var alert_msg = 'FIXME: If you encounter this alert, please inform your IT/ILS helpdesk staff or your friendly Evergreen developers.\n\n' + (new Date()) + '\n\n' + msg + '\n\n' + (typeof E.ilsevent != 'undefined' ? E.textcode + '\n' + (E.desc ? E.desc + '\n' : '') : '') + ( typeof E.status != 'undefined' ? 'Status: ' + E.status + '\n': '' ); obj.sdump('D_ERROR',msg + ' : ' + js2JSON(E)); var r = obj.yns_alert( alert_msg, 'Unhandled Error', - 'Ok', 'Debug', 'Report to Helpdesk', 'Check here to confirm this message' + 'Ok', 'Debug Output to send to Helpdesk', null, 'Check here to confirm this message', + '/xul/server/skin/media/images/skull.png' ); if (r == 1) { JSAN.use('util.window'); var win = new util.window(); win.open( - 'data:text/plain,' + window.escape( msg + '\n\n' + obj.pretty_print(js2JSON(E)) ), + 'data:text/plain,' + window.escape( 'Please open a helpdesk ticket and include the following text: \n\n' + (new Date()) + '\n\n' + msg + '\n\n' + obj.pretty_print(js2JSON(E)) ), 'error_alert', 'chrome,resizable,width=700,height=500' ); @@ -300,7 +301,7 @@ util.error.prototype = { } }, - 'yns_alert' : function (s,title,b1,b2,b3,c) { + 'yns_alert' : function (s,title,b1,b2,b3,c,image) { /* 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 */ @@ -323,8 +324,11 @@ util.error.prototype = { //FIXME - need to escape these values before embedding them into xml.. but window.escape was weird.. var xml = '' - + '' + (s) - + ''; + + ''; + + if (image) xml += ''; + 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 */ @@ -347,7 +351,7 @@ util.error.prototype = { case 'b3' : return 2; break; } } else { - return this.yns_alert(s,title,b1,b2,b3,c); + return this.yns_alert(s,title,b1,b2,b3,c,image); } },