From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Fri, 13 Nov 2009 16:55:58 +0000 (+0000) Subject: Copy Message button for all yns_alert dialogs. Mainly for error alerts, but the... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f16ef012e206ddec8b1763a5d5e3def70d68b826;p=evergreen%2Fmasslnc.git Copy Message button for all yns_alert dialogs. Mainly for error alerts, but the dialog does get used for pre-cats, etc. git-svn-id: svn://svn.open-ils.org/ILS/trunk@14903 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 93b2e931c1..70f0829c14 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/error.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/error.js @@ -346,14 +346,22 @@ util.error.prototype = { + '<groupbox flex="1" style="overflow: auto; border: solid thin red;"><caption label="' + (title) + '"/>'; if (image) xml += '<hbox><image src="' + image + '"/><spacer flex="1"/></hbox>'; - xml += '<description style="font-size: large">' + (s) + xml += '<description id="msg" style="-moz-user-select: text; -moz-user-focus: normal; font-size: large">' + (s) + '</description></groupbox><groupbox><caption label="Options"/><hbox>'; 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 += '<button id="b1" accesskey="' + b1_key + '" label="' + (b1) + '" name="fancy_submit" value="b1"/>' - if (b2) xml += '<button id="b2" accesskey="' + b2_key + '" label="' + (b2) + '" name="fancy_submit" value="b2"/>' - if (b3) xml += '<button id="b3" accesskey="' + b3_key + '" label="' + (b3) + '" name="fancy_submit" value="b3"/>' + if (b1) xml += '<button id="b1" accesskey="' + b1_key + '" label="' + (b1) + '" name="fancy_submit" value="b1"/>'; + if (b2) xml += '<button id="b2" accesskey="' + b2_key + '" label="' + (b2) + '" name="fancy_submit" value="b2"/>'; + if (b3) xml += '<button id="b3" accesskey="' + b3_key + '" label="' + (b3) + '" name="fancy_submit" value="b3"/>'; + var copy_button_label = 'Copy Message'; /* default in case the I18N infrastructure is failing, yns_alert often gets used for errors */ + var x= document.getElementById('offlineStrings'); + if (x) { + if (typeof x.getString == 'function') { + if (x.getString('common.error.copy_msg')) { copy_button_label = x.getString('common.error.copy_msg'); } + } + } + xml += '<spacer flex="1"/><button label="' + copy_button_label + '" oncommand="try { copy_to_clipboard( document.getElementById(' + "'msg'" + ').textContent ); } catch(E) { alert(E); }" />'; xml += '</hbox></groupbox></vbox>'; JSAN.use('OpenILS.data'); //var data = new OpenILS.data(); data.init({'via':'stash'}); @@ -402,7 +410,7 @@ util.error.prototype = { 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'); + dump('yns_alert_formatted:\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(); @@ -415,14 +423,22 @@ util.error.prototype = { + '<groupbox flex="1" style="overflow: auto; border: solid thin red;"><caption label="' + (title) + '"/>'; if (image) xml += '<hbox><image src="' + image + '"/><spacer flex="1"/></hbox>'; - xml += '<description style="font-size: large"><html:pre style="font-size: large">' + (s) + xml += '<description style="-moz-user-select: text; -moz-user-focus: normal; font-size: large"><html:pre id="msg" style="font-size: large">' + (s) + '</html:pre></description></groupbox><groupbox><caption label="Options"/><hbox>'; 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 += '<button id="b1" accesskey="' + b1_key + '" label="' + (b1) + '" name="fancy_submit" value="b1"/>' - if (b2) xml += '<button id="b2" accesskey="' + b2_key + '" label="' + (b2) + '" name="fancy_submit" value="b2"/>' - if (b3) xml += '<button id="b3" accesskey="' + b3_key + '" label="' + (b3) + '" name="fancy_submit" value="b3"/>' + if (b1) xml += '<button id="b1" accesskey="' + b1_key + '" label="' + (b1) + '" name="fancy_submit" value="b1"/>'; + if (b2) xml += '<button id="b2" accesskey="' + b2_key + '" label="' + (b2) + '" name="fancy_submit" value="b2"/>'; + if (b3) xml += '<button id="b3" accesskey="' + b3_key + '" label="' + (b3) + '" name="fancy_submit" value="b3"/>'; + var copy_button_label = 'Copy Message'; /* default in case the I18N infrastructure is failing, yns_alert often gets used for errors */ + var x= document.getElementById('offlineStrings'); + if (x) { + if (typeof x.getString == 'function') { + if (x.getString('common.error.copy_msg')) { copy_button_label = x.getString('common.error.copy_msg'); } + } + } + xml += '<spacer flex="1"/><button label="' + copy_button_label + '" oncommand="try { copy_to_clipboard( document.getElementById(' + "'msg'" + ').textContent ); } catch(E) { alert(E); }" />'; xml += '</hbox></groupbox></vbox>'; JSAN.use('OpenILS.data'); //var data = new OpenILS.data(); data.init({'via':'stash'}); diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties index 12f372383d..04836aaafc 100644 --- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties +++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties @@ -4,6 +4,7 @@ common.ok=Ok common.clear=Clear common.confirm=Check here to confirm this message. common.error.default=Please report that this happened. +common.error.copy_msg=Copy Message common.barcode.status.warning=Warning: As of %1$s, this barcode (%2$s) was flagged %3. common.barcode.status.warning.lost=Lost common.barcode.status.warning.expired=Expired